Changeset 156621 in webkit


Ignore:
Timestamp:
Sep 29, 2013 5:57:07 PM (11 years ago)
Author:
akling@apple.com
Message:

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

Reviewed by Geoffrey Garen.

ArrayPrototype doesn't need the global object for anything during
construction, so reduce the amount of loads by just passing the VM.

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r156620 r156621  
     12013-09-29  Andreas Kling  <akling@apple.com>
     2
     3        Pass VM instead of JSGlobalObject to ArrayPrototype constructor.
     4        <https://webkit.org/b/122079>
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        ArrayPrototype doesn't need the global object for anything during
     9        construction, so reduce the amount of loads by just passing the VM.
     10
    1112013-09-29  Andreas Kling  <akling@apple.com>
    212
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r156240 r156621  
    116116*/
    117117
    118 ArrayPrototype* ArrayPrototype::create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    119 {
    120     ArrayPrototype* prototype = new (NotNull, allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure);
    121     prototype->finishCreation(globalObject);
     118ArrayPrototype* ArrayPrototype::create(VM& vm, Structure* structure)
     119{
     120    ArrayPrototype* prototype = new (NotNull, allocateCell<ArrayPrototype>(vm.heap)) ArrayPrototype(vm, structure);
     121    prototype->finishCreation(vm);
    122122    return prototype;
    123123}
    124124
    125125// ECMA 15.4.4
    126 ArrayPrototype::ArrayPrototype(JSGlobalObject* globalObject, Structure* structure)
    127     : JSArray(globalObject->vm(), structure, 0)
    128 {
    129 }
    130 
    131 void ArrayPrototype::finishCreation(JSGlobalObject* globalObject)
    132 {
    133     VM& vm = globalObject->vm();
     126ArrayPrototype::ArrayPrototype(VM& vm, Structure* structure)
     127    : JSArray(vm, structure, 0)
     128{
     129}
     130
     131void ArrayPrototype::finishCreation(VM& vm)
     132{
    134133    Base::finishCreation(vm);
    135134    ASSERT(inherits(info()));
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h

    r154373 r156621  
    2929class ArrayPrototype : public JSArray {
    3030private:
    31     ArrayPrototype(JSGlobalObject*, Structure*);
     31    ArrayPrototype(VM&, Structure*);
    3232
    3333public:
    3434    typedef JSArray Base;
    3535
    36     static ArrayPrototype* create(ExecState*, JSGlobalObject*, Structure*);
     36    static ArrayPrototype* create(VM&, Structure*);
    3737       
    3838    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
     
    4646
    4747protected:
    48     void finishCreation(JSGlobalObject*);
     48    void finishCreation(VM&);
    4949};
    5050
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r156620 r156621  
    284284#endif
    285285
    286     m_arrayPrototype.set(vm, this, ArrayPrototype::create(exec, this, ArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
     286    m_arrayPrototype.set(vm, this, ArrayPrototype::create(vm, ArrayPrototype::createStructure(vm, this, m_objectPrototype.get())));
    287287   
    288288    m_originalArrayStructureForIndexingShape[UndecidedShape >> IndexingShapeShift].set(vm, this, JSArray::createStructure(vm, this, m_arrayPrototype.get(), ArrayWithUndecided));
Note: See TracChangeset for help on using the changeset viewer.