3 ms·
This doesn't mention split tagging (or of course, the best answer of "no tagging", which is often best implemented as "tag stored in debug mode, but not normall
by o11c 2y ago
This doesn't mention split tagging (or of course, the best answer of "no tagging", which is often best implemented as "tag stored in debug mode, but not normally since static types are tracked").
If you can reduce your tag to a single bit (object vs primitive), a single byte of tag data can cover 8 variables, and a bigger integer can cover a whole 64 variables, plenty for most functions.
- adgjlsfhk1 2y agothese tag bits are often used for the GC and there you really don't want to collect all of the tag data together since it would cause false sharing issues
- o11c 2y agoIt's not for unrelated values though. Actually, the real observation is that tags aren't useful once you have a value, they're useful to get to the value in the first place. In a stack frame, all the local variables have their tags together. For the fields of an object, all the tags are stored together in the object.