⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 157614 in webkit


Ignore:
Timestamp:
Oct 17, 2013, 4:35:47 PM (13 years ago)
Author:
akling@apple.com
Message:

Pass VM instead of JSGlobalObject to JSONObject constructor.
<https://webkit.org/b/122999>

JSONObject was only use the JSGlobalObject to grab at the VM.
Dodge a few loads by passing the VM directly instead.

Reviewed by Geoffrey Garen.

  • runtime/JSONObject.cpp:

(JSC::JSONObject::JSONObject):
(JSC::JSONObject::finishCreation):

  • runtime/JSONObject.h:

(JSC::JSONObject::create):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r157612 r157614  
     12013-10-17  Andreas Kling  <akling@apple.com>
     2
     3        Pass VM instead of JSGlobalObject to JSONObject constructor.
     4        <https://webkit.org/b/122999>
     5
     6        JSONObject was only use the JSGlobalObject to grab at the VM.
     7        Dodge a few loads by passing the VM directly instead.
     8
     9        Reviewed by Geoffrey Garen.
     10
     11        * runtime/JSONObject.cpp:
     12        (JSC::JSONObject::JSONObject):
     13        (JSC::JSONObject::finishCreation):
     14        * runtime/JSONObject.h:
     15        (JSC::JSONObject::create):
     16
    1172013-10-17  Geoffrey Garen  <ggaren@apple.com>
    218
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r157301 r157614  
    396396    putDirectWithoutTransition(vm, vm.propertyNames->eval, m_evalFunction.get(), DontEnum);
    397397
    398     putDirectWithoutTransition(vm, vm.propertyNames->JSON, JSONObject::create(exec, this, JSONObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
     398    putDirectWithoutTransition(vm, vm.propertyNames->JSON, JSONObject::create(vm, JSONObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
    399399    putDirectWithoutTransition(vm, vm.propertyNames->Math, MathObject::create(vm, this, MathObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
    400400   
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r156785 r157614  
    5555namespace JSC {
    5656
    57 JSONObject::JSONObject(JSGlobalObject* globalObject, Structure* structure)
    58     : JSNonFinalObject(globalObject->vm(), structure)
    59 {
    60 }
    61 
    62 void JSONObject::finishCreation(JSGlobalObject* globalObject)
    63 {
    64     Base::finishCreation(globalObject->vm());
     57JSONObject::JSONObject(VM& vm, Structure* structure)
     58    : JSNonFinalObject(vm, structure)
     59{
     60}
     61
     62void JSONObject::finishCreation(VM& vm)
     63{
     64    Base::finishCreation(vm);
    6565    ASSERT(inherits(info()));
    6666}
  • trunk/Source/JavaScriptCore/runtime/JSONObject.h

    r156785 r157614  
    3737        typedef JSNonFinalObject Base;
    3838
    39         static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     39        static JSONObject* create(VM& vm, Structure* structure)
    4040        {
    41             JSONObject* object = new (NotNull, allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure);
    42             object->finishCreation(globalObject);
     41            JSONObject* object = new (NotNull, allocateCell<JSONObject>(vm.heap)) JSONObject(vm, structure);
     42            object->finishCreation(vm);
    4343            return object;
    4444        }
     
    5252
    5353    protected:
    54         void finishCreation(JSGlobalObject*);
     54        void finishCreation(VM&);
    5555        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags;
    5656
    5757    private:
    58         JSONObject(JSGlobalObject*, Structure*);
     58        JSONObject(VM&, Structure*);
    5959        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    6060
Note: See TracChangeset for help on using the changeset viewer.