This stamp is used to guard atomic access to the varTable field
when it needs to be grown to accommodate more values. The logic
expects that anyone performing such an update will increment the
stamp while updating the the table reference, backing off if the
stamp has changed before finally assigning the new table (allowing
concurrent writers to all attempt growth without a hard lock, with
the first-past-the-post thread winning).
We probably don't need 32 bit for this, since that would
accommodate an absurd 2-4 billion concurrent mutators. Byte range
may be too small, but still handles at least 64 concurrent mutators
with non successfully growing the table large enough for any of the
others to proceed.
This relates to object header size reductions detailed in recent
issues like jruby#9090.
This PR will experiment with and eventually proceed with changes to reduce the size of the varTableStamp we currently use to guard concurrent, atomic growth of the varTable field.
Initial experiments simply shrink the stamp to a byte, which still accommodates up to 64 concurrent mutators. It may be possible to reduce it to a single bit by forcing other mutators to block for a (very) short time while the var table is being updated, but we'll want to have some tests that show this does not lead to any deadlocks (unlikely, since this code does not trigger further locking) or false positive locks as well as benchmarks to show that we are not adversely impacting concurrent updates (both contended and non-contended).