Ignore:
Timestamp:
Feb 1, 2011, 12:17:21 PM (14 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/JSObject.h

    r77151 r77269  
    156156        }
    157157
    158         JSValue* getDirectLocation(const Identifier& propertyName)
     158        WriteBarrierBase<Unknown>* getDirectLocation(const Identifier& propertyName)
    159159        {
    160160            size_t offset = m_structure->get(propertyName);
     
    162162        }
    163163
    164         JSValue* getDirectLocation(const Identifier& propertyName, unsigned& attributes)
     164        WriteBarrierBase<Unknown>* getDirectLocation(const Identifier& propertyName, unsigned& attributes)
    165165        {
    166166            JSCell* specificFunction;
     
    169169        }
    170170
    171         size_t offsetForLocation(JSValue* location) const
    172         {
    173             return location - reinterpret_cast<const JSValue*>(propertyStorage());
     171        size_t offsetForLocation(WriteBarrierBase<Unknown>* location) const
     172        {
     173            return location - propertyStorage();
    174174        }
    175175
     
    199199        void putUndefinedAtDirectOffset(size_t offset) { propertyStorage()[offset].setUndefined(); }
    200200
    201         void fillGetterPropertySlot(PropertySlot&, JSValue* location);
     201        void fillGetterPropertySlot(PropertySlot&, WriteBarrierBase<Unknown>* location);
    202202
    203203        virtual void defineGetter(ExecState*, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes = 0);
     
    232232        }
    233233
    234         void putAnonymousValue(unsigned index, JSValue value)
     234        void putAnonymousValue(JSGlobalData& globalData, unsigned index, JSValue value)
    235235        {
    236236            ASSERT(index < m_structure->anonymousSlotCount());
    237             *locationForOffset(index) = value;
     237            locationForOffset(index)->set(globalData, this, value);
     238        }
     239        void clearAnonymousValue(unsigned index)
     240        {
     241            ASSERT(index < m_structure->anonymousSlotCount());
     242            locationForOffset(index)->clear();
    238243        }
    239244        JSValue getAnonymousValue(unsigned index) const
    240245        {
    241246            ASSERT(index < m_structure->anonymousSlotCount());
    242             return *locationForOffset(index);
     247            return locationForOffset(index)->get();
    243248        }
    244249       
    245250    protected:
    246251        static const unsigned StructureFlags = 0;
     252       
     253        void putThisToAnonymousValue(unsigned index)
     254        {
     255            locationForOffset(index)->setWithoutWriteBarrier(this);
     256        }
    247257       
    248258    private:
     
    255265        void isObject();
    256266        void isString();
    257 
     267       
    258268        ConstPropertyStorage propertyStorage() const { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); }
    259269        PropertyStorage propertyStorage() { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); }
    260270
    261         const JSValue* locationForOffset(size_t offset) const
    262         {
    263             return reinterpret_cast<const JSValue*>(&propertyStorage()[offset]);
    264         }
    265 
    266         JSValue* locationForOffset(size_t offset)
    267         {
    268             return reinterpret_cast<JSValue*>(&propertyStorage()[offset]);
     271        const WriteBarrierBase<Unknown>* locationForOffset(size_t offset) const
     272        {
     273            return &propertyStorage()[offset];
     274        }
     275
     276        WriteBarrierBase<Unknown>* locationForOffset(size_t offset)
     277        {
     278            return &propertyStorage()[offset];
    269279        }
    270280
     
    374384ALWAYS_INLINE bool JSObject::inlineGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    375385{
    376     if (JSValue* location = getDirectLocation(propertyName)) {
    377         if (m_structure->hasGetterSetterProperties() && location[0].isGetterSetter())
     386    if (WriteBarrierBase<Unknown>* location = getDirectLocation(propertyName)) {
     387        if (m_structure->hasGetterSetterProperties() && location->isGetterSetter())
    378388            fillGetterPropertySlot(slot, location);
    379389        else
    380             slot.setValueSlot(this, location, offsetForLocation(location));
     390            slot.setValue(this, location->get(), offsetForLocation(location));
    381391        return true;
    382392    }
Note: See TracChangeset for help on using the changeset viewer.