experiment: precise heap tags
Implement precise tagging of heap allocated objects.
Splits
TAG_ARRAYinto consecutiveTAG_ARRAY_I,TAG_ARRAY_M,TAG_ARRAY_T,TAG_ARRAY_S(immutable array, array, tuple, shared function).TAG_BLOBinto consecutiveTAG_BLOB_B,TAB_BLOB_TandTAG_BLOB_P,TAG_BLOB_A(blob, text, principal, actor reference).TAG_BITS_32into consecutiveTAG_BITS32_U,TAG_BITS32_SandTAG_BITS32_F((boxed) Nat32/Int32, Float32 (reserved for future use).TAG_BITS_64into consecutiveTAG_BITS64_U,TAG_BITS64_SandTAG_BITS64_F((boxed) Nat64/Int32, Float64).
Modifies array slicing logic to preserve the base tag of the underlying array, by stealing the top 2 bits of the slice start field, relying on the fact that array indices are < 2^30. For clarity, the tag in decompressed on each iteration. For efficiency, it could actually be maintained during slicing compressed form as a sort ( see 448962f).
TODO: ~[ ] print refined tags in debug output?~ (rts debug printing is rarely used and can be adapted later)
Comparing from c89946270d551dd85aaa429dfc0019265b74c2ae to 0082f1db83c73ade9a4eb81f75b9e054fd4ad1ce: In terms of gas, 4 tests regressed, 1 tests improved and the mean change is -0.7%. In terms of size, 5 tests regressed and the mean change is +0.3%.
I think I've addressed all the issue. PTAL @luc-blaeser
@ggreif, since Luc has already merged this branch into his EOP PRs, and a squash merge of this PR to master may cause him trouble merging later, we've decide not to merge this branch directly into master but as part of larger PR. That's also why I'm not addressing the issues you found (which are mostly cosmetic).
Not merging into master as already merged into Luc's EOP PRs.
I now merged the PR into the EOP PR stack. I think we could probably now close this PR. @crusso: Thank you again for this great contribution!
Merged with EOP