Ignore:
Timestamp:
Aug 24, 2012, 2:23:51 PM (13 years ago)
Author:
[email protected]
Message:

Always null check cells before marking
https://bugs.webkit.org/show_bug.cgi?id=94968

Reviewed by Geoffrey Garen.

Originally we tried to minimise null checks by only null checking values
that we knew could be null, however given that we can't ever guarantee
when a GC will happen, we're better off just always assuming that a null
check will be necessary. This results in a much less fragile code base
as we can add GC allocations to object initialisers without having to
subsequently worry about whether the object we are initialising will need
to add a bunch of null checks in its visitChildren implementation.

  • heap/MarkStack.cpp:

(JSC::MarkStack::internalAppend):

  • heap/MarkStackInlineMethods.h:

(JSC::MarkStack::append):
(JSC::MarkStack::appendUnbarrieredPointer):

  • runtime/Structure.h:

(JSC::MarkStack::internalAppend):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/MarkStackInlineMethods.h

    r126354 r126624  
    3636    for (size_t i = 0; i < count; ++i) {
    3737        JSValue& value = slot[i];
    38         if (!value)
    39             continue;
    4038        internalAppend(value);
    4139    }
     
    4745    ASSERT(slot);
    4846    JSCell* cell = *slot;
    49     if (cell)
    50         internalAppend(cell);
     47    internalAppend(cell);
    5148}
    5249
     
    7168ALWAYS_INLINE void MarkStack::internalAppend(JSValue value)
    7269{
    73     ASSERT(value);
    74     if (!value.isCell())
     70    if (!value || !value.isCell())
    7571        return;
    7672    internalAppend(value.asCell());
Note: See TracChangeset for help on using the changeset viewer.