Changeset 156624 in webkit
- Timestamp:
- Sep 29, 2013 8:45:30 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackFunction.cpp
r155143 r156624 46 46 const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackFunction) }; 47 47 48 JSCallbackFunction::JSCallbackFunction( JSGlobalObject* globalObject, Structure* structure, JSObjectCallAsFunctionCallback callback)49 : InternalFunction( globalObject, structure)48 JSCallbackFunction::JSCallbackFunction(VM& vm, Structure* structure, JSObjectCallAsFunctionCallback callback) 49 : InternalFunction(vm, structure) 50 50 , m_callback(callback) 51 51 { … … 58 58 } 59 59 60 JSCallbackFunction* JSCallbackFunction::create( ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const String& name)60 JSCallbackFunction* JSCallbackFunction::create(VM& vm, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const String& name) 61 61 { 62 JSCallbackFunction* function = new (NotNull, allocateCell<JSCallbackFunction>( *exec->heap())) JSCallbackFunction(globalObject, globalObject->callbackFunctionStructure(), callback);63 function->finishCreation( exec->vm(), name);62 JSCallbackFunction* function = new (NotNull, allocateCell<JSCallbackFunction>(vm.heap)) JSCallbackFunction(vm, globalObject->callbackFunctionStructure(), callback); 63 function->finishCreation(vm, name); 64 64 return function; 65 65 } -
trunk/Source/JavaScriptCore/API/JSCallbackFunction.h
r154038 r156624 37 37 typedef InternalFunction Base; 38 38 39 static JSCallbackFunction* create( ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const String& name);39 static JSCallbackFunction* create(VM&, JSGlobalObject*, JSObjectCallAsFunctionCallback, const String& name); 40 40 41 41 DECLARE_INFO; … … 49 49 50 50 private: 51 JSCallbackFunction( JSGlobalObject*, Structure*, JSObjectCallAsFunctionCallback);51 JSCallbackFunction(VM&, Structure*, JSObjectCallAsFunctionCallback); 52 52 void finishCreation(VM&, const String& name); 53 53 -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r156240 r156624 593 593 if (Parent::getOwnPropertySlot(thisObj, exec, propertyName, slot2)) 594 594 return slot2.getValue(exec, propertyName); 595 595 596 596 if (StringImpl* name = propertyName.publicName()) { 597 597 for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) { … … 599 599 if (StaticFunctionEntry* entry = staticFunctions->get(name)) { 600 600 if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) { 601 602 JSObject* o = JSCallbackFunction::create( exec, thisObj->globalObject(), callAsFunction, name);603 thisObj->putDirect( exec->vm(), propertyName, o, entry->attributes);601 VM& vm = exec->vm(); 602 JSObject* o = JSCallbackFunction::create(vm, thisObj->globalObject(), callAsFunction, name); 603 thisObj->putDirect(vm, propertyName, o, entry->attributes); 604 604 return o; 605 605 } -
trunk/Source/JavaScriptCore/API/JSObjectRef.cpp
r154459 r156624 106 106 ExecState* exec = toJS(ctx); 107 107 APIEntryShim entryShim(exec); 108 return toRef(JSCallbackFunction::create(exec , exec->lexicalGlobalObject(), callAsFunction, name ? name->string() : ASCIILiteral("anonymous")));108 return toRef(JSCallbackFunction::create(exec->vm(), exec->lexicalGlobalObject(), callAsFunction, name ? name->string() : ASCIILiteral("anonymous"))); 109 109 } 110 110 -
trunk/Source/JavaScriptCore/API/ObjCCallbackFunction.h
r154038 r156624 48 48 typedef InternalFunction Base; 49 49 50 static ObjCCallbackFunction* create( ExecState*, JSGlobalObject*, const String& name, PassOwnPtr<ObjCCallbackFunctionImpl>);50 static ObjCCallbackFunction* create(VM&, JSGlobalObject*, const String& name, PassOwnPtr<ObjCCallbackFunctionImpl>); 51 51 static void destroy(JSCell*); 52 52 … … 62 62 63 63 protected: 64 ObjCCallbackFunction( JSGlobalObject*, JSObjectCallAsFunctionCallback, PassOwnPtr<ObjCCallbackFunctionImpl>);64 ObjCCallbackFunction(VM&, JSGlobalObject*, JSObjectCallAsFunctionCallback, PassOwnPtr<ObjCCallbackFunctionImpl>); 65 65 66 66 private: -
trunk/Source/JavaScriptCore/API/ObjCCallbackFunction.mm
r154647 r156624 468 468 const JSC::ClassInfo ObjCCallbackFunction::s_info = { "CallbackFunction", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(ObjCCallbackFunction) }; 469 469 470 ObjCCallbackFunction::ObjCCallbackFunction(JSC:: JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, PassOwnPtr<ObjCCallbackFunctionImpl> impl)471 : Base( globalObject, globalObject->objcCallbackFunctionStructure())470 ObjCCallbackFunction::ObjCCallbackFunction(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, PassOwnPtr<ObjCCallbackFunctionImpl> impl) 471 : Base(vm, globalObject->objcCallbackFunctionStructure()) 472 472 , m_callback(callback) 473 473 , m_impl(impl) … … 475 475 } 476 476 477 ObjCCallbackFunction* ObjCCallbackFunction::create(JSC:: ExecState* exec, JSC::JSGlobalObject* globalObject, const String& name, PassOwnPtr<ObjCCallbackFunctionImpl> impl)478 { 479 ObjCCallbackFunction* function = new (NotNull, allocateCell<ObjCCallbackFunction>( *exec->heap())) ObjCCallbackFunction(globalObject, objCCallbackFunctionCallAsFunction, impl);480 function->finishCreation( exec->vm(), name);477 ObjCCallbackFunction* ObjCCallbackFunction::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, const String& name, PassOwnPtr<ObjCCallbackFunctionImpl> impl) 478 { 479 ObjCCallbackFunction* function = new (NotNull, allocateCell<ObjCCallbackFunction>(vm.heap)) ObjCCallbackFunction(vm, globalObject, objCCallbackFunctionCallAsFunction, impl); 480 function->finishCreation(vm, name); 481 481 return function; 482 482 } … … 590 590 OwnPtr<JSC::ObjCCallbackFunctionImpl> impl = adoptPtr(new JSC::ObjCCallbackFunctionImpl(context, invocation, type, instanceClass, arguments.release(), result.release())); 591 591 // FIXME: Maybe we could support having the selector as the name of the function to make it a bit more user-friendly from the JS side? 592 return toRef(JSC::ObjCCallbackFunction::create(exec , exec->lexicalGlobalObject(), "", impl.release()));592 return toRef(JSC::ObjCCallbackFunction::create(exec->vm(), exec->lexicalGlobalObject(), "", impl.release())); 593 593 } 594 594 -
trunk/Source/JavaScriptCore/ChangeLog
r156621 r156624 1 2013-09-29 Andreas Kling <akling@apple.com> 2 3 Pass VM instead of JSGlobalObject to function constructors. 4 <https://webkit.org/b/122082> 5 6 Reviewed by Darin Adler. 7 8 Functions don't need anything from the global object during their 9 construction and only use it to get to the VM. Reduce loads by 10 simply passing the VM around instead. 11 12 This patch is mostly mechanical, I just changed the signature of 13 InternalFunction and worked my way from there until it built. 14 15 JSC release binary size -= 4840 bytes. 16 1 17 2013-09-29 Andreas Kling <akling@apple.com> 2 18 -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r156498 r156624 55 55 */ 56 56 57 ArrayConstructor::ArrayConstructor( JSGlobalObject* globalObject, Structure* structure)58 : InternalFunction( globalObject, structure)57 ArrayConstructor::ArrayConstructor(VM& vm, Structure* structure) 58 : InternalFunction(vm, structure) 59 59 { 60 60 } -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h
r156498 r156624 34 34 typedef InternalFunction Base; 35 35 36 static ArrayConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)36 static ArrayConstructor* create(VM& vm, Structure* structure, ArrayPrototype* arrayPrototype) 37 37 { 38 VM& vm = exec->vm(); 39 ArrayConstructor* constructor = new (NotNull, allocateCell<ArrayConstructor>(vm.heap)) ArrayConstructor(globalObject, structure); 38 ArrayConstructor* constructor = new (NotNull, allocateCell<ArrayConstructor>(vm.heap)) ArrayConstructor(vm, structure); 40 39 constructor->finishCreation(vm, arrayPrototype); 41 40 return constructor; … … 54 53 55 54 private: 56 ArrayConstructor( JSGlobalObject*, Structure*);55 ArrayConstructor(VM&, Structure*); 57 56 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 58 57 -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
r156498 r156624 32 32 const ClassInfo BooleanConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(BooleanConstructor) }; 33 33 34 BooleanConstructor::BooleanConstructor( JSGlobalObject* globalObject, Structure* structure)35 : InternalFunction( globalObject, structure)34 BooleanConstructor::BooleanConstructor(VM& vm, Structure* structure) 35 : InternalFunction(vm, structure) 36 36 { 37 37 } -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h
r156498 r156624 32 32 typedef InternalFunction Base; 33 33 34 static BooleanConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)34 static BooleanConstructor* create(VM& vm, Structure* structure, BooleanPrototype* booleanPrototype) 35 35 { 36 VM& vm = exec->vm(); 37 BooleanConstructor* constructor = new (NotNull, allocateCell<BooleanConstructor>(vm.heap)) BooleanConstructor(globalObject, structure); 36 BooleanConstructor* constructor = new (NotNull, allocateCell<BooleanConstructor>(vm.heap)) BooleanConstructor(vm, structure); 38 37 constructor->finishCreation(vm, booleanPrototype); 39 38 return constructor; … … 51 50 52 51 private: 53 BooleanConstructor( JSGlobalObject*, Structure*);52 BooleanConstructor(VM&, Structure*); 54 53 static ConstructType getConstructData(JSCell*, ConstructData&); 55 54 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r156620 r156624 75 75 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(DateConstructor); 76 76 77 DateConstructor::DateConstructor( JSGlobalObject* globalObject, Structure* structure)78 : InternalFunction( globalObject, structure)77 DateConstructor::DateConstructor(VM& vm, Structure* structure) 78 : InternalFunction(vm, structure) 79 79 { 80 80 } -
trunk/Source/JavaScriptCore/runtime/DateConstructor.h
r156498 r156624 32 32 typedef InternalFunction Base; 33 33 34 static DateConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)34 static DateConstructor* create(VM& vm, Structure* structure, DatePrototype* datePrototype) 35 35 { 36 DateConstructor* constructor = new (NotNull, allocateCell<DateConstructor>( *exec->heap())) DateConstructor(globalObject, structure);37 constructor->finishCreation( exec->vm(), datePrototype);36 DateConstructor* constructor = new (NotNull, allocateCell<DateConstructor>(vm.heap)) DateConstructor(vm, structure); 37 constructor->finishCreation(vm, datePrototype); 38 38 return constructor; 39 39 } … … 51 51 52 52 private: 53 DateConstructor( JSGlobalObject*, Structure*);53 DateConstructor(VM&, Structure*); 54 54 static ConstructType getConstructData(JSCell*, ConstructData&); 55 55 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/JavaScriptCore/runtime/Error.h
r154797 r156624 74 74 class StrictModeTypeErrorFunction : public InternalFunction { 75 75 private: 76 StrictModeTypeErrorFunction( JSGlobalObject* globalObject, Structure* structure, const String& message)77 : InternalFunction( globalObject, structure)76 StrictModeTypeErrorFunction(VM& vm, Structure* structure, const String& message) 77 : InternalFunction(vm, structure) 78 78 , m_message(message) 79 79 { … … 85 85 typedef InternalFunction Base; 86 86 87 static StrictModeTypeErrorFunction* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const String& message)87 static StrictModeTypeErrorFunction* create(VM& vm, Structure* structure, const String& message) 88 88 { 89 StrictModeTypeErrorFunction* function = new (NotNull, allocateCell<StrictModeTypeErrorFunction>( *exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);90 function->finishCreation( exec->vm(), String());89 StrictModeTypeErrorFunction* function = new (NotNull, allocateCell<StrictModeTypeErrorFunction>(vm.heap)) StrictModeTypeErrorFunction(vm, structure, message); 90 function->finishCreation(vm, String()); 91 91 return function; 92 92 } -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
r156498 r156624 34 34 const ClassInfo ErrorConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(ErrorConstructor) }; 35 35 36 ErrorConstructor::ErrorConstructor( JSGlobalObject* globalObject, Structure* structure)37 : InternalFunction( globalObject, structure)36 ErrorConstructor::ErrorConstructor(VM& vm, Structure* structure) 37 : InternalFunction(vm, structure) 38 38 { 39 39 } -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h
r156498 r156624 33 33 typedef InternalFunction Base; 34 34 35 static ErrorConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)35 static ErrorConstructor* create(VM& vm, Structure* structure, ErrorPrototype* errorPrototype) 36 36 { 37 VM& vm = exec->vm(); 38 ErrorConstructor* constructor = new (NotNull, allocateCell<ErrorConstructor>(vm.heap)) ErrorConstructor(globalObject, structure); 37 ErrorConstructor* constructor = new (NotNull, allocateCell<ErrorConstructor>(vm.heap)) ErrorConstructor(vm, structure); 39 38 constructor->finishCreation(vm, errorPrototype); 40 39 return constructor; … … 52 51 53 52 private: 54 ErrorConstructor( JSGlobalObject*, Structure*);53 ErrorConstructor(VM&, Structure*); 55 54 static ConstructType getConstructData(JSCell*, ConstructData&); 56 55 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r156602 r156624 40 40 const ClassInfo FunctionConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(FunctionConstructor) }; 41 41 42 FunctionConstructor::FunctionConstructor( JSGlobalObject* globalObject, Structure* structure)43 : InternalFunction( globalObject, structure)42 FunctionConstructor::FunctionConstructor(VM& vm, Structure* structure) 43 : InternalFunction(vm, structure) 44 44 { 45 45 } -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h
r156498 r156624 36 36 typedef InternalFunction Base; 37 37 38 static FunctionConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)38 static FunctionConstructor* create(VM& vm, Structure* structure, FunctionPrototype* functionPrototype) 39 39 { 40 VM& vm = exec->vm(); 41 FunctionConstructor* constructor = new (NotNull, allocateCell<FunctionConstructor>(vm.heap)) FunctionConstructor(globalObject, structure); 40 FunctionConstructor* constructor = new (NotNull, allocateCell<FunctionConstructor>(vm.heap)) FunctionConstructor(vm, structure); 42 41 constructor->finishCreation(vm, functionPrototype); 43 42 return constructor; … … 52 51 53 52 private: 54 FunctionConstructor( JSGlobalObject*, Structure*);53 FunctionConstructor(VM&, Structure*); 55 54 void finishCreation(VM&, FunctionPrototype*); 56 55 static ConstructType getConstructData(JSCell*, ConstructData&); -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r156602 r156624 43 43 static EncodedJSValue JSC_HOST_CALL functionProtoFuncBind(ExecState*); 44 44 45 FunctionPrototype::FunctionPrototype( JSGlobalObject* globalObject, Structure* structure)46 : InternalFunction( globalObject, structure)45 FunctionPrototype::FunctionPrototype(VM& vm, Structure* structure) 46 : InternalFunction(vm, structure) 47 47 { 48 48 } -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h
r156498 r156624 30 30 typedef InternalFunction Base; 31 31 32 static FunctionPrototype* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure)32 static FunctionPrototype* create(VM& vm, Structure* structure) 33 33 { 34 VM& vm = exec->vm(); 35 FunctionPrototype* prototype = new (NotNull, allocateCell<FunctionPrototype>(vm.heap)) FunctionPrototype(globalObject, structure); 34 FunctionPrototype* prototype = new (NotNull, allocateCell<FunctionPrototype>(vm.heap)) FunctionPrototype(vm, structure); 36 35 prototype->finishCreation(vm, String()); 37 36 return prototype; … … 51 50 52 51 private: 53 FunctionPrototype( JSGlobalObject*, Structure*);52 FunctionPrototype(VM&, Structure*); 54 53 static CallType getCallData(JSCell*, CallData&); 55 54 }; -
trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp
r155143 r156624 35 35 const ClassInfo InternalFunction::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(InternalFunction) }; 36 36 37 InternalFunction::InternalFunction( JSGlobalObject* globalObject, Structure* structure)38 : JSDestructibleObject( globalObject->vm(), structure)37 InternalFunction::InternalFunction(VM& vm, Structure* structure) 38 : JSDestructibleObject(vm, structure) 39 39 { 40 40 } -
trunk/Source/JavaScriptCore/runtime/InternalFunction.h
r154038 r156624 50 50 static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags; 51 51 52 JS_EXPORT_PRIVATE InternalFunction( JSGlobalObject*, Structure*);52 JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*); 53 53 54 54 JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name); -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp
r156240 r156624 41 41 }; 42 42 43 JSArrayBufferConstructor::JSArrayBufferConstructor( 44 JSGlobalObject* globalObject, Structure* structure) 45 : Base(globalObject, structure) 43 JSArrayBufferConstructor::JSArrayBufferConstructor(VM& vm, Structure* structure) 44 : Base(vm, structure) 46 45 { 47 46 } … … 54 53 } 55 54 56 JSArrayBufferConstructor* JSArrayBufferConstructor::create( CallFrame* callFrame, JSGlobalObject* globalObject, Structure* structure, JSArrayBufferPrototype* prototype)55 JSArrayBufferConstructor* JSArrayBufferConstructor::create(VM& vm, Structure* structure, JSArrayBufferPrototype* prototype) 57 56 { 58 VM& vm = callFrame->vm();59 57 JSArrayBufferConstructor* result = 60 58 new (NotNull, allocateCell<JSArrayBufferConstructor>(vm.heap)) 61 JSArrayBufferConstructor( globalObject, structure);59 JSArrayBufferConstructor(vm, structure); 62 60 result->finishCreation(vm, prototype); 63 61 return result; -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.h
r155177 r156624 38 38 39 39 protected: 40 JSArrayBufferConstructor( JSGlobalObject*, Structure*);40 JSArrayBufferConstructor(VM&, Structure*); 41 41 void finishCreation(VM&, JSArrayBufferPrototype*); 42 42 43 43 public: 44 static JSArrayBufferConstructor* create( CallFrame*, JSGlobalObject*, Structure*, JSArrayBufferPrototype*);44 static JSArrayBufferConstructor* create(VM&, Structure*, JSArrayBufferPrototype*); 45 45 46 46 DECLARE_INFO; -
trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h
r154127 r156624 37 37 38 38 protected: 39 JSGenericTypedArrayViewConstructor( JSGlobalObject*, Structure*);39 JSGenericTypedArrayViewConstructor(VM&, Structure*); 40 40 void finishCreation(VM&, JSObject* prototype, const String& name); 41 41 42 42 public: 43 43 static JSGenericTypedArrayViewConstructor* create( 44 JSGlobalObject*, Structure*, JSObject* prototype, const String& name);45 44 VM&, Structure*, JSObject* prototype, const String& name); 45 46 46 DECLARE_INFO; 47 47 -
trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h
r156240 r156624 35 35 36 36 template<typename ViewClass> 37 JSGenericTypedArrayViewConstructor<ViewClass>::JSGenericTypedArrayViewConstructor( JSGlobalObject* globalObject, Structure* structure)38 : Base( globalObject, structure)37 JSGenericTypedArrayViewConstructor<ViewClass>::JSGenericTypedArrayViewConstructor(VM& vm, Structure* structure) 38 : Base(vm, structure) 39 39 { 40 40 } … … 52 52 JSGenericTypedArrayViewConstructor<ViewClass>* 53 53 JSGenericTypedArrayViewConstructor<ViewClass>::create( 54 JSGlobalObject* globalObject, Structure* structure, JSObject* prototype,54 VM& vm, Structure* structure, JSObject* prototype, 55 55 const String& name) 56 56 { 57 VM& vm = globalObject->vm();58 57 JSGenericTypedArrayViewConstructor* result = 59 58 new (NotNull, allocateCell<JSGenericTypedArrayViewConstructor>(vm.heap)) 60 JSGenericTypedArrayViewConstructor( globalObject, structure);59 JSGenericTypedArrayViewConstructor(vm, structure); 61 60 result->finishCreation(vm, prototype, name); 62 61 return result; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r156621 r156624 229 229 VM& vm = exec->vm(); 230 230 231 m_functionPrototype.set(vm, this, FunctionPrototype::create( exec, this, FunctionPrototype::createStructure(vm, this, jsNull()))); // The real prototype will be set once ObjectPrototype is created.231 m_functionPrototype.set(vm, this, FunctionPrototype::create(vm, FunctionPrototype::createStructure(vm, this, jsNull()))); // The real prototype will be set once ObjectPrototype is created. 232 232 m_functionStructure.set(vm, this, JSFunction::createStructure(vm, this, m_functionPrototype.get())); 233 233 m_boundFunctionStructure.set(vm, this, JSBoundFunction::createStructure(vm, this, m_functionPrototype.get())); … … 322 322 // Constructors 323 323 324 JSCell* objectConstructor = ObjectConstructor::create( exec, this, ObjectConstructor::createStructure(vm, this, m_functionPrototype.get()), m_objectPrototype.get());325 JSCell* functionConstructor = FunctionConstructor::create( exec, this, FunctionConstructor::createStructure(vm, this, m_functionPrototype.get()), m_functionPrototype.get());326 JSCell* arrayConstructor = ArrayConstructor::create( exec, this, ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_arrayPrototype.get());324 JSCell* objectConstructor = ObjectConstructor::create(vm, ObjectConstructor::createStructure(vm, this, m_functionPrototype.get()), m_objectPrototype.get()); 325 JSCell* functionConstructor = FunctionConstructor::create(vm, FunctionConstructor::createStructure(vm, this, m_functionPrototype.get()), m_functionPrototype.get()); 326 JSCell* arrayConstructor = ArrayConstructor::create(vm, ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_arrayPrototype.get()); 327 327 328 328 #if ENABLE(PROMISES) 329 JSCell* promiseConstructor = JSPromiseConstructor::create( exec, this, JSPromiseConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promisePrototype.get());330 JSCell* promiseResolverConstructor = JSPromiseResolverConstructor::create( exec, this, JSPromiseResolverConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promiseResolverPrototype.get());329 JSCell* promiseConstructor = JSPromiseConstructor::create(vm, JSPromiseConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promisePrototype.get()); 330 JSCell* promiseResolverConstructor = JSPromiseResolverConstructor::create(vm, JSPromiseResolverConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promiseResolverPrototype.get()); 331 331 #endif // ENABLE(PROMISES) 332 332 333 m_regExpConstructor.set(vm, this, RegExpConstructor::create( exec, this, RegExpConstructor::createStructure(vm, this, m_functionPrototype.get()), m_regExpPrototype.get()));333 m_regExpConstructor.set(vm, this, RegExpConstructor::create(vm, RegExpConstructor::createStructure(vm, this, m_functionPrototype.get()), m_regExpPrototype.get())); 334 334 335 335 #define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ 336 capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create( exec, this, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get()); \336 capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get()); \ 337 337 m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, lowerName ## Constructor, DontEnum); \ 338 338 … … 392 392 393 393 FixedArray<InternalFunction*, NUMBER_OF_TYPED_ARRAY_TYPES> typedArrayConstructors; 394 typedArrayConstructors[toIndex(TypeInt8)] = JSInt8ArrayConstructor::create( this, JSInt8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt8)].prototype.get(), "Int8Array");395 typedArrayConstructors[toIndex(TypeInt16)] = JSInt16ArrayConstructor::create( this, JSInt16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt16)].prototype.get(), "Int16Array");396 typedArrayConstructors[toIndex(TypeInt32)] = JSInt32ArrayConstructor::create( this, JSInt32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt32)].prototype.get(), "Int32Array");397 typedArrayConstructors[toIndex(TypeUint8)] = JSUint8ArrayConstructor::create( this, JSUint8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8)].prototype.get(), "Uint8Array");398 typedArrayConstructors[toIndex(TypeUint8Clamped)] = JSUint8ClampedArrayConstructor::create( this, JSUint8ClampedArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8Clamped)].prototype.get(), "Uint8ClampedArray");399 typedArrayConstructors[toIndex(TypeUint16)] = JSUint16ArrayConstructor::create( this, JSUint16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint16)].prototype.get(), "Uint16Array");400 typedArrayConstructors[toIndex(TypeUint32)] = JSUint32ArrayConstructor::create( this, JSUint32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint32)].prototype.get(), "Uint32Array");401 typedArrayConstructors[toIndex(TypeFloat32)] = JSFloat32ArrayConstructor::create( this, JSFloat32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat32)].prototype.get(), "Float32Array");402 typedArrayConstructors[toIndex(TypeFloat64)] = JSFloat64ArrayConstructor::create( this, JSFloat64ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat64)].prototype.get(), "Float64Array");403 typedArrayConstructors[toIndex(TypeDataView)] = JSDataViewConstructor::create( this, JSDataViewConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeDataView)].prototype.get(), "DataView");394 typedArrayConstructors[toIndex(TypeInt8)] = JSInt8ArrayConstructor::create(vm, JSInt8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt8)].prototype.get(), "Int8Array"); 395 typedArrayConstructors[toIndex(TypeInt16)] = JSInt16ArrayConstructor::create(vm, JSInt16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt16)].prototype.get(), "Int16Array"); 396 typedArrayConstructors[toIndex(TypeInt32)] = JSInt32ArrayConstructor::create(vm, JSInt32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt32)].prototype.get(), "Int32Array"); 397 typedArrayConstructors[toIndex(TypeUint8)] = JSUint8ArrayConstructor::create(vm, JSUint8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8)].prototype.get(), "Uint8Array"); 398 typedArrayConstructors[toIndex(TypeUint8Clamped)] = JSUint8ClampedArrayConstructor::create(vm, JSUint8ClampedArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8Clamped)].prototype.get(), "Uint8ClampedArray"); 399 typedArrayConstructors[toIndex(TypeUint16)] = JSUint16ArrayConstructor::create(vm, JSUint16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint16)].prototype.get(), "Uint16Array"); 400 typedArrayConstructors[toIndex(TypeUint32)] = JSUint32ArrayConstructor::create(vm, JSUint32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint32)].prototype.get(), "Uint32Array"); 401 typedArrayConstructors[toIndex(TypeFloat32)] = JSFloat32ArrayConstructor::create(vm, JSFloat32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat32)].prototype.get(), "Float32Array"); 402 typedArrayConstructors[toIndex(TypeFloat64)] = JSFloat64ArrayConstructor::create(vm, JSFloat64ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat64)].prototype.get(), "Float64Array"); 403 typedArrayConstructors[toIndex(TypeDataView)] = JSDataViewConstructor::create(vm, JSDataViewConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeDataView)].prototype.get(), "DataView"); 404 404 405 405 for (unsigned typedArrayIndex = NUMBER_OF_TYPED_ARRAY_TYPES; typedArrayIndex--;) { … … 424 424 m_privateNameStructure.set(vm, this, NameInstance::createStructure(vm, this, privateNamePrototype)); 425 425 426 JSCell* privateNameConstructor = NameConstructor::create( exec, this, NameConstructor::createStructure(vm, this, m_functionPrototype.get()), privateNamePrototype);426 JSCell* privateNameConstructor = NameConstructor::create(vm, NameConstructor::createStructure(vm, this, m_functionPrototype.get()), privateNamePrototype); 427 427 privateNamePrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, privateNameConstructor, DontEnum); 428 428 putDirectWithoutTransition(vm, Identifier(exec, "Name"), privateNameConstructor, DontEnum); -
trunk/Source/JavaScriptCore/runtime/JSPromiseCallback.cpp
r154847 r156624 40 40 const ClassInfo JSPromiseCallback::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromiseCallback) }; 41 41 42 JSPromiseCallback* JSPromiseCallback::create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSPromiseResolver* resolver, Algorithm algorithm)42 JSPromiseCallback* JSPromiseCallback::create(VM& vm, Structure* structure, JSPromiseResolver* resolver, Algorithm algorithm) 43 43 { 44 JSPromiseCallback* constructor = new (NotNull, allocateCell<JSPromiseCallback>( *exec->heap())) JSPromiseCallback(globalObject, structure, algorithm);45 constructor->finishCreation( exec, resolver);44 JSPromiseCallback* constructor = new (NotNull, allocateCell<JSPromiseCallback>(vm.heap)) JSPromiseCallback(vm, structure, algorithm); 45 constructor->finishCreation(vm, resolver); 46 46 return constructor; 47 47 } … … 52 52 } 53 53 54 JSPromiseCallback::JSPromiseCallback( JSGlobalObject* globalObject, Structure* structure, Algorithm algorithm)55 : InternalFunction( globalObject, structure)54 JSPromiseCallback::JSPromiseCallback(VM& vm, Structure* structure, Algorithm algorithm) 55 : InternalFunction(vm, structure) 56 56 , m_algorithm(algorithm) 57 57 { 58 58 } 59 59 60 void JSPromiseCallback::finishCreation( ExecState* exec, JSPromiseResolver* resolver)60 void JSPromiseCallback::finishCreation(VM& vm, JSPromiseResolver* resolver) 61 61 { 62 Base::finishCreation( exec->vm(), "PromiseCallback");63 m_resolver.set( exec->vm(), this, resolver);62 Base::finishCreation(vm, "PromiseCallback"); 63 m_resolver.set(vm, this, resolver); 64 64 } 65 65 … … 113 113 const ClassInfo JSPromiseWrapperCallback::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromiseWrapperCallback) }; 114 114 115 JSPromiseWrapperCallback* JSPromiseWrapperCallback::create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSPromiseResolver* resolver, JSValue callback)115 JSPromiseWrapperCallback* JSPromiseWrapperCallback::create(VM& vm, Structure* structure, JSPromiseResolver* resolver, JSValue callback) 116 116 { 117 JSPromiseWrapperCallback* constructor = new (NotNull, allocateCell<JSPromiseWrapperCallback>( *exec->heap())) JSPromiseWrapperCallback(globalObject, structure);118 constructor->finishCreation( exec, resolver, callback);117 JSPromiseWrapperCallback* constructor = new (NotNull, allocateCell<JSPromiseWrapperCallback>(vm.heap)) JSPromiseWrapperCallback(vm, structure); 118 constructor->finishCreation(vm, resolver, callback); 119 119 return constructor; 120 120 } … … 125 125 } 126 126 127 JSPromiseWrapperCallback::JSPromiseWrapperCallback( JSGlobalObject* globalObject, Structure* structure)128 : InternalFunction( globalObject, structure)127 JSPromiseWrapperCallback::JSPromiseWrapperCallback(VM& vm, Structure* structure) 128 : InternalFunction(vm, structure) 129 129 { 130 130 } 131 131 132 void JSPromiseWrapperCallback::finishCreation( ExecState* exec, JSPromiseResolver* resolver, JSValue callback)132 void JSPromiseWrapperCallback::finishCreation(VM& vm, JSPromiseResolver* resolver, JSValue callback) 133 133 { 134 Base::finishCreation( exec->vm(), "PromiseWrapperCallback");135 m_resolver.set( exec->vm(), this, resolver);136 m_callback.set( exec->vm(), this, callback);134 Base::finishCreation(vm, "PromiseWrapperCallback"); 135 m_resolver.set(vm, this, resolver); 136 m_callback.set(vm, this, callback); 137 137 } 138 138 -
trunk/Source/JavaScriptCore/runtime/JSPromiseCallback.h
r154847 r156624 45 45 }; 46 46 47 static JSPromiseCallback* create( ExecState*, JSGlobalObject*, Structure*, JSPromiseResolver*, Algorithm);47 static JSPromiseCallback* create(VM&, Structure*, JSPromiseResolver*, Algorithm); 48 48 static Structure* createStructure(VM&, JSGlobalObject*, JSValue); 49 49 … … 51 51 52 52 private: 53 JSPromiseCallback( JSGlobalObject*, Structure*, Algorithm);54 void finishCreation( ExecState*, JSPromiseResolver*);53 JSPromiseCallback(VM&, Structure*, Algorithm); 54 void finishCreation(VM&, JSPromiseResolver*); 55 55 static const unsigned StructureFlags = OverridesVisitChildren | JSObject::StructureFlags; 56 56 … … 68 68 typedef InternalFunction Base; 69 69 70 static JSPromiseWrapperCallback* create( ExecState*, JSGlobalObject*, Structure*, JSPromiseResolver*, JSValue callback);70 static JSPromiseWrapperCallback* create(VM&, Structure*, JSPromiseResolver*, JSValue callback); 71 71 static Structure* createStructure(VM&, JSGlobalObject*, JSValue); 72 72 … … 74 74 75 75 private: 76 JSPromiseWrapperCallback( JSGlobalObject*, Structure*);77 void finishCreation( ExecState*, JSPromiseResolver*, JSValue callback);76 JSPromiseWrapperCallback(VM&, Structure*); 77 void finishCreation(VM&, JSPromiseResolver*, JSValue callback); 78 78 static const unsigned StructureFlags = OverridesVisitChildren | JSObject::StructureFlags; 79 79 -
trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp
r156498 r156624 66 66 */ 67 67 68 JSPromiseConstructor* JSPromiseConstructor::create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSPromisePrototype* promisePrototype)68 JSPromiseConstructor* JSPromiseConstructor::create(VM& vm, Structure* structure, JSPromisePrototype* promisePrototype) 69 69 { 70 VM& vm = exec->vm(); 71 JSPromiseConstructor* constructor = new (NotNull, allocateCell<JSPromiseConstructor>(vm.heap)) JSPromiseConstructor(globalObject, structure); 70 JSPromiseConstructor* constructor = new (NotNull, allocateCell<JSPromiseConstructor>(vm.heap)) JSPromiseConstructor(vm, structure); 72 71 constructor->finishCreation(vm, promisePrototype); 73 72 return constructor; … … 79 78 } 80 79 81 JSPromiseConstructor::JSPromiseConstructor( JSGlobalObject* globalObject, Structure* structure)82 : InternalFunction( globalObject, structure)80 JSPromiseConstructor::JSPromiseConstructor(VM& vm, Structure* structure) 81 : InternalFunction(vm, structure) 83 82 { 84 83 } -
trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.h
r156498 r156624 39 39 typedef InternalFunction Base; 40 40 41 static JSPromiseConstructor* create( ExecState*, JSGlobalObject*, Structure*, JSPromisePrototype*);41 static JSPromiseConstructor* create(VM&, Structure*, JSPromisePrototype*); 42 42 static Structure* createStructure(VM&, JSGlobalObject*, JSValue); 43 43 … … 49 49 50 50 private: 51 JSPromiseConstructor( JSGlobalObject*, Structure*);51 JSPromiseConstructor(VM&, Structure*); 52 52 static ConstructType getConstructData(JSCell*, ConstructData&); 53 53 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/JavaScriptCore/runtime/JSPromisePrototype.cpp
r156498 r156624 93 93 { 94 94 if (!callback.isUndefined()) 95 return JSPromiseWrapperCallback::create(exec , globalObject, globalObject->promiseWrapperCallbackStructure(), resolver, callback);96 return JSPromiseCallback::create(exec , globalObject, globalObject->promiseCallbackStructure(), resolver, algorithm);95 return JSPromiseWrapperCallback::create(exec->vm(), globalObject->promiseWrapperCallbackStructure(), resolver, callback); 96 return JSPromiseCallback::create(exec->vm(), globalObject->promiseCallbackStructure(), resolver, algorithm); 97 97 } 98 98 … … 159 159 JSFunction* callee = jsCast<JSFunction*>(exec->callee()); 160 160 JSGlobalObject* globalObject = callee->globalObject(); 161 VM& vm = exec->vm(); 161 162 162 163 // 1. Let promise be a new promise. 163 JSPromise* promise = JSPromise::createWithResolver( exec->vm(), globalObject);164 JSPromise* promise = JSPromise::createWithResolver(vm, globalObject); 164 165 165 166 // 2. Let resolver be promise's associated resolver. … … 167 168 168 169 // 3. Let fulfillCallback be a new promise callback for resolver and its fulfill algorithm. 169 InternalFunction* fulfillWrapper = JSPromiseCallback::create( exec, globalObject, globalObject->promiseCallbackStructure(), resolver, JSPromiseCallback::Fulfill);170 InternalFunction* fulfillWrapper = JSPromiseCallback::create(vm, globalObject->promiseCallbackStructure(), resolver, JSPromiseCallback::Fulfill); 170 171 171 172 // 4. Let rejectWrapper be a promise wrapper callback for resolver and rejectCallback if rejectCallback is -
trunk/Source/JavaScriptCore/runtime/JSPromiseResolver.cpp
r154847 r156624 149 149 CallType callType = JSC::getCallData(then, callData); 150 150 if (callType != CallTypeNone) { 151 VM& vm = exec->vm(); 151 152 // 4.1. Let fulfillCallback be a promise callback for the context object and its resolve algorithm. 152 JSPromiseCallback* fulfillCallback = JSPromiseCallback::create( exec, globalObject(), globalObject()->promiseCallbackStructure(), this, JSPromiseCallback::Resolve);153 JSPromiseCallback* fulfillCallback = JSPromiseCallback::create(vm, globalObject()->promiseCallbackStructure(), this, JSPromiseCallback::Resolve); 153 154 154 155 // 4.2. Let rejectCallback be a promise callback for the context object and its reject algorithm. 155 JSPromiseCallback* rejectCallback = JSPromiseCallback::create( exec, globalObject(), globalObject()->promiseCallbackStructure(), this, JSPromiseCallback::Reject);156 JSPromiseCallback* rejectCallback = JSPromiseCallback::create(vm, globalObject()->promiseCallbackStructure(), this, JSPromiseCallback::Reject); 156 157 157 158 // 4.3. Call the JavaScript [[Call]] internal method of then with this value value and fulfillCallback -
trunk/Source/JavaScriptCore/runtime/JSPromiseResolverConstructor.cpp
r156498 r156624 41 41 const ClassInfo JSPromiseResolverConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromiseResolverConstructor) }; 42 42 43 JSPromiseResolverConstructor* JSPromiseResolverConstructor::create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSPromiseResolverPrototype* promisePrototype)43 JSPromiseResolverConstructor* JSPromiseResolverConstructor::create(VM& vm, Structure* structure, JSPromiseResolverPrototype* promisePrototype) 44 44 { 45 VM& vm = exec->vm(); 46 JSPromiseResolverConstructor* constructor = new (NotNull, allocateCell<JSPromiseResolverConstructor>(vm.heap)) JSPromiseResolverConstructor(globalObject, structure); 45 JSPromiseResolverConstructor* constructor = new (NotNull, allocateCell<JSPromiseResolverConstructor>(vm.heap)) JSPromiseResolverConstructor(vm, structure); 47 46 constructor->finishCreation(vm, promisePrototype); 48 47 return constructor; … … 54 53 } 55 54 56 JSPromiseResolverConstructor::JSPromiseResolverConstructor( JSGlobalObject* globalObject, Structure* structure)57 : InternalFunction( globalObject, structure)55 JSPromiseResolverConstructor::JSPromiseResolverConstructor(VM& vm, Structure* structure) 56 : InternalFunction(vm, structure) 58 57 { 59 58 } -
trunk/Source/JavaScriptCore/runtime/JSPromiseResolverConstructor.h
r156498 r156624 39 39 typedef InternalFunction Base; 40 40 41 static JSPromiseResolverConstructor* create( ExecState*, JSGlobalObject*, Structure*, JSPromiseResolverPrototype*);41 static JSPromiseResolverConstructor* create(VM&, Structure*, JSPromiseResolverPrototype*); 42 42 static Structure* createStructure(VM&, JSGlobalObject*, JSValue); 43 43 … … 49 49 50 50 private: 51 JSPromiseResolverConstructor( JSGlobalObject*, Structure*);51 JSPromiseResolverConstructor(VM&, Structure*); 52 52 static ConstructType getConstructData(JSCell*, ConstructData&); 53 53 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/JavaScriptCore/runtime/MapConstructor.h
r156498 r156624 37 37 typedef InternalFunction Base; 38 38 39 static MapConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, MapPrototype* mapPrototype)39 static MapConstructor* create(VM& vm, Structure* structure, MapPrototype* mapPrototype) 40 40 { 41 VM& vm = exec->vm(); 42 MapConstructor* constructor = new (NotNull, allocateCell<MapConstructor>(vm.heap)) MapConstructor(globalObject, structure); 41 MapConstructor* constructor = new (NotNull, allocateCell<MapConstructor>(vm.heap)) MapConstructor(vm, structure); 43 42 constructor->finishCreation(vm, mapPrototype); 44 43 return constructor; … … 53 52 54 53 private: 55 MapConstructor( JSGlobalObject* globalObject, Structure* structure)56 : Base( globalObject, structure)54 MapConstructor(VM& vm, Structure* structure) 55 : Base(vm, structure) 57 56 { 58 57 } -
trunk/Source/JavaScriptCore/runtime/NameConstructor.cpp
r156498 r156624 37 37 const ClassInfo NameConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(NameConstructor) }; 38 38 39 NameConstructor::NameConstructor( JSGlobalObject* globalObject, Structure* structure)40 : InternalFunction( globalObject, structure)39 NameConstructor::NameConstructor(VM& vm, Structure* structure) 40 : InternalFunction(vm, structure) 41 41 { 42 42 } -
trunk/Source/JavaScriptCore/runtime/NameConstructor.h
r156498 r156624 38 38 typedef InternalFunction Base; 39 39 40 static NameConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NamePrototype* prototype)40 static NameConstructor* create(VM& vm, Structure* structure, NamePrototype* prototype) 41 41 { 42 VM& vm = exec->vm(); 43 NameConstructor* constructor = new (NotNull, allocateCell<NameConstructor>(vm.heap)) NameConstructor(globalObject, structure); 42 NameConstructor* constructor = new (NotNull, allocateCell<NameConstructor>(vm.heap)) NameConstructor(vm, structure); 44 43 constructor->finishCreation(vm, prototype); 45 44 return constructor; … … 57 56 58 57 private: 59 NameConstructor( JSGlobalObject*, Structure*);58 NameConstructor(VM&, Structure*); 60 59 static ConstructType getConstructData(JSCell*, ConstructData&); 61 60 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
r156240 r156624 34 34 const ClassInfo NativeErrorConstructor::s_info = { "Function", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(NativeErrorConstructor) }; 35 35 36 NativeErrorConstructor::NativeErrorConstructor( JSGlobalObject* globalObject, Structure* structure)37 : InternalFunction( globalObject, structure)36 NativeErrorConstructor::NativeErrorConstructor(VM& vm, Structure* structure) 37 : InternalFunction(vm, structure) 38 38 { 39 39 } -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h
r156620 r156624 37 37 static NativeErrorConstructor* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name) 38 38 { 39 NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(vm.heap)) NativeErrorConstructor( globalObject, structure);39 NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(vm.heap)) NativeErrorConstructor(vm, structure); 40 40 constructor->finishCreation(vm, globalObject, prototypeStructure, name); 41 41 return constructor; … … 67 67 68 68 private: 69 NativeErrorConstructor( JSGlobalObject*, Structure*);69 NativeErrorConstructor(VM&, Structure*); 70 70 static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags; 71 71 static ConstructType getConstructData(JSCell*, ConstructData&); -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r156498 r156624 56 56 */ 57 57 58 NumberConstructor::NumberConstructor( JSGlobalObject* globalObject, Structure* structure)59 : InternalFunction( globalObject, structure)58 NumberConstructor::NumberConstructor(VM& vm, Structure* structure) 59 : InternalFunction(vm, structure) 60 60 { 61 61 } -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.h
r156498 r156624 32 32 typedef InternalFunction Base; 33 33 34 static NumberConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)34 static NumberConstructor* create(VM& vm, Structure* structure, NumberPrototype* numberPrototype) 35 35 { 36 VM& vm = exec->vm(); 37 NumberConstructor* constructor = new (NotNull, allocateCell<NumberConstructor>(vm.heap)) NumberConstructor(globalObject, structure); 36 NumberConstructor* constructor = new (NotNull, allocateCell<NumberConstructor>(vm.heap)) NumberConstructor(vm, structure); 38 37 constructor->finishCreation(vm, numberPrototype); 39 38 return constructor; … … 59 58 60 59 private: 61 NumberConstructor( JSGlobalObject*, Structure*);60 NumberConstructor(VM&, Structure*); 62 61 static ConstructType getConstructData(JSCell*, ConstructData&); 63 62 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r156498 r156624 81 81 */ 82 82 83 ObjectConstructor::ObjectConstructor( JSGlobalObject* globalObject, Structure* structure)84 : InternalFunction( globalObject, structure)83 ObjectConstructor::ObjectConstructor(VM& vm, Structure* structure) 84 : InternalFunction(vm, structure) 85 85 { 86 86 } -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h
r156498 r156624 34 34 typedef InternalFunction Base; 35 35 36 static ObjectConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype)36 static ObjectConstructor* create(VM& vm, Structure* structure, ObjectPrototype* objectPrototype) 37 37 { 38 VM& vm = exec->vm(); 39 ObjectConstructor* constructor = new (NotNull, allocateCell<ObjectConstructor>(vm.heap)) ObjectConstructor(globalObject, structure); 38 ObjectConstructor* constructor = new (NotNull, allocateCell<ObjectConstructor>(vm.heap)) ObjectConstructor(vm, structure); 40 39 constructor->finishCreation(vm, objectPrototype); 41 40 return constructor; … … 56 55 57 56 private: 58 ObjectConstructor( JSGlobalObject*, Structure*);57 ObjectConstructor(VM&, Structure*); 59 58 static ConstructType getConstructData(JSCell*, ConstructData&); 60 59 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r156498 r156624 83 83 */ 84 84 85 RegExpConstructor::RegExpConstructor( JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)86 : InternalFunction( globalObject, structure)87 , m_cachedResult( globalObject->vm(), this, regExpPrototype->regExp())85 RegExpConstructor::RegExpConstructor(VM& vm, Structure* structure, RegExpPrototype* regExpPrototype) 86 : InternalFunction(vm, structure) 87 , m_cachedResult(vm, this, regExpPrototype->regExp()) 88 88 , m_multiline(false) 89 89 { -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h
r156498 r156624 37 37 typedef InternalFunction Base; 38 38 39 static RegExpConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)39 static RegExpConstructor* create(VM& vm, Structure* structure, RegExpPrototype* regExpPrototype) 40 40 { 41 VM& vm = exec->vm(); 42 RegExpConstructor* constructor = new (NotNull, allocateCell<RegExpConstructor>(vm.heap)) RegExpConstructor(globalObject, structure, regExpPrototype); 41 RegExpConstructor* constructor = new (NotNull, allocateCell<RegExpConstructor>(vm.heap)) RegExpConstructor(vm, structure, regExpPrototype); 43 42 constructor->finishCreation(vm, regExpPrototype); 44 43 return constructor; … … 77 76 78 77 private: 79 RegExpConstructor( JSGlobalObject*, Structure*, RegExpPrototype*);78 RegExpConstructor(VM&, Structure*, RegExpPrototype*); 80 79 static void destroy(JSCell*); 81 80 static ConstructType getConstructData(JSCell*, ConstructData&); -
trunk/Source/JavaScriptCore/runtime/SetConstructor.h
r156498 r156624 37 37 typedef InternalFunction Base; 38 38 39 static SetConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, SetPrototype* setPrototype)39 static SetConstructor* create(VM& vm, Structure* structure, SetPrototype* setPrototype) 40 40 { 41 VM& vm = exec->vm(); 42 SetConstructor* constructor = new (NotNull, allocateCell<SetConstructor>(vm.heap)) SetConstructor(globalObject, structure); 41 SetConstructor* constructor = new (NotNull, allocateCell<SetConstructor>(vm.heap)) SetConstructor(vm, structure); 43 42 constructor->finishCreation(vm, setPrototype); 44 43 return constructor; … … 53 52 54 53 private: 55 SetConstructor( JSGlobalObject* globalObject, Structure* structure)56 : Base( globalObject, structure)54 SetConstructor(VM& vm, Structure* structure) 55 : Base(vm, structure) 57 56 { 58 57 } -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r156498 r156624 49 49 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(StringConstructor); 50 50 51 StringConstructor::StringConstructor( JSGlobalObject* globalObject, Structure* structure)52 : InternalFunction( globalObject, structure)51 StringConstructor::StringConstructor(VM& vm, Structure* structure) 52 : InternalFunction(vm, structure) 53 53 { 54 54 } -
trunk/Source/JavaScriptCore/runtime/StringConstructor.h
r156498 r156624 32 32 typedef InternalFunction Base; 33 33 34 static StringConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, StringPrototype* stringPrototype)34 static StringConstructor* create(VM& vm, Structure* structure, StringPrototype* stringPrototype) 35 35 { 36 VM& vm = exec->vm(); 37 StringConstructor* constructor = new (NotNull, allocateCell<StringConstructor>(vm.heap)) StringConstructor(globalObject, structure); 36 StringConstructor* constructor = new (NotNull, allocateCell<StringConstructor>(vm.heap)) StringConstructor(vm, structure); 38 37 constructor->finishCreation(vm, stringPrototype); 39 38 return constructor; … … 51 50 52 51 private: 53 StringConstructor( JSGlobalObject*, Structure*);52 StringConstructor(VM&, Structure*); 54 53 void finishCreation(VM&, StringPrototype*); 55 54 static ConstructType getConstructData(JSCell*, ConstructData&); -
trunk/Source/JavaScriptCore/runtime/WeakMapConstructor.h
r156498 r156624 37 37 typedef InternalFunction Base; 38 38 39 static WeakMapConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, WeakMapPrototype* prototype)39 static WeakMapConstructor* create(VM& vm, Structure* structure, WeakMapPrototype* prototype) 40 40 { 41 VM& vm = exec->vm(); 42 WeakMapConstructor* constructor = new (NotNull, allocateCell<WeakMapConstructor>(vm.heap)) WeakMapConstructor(globalObject, structure); 41 WeakMapConstructor* constructor = new (NotNull, allocateCell<WeakMapConstructor>(vm.heap)) WeakMapConstructor(vm, structure); 43 42 constructor->finishCreation(vm, prototype); 44 43 return constructor; … … 53 52 54 53 private: 55 WeakMapConstructor( JSGlobalObject* globalObject, Structure* structure)56 : Base( globalObject, structure)54 WeakMapConstructor(VM& vm, Structure* structure) 55 : Base(vm, structure) 57 56 { 58 57 } -
trunk/Source/WebCore/bridge/runtime_method.cpp
r155739 r156624 44 44 RuntimeMethod::RuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Method* method) 45 45 // Callers will need to pass in the right global object corresponding to this native object "method". 46 : InternalFunction(globalObject , structure)46 : InternalFunction(globalObject->vm(), structure) 47 47 , m_method(method) 48 48 { -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp
r155143 r156624 47 47 48 48 JSNPMethod::JSNPMethod(JSGlobalObject* globalObject, Structure* structure, NPIdentifier npIdentifier) 49 : InternalFunction(globalObject , structure)49 : InternalFunction(globalObject->vm(), structure) 50 50 , m_npIdentifier(npIdentifier) 51 51 {
Note: See TracChangeset
for help on using the changeset viewer.