Changeset 156621 in webkit
- Timestamp:
- Sep 29, 2013 5:57:07 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r156620 r156621 1 2013-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 1 11 2013-09-29 Andreas Kling <akling@apple.com> 2 12 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r156240 r156621 116 116 */ 117 117 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);118 ArrayPrototype* ArrayPrototype::create(VM& vm, Structure* structure) 119 { 120 ArrayPrototype* prototype = new (NotNull, allocateCell<ArrayPrototype>(vm.heap)) ArrayPrototype(vm, structure); 121 prototype->finishCreation(vm); 122 122 return prototype; 123 123 } 124 124 125 125 // 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(); 126 ArrayPrototype::ArrayPrototype(VM& vm, Structure* structure) 127 : JSArray(vm, structure, 0) 128 { 129 } 130 131 void ArrayPrototype::finishCreation(VM& vm) 132 { 134 133 Base::finishCreation(vm); 135 134 ASSERT(inherits(info())); -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h
r154373 r156621 29 29 class ArrayPrototype : public JSArray { 30 30 private: 31 ArrayPrototype( JSGlobalObject*, Structure*);31 ArrayPrototype(VM&, Structure*); 32 32 33 33 public: 34 34 typedef JSArray Base; 35 35 36 static ArrayPrototype* create( ExecState*, JSGlobalObject*, Structure*);36 static ArrayPrototype* create(VM&, Structure*); 37 37 38 38 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); … … 46 46 47 47 protected: 48 void finishCreation( JSGlobalObject*);48 void finishCreation(VM&); 49 49 }; 50 50 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r156620 r156621 284 284 #endif 285 285 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()))); 287 287 288 288 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.