Clear mark state implicitly by incrementing a 2-bit version
Summary:
The GC init phase currently scans the whole heap, clearing the
mark bit for every object. By using a two-bit version, the
clear becomes O(1) by incrementing a global "version". Any object
with a different version is "unmarked".
This uses 2 bits instead of 1, so newly allocated objects can
hardcode the version value 0, instead of loading a global value.
The actual global version counter cycles between 1-2-3.
Implicit clearing of mark-state eliminates a lot of stores, but
doesn't eliminate the whole-heap scan yet; we still need it to
reconstruct crossing maps. That will be optimized separately.
Reviewed By: ricklavoie
Differential Revision:
D5827657
fbshipit-source-id:
bbba9666275c1e1386ee5231f713fe3b01b304af