Ignore:
Timestamp:
Mar 3, 2011, 2:30:59 PM (14 years ago)
Author:
[email protected]
Message:

2011-03-03 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

JSVariableObject needs to use WriteBarrier for symboltable property storage
https://bugs.webkit.org/show_bug.cgi?id=55698

Replace the direct usage of Register in JSVariableObject (and descendents)
with WriteBarrier. This requires updating the Arguments object to use
WriteBarrier as well.

  • interpreter/Interpreter.cpp: (JSC::Interpreter::unwindCallFrame): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveArguments):
  • jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION):
  • runtime/ArgList.h: (JSC::MarkedArgumentBuffer::initialize):
  • runtime/Arguments.cpp: (JSC::Arguments::markChildren): (JSC::Arguments::copyToRegisters): (JSC::Arguments::fillArgList): (JSC::Arguments::getOwnPropertySlot): (JSC::Arguments::getOwnPropertyDescriptor): (JSC::Arguments::put):
  • runtime/Arguments.h: (JSC::Arguments::setActivation): (JSC::Arguments::Arguments): (JSC::Arguments::copyRegisters): (JSC::JSActivation::copyRegisters):
  • runtime/JSActivation.cpp: (JSC::JSActivation::markChildren): (JSC::JSActivation::symbolTableGet): (JSC::JSActivation::symbolTablePut): (JSC::JSActivation::symbolTablePutWithAttributes): (JSC::JSActivation::put): (JSC::JSActivation::putWithAttributes): (JSC::JSActivation::argumentsGetter):
  • runtime/JSActivation.h:
  • runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::put): (JSC::JSGlobalObject::putWithAttributes): (JSC::JSGlobalObject::markChildren): (JSC::JSGlobalObject::copyGlobalsFrom): (JSC::JSGlobalObject::copyGlobalsTo): (JSC::JSGlobalObject::resizeRegisters):
  • runtime/JSGlobalObject.h: (JSC::JSGlobalObject::setRegisters): (JSC::JSGlobalObject::addStaticGlobals):
  • runtime/JSStaticScopeObject.cpp: (JSC::JSStaticScopeObject::put): (JSC::JSStaticScopeObject::putWithAttributes):
  • runtime/JSVariableObject.cpp: (JSC::JSVariableObject::symbolTableGet):
  • runtime/JSVariableObject.h: (JSC::JSVariableObject::registerAt): (JSC::JSVariableObject::JSVariableObjectData::JSVariableObjectData): (JSC::JSVariableObject::symbolTableGet): (JSC::JSVariableObject::symbolTablePut): (JSC::JSVariableObject::symbolTablePutWithAttributes): (JSC::JSVariableObject::copyRegisterArray): (JSC::JSVariableObject::setRegisters):

2011-03-03 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

JSVariableObject needs to use WriteBarrier for symboltable property storage
https://bugs.webkit.org/show_bug.cgi?id=55698

Update to pass JSGlobalData for the symbol table write used
to set the document property.

  • bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::updateDocument):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r80277 r80285  
    6161
    6262    // No need to mark our registers if they're still in the RegisterFile.
    63     Register* registerArray = m_registerArray.get();
     63    WriteBarrier<Unknown>* registerArray = m_registerArray.get();
    6464    if (!registerArray)
    6565        return;
     
    6868
    6969    size_t count = numParametersMinusThis;
    70     markStack.deprecatedAppendValues(registerArray, count);
     70    markStack.appendValues(registerArray, count);
    7171
    7272    size_t numVars = m_functionExecutable->capturedVariableCount();
    7373
    7474    // Skip the call frame, which sits between the parameters and vars.
    75     markStack.deprecatedAppendValues(registerArray + count + RegisterFile::CallFrameHeaderSize, numVars, MayContainNullValues);
     75    markStack.appendValues(registerArray + count + RegisterFile::CallFrameHeaderSize, numVars, MayContainNullValues);
    7676}
    7777
     
    8181    if (!entry.isNull()) {
    8282        ASSERT(entry.getIndex() < static_cast<int>(m_functionExecutable->capturedVariableCount()));
    83         slot.setValue(registerAt(entry.getIndex()).jsValue());
     83        slot.setValue(registerAt(entry.getIndex()).get());
    8484        return true;
    8585    }
     
    8787}
    8888
    89 inline bool JSActivation::symbolTablePut(const Identifier& propertyName, JSValue value)
     89inline bool JSActivation::symbolTablePut(JSGlobalData& globalData, const Identifier& propertyName, JSValue value)
    9090{
    9191    ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
     
    9797        return true;
    9898    ASSERT(entry.getIndex() < static_cast<int>(m_functionExecutable->capturedVariableCount()));
    99     registerAt(entry.getIndex()) = value;
     99    registerAt(entry.getIndex()).set(globalData, this, value);
    100100    return true;
    101101}
     
    113113}
    114114
    115 inline bool JSActivation::symbolTablePutWithAttributes(const Identifier& propertyName, JSValue value, unsigned attributes)
     115inline bool JSActivation::symbolTablePutWithAttributes(JSGlobalData& globalData, const Identifier& propertyName, JSValue value, unsigned attributes)
    116116{
    117117    ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
     
    125125        return false;
    126126    entry.setAttributes(attributes);
    127     registerAt(entry.getIndex()) = value;
     127    registerAt(entry.getIndex()).set(globalData, this, value);
    128128    return true;
    129129}
     
    155155    ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
    156156
    157     if (symbolTablePut(propertyName, value))
     157    if (symbolTablePut(exec->globalData(), propertyName, value))
    158158        return;
    159159
     
    170170    ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
    171171
    172     if (symbolTablePutWithAttributes(propertyName, value, attributes))
     172    if (symbolTablePutWithAttributes(exec->globalData(), propertyName, value, attributes))
    173173        return;
    174174
     
    208208{
    209209    JSActivation* activation = asActivation(slotBase);
    210     CallFrame* callFrame = CallFrame::create(activation->m_registers);
     210    CallFrame* callFrame = CallFrame::create(reinterpret_cast<Register*>(activation->m_registers));
    211211    int argumentsRegister = activation->m_functionExecutable->generatedBytecode().argumentsRegister();
    212212    if (JSValue arguments = callFrame->uncheckedR(argumentsRegister).jsValue())
Note: See TracChangeset for help on using the changeset viewer.