Ignore:
Timestamp:
Feb 1, 2011, 12:17:21 PM (15 years ago)
Author:
[email protected]
Message:

2011-01-31 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Update JSObject storage for new marking API
https://bugs.webkit.org/show_bug.cgi?id=53467

JSObject no longer uses EncodedJSValue for its property storage.
This produces a stream of mechanical changes to PropertySlot and
anonymous storage APIs.

  • JavaScriptCore.exp:
  • runtime/ArrayPrototype.cpp: (JSC::ArrayPrototype::ArrayPrototype):
  • runtime/BooleanConstructor.cpp: (JSC::constructBoolean): (JSC::constructBooleanFromImmediateBoolean):
  • runtime/BooleanObject.cpp: (JSC::BooleanObject::BooleanObject):
  • runtime/BooleanObject.h:
  • runtime/BooleanPrototype.cpp: (JSC::BooleanPrototype::BooleanPrototype):
  • runtime/DateInstance.cpp: (JSC::DateInstance::DateInstance):
  • runtime/DatePrototype.cpp: (JSC::DatePrototype::DatePrototype):
  • runtime/JSActivation.cpp: (JSC::JSActivation::getOwnPropertySlot):
  • runtime/JSArray.cpp: (JSC::JSArray::getOwnPropertySlot):
  • runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot):
  • runtime/JSGlobalObject.h: (JSC::JSGlobalObject::JSGlobalObject):
  • runtime/JSObject.cpp: (JSC::JSObject::fillGetterPropertySlot):
  • runtime/JSObject.h: (JSC::JSObject::getDirectLocation): (JSC::JSObject::offsetForLocation): (JSC::JSObject::putAnonymousValue): (JSC::JSObject::clearAnonymousValue): (JSC::JSObject::getAnonymousValue): (JSC::JSObject::putThisToAnonymousValue): (JSC::JSObject::locationForOffset): (JSC::JSObject::inlineGetOwnPropertySlot):
  • runtime/JSObjectWithGlobalObject.cpp: (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
  • runtime/JSWrapperObject.h: (JSC::JSWrapperObject::JSWrapperObject): (JSC::JSWrapperObject::setInternalValue):
  • runtime/Lookup.cpp: (JSC::setUpStaticFunctionSlot):
  • runtime/NumberConstructor.cpp: (JSC::constructWithNumberConstructor):
  • runtime/NumberObject.cpp: (JSC::NumberObject::NumberObject): (JSC::constructNumber):
  • runtime/NumberObject.h:
  • runtime/NumberPrototype.cpp: (JSC::NumberPrototype::NumberPrototype):
  • runtime/PropertySlot.h: (JSC::PropertySlot::getValue): (JSC::PropertySlot::setValue): (JSC::PropertySlot::setRegisterSlot):
  • runtime/StringObject.cpp: (JSC::StringObject::StringObject):
  • runtime/StringPrototype.cpp: (JSC::StringPrototype::StringPrototype):
  • runtime/WriteBarrier.h: (JSC::WriteBarrierBase::setWithoutWriteBarrier):

2011-01-31 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Update JSObject storage for new marking API
https://bugs.webkit.org/show_bug.cgi?id=53467

Update WebCore to handle new anonymous slot behaviour.

  • bindings/js/JSDOMWindowShell.cpp: (WebCore::JSDOMWindowShell::setWindow):
  • bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::initScript):
  • bindings/scripts/CodeGeneratorJS.pm:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/PropertySlot.h

    r55564 r77269  
    3333    class JSObject;
    3434
    35 #define JSC_VALUE_SLOT_MARKER 0
    36 #define JSC_REGISTER_SLOT_MARKER reinterpret_cast<GetValueFunc>(1)
     35#define JSC_VALUE_MARKER 0
    3736#define INDEX_GETTER_MARKER reinterpret_cast<GetValueFunc>(2)
    3837#define GETTER_FUNCTION_MARKER reinterpret_cast<GetValueFunc>(3)
     
    6867        JSValue getValue(ExecState* exec, const Identifier& propertyName) const
    6968        {
    70             if (m_getValue == JSC_VALUE_SLOT_MARKER)
    71                 return *m_data.valueSlot;
    72             if (m_getValue == JSC_REGISTER_SLOT_MARKER)
    73                 return (*m_data.registerSlot).jsValue();
     69            if (m_getValue == JSC_VALUE_MARKER)
     70                return m_value;
    7471            if (m_getValue == INDEX_GETTER_MARKER)
    7572                return m_getIndexValue(exec, slotBase(), index());
     
    8178        JSValue getValue(ExecState* exec, unsigned propertyName) const
    8279        {
    83             if (m_getValue == JSC_VALUE_SLOT_MARKER)
    84                 return *m_data.valueSlot;
    85             if (m_getValue == JSC_REGISTER_SLOT_MARKER)
    86                 return (*m_data.registerSlot).jsValue();
     80            if (m_getValue == JSC_VALUE_MARKER)
     81                return m_value;
    8782            if (m_getValue == INDEX_GETTER_MARKER)
    8883                return m_getIndexValue(exec, m_slotBase, m_data.index);
     
    10196        }
    10297
    103         void setValueSlot(JSValue* valueSlot)
    104         {
    105             ASSERT(valueSlot);
    106             clearBase();
    107             clearOffset();
    108             m_getValue = JSC_VALUE_SLOT_MARKER;
    109             m_data.valueSlot = valueSlot;
     98        void setValue(JSValue slotBase, JSValue value)
     99        {
     100            ASSERT(value);
     101            clearOffset();
     102            m_getValue = JSC_VALUE_MARKER;
     103            m_slotBase = slotBase;
     104            m_value = value;
    110105        }
    111106       
    112         void setValueSlot(JSValue slotBase, JSValue* valueSlot)
    113         {
    114             ASSERT(valueSlot);
    115             m_getValue = JSC_VALUE_SLOT_MARKER;
    116             m_slotBase = slotBase;
    117             m_data.valueSlot = valueSlot;
    118         }
    119        
    120         void setValueSlot(JSValue slotBase, JSValue* valueSlot, size_t offset)
    121         {
    122             ASSERT(valueSlot);
    123             m_getValue = JSC_VALUE_SLOT_MARKER;
    124             m_slotBase = slotBase;
    125             m_data.valueSlot = valueSlot;
     107        void setValue(JSValue slotBase, JSValue value, size_t offset)
     108        {
     109            ASSERT(value);
     110            m_getValue = JSC_VALUE_MARKER;
     111            m_slotBase = slotBase;
     112            m_value = value;
    126113            m_offset = offset;
    127114            m_cachedPropertyType = Value;
    128115        }
    129        
     116
    130117        void setValue(JSValue value)
    131118        {
     
    133120            clearBase();
    134121            clearOffset();
    135             m_getValue = JSC_VALUE_SLOT_MARKER;
     122            m_getValue = JSC_VALUE_MARKER;
    136123            m_value = value;
    137             m_data.valueSlot = &m_value;
    138124        }
    139125
     
    143129            clearBase();
    144130            clearOffset();
    145             m_getValue = JSC_REGISTER_SLOT_MARKER;
    146             m_data.registerSlot = registerSlot;
     131            m_getValue = JSC_VALUE_MARKER;
     132            m_value = registerSlot->jsValue();
    147133        }
    148134
     
    252238        union {
    253239            JSObject* getterFunc;
    254             JSValue* valueSlot;
    255             Register* registerSlot;
    256240            unsigned index;
    257241        } m_data;
Note: See TracChangeset for help on using the changeset viewer.