Understanding GC in JSC from Scratch
webkit.org
webkit.org
> WebKit’s JavaScript implementation, called JSC (JavaScriptCore), implements all of ES6.
"Avoid fancy words" - Chapter 5, §14, Strunk & White: "The Elements of Style".
Something I'm not getting, perhaps I'm missing something terribly obvious:
> during a full GC, we should also accept l_markVersion that is off-by-one. In that case, we know the isMarked bit accurately reflects whether or not a cell is live, since that is the result of the last GC cycle.
Here's part of the related footnote:
> any number of eden GC cycles may have run between the last full GC cycle and the current full GC cycle, but eden GC does not bump mark version. So for any object born before the last GC cycle (no matter eden or full), the isMarked bit honestly reflects if it is live
Couldn't an object have become non-live since the last GC cycle (whether eden or full)?
I think the point you missed is: the function 'cellContainsLiveObject' is not used by GC, it is used by allocator to tell if the cell is available for allocation. So it's fine if the function returns true but the object is actually unreachable, but not the other way around.