Changeset 76193 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Jan 19, 2011, 6:56:22 PM (14 years ago)
Author:
[email protected]
Message:

Rolled back in r76078, with crash fixed.
https://bugs.webkit.org/show_bug.cgi?id=52668

Reviewed by Darin Adler.

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::markChildren): Account for the fact that the global
object moves its variables into and out of the register file. While out
of the register file, the symbol table's size is not an accurate count
for the size of the register array, since the BytecodeGenerator might
be compiling, adding items to the symbol table.

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r76185 r76193  
     12011-01-18  Geoffrey Garen  <[email protected]>
     2
     3        Reviewed by Darin Adler.
     4
     5        Rolled back in r76078, with crash fixed.
     6        https://bugs.webkit.org/show_bug.cgi?id=52668
     7       
     8        * runtime/JSGlobalObject.cpp:
     9        (JSC::JSGlobalObject::markChildren): Account for the fact that the global
     10        object moves its variables into and out of the register file. While out
     11        of the register file, the symbol table's size is not an accurate count
     12        for the size of the register array, since the BytecodeGenerator might
     13        be compiling, adding items to the symbol table.
     14       
    1152011-01-18  Darin Adler  <[email protected]>
    216
  • trunk/Source/JavaScriptCore/interpreter/RegisterFile.h

    r76100 r76193  
    132132        Register* lastGlobal() const { return m_start - m_numGlobals; }
    133133       
    134         void markGlobals(MarkStack& markStack, Heap* heap) { heap->markConservatively(markStack, lastGlobal(), m_start); }
    135134        void markCallFrames(MarkStack& markStack, Heap* heap) { heap->markConservatively(markStack, m_start, m_end); }
    136135
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r76100 r76193  
    5454    Base::markChildren(markStack);
    5555
     56    // No need to mark our registers if they're still in the RegisterFile.
    5657    Register* registerArray = d()->registerArray.get();
    5758    if (!registerArray)
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r76100 r76193  
    350350        (*it)->markAggregate(markStack);
    351351
    352     RegisterFile& registerFile = globalData().interpreter->registerFile();
    353     if (registerFile.globalObject() == this)
    354         registerFile.markGlobals(markStack, &globalData().heap);
    355 
    356352    markIfNeeded(markStack, d()->regExpConstructor);
    357353    markIfNeeded(markStack, d()->errorConstructor);
     
    398394    // guaranteed to be referenced elsewhere.
    399395
    400     Register* registerArray = d()->registerArray.get();
    401     if (!registerArray)
    402         return;
    403 
    404     size_t size = d()->registerArraySize;
    405     markStack.appendValues(reinterpret_cast<JSValue*>(registerArray), size);
     396    if (d()->registerArray) {
     397        // Outside the execution of global code, when our variables are torn off,
     398        // we can mark the torn-off array.
     399        markStack.appendValues(d()->registerArray.get(), d()->registerArraySize);
     400    } else if (d()->registers) {
     401        // During execution of global code, when our variables are in the register file,
     402        // the symbol table tells us how many variables there are, and registers
     403        // points to where they end, and the registers used for execution begin.
     404        markStack.appendValues(d()->registers - symbolTable().size(), symbolTable().size());
     405    }
    406406}
    407407
Note: See TracChangeset for help on using the changeset viewer.