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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.