We want to keep track of three states for an object: (1) Not marked (which implies not in the remembered set) (2) Marked but not in the remembered set (3) Marked and in the remembered set Currently we only indicate marked vs. not marked in JSCell::m_gcData. During a write barrier, we only want to take the slow path if the object being stored to is in state (2). We'd like to make the test for state (2) as fast as possible, which probably means making it a compare against 0.
Created attachment 225902 [details] Patch
Created attachment 225903 [details] Patch
Created attachment 225905 [details] Patch
Comment on attachment 225905 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=225905&action=review r=me Is speedup? > Source/JavaScriptCore/runtime/JSCell.h:150 > + void mark() { m_gcData = Marked; } I would call this "setMarked". > Source/JavaScriptCore/runtime/JSCell.h:151 > + void remember() { ASSERT(m_gcData == Marked); m_gcData = MarkedAndRemembered; } "setRemembered(true)" > Source/JavaScriptCore/runtime/JSCell.h:152 > + void forget() { ASSERT(m_gcData == MarkedAndRemembered); m_gcData = Marked; } "setRemembered(false)"
(In reply to comment #4) > (From update of attachment 225905 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=225905&action=review > > r=me > > Is speedup? No visible effect on benchmarks.
Committed r165135: <http://trac.webkit.org/changeset/165135>