Changeset 95108 in webkit
- Timestamp:
- Sep 14, 2011 11:55:25 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 81 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackFunction.cpp
r94875 r95108 43 43 const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0 }; 44 44 45 JSCallbackFunction::JSCallbackFunction( ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)45 JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback) 46 46 : InternalFunction(globalObject, globalObject->callbackFunctionStructure()) 47 47 , m_callback(callback) 48 48 { 49 finishCreation(exec->globalData(), name);50 49 } 51 50 -
trunk/Source/JavaScriptCore/API/JSCallbackFunction.h
r94929 r95108 34 34 class JSCallbackFunction : public InternalFunction { 35 35 protected: 36 JSCallbackFunction( ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name);36 JSCallbackFunction(JSGlobalObject*, JSObjectCallAsFunctionCallback); 37 37 void finishCreation(JSGlobalData&, const Identifier& name); 38 38 … … 42 42 static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name) 43 43 { 44 return new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(exec, globalObject, callback, name); 44 JSCallbackFunction* function = new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback); 45 function->finishCreation(exec->globalData(), name); 46 return function; 45 47 } 46 48 -
trunk/Source/JavaScriptCore/ChangeLog
r95107 r95108 1 2011-09-14 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (6/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67692 5 6 Reviewed by Geoffrey Garen. 7 8 Completed the sixth level of the refactoring to add finishCreation() 9 methods to all classes within the JSCell hierarchy with non-trivial 10 constructor bodies. 11 12 This primarily consists of pushing the calls to finishCreation() down 13 into the constructors of the subclasses of the fifth level of the hierarchy 14 as well as pulling the finishCreation() calls out into the class's corresponding 15 create() method if it has one. Doing both simultaneously allows us to 16 maintain the invariant that the finishCreation() method chain is called exactly 17 once during the creation of an object, since calling it any other number of 18 times (0, 2, or more) will cause an assertion failure. 19 20 * API/JSCallbackFunction.cpp: 21 (JSC::JSCallbackFunction::JSCallbackFunction): 22 * API/JSCallbackFunction.h: 23 (JSC::JSCallbackFunction::create): 24 * jsc.cpp: 25 (GlobalObject::create): 26 (GlobalObject::GlobalObject): 27 * runtime/ArrayConstructor.cpp: 28 (JSC::ArrayConstructor::ArrayConstructor): 29 * runtime/ArrayConstructor.h: 30 (JSC::ArrayConstructor::create): 31 * runtime/BooleanConstructor.cpp: 32 (JSC::BooleanConstructor::BooleanConstructor): 33 * runtime/BooleanConstructor.h: 34 (JSC::BooleanConstructor::create): 35 * runtime/BooleanPrototype.cpp: 36 (JSC::BooleanPrototype::BooleanPrototype): 37 * runtime/BooleanPrototype.h: 38 (JSC::BooleanPrototype::create): 39 * runtime/DateConstructor.cpp: 40 (JSC::DateConstructor::DateConstructor): 41 * runtime/DateConstructor.h: 42 (JSC::DateConstructor::create): 43 * runtime/DatePrototype.cpp: 44 (JSC::DatePrototype::DatePrototype): 45 * runtime/DatePrototype.h: 46 (JSC::DatePrototype::create): 47 * runtime/Error.cpp: 48 (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction): 49 (JSC::StrictModeTypeErrorFunction::create): 50 * runtime/ErrorConstructor.cpp: 51 (JSC::ErrorConstructor::ErrorConstructor): 52 * runtime/ErrorConstructor.h: 53 (JSC::ErrorConstructor::create): 54 * runtime/FunctionConstructor.cpp: 55 (JSC::FunctionConstructor::FunctionConstructor): 56 * runtime/FunctionConstructor.h: 57 (JSC::FunctionConstructor::create): 58 * runtime/FunctionPrototype.cpp: 59 (JSC::FunctionPrototype::FunctionPrototype): 60 * runtime/FunctionPrototype.h: 61 (JSC::FunctionPrototype::create): 62 * runtime/NativeErrorConstructor.cpp: 63 (JSC::NativeErrorConstructor::NativeErrorConstructor): 64 * runtime/NativeErrorConstructor.h: 65 (JSC::NativeErrorConstructor::create): 66 * runtime/NativeErrorPrototype.cpp: 67 (JSC::NativeErrorPrototype::NativeErrorPrototype): 68 (JSC::NativeErrorPrototype::finishCreation): 69 * runtime/NativeErrorPrototype.h: 70 (JSC::NativeErrorPrototype::create): 71 * runtime/NumberConstructor.cpp: 72 (JSC::NumberConstructor::NumberConstructor): 73 * runtime/NumberConstructor.h: 74 (JSC::NumberConstructor::create): 75 * runtime/NumberPrototype.cpp: 76 (JSC::NumberPrototype::NumberPrototype): 77 * runtime/NumberPrototype.h: 78 (JSC::NumberPrototype::create): 79 * runtime/ObjectConstructor.cpp: 80 (JSC::ObjectConstructor::ObjectConstructor): 81 * runtime/ObjectConstructor.h: 82 (JSC::ObjectConstructor::create): 83 * runtime/RegExpConstructor.cpp: 84 (JSC::RegExpConstructor::RegExpConstructor): 85 * runtime/RegExpConstructor.h: 86 (JSC::RegExpConstructor::create): 87 * runtime/RegExpPrototype.cpp: 88 (JSC::RegExpPrototype::RegExpPrototype): 89 * runtime/RegExpPrototype.h: 90 (JSC::RegExpPrototype::create): 91 * runtime/StringConstructor.cpp: 92 (JSC::StringConstructor::StringConstructor): 93 * runtime/StringConstructor.h: 94 (JSC::StringConstructor::create): 95 * runtime/StringObjectThatMasqueradesAsUndefined.h: 96 (JSC::StringObjectThatMasqueradesAsUndefined::create): 97 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): 98 * runtime/StringPrototype.cpp: 99 (JSC::StringPrototype::StringPrototype): 100 * runtime/StringPrototype.h: 101 (JSC::StringPrototype::create): 102 1 103 2011-09-13 Eric Seidel <eric@webkit.org> 2 104 -
trunk/Source/JavaScriptCore/jsc.cpp
r94875 r95108 146 146 class GlobalObject : public JSGlobalObject { 147 147 private: 148 GlobalObject(JSGlobalData&, Structure* , const Vector<UString>& arguments);148 GlobalObject(JSGlobalData&, Structure*); 149 149 150 150 public: … … 153 153 static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments) 154 154 { 155 return new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure, arguments); 155 GlobalObject* object = new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure); 156 object->finishCreation(globalData, arguments); 157 return object; 156 158 } 157 159 virtual UString className() const { return "global"; } … … 189 191 ASSERT_CLASS_FITS_IN_CELL(GlobalObject); 190 192 191 GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure , const Vector<UString>& arguments)193 GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure) 192 194 : JSGlobalObject(globalData, structure) 193 195 { 194 finishCreation(globalData, arguments);195 196 } 196 197 -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r94875 r95108 52 52 ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor); 53 53 54 ArrayConstructor::ArrayConstructor( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)54 ArrayConstructor::ArrayConstructor(JSGlobalObject* globalObject, Structure* structure) 55 55 : InternalFunction(globalObject, structure) 56 56 { 57 finishCreation(exec, arrayPrototype);58 57 } 59 58 -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h
r94929 r95108 32 32 typedef InternalFunction Base; 33 33 34 static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arr Prototype)34 static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype) 35 35 { 36 return new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(exec, globalObject, structure, arrPrototype); 36 ArrayConstructor* constructor = new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(globalObject, structure); 37 constructor->finishCreation(exec, arrayPrototype); 38 return constructor; 37 39 } 38 40 … … 49 51 50 52 private: 51 ArrayConstructor( ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*);53 ArrayConstructor(JSGlobalObject*, Structure*); 52 54 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 53 55 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
r94875 r95108 29 29 ASSERT_CLASS_FITS_IN_CELL(BooleanConstructor); 30 30 31 BooleanConstructor::BooleanConstructor( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)31 BooleanConstructor::BooleanConstructor(JSGlobalObject* globalObject, Structure* structure) 32 32 : InternalFunction(globalObject, structure) 33 33 { 34 finishCreation(exec, booleanPrototype);35 34 } 36 35 -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h
r94875 r95108 32 32 typedef InternalFunction Base; 33 33 34 static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* bool Prototype)34 static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype) 35 35 { 36 return new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(exec, globalObject, structure, boolPrototype); 36 BooleanConstructor* constructor = new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure); 37 constructor->finishCreation(exec, booleanPrototype); 38 return constructor; 37 39 } 38 40 … … 41 43 42 44 private: 43 BooleanConstructor( ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);45 BooleanConstructor(JSGlobalObject*, Structure*); 44 46 virtual ConstructType getConstructData(ConstructData&); 45 47 virtual CallType getCallData(CallData&); -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
r94929 r95108 50 50 ASSERT_CLASS_FITS_IN_CELL(BooleanPrototype); 51 51 52 BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject,Structure* structure)52 BooleanPrototype::BooleanPrototype(ExecState* exec, Structure* structure) 53 53 : BooleanObject(exec->globalData(), structure) 54 54 { 55 finishCreation(exec, globalObject);56 55 } 57 56 -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h
r94929 r95108 32 32 static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 33 33 { 34 return new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, globalObject, structure); 34 BooleanPrototype* prototype = new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, structure); 35 prototype->finishCreation(exec, globalObject); 36 return prototype; 35 37 } 36 38 … … 47 49 48 50 private: 49 BooleanPrototype(ExecState*, JSGlobalObject*,Structure*);51 BooleanPrototype(ExecState*, Structure*); 50 52 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 51 53 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r94875 r95108 74 74 ASSERT_CLASS_FITS_IN_CELL(DateConstructor); 75 75 76 DateConstructor::DateConstructor( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)76 DateConstructor::DateConstructor(JSGlobalObject* globalObject, Structure* structure) 77 77 : InternalFunction(globalObject, structure) 78 78 { 79 finishCreation(exec, datePrototype);80 79 } 81 80 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.h
r94929 r95108 34 34 static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype) 35 35 { 36 return new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(exec, globalObject, structure, datePrototype); 36 DateConstructor* constructor = new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure); 37 constructor->finishCreation(exec, datePrototype); 38 return constructor; 37 39 } 38 40 … … 49 51 50 52 private: 51 DateConstructor( ExecState*, JSGlobalObject*, Structure*, DatePrototype*);53 DateConstructor(JSGlobalObject*, Structure*); 52 54 virtual ConstructType getConstructData(ConstructData&); 53 55 virtual CallType getCallData(CallData&); -
trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp
r94929 r95108 431 431 // ECMA 15.9.4 432 432 433 DatePrototype::DatePrototype(ExecState* exec, JSGlobalObject* globalObject,Structure* structure)433 DatePrototype::DatePrototype(ExecState* exec, Structure* structure) 434 434 : DateInstance(exec, structure) 435 435 { 436 finishCreation(exec, globalObject);437 436 } 438 437 -
trunk/Source/JavaScriptCore/runtime/DatePrototype.h
r94929 r95108 30 30 class DatePrototype : public DateInstance { 31 31 private: 32 DatePrototype(ExecState*, JSGlobalObject*,Structure*);32 DatePrototype(ExecState*, Structure*); 33 33 34 34 public: … … 37 37 static DatePrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 38 38 { 39 return new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, globalObject, structure); 39 DatePrototype* prototype = new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, structure); 40 prototype->finishCreation(exec, globalObject); 41 return prototype; 40 42 } 41 43 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/Source/JavaScriptCore/runtime/Error.cpp
r94875 r95108 168 168 class StrictModeTypeErrorFunction : public InternalFunction { 169 169 private: 170 StrictModeTypeErrorFunction( ExecState* exec,JSGlobalObject* globalObject, Structure* structure, const UString& message)170 StrictModeTypeErrorFunction(JSGlobalObject* globalObject, Structure* structure, const UString& message) 171 171 : InternalFunction(globalObject, structure) 172 172 , m_message(message) 173 173 { 174 finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);175 174 } 176 175 … … 180 179 static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message) 181 180 { 182 return new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(exec, globalObject, structure, message); 181 StrictModeTypeErrorFunction* function = new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message); 182 function->finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier); 183 return function; 183 184 } 184 185 -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
r94875 r95108 30 30 ASSERT_CLASS_FITS_IN_CELL(ErrorConstructor); 31 31 32 ErrorConstructor::ErrorConstructor( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)32 ErrorConstructor::ErrorConstructor(JSGlobalObject* globalObject, Structure* structure) 33 33 : InternalFunction(globalObject, structure) 34 34 { 35 finishCreation(exec, errorPrototype);36 35 } 37 36 -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h
r94875 r95108 33 33 typedef InternalFunction Base; 34 34 35 static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* err Prototype)35 static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype) 36 36 { 37 return new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(exec, globalObject, structure, errPrototype); 37 ErrorConstructor* constructor = new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(globalObject, structure); 38 constructor->finishCreation(exec, errorPrototype); 39 return constructor; 38 40 } 39 41 … … 42 44 43 45 private: 44 ErrorConstructor( ExecState*, JSGlobalObject*, Structure*, ErrorPrototype*);46 ErrorConstructor(JSGlobalObject*, Structure*); 45 47 virtual ConstructType getConstructData(ConstructData&); 46 48 virtual CallType getCallData(CallData&); -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r94875 r95108 38 38 ASSERT_CLASS_FITS_IN_CELL(FunctionConstructor); 39 39 40 FunctionConstructor::FunctionConstructor( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)40 FunctionConstructor::FunctionConstructor(JSGlobalObject* globalObject, Structure* structure) 41 41 : InternalFunction(globalObject, structure) 42 42 { 43 finishCreation(exec, functionPrototype);44 43 } 45 44 -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h
r94875 r95108 32 32 typedef InternalFunction Base; 33 33 34 static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* func Prototype)34 static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype) 35 35 { 36 return new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(exec, globalObject, structure, funcPrototype); 36 FunctionConstructor* constructor = new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(globalObject, structure); 37 constructor->finishCreation(exec, functionPrototype); 38 return constructor; 37 39 } 38 40 39 41 private: 40 FunctionConstructor( ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*);42 FunctionConstructor(JSGlobalObject*, Structure*); 41 43 void finishCreation(ExecState*, FunctionPrototype*); 42 44 virtual ConstructType getConstructData(ConstructData&); -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r94875 r95108 38 38 static EncodedJSValue JSC_HOST_CALL functionProtoFuncCall(ExecState*); 39 39 40 FunctionPrototype::FunctionPrototype( ExecState* exec,JSGlobalObject* globalObject, Structure* structure)40 FunctionPrototype::FunctionPrototype(JSGlobalObject* globalObject, Structure* structure) 41 41 : InternalFunction(globalObject, structure) 42 42 { 43 finishCreation(exec, exec->propertyNames().nullIdentifier);44 43 } 45 44 -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h
r94929 r95108 32 32 static FunctionPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 33 33 { 34 return new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(exec, globalObject, structure); 34 FunctionPrototype* prototype = new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(globalObject, structure); 35 prototype->finishCreation(exec, exec->propertyNames().nullIdentifier); 36 return prototype; 35 37 } 36 38 … … 46 48 47 49 private: 48 FunctionPrototype( ExecState*,JSGlobalObject*, Structure*);50 FunctionPrototype(JSGlobalObject*, Structure*); 49 51 virtual CallType getCallData(CallData&); 50 52 }; -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
r94875 r95108 33 33 const ClassInfo NativeErrorConstructor::s_info = { "Function", &InternalFunction::s_info, 0, 0 }; 34 34 35 NativeErrorConstructor::NativeErrorConstructor( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name)35 NativeErrorConstructor::NativeErrorConstructor(JSGlobalObject* globalObject, Structure* structure) 36 36 : InternalFunction(globalObject, structure) 37 37 { 38 finishCreation(exec, globalObject, prototypeStructure, name);39 38 } 40 39 -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h
r94929 r95108 37 37 static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name) 38 38 { 39 return new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(exec, globalObject, structure, prototypeStructure, name); 39 NativeErrorConstructor* constructor = new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(globalObject, structure); 40 constructor->finishCreation(exec, globalObject, prototypeStructure, name); 41 return constructor; 40 42 } 41 43 … … 65 67 66 68 private: 67 NativeErrorConstructor( ExecState*, JSGlobalObject*, Structure*, Structure* prototypeStructure, const UString&);69 NativeErrorConstructor(JSGlobalObject*, Structure*); 68 70 static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags; 69 71 virtual ConstructType getConstructData(ConstructData&); -
trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
r94875 r95108 31 31 ASSERT_CLASS_FITS_IN_CELL(NativeErrorPrototype); 32 32 33 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& nameAndMessage, NativeErrorConstructor* constructor)33 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, Structure* structure) 34 34 : ErrorPrototype(exec, structure) 35 35 { 36 finishCreation(exec, globalObject, nameAndMessage, constructor);37 36 } 38 37 39 inlinevoid NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor)38 void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor) 40 39 { 41 40 Base::finishCreation(exec, globalObject); -
trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.h
r94875 r95108 29 29 class NativeErrorPrototype : public ErrorPrototype { 30 30 private: 31 NativeErrorPrototype(ExecState*, JSGlobalObject*, Structure*, const UString&, NativeErrorConstructor*);31 NativeErrorPrototype(ExecState*, Structure*); 32 32 33 33 public: … … 36 36 static NativeErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& name, NativeErrorConstructor* constructor) 37 37 { 38 return new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, globalObject, structure, name, constructor); 38 NativeErrorPrototype* prototype = new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, structure); 39 prototype->finishCreation(exec, globalObject, name, constructor); 40 return prototype; 39 41 } 40 42 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r94875 r95108 55 55 */ 56 56 57 NumberConstructor::NumberConstructor( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)57 NumberConstructor::NumberConstructor(JSGlobalObject* globalObject, Structure* structure) 58 58 : InternalFunction(globalObject, structure) 59 59 { 60 finishCreation(exec, numberPrototype);61 60 } 62 61 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.h
r94929 r95108 32 32 typedef InternalFunction Base; 33 33 34 static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* num Prototype)34 static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype) 35 35 { 36 return new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(exec, globalObject, structure, numPrototype); 36 NumberConstructor* constructor = new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(globalObject, structure); 37 constructor->finishCreation(exec, numberPrototype); 38 return constructor; 37 39 } 38 40 … … 55 57 56 58 private: 57 NumberConstructor( ExecState*, JSGlobalObject*, Structure*, NumberPrototype*);59 NumberConstructor(JSGlobalObject*, Structure*); 58 60 virtual ConstructType getConstructData(ConstructData&); 59 61 virtual CallType getCallData(CallData&); -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r94929 r95108 71 71 ASSERT_CLASS_FITS_IN_CELL(NumberPrototype); 72 72 73 NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject,Structure* structure)73 NumberPrototype::NumberPrototype(ExecState* exec, Structure* structure) 74 74 : NumberObject(exec->globalData(), structure) 75 75 { 76 finishCreation(exec, globalObject);77 76 } 78 77 -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.h
r94929 r95108 32 32 static NumberPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 33 33 { 34 return new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, globalObject, structure); 34 NumberPrototype* prototype = new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, structure); 35 prototype->finishCreation(exec, globalObject); 36 return prototype; 35 37 } 36 38 … … 47 49 48 50 private: 49 NumberPrototype(ExecState*, JSGlobalObject*,Structure*);51 NumberPrototype(ExecState*, Structure*); 50 52 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 51 53 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r95028 r95108 76 76 */ 77 77 78 ObjectConstructor::ObjectConstructor( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype)78 ObjectConstructor::ObjectConstructor(JSGlobalObject* globalObject, Structure* structure) 79 79 : InternalFunction(globalObject, structure) 80 80 { 81 finishCreation(exec, objectPrototype);82 81 } 83 82 -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h
r94929 r95108 32 32 typedef InternalFunction Base; 33 33 34 static ObjectConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* obj Prototype)34 static ObjectConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype) 35 35 { 36 return new (allocateCell<ObjectConstructor>(*exec->heap())) ObjectConstructor(exec, globalObject, structure, objPrototype); 36 ObjectConstructor* constructor = new (allocateCell<ObjectConstructor>(*exec->heap())) ObjectConstructor(globalObject, structure); 37 constructor->finishCreation(exec, objectPrototype); 38 return constructor; 37 39 } 38 40 … … 52 54 53 55 private: 54 ObjectConstructor( ExecState*, JSGlobalObject*, Structure*, ObjectPrototype*);56 ObjectConstructor(JSGlobalObject*, Structure*); 55 57 virtual ConstructType getConstructData(ConstructData&); 56 58 virtual CallType getCallData(CallData&); -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r94875 r95108 96 96 */ 97 97 98 RegExpConstructor::RegExpConstructor( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)98 RegExpConstructor::RegExpConstructor(JSGlobalObject* globalObject, Structure* structure) 99 99 : InternalFunction(globalObject, structure) 100 100 , d(adoptPtr(new RegExpConstructorPrivate)) 101 101 { 102 finishCreation(exec, regExpPrototype);103 102 } 104 103 -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h
r94929 r95108 62 62 static RegExpConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype) 63 63 { 64 return new (allocateCell<RegExpConstructor>(*exec->heap())) RegExpConstructor(exec, globalObject, structure, regExpPrototype); 64 RegExpConstructor* constructor = new (allocateCell<RegExpConstructor>(*exec->heap())) RegExpConstructor(globalObject, structure); 65 constructor->finishCreation(exec, regExpPrototype); 66 return constructor; 65 67 } 66 68 … … 95 97 96 98 private: 97 RegExpConstructor( ExecState*, JSGlobalObject*, Structure*, RegExpPrototype*);99 RegExpConstructor(JSGlobalObject*, Structure*); 98 100 virtual ConstructType getConstructData(ConstructData&); 99 101 virtual CallType getCallData(CallData&); -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r94875 r95108 63 63 ASSERT_CLASS_FITS_IN_CELL(RegExpPrototype); 64 64 65 RegExpPrototype::RegExpPrototype( ExecState*,JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)65 RegExpPrototype::RegExpPrototype(JSGlobalObject* globalObject, Structure* structure, RegExp* regExp) 66 66 : RegExpObject(globalObject, structure, regExp) 67 67 { 68 finishCreation(globalObject);69 68 } 70 69 -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h
r94929 r95108 33 33 static RegExpPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp) 34 34 { 35 return new (allocateCell<RegExpPrototype>(*exec->heap())) RegExpPrototype(exec, globalObject, structure, regExp); 35 RegExpPrototype* prototype = new (allocateCell<RegExpPrototype>(*exec->heap())) RegExpPrototype(globalObject, structure, regExp); 36 prototype->finishCreation(globalObject); 37 return prototype; 36 38 } 37 39 … … 44 46 45 47 protected: 46 RegExpPrototype( ExecState*,JSGlobalObject*, Structure*, RegExp*);48 RegExpPrototype(JSGlobalObject*, Structure*, RegExp*); 47 49 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | RegExpObject::StructureFlags; 48 50 -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r94875 r95108 48 48 ASSERT_CLASS_FITS_IN_CELL(StringConstructor); 49 49 50 StringConstructor::StringConstructor( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, StringPrototype* stringPrototype)50 StringConstructor::StringConstructor(JSGlobalObject* globalObject, Structure* structure) 51 51 : InternalFunction(globalObject, structure) 52 52 { 53 finishCreation(exec, stringPrototype);54 53 } 55 54 -
trunk/Source/JavaScriptCore/runtime/StringConstructor.h
r94929 r95108 32 32 typedef InternalFunction Base; 33 33 34 static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* str Prototype)34 static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* stringPrototype) 35 35 { 36 return new (allocateCell<StringConstructor>(*exec->heap())) StringConstructor(exec, globalObject, structure, strPrototype); 36 StringConstructor* constructor = new (allocateCell<StringConstructor>(*exec->heap())) StringConstructor(globalObject, structure); 37 constructor->finishCreation(exec, stringPrototype); 38 return constructor; 37 39 } 38 40 … … 48 50 49 51 private: 50 StringConstructor( ExecState*, JSGlobalObject*, Structure*, StringPrototype*);52 StringConstructor(JSGlobalObject*, Structure*); 51 53 void finishCreation(ExecState*, StringPrototype*); 52 54 virtual ConstructType getConstructData(ConstructData&); -
trunk/Source/JavaScriptCore/runtime/StringObjectThatMasqueradesAsUndefined.h
r94929 r95108 37 37 JSString* newString = jsString(exec, string); 38 38 Structure* structure = createStructure(exec->globalData(), exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->stringPrototype()); 39 return new (allocateCell<StringObjectThatMasqueradesAsUndefined>(*exec->heap())) StringObjectThatMasqueradesAsUndefined(exec, structure, newString); 39 StringObjectThatMasqueradesAsUndefined* object = new (allocateCell<StringObjectThatMasqueradesAsUndefined>(*exec->heap())) StringObjectThatMasqueradesAsUndefined(exec, structure); 40 object->finishCreation(exec->globalData(), newString); 41 return object; 40 42 } 41 43 42 44 private: 43 StringObjectThatMasqueradesAsUndefined(ExecState* exec, Structure* structure , JSString* string)45 StringObjectThatMasqueradesAsUndefined(ExecState* exec, Structure* structure) 44 46 : StringObject(exec->globalData(), structure) 45 47 { 46 finishCreation(exec->globalData(), string);47 48 } 48 49 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r94929 r95108 132 132 133 133 // ECMA 15.5.4 134 StringPrototype::StringPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSString* nameAndMessage)134 StringPrototype::StringPrototype(ExecState* exec, Structure* structure) 135 135 : StringObject(exec->globalData(), structure) 136 136 { 137 finishCreation(exec, globalObject, nameAndMessage);138 137 } 139 138 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.h
r94929 r95108 30 30 class StringPrototype : public StringObject { 31 31 private: 32 StringPrototype(ExecState*, JSGlobalObject*, Structure*, JSString*);32 StringPrototype(ExecState*, Structure*); 33 33 34 34 public: … … 37 37 static StringPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 38 38 { 39 return new (allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, globalObject, structure, jsEmptyString(exec)); 39 JSString* empty = jsEmptyString(exec); 40 StringPrototype* prototype = new (allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, structure); 41 prototype->finishCreation(exec, globalObject, empty); 42 return prototype; 40 43 } 41 44 -
trunk/Source/JavaScriptGlue/ChangeLog
r95049 r95108 1 2011-09-14 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (6/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67692 5 6 Reviewed by Geoffrey Garen. 7 8 Completed the sixth level of the refactoring to add finishCreation() 9 methods to all classes within the JSCell hierarchy with non-trivial 10 constructor bodies. 11 12 This primarily consists of pushing the calls to finishCreation() down 13 into the constructors of the subclasses of the fifth level of the hierarchy 14 as well as pulling the finishCreation() calls out into the class's corresponding 15 create() method if it has one. Doing both simultaneously allows us to 16 maintain the invariant that the finishCreation() method chain is called exactly 17 once during the creation of an object, since calling it any other number of 18 times (0, 2, or more) will cause an assertion failure. 19 20 * JSRun.cpp: 21 (JSGlueGlobalObject::JSGlueGlobalObject): 22 * JSRun.h: 23 (JSGlueGlobalObject::create): 24 1 25 2011-09-13 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/Source/JavaScriptGlue/JSRun.cpp
r94875 r95108 39 39 , m_userObjectStructure(globalData, userObjectStructure) 40 40 { 41 finishCreation(globalData, this);42 41 } 43 42 -
trunk/Source/JavaScriptGlue/JSRun.h
r94811 r95108 42 42 { 43 43 Structure* userObjectStructure = UserObjectImp::createStructure(globalData, 0, jsNull()); 44 return new (allocateCell<JSGlueGlobalObject>(globalData.heap)) JSGlueGlobalObject(globalData, structure, userObjectStructure, flags); 44 JSGlueGlobalObject* object = new (allocateCell<JSGlueGlobalObject>(globalData.heap)) JSGlueGlobalObject(globalData, structure, userObjectStructure, flags); 45 object->finishCreation(globalData, object); 46 return object; 45 47 } 46 48 -
trunk/Source/WebCore/ChangeLog
r95107 r95108 1 2011-09-14 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (6/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67692 5 6 Reviewed by Geoffrey Garen. 7 8 No new tests. 9 10 Completed the sixth level of the refactoring to add finishCreation() 11 methods to all classes within the JSCell hierarchy with non-trivial 12 constructor bodies. 13 14 This primarily consists of pushing the calls to finishCreation() down 15 into the constructors of the subclasses of the fifth level of the hierarchy 16 as well as pulling the finishCreation() calls out into the class's corresponding 17 create() method if it has one. Doing both simultaneously allows us to 18 maintain the invariant that the finishCreation() method chain is called exactly 19 once during the creation of an object, since calling it any other number of 20 times (0, 2, or more) will cause an assertion failure. 21 22 * WebCore.exp.in: 23 * bindings/js/JSDOMBinding.h: 24 (WebCore::DOMConstructorObject::DOMConstructorObject): 25 (WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument): 26 (WebCore::DOMConstructorWithDocument::finishCreation): 27 * bindings/js/JSDOMGlobalObject.cpp: 28 (WebCore::JSDOMGlobalObject::JSDOMGlobalObject): 29 * bindings/js/JSDOMGlobalObject.h: 30 * bindings/js/JSDOMWindowBase.cpp: 31 (WebCore::JSDOMWindowBase::JSDOMWindowBase): 32 (WebCore::JSDOMWindowBase::finishCreation): 33 * bindings/js/JSDOMWindowBase.h: 34 * bindings/js/JSWorkerContextBase.cpp: 35 (WebCore::JSWorkerContextBase::JSWorkerContextBase): 36 (WebCore::JSWorkerContextBase::finishCreation): 37 * bindings/js/JSWorkerContextBase.h: 38 * bindings/scripts/CodeGeneratorJS.pm: 39 40 Added a finishCreation declaration and Moved the finishCreation call into the 41 create method for all classes except for subclasses of JSWorkerContextBase and 42 JSDOMWindowBase because those classes are on the next level, and it's easier 43 to do all of these classes in one fell swoop rather than level by level. 44 (GenerateHeader): 45 Added the implementation of the finishCreation method for the classes described above. 46 (GenerateImplementation): 47 Also added the finishCreation calls to the autogenerated DOM constructor classes. 48 (GenerateConstructorDeclaration): 49 (GenerateConstructorDefinition): 50 51 * bindings/scripts/test/JS/JSTestInterface.cpp: 52 (WebCore::JSTestInterfaceConstructor::create): 53 (WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor): 54 (WebCore::JSTestInterfaceConstructor::finishCreation): 55 (WebCore::JSTestInterface::JSTestInterface): 56 (WebCore::JSTestInterface::finishCreation): 57 * bindings/scripts/test/JS/JSTestInterface.h: 58 (WebCore::JSTestInterface::create): 59 (WebCore::JSTestInterfacePrototype::create): 60 (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype): 61 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: 62 (WebCore::JSTestMediaQueryListListenerConstructor::create): 63 (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor): 64 (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation): 65 (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener): 66 (WebCore::JSTestMediaQueryListListener::finishCreation): 67 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: 68 (WebCore::JSTestMediaQueryListListener::create): 69 (WebCore::JSTestMediaQueryListListenerPrototype::create): 70 (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype): 71 * bindings/scripts/test/JS/JSTestObj.cpp: 72 (WebCore::JSTestObjConstructor::create): 73 (WebCore::JSTestObjConstructor::JSTestObjConstructor): 74 (WebCore::JSTestObjConstructor::finishCreation): 75 (WebCore::JSTestObj::JSTestObj): 76 (WebCore::JSTestObj::finishCreation): 77 * bindings/scripts/test/JS/JSTestObj.h: 78 (WebCore::JSTestObj::create): 79 (WebCore::JSTestObjPrototype::create): 80 (WebCore::JSTestObjPrototype::JSTestObjPrototype): 81 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 82 (WebCore::JSTestSerializedScriptValueInterfaceConstructor::create): 83 (WebCore::JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor): 84 (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation): 85 (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface): 86 (WebCore::JSTestSerializedScriptValueInterface::finishCreation): 87 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: 88 (WebCore::JSTestSerializedScriptValueInterface::create): 89 (WebCore::JSTestSerializedScriptValueInterfacePrototype::create): 90 (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype): 91 * bridge/c/CRuntimeObject.cpp: 92 (JSC::Bindings::CRuntimeObject::CRuntimeObject): 93 * bridge/c/CRuntimeObject.h: 94 (JSC::Bindings::CRuntimeObject::create): 95 * bridge/c/c_instance.cpp: 96 (JSC::Bindings::CRuntimeMethod::CRuntimeMethod): 97 (JSC::Bindings::CRuntimeMethod::finishCreation): 98 * bridge/jni/jsc/JavaInstanceJSC.cpp: 99 (JavaRuntimeMethod::JavaRuntimeMethod): 100 (JavaRuntimeMethod::finishCreation): 101 * bridge/jni/jsc/JavaRuntimeObject.cpp: 102 (JSC::Bindings::JavaRuntimeObject::JavaRuntimeObject): 103 * bridge/jni/jsc/JavaRuntimeObject.h: 104 (JSC::Bindings::JavaRuntimeObject::create): 105 * bridge/objc/ObjCRuntimeObject.h: 106 (JSC::Bindings::ObjCRuntimeObject::create): 107 * bridge/objc/ObjCRuntimeObject.mm: 108 (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject): 109 * bridge/objc/objc_instance.mm: 110 (ObjCRuntimeMethod::ObjCRuntimeMethod): 111 (ObjCRuntimeMethod::finishCreation): 112 * bridge/qt/qt_instance.cpp: 113 (JSC::Bindings::QtRuntimeObject::create): 114 (JSC::Bindings::QtRuntimeObject::QtRuntimeObject): 115 * bridge/qt/qt_pixmapruntime.cpp: 116 (JSC::Bindings::QtPixmapRuntimeObject::create): 117 (JSC::Bindings::QtPixmapRuntimeObject::QtPixmapRuntimeObject): 118 * bridge/qt/qt_runtime.cpp: 119 (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod): 120 (JSC::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod): 121 (JSC::Bindings::QtRuntimeMetaMethod::finishCreation): 122 (JSC::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod): 123 (JSC::Bindings::QtRuntimeConnectionMethod::finishCreation): 124 * bridge/qt/qt_runtime.h: 125 (JSC::Bindings::QtRuntimeMetaMethod::create): 126 * bridge/runtime_method.cpp: 127 (JSC::RuntimeMethod::RuntimeMethod): 128 * bridge/runtime_method.h: 129 (JSC::RuntimeMethod::create): 130 1 131 2011-09-13 Eric Seidel <eric@webkit.org> 2 132 -
trunk/Source/WebCore/WebCore.exp.in
r95040 r95108 1644 1644 #if USE(PLUGIN_HOST_PROCESS) 1645 1645 __ZN3JSC13RuntimeMethod11getCallDataERNS_8CallDataE 1646 __ZN3JSC13RuntimeMethod14finishCreationERNS_12JSGlobalDataERKNS_10IdentifierE 1646 1647 __ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 1647 1648 __ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 1648 1649 __ZN3JSC13RuntimeMethod6s_infoE 1649 __ZN3JSC13RuntimeMethodC2EPNS_ 9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureERKNS_10IdentifierERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE1650 __ZN3JSC13RuntimeMethodC2EPNS_14JSGlobalObjectEPNS_9StructureERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE 1650 1651 __ZN3JSC8Bindings10RootObjectD1Ev 1651 1652 __ZN3JSC8Bindings13RuntimeObject11getCallDataERNS_8CallDataE -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r94929 r95108 45 45 // Base class for all constructor objects in the JSC bindings. 46 46 class DOMConstructorObject : public JSDOMWrapper { 47 typedef JSDOMWrapper Base; 47 48 public: 48 49 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) … … 56 57 : JSDOMWrapper(structure, globalObject) 57 58 { 58 finishCreation(globalObject->globalData());59 59 } 60 60 }; … … 63 63 // can never be used from a WorkerContext. 64 64 class DOMConstructorWithDocument : public DOMConstructorObject { 65 typedef DOMConstructorObject Base; 65 66 public: 66 67 Document* document() const … … 73 74 : DOMConstructorObject(structure, globalObject) 74 75 { 76 finishCreation(globalObject); 77 } 78 79 void finishCreation(JSDOMGlobalObject* globalObject) 80 { 81 Base::finishCreation(globalObject->globalData()); 75 82 ASSERT(globalObject->scriptExecutionContext()->isDocument()); 76 83 } -
trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
r94875 r95108 43 43 const ClassInfo JSDOMGlobalObject::s_info = { "DOMGlobalObject", &JSGlobalObject::s_info, 0, 0 }; 44 44 45 JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWrapperWorld> world , JSObject* thisValue)45 JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWrapperWorld> world) 46 46 : JSGlobalObject(globalData, structure) 47 47 , m_currentEvent(0) 48 48 , m_world(world) 49 49 { 50 finishCreation(globalData, thisValue);51 50 } 52 51 -
trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.h
r94929 r95108 47 47 struct JSDOMGlobalObjectData; 48 48 49 JSDOMGlobalObject(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWrapperWorld> , JSC::JSObject* thisValue);49 JSDOMGlobalObject(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWrapperWorld>); 50 50 void finishCreation(JSC::JSGlobalData&, JSC::JSObject* thisValue); 51 51 -
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
r93913 r95108 45 45 46 46 JSDOMWindowBase::JSDOMWindowBase(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWindow> window, JSDOMWindowShell* shell) 47 : JSDOMGlobalObject(globalData, structure, shell->world() , shell)47 : JSDOMGlobalObject(globalData, structure, shell->world()) 48 48 , m_impl(window) 49 49 , m_shell(shell) 50 50 { 51 finishCreation(globalData, shell); 52 } 53 54 void JSDOMWindowBase::finishCreation(JSGlobalData& globalData, JSDOMWindowShell* shell) 55 { 56 Base::finishCreation(globalData, shell); 51 57 ASSERT(inherits(&s_info)); 52 58 -
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h
r94929 r95108 39 39 protected: 40 40 JSDOMWindowBase(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWindow>, JSDOMWindowShell*); 41 void finishCreation(JSC::JSGlobalData&, JSDOMWindowShell*); 41 42 42 43 public: -
trunk/Source/WebCore/bindings/js/JSWorkerContextBase.cpp
r93086 r95108 50 50 51 51 JSWorkerContextBase::JSWorkerContextBase(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<WorkerContext> impl) 52 : JSDOMGlobalObject(globalData, structure, normalWorld(globalData) , this)52 : JSDOMGlobalObject(globalData, structure, normalWorld(globalData)) 53 53 , m_impl(impl) 54 54 { 55 finishCreation(globalData, this); 56 } 57 58 void JSWorkerContextBase::finishCreation(JSGlobalData& globalData, JSWorkerContextBase* thisValue) 59 { 60 Base::finishCreation(globalData, thisValue); 55 61 ASSERT(inherits(&s_info)); 56 62 } -
trunk/Source/WebCore/bindings/js/JSWorkerContextBase.h
r94929 r95108 42 42 typedef JSDOMGlobalObject Base; 43 43 public: 44 JSWorkerContextBase(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<WorkerContext>);45 44 virtual ~JSWorkerContextBase(); 46 45 … … 54 53 return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); 55 54 } 55 56 protected: 57 JSWorkerContextBase(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<WorkerContext>); 58 void finishCreation(JSC::JSGlobalData&, JSWorkerContextBase*); 56 59 57 60 private: -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r94929 r95108 731 731 push(@headerContent, " static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* windowShell)\n"); 732 732 push(@headerContent, " {\n"); 733 push(@headerContent, " return new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n"); 733 push(@headerContent, " $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n"); 734 push(@headerContent, " return ptr;\n"); 734 735 push(@headerContent, " }\n\n"); 735 736 } elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) { 736 737 push(@headerContent, " static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl)\n"); 737 738 push(@headerContent, " {\n"); 738 push(@headerContent, " return new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n"); 739 push(@headerContent, " $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n"); 740 push(@headerContent, " return ptr;\n"); 739 741 push(@headerContent, " }\n\n"); 740 742 } else { … … 742 744 push(@headerContent, " static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n"); 743 745 push(@headerContent, " {\n"); 744 push(@headerContent, " return new (JSC::allocateCell<$className>(globalObject->globalData().heap)) $className(structure, globalObject, impl);\n"); 746 push(@headerContent, " $className* ptr = new (JSC::allocateCell<$className>(globalObject->globalData().heap)) $className(structure, globalObject, impl);\n"); 747 push(@headerContent, " ptr->finishCreation(globalObject->globalData());\n"); 748 push(@headerContent, " return ptr;\n"); 745 749 push(@headerContent, " }\n\n"); 746 750 } … … 928 932 } else { 929 933 push(@headerContent, " $className(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<$implType>);\n"); 934 push(@headerContent, " void finishCreation(JSC::JSGlobalData&);\n"); 930 935 } 931 936 … … 1021 1026 push(@headerContent, " static ${className}Prototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)\n"); 1022 1027 push(@headerContent, " {\n"); 1023 push(@headerContent, " return new (JSC::allocateCell<${className}Prototype>(globalData.heap)) ${className}Prototype(globalData, globalObject, structure);\n"); 1028 push(@headerContent, " ${className}Prototype* ptr = new (JSC::allocateCell<${className}Prototype>(globalData.heap)) ${className}Prototype(globalData, globalObject, structure);\n"); 1029 push(@headerContent, " ptr->finishCreation(globalData);\n"); 1030 push(@headerContent, " return ptr;\n"); 1024 1031 push(@headerContent, " }\n\n"); 1025 1032 … … 1049 1056 1050 1057 push(@headerContent, "\nprivate:\n"); 1051 push(@headerContent, " ${className}Prototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData);}\n");1058 push(@headerContent, " ${className}Prototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }\n"); 1052 1059 1053 1060 # structure flags … … 1507 1514 push(@implContent, " : $parentClassName(globalData, structure, impl, shell)\n"); 1508 1515 push(@implContent, "{\n"); 1516 push(@implContent, "}\n\n"); 1509 1517 } elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) { 1510 1518 AddIncludesForTypeInImpl($interfaceName); … … 1512 1520 push(@implContent, " : $parentClassName(globalData, structure, impl)\n"); 1513 1521 push(@implContent, "{\n"); 1522 push(@implContent, "}\n\n"); 1514 1523 } else { 1515 1524 push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n"); 1516 1525 if ($hasParent) { 1517 1526 push(@implContent, " : $parentClassName(structure, globalObject, impl)\n"); 1518 push(@implContent, "{\n");1519 1527 } else { 1520 1528 push(@implContent, " : $parentClassName(structure, globalObject)\n"); 1521 1529 push(@implContent, " , m_impl(impl)\n"); 1522 push(@implContent, "{\n"); 1523 push(@implContent, " finishCreation(globalObject->globalData());\n"); 1524 } 1525 } 1526 push(@implContent, " ASSERT(inherits(&s_info));\n"); 1527 push(@implContent, "}\n\n"); 1530 } 1531 push(@implContent, "{\n"); 1532 push(@implContent, "}\n\n"); 1533 1534 push(@implContent, "void ${className}::finishCreation(JSGlobalData& globalData)\n"); 1535 push(@implContent, "{\n"); 1536 push(@implContent, " Base::finishCreation(globalData);\n"); 1537 push(@implContent, " ASSERT(inherits(&s_info));\n"); 1538 push(@implContent, "}\n\n"); 1539 } 1528 1540 1529 1541 if (!$dataNode->extendedAttributes->{"ExtendsDOMGlobalObject"}) { … … 3107 3119 push(@$outputArray, "class ${constructorClassName} : public DOMConstructorObject {\n"); 3108 3120 push(@$outputArray, "private:\n"); 3109 push(@$outputArray, " ${constructorClassName}(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);\n\n"); 3110 3121 push(@$outputArray, " ${constructorClassName}(JSC::Structure*, JSDOMGlobalObject*);\n"); 3122 push(@$outputArray, " void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);\n\n"); 3123 3111 3124 push(@$outputArray, "public:\n"); 3112 3125 push(@$outputArray, " typedef DOMConstructorObject Base;\n"); 3113 3126 push(@$outputArray, " static $constructorClassName* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)\n"); 3114 3127 push(@$outputArray, " {\n"); 3115 push(@$outputArray, " return new (JSC::allocateCell<$constructorClassName>(*exec->heap())) $constructorClassName(exec, structure, globalObject);\n"); 3128 push(@$outputArray, " $constructorClassName* ptr = new (JSC::allocateCell<$constructorClassName>(*exec->heap())) $constructorClassName(structure, globalObject);\n"); 3129 push(@$outputArray, " ptr->finishCreation(exec, globalObject);\n"); 3130 push(@$outputArray, " return ptr;\n"); 3116 3131 push(@$outputArray, " }\n\n"); 3117 3132 … … 3153 3168 push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleClassName}Constructor\", &DOMConstructorObject::s_info, &${constructorClassName}Table, 0 };\n\n"); 3154 3169 3155 push(@$outputArray, "${constructorClassName}::${constructorClassName}( ExecState* exec,Structure* structure, JSDOMGlobalObject* globalObject)\n");3170 push(@$outputArray, "${constructorClassName}::${constructorClassName}(Structure* structure, JSDOMGlobalObject* globalObject)\n"); 3156 3171 push(@$outputArray, " : DOMConstructorObject(structure, globalObject)\n"); 3157 3172 push(@$outputArray, "{\n"); 3173 push(@$outputArray, "}\n\n"); 3174 3175 push(@$outputArray, "void ${constructorClassName}::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)\n"); 3176 push(@$outputArray, "{\n"); 3177 push(@$outputArray, " Base::finishCreation(exec->globalData());\n"); 3158 3178 push(@$outputArray, " ASSERT(inherits(&s_info));\n"); 3159 3179 if ($interfaceName eq "DOMWindow") { -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r94929 r95108 65 65 class JSTestInterfaceConstructor : public DOMConstructorObject { 66 66 private: 67 JSTestInterfaceConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); 67 JSTestInterfaceConstructor(JSC::Structure*, JSDOMGlobalObject*); 68 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); 68 69 69 70 public: … … 71 72 static JSTestInterfaceConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) 72 73 { 73 return new (JSC::allocateCell<JSTestInterfaceConstructor>(*exec->heap())) JSTestInterfaceConstructor(exec, structure, globalObject); 74 JSTestInterfaceConstructor* ptr = new (JSC::allocateCell<JSTestInterfaceConstructor>(*exec->heap())) JSTestInterfaceConstructor(structure, globalObject); 75 ptr->finishCreation(exec, globalObject); 76 return ptr; 74 77 } 75 78 … … 89 92 const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0 }; 90 93 91 JSTestInterfaceConstructor::JSTestInterfaceConstructor( ExecState* exec,Structure* structure, JSDOMGlobalObject* globalObject)94 JSTestInterfaceConstructor::JSTestInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject) 92 95 : DOMConstructorObject(structure, globalObject) 93 96 { 97 } 98 99 void JSTestInterfaceConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) 100 { 101 Base::finishCreation(exec->globalData()); 94 102 ASSERT(inherits(&s_info)); 95 103 putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly); … … 147 155 , m_impl(impl) 148 156 { 149 finishCreation(globalObject->globalData()); 157 } 158 159 void JSTestInterface::finishCreation(JSGlobalData& globalData) 160 { 161 Base::finishCreation(globalData); 150 162 ASSERT(inherits(&s_info)); 151 163 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
r94929 r95108 37 37 static JSTestInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl) 38 38 { 39 return new (JSC::allocateCell<JSTestInterface>(globalObject->globalData().heap)) JSTestInterface(structure, globalObject, impl); 39 JSTestInterface* ptr = new (JSC::allocateCell<JSTestInterface>(globalObject->globalData().heap)) JSTestInterface(structure, globalObject, impl); 40 ptr->finishCreation(globalObject->globalData()); 41 return ptr; 40 42 } 41 43 … … 57 59 protected: 58 60 JSTestInterface(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestInterface>); 61 void finishCreation(JSC::JSGlobalData&); 59 62 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; 60 63 }; … … 69 72 static JSTestInterfacePrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) 70 73 { 71 return new (JSC::allocateCell<JSTestInterfacePrototype>(globalData.heap)) JSTestInterfacePrototype(globalData, globalObject, structure); 74 JSTestInterfacePrototype* ptr = new (JSC::allocateCell<JSTestInterfacePrototype>(globalData.heap)) JSTestInterfacePrototype(globalData, globalObject, structure); 75 ptr->finishCreation(globalData); 76 return ptr; 72 77 } 73 78 … … 79 84 80 85 private: 81 JSTestInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData);}86 JSTestInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { } 82 87 protected: 83 88 static const unsigned StructureFlags = Base::StructureFlags; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
r94929 r95108 66 66 class JSTestMediaQueryListListenerConstructor : public DOMConstructorObject { 67 67 private: 68 JSTestMediaQueryListListenerConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); 68 JSTestMediaQueryListListenerConstructor(JSC::Structure*, JSDOMGlobalObject*); 69 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); 69 70 70 71 public: … … 72 73 static JSTestMediaQueryListListenerConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) 73 74 { 74 return new (JSC::allocateCell<JSTestMediaQueryListListenerConstructor>(*exec->heap())) JSTestMediaQueryListListenerConstructor(exec, structure, globalObject); 75 JSTestMediaQueryListListenerConstructor* ptr = new (JSC::allocateCell<JSTestMediaQueryListListenerConstructor>(*exec->heap())) JSTestMediaQueryListListenerConstructor(structure, globalObject); 76 ptr->finishCreation(exec, globalObject); 77 return ptr; 75 78 } 76 79 … … 88 91 const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0 }; 89 92 90 JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor( ExecState* exec,Structure* structure, JSDOMGlobalObject* globalObject)93 JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(Structure* structure, JSDOMGlobalObject* globalObject) 91 94 : DOMConstructorObject(structure, globalObject) 92 95 { 96 } 97 98 void JSTestMediaQueryListListenerConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) 99 { 100 Base::finishCreation(exec->globalData()); 93 101 ASSERT(inherits(&s_info)); 94 102 putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestMediaQueryListListenerPrototype::self(exec, globalObject), DontDelete | ReadOnly); … … 143 151 , m_impl(impl) 144 152 { 145 finishCreation(globalObject->globalData()); 153 } 154 155 void JSTestMediaQueryListListener::finishCreation(JSGlobalData& globalData) 156 { 157 Base::finishCreation(globalData); 146 158 ASSERT(inherits(&s_info)); 147 159 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
r94929 r95108 35 35 static JSTestMediaQueryListListener* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl) 36 36 { 37 return new (JSC::allocateCell<JSTestMediaQueryListListener>(globalObject->globalData().heap)) JSTestMediaQueryListListener(structure, globalObject, impl); 37 JSTestMediaQueryListListener* ptr = new (JSC::allocateCell<JSTestMediaQueryListListener>(globalObject->globalData().heap)) JSTestMediaQueryListListener(structure, globalObject, impl); 38 ptr->finishCreation(globalObject->globalData()); 39 return ptr; 38 40 } 39 41 … … 55 57 protected: 56 58 JSTestMediaQueryListListener(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestMediaQueryListListener>); 59 void finishCreation(JSC::JSGlobalData&); 57 60 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; 58 61 }; … … 67 70 static JSTestMediaQueryListListenerPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) 68 71 { 69 return new (JSC::allocateCell<JSTestMediaQueryListListenerPrototype>(globalData.heap)) JSTestMediaQueryListListenerPrototype(globalData, globalObject, structure); 72 JSTestMediaQueryListListenerPrototype* ptr = new (JSC::allocateCell<JSTestMediaQueryListListenerPrototype>(globalData.heap)) JSTestMediaQueryListListenerPrototype(globalData, globalObject, structure); 73 ptr->finishCreation(globalData); 74 return ptr; 70 75 } 71 76 … … 79 84 80 85 private: 81 JSTestMediaQueryListListenerPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData);}86 JSTestMediaQueryListListenerPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { } 82 87 protected: 83 88 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r94929 r95108 168 168 class JSTestObjConstructor : public DOMConstructorObject { 169 169 private: 170 JSTestObjConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); 170 JSTestObjConstructor(JSC::Structure*, JSDOMGlobalObject*); 171 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); 171 172 172 173 public: … … 174 175 static JSTestObjConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) 175 176 { 176 return new (JSC::allocateCell<JSTestObjConstructor>(*exec->heap())) JSTestObjConstructor(exec, structure, globalObject); 177 JSTestObjConstructor* ptr = new (JSC::allocateCell<JSTestObjConstructor>(*exec->heap())) JSTestObjConstructor(structure, globalObject); 178 ptr->finishCreation(exec, globalObject); 179 return ptr; 177 180 } 178 181 … … 190 193 const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0 }; 191 194 192 JSTestObjConstructor::JSTestObjConstructor( ExecState* exec,Structure* structure, JSDOMGlobalObject* globalObject)195 JSTestObjConstructor::JSTestObjConstructor(Structure* structure, JSDOMGlobalObject* globalObject) 193 196 : DOMConstructorObject(structure, globalObject) 194 197 { 198 } 199 200 void JSTestObjConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) 201 { 202 Base::finishCreation(exec->globalData()); 195 203 ASSERT(inherits(&s_info)); 196 204 putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly); … … 300 308 , m_impl(impl) 301 309 { 302 finishCreation(globalObject->globalData()); 310 } 311 312 void JSTestObj::finishCreation(JSGlobalData& globalData) 313 { 314 Base::finishCreation(globalData); 303 315 ASSERT(inherits(&s_info)); 304 316 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
r94929 r95108 35 35 static JSTestObj* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl) 36 36 { 37 return new (JSC::allocateCell<JSTestObj>(globalObject->globalData().heap)) JSTestObj(structure, globalObject, impl); 37 JSTestObj* ptr = new (JSC::allocateCell<JSTestObj>(globalObject->globalData().heap)) JSTestObj(structure, globalObject, impl); 38 ptr->finishCreation(globalObject->globalData()); 39 return ptr; 38 40 } 39 41 … … 68 70 protected: 69 71 JSTestObj(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestObj>); 72 void finishCreation(JSC::JSGlobalData&); 70 73 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags; 71 74 }; … … 80 83 static JSTestObjPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) 81 84 { 82 return new (JSC::allocateCell<JSTestObjPrototype>(globalData.heap)) JSTestObjPrototype(globalData, globalObject, structure); 85 JSTestObjPrototype* ptr = new (JSC::allocateCell<JSTestObjPrototype>(globalData.heap)) JSTestObjPrototype(globalData, globalObject, structure); 86 ptr->finishCreation(globalData); 87 return ptr; 83 88 } 84 89 … … 92 97 93 98 private: 94 JSTestObjPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData);}99 JSTestObjPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { } 95 100 protected: 96 101 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r94929 r95108 67 67 class JSTestSerializedScriptValueInterfaceConstructor : public DOMConstructorObject { 68 68 private: 69 JSTestSerializedScriptValueInterfaceConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); 69 JSTestSerializedScriptValueInterfaceConstructor(JSC::Structure*, JSDOMGlobalObject*); 70 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); 70 71 71 72 public: … … 73 74 static JSTestSerializedScriptValueInterfaceConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) 74 75 { 75 return new (JSC::allocateCell<JSTestSerializedScriptValueInterfaceConstructor>(*exec->heap())) JSTestSerializedScriptValueInterfaceConstructor(exec, structure, globalObject); 76 JSTestSerializedScriptValueInterfaceConstructor* ptr = new (JSC::allocateCell<JSTestSerializedScriptValueInterfaceConstructor>(*exec->heap())) JSTestSerializedScriptValueInterfaceConstructor(structure, globalObject); 77 ptr->finishCreation(exec, globalObject); 78 return ptr; 76 79 } 77 80 … … 89 92 const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestSerializedScriptValueInterfaceConstructorTable, 0 }; 90 93 91 JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor( ExecState* exec,Structure* structure, JSDOMGlobalObject* globalObject)94 JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject) 92 95 : DOMConstructorObject(structure, globalObject) 93 96 { 97 } 98 99 void JSTestSerializedScriptValueInterfaceConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) 100 { 101 Base::finishCreation(exec->globalData()); 94 102 ASSERT(inherits(&s_info)); 95 103 putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestSerializedScriptValueInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly); … … 133 141 , m_impl(impl) 134 142 { 135 finishCreation(globalObject->globalData()); 143 } 144 145 void JSTestSerializedScriptValueInterface::finishCreation(JSGlobalData& globalData) 146 { 147 Base::finishCreation(globalData); 136 148 ASSERT(inherits(&s_info)); 137 149 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h
r94929 r95108 37 37 static JSTestSerializedScriptValueInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestSerializedScriptValueInterface> impl) 38 38 { 39 return new (JSC::allocateCell<JSTestSerializedScriptValueInterface>(globalObject->globalData().heap)) JSTestSerializedScriptValueInterface(structure, globalObject, impl); 39 JSTestSerializedScriptValueInterface* ptr = new (JSC::allocateCell<JSTestSerializedScriptValueInterface>(globalObject->globalData().heap)) JSTestSerializedScriptValueInterface(structure, globalObject, impl); 40 ptr->finishCreation(globalObject->globalData()); 41 return ptr; 40 42 } 41 43 … … 57 59 protected: 58 60 JSTestSerializedScriptValueInterface(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestSerializedScriptValueInterface>); 61 void finishCreation(JSC::JSGlobalData&); 59 62 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; 60 63 }; … … 69 72 static JSTestSerializedScriptValueInterfacePrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) 70 73 { 71 return new (JSC::allocateCell<JSTestSerializedScriptValueInterfacePrototype>(globalData.heap)) JSTestSerializedScriptValueInterfacePrototype(globalData, globalObject, structure); 74 JSTestSerializedScriptValueInterfacePrototype* ptr = new (JSC::allocateCell<JSTestSerializedScriptValueInterfacePrototype>(globalData.heap)) JSTestSerializedScriptValueInterfacePrototype(globalData, globalObject, structure); 75 ptr->finishCreation(globalData); 76 return ptr; 72 77 } 73 78 … … 79 84 80 85 private: 81 JSTestSerializedScriptValueInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData);}86 JSTestSerializedScriptValueInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { } 82 87 protected: 83 88 static const unsigned StructureFlags = Base::StructureFlags; -
trunk/Source/WebCore/bridge/c/CRuntimeObject.cpp
r94875 r95108 41 41 : RuntimeObject(exec, globalObject, structure, instance) 42 42 { 43 finishCreation(globalObject);44 43 } 45 44 -
trunk/Source/WebCore/bridge/c/CRuntimeObject.h
r94929 r95108 46 46 // We need to pass in the right global object for "i". 47 47 Structure* domStructure = WebCore::deprecatedGetDOMStructure<CRuntimeObject>(exec); 48 return new (allocateCell<CRuntimeObject>(*exec->heap())) CRuntimeObject(exec, globalObject, domStructure, instance); 48 CRuntimeObject* object = new (allocateCell<CRuntimeObject>(*exec->heap())) CRuntimeObject(exec, globalObject, domStructure, instance); 49 object->finishCreation(globalObject); 50 return object; 49 51 } 50 52 -
trunk/Source/WebCore/bridge/c/c_instance.cpp
r94929 r95108 131 131 private: 132 132 CRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list) 133 : RuntimeMethod(exec, globalObject, structure, name, list) 134 { 133 : RuntimeMethod(globalObject, structure, list) 134 { 135 finishCreation(exec->globalData(), name); 136 } 137 138 void finishCreation(JSGlobalData& globalData, const Identifier& name) 139 { 140 Base::finishCreation(globalData, name); 135 141 ASSERT(inherits(&s_info)); 136 142 } -
trunk/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
r94929 r95108 136 136 private: 137 137 JavaRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list) 138 : RuntimeMethod( exec, globalObject, structure, name, list)138 : RuntimeMethod(globalObject, structure, list) 139 139 { 140 finishCreation(exec->globalData(), name); 141 } 142 143 void finishCreation(JSGlobalData& globalData, const Identifier& name) 144 { 145 Base::finishCreation(globalData, name); 140 146 ASSERT(inherits(&s_info)); 141 147 } 142 143 148 }; 144 149 -
trunk/Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.cpp
r94875 r95108 39 39 : RuntimeObject(exec, globalObject, structure, instance) 40 40 { 41 finishCreation(globalObject);42 41 } 43 42 -
trunk/Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.h
r94929 r95108 39 39 typedef RuntimeObject Base; 40 40 41 static JavaRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<JavaInstance> javaInst )41 static JavaRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<JavaInstance> javaInstance) 42 42 { 43 43 // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object 44 44 // We need to pass in the right global object for "i". 45 45 Structure* domStructure = WebCore::deprecatedGetDOMStructure<JavaRuntimeObject>(exec); 46 return new (allocateCell<JavaRuntimeObject>(*exec->heap())) JavaRuntimeObject(exec, globalObject, domStructure, javaInst); 46 JavaRuntimeObject* object = new (allocateCell<JavaRuntimeObject>(*exec->heap())) JavaRuntimeObject(exec, globalObject, domStructure, javaInstance); 47 object->finishCreation(globalObject); 48 return object; 47 49 } 48 50 -
trunk/Source/WebCore/bridge/objc/ObjCRuntimeObject.h
r94929 r95108 43 43 // We need to pass in the right global object for "i". 44 44 Structure* structure = WebCore::deprecatedGetDOMStructure<ObjCRuntimeObject>(exec); 45 return new (allocateCell<ObjCRuntimeObject>(*exec->heap())) ObjCRuntimeObject(exec, globalObject, inst, structure); 45 ObjCRuntimeObject* object = new (allocateCell<ObjCRuntimeObject>(*exec->heap())) ObjCRuntimeObject(exec, globalObject, inst, structure); 46 object->finishCreation(globalObject); 47 return object; 46 48 } 47 49 -
trunk/Source/WebCore/bridge/objc/ObjCRuntimeObject.mm
r94875 r95108 39 39 : RuntimeObject(exec, globalObject, structure, instance) 40 40 { 41 finishCreation(globalObject);42 41 } 43 42 -
trunk/Source/WebCore/bridge/objc/objc_instance.mm
r94929 r95108 190 190 191 191 private: 192 typedef RuntimeMethod Base; 193 192 194 ObjCRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list) 193 : RuntimeMethod( exec, globalObject, structure, name, list)195 : RuntimeMethod(globalObject, structure, list) 194 196 { 197 finishCreation(exec->globalData(), name); 198 } 199 200 void finishCreation(JSGlobalData& globalData, const Identifier& name) 201 { 202 Base::finishCreation(globalData, name); 195 203 ASSERT(inherits(&s_info)); 196 204 } -
trunk/Source/WebCore/bridge/qt/qt_instance.cpp
r94929 r95108 56 56 { 57 57 Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeObject>(exec); 58 return new (allocateCell<QtRuntimeObject>(*exec->heap())) QtRuntimeObject(exec, globalObject, domStructure, instance); 58 QtRuntimeObject* object = new (allocateCell<QtRuntimeObject>(*exec->heap())) QtRuntimeObject(exec, globalObject, domStructure, instance); 59 object->finishCreation(globalObject); 60 return object; 59 61 } 60 62 … … 86 88 : RuntimeObject(exec, globalObject, structure, instance) 87 89 { 88 finishCreation(globalObject);89 90 } 90 91 -
trunk/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
r94929 r95108 205 205 { 206 206 Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtPixmapRuntimeObject>(exec); 207 return new (allocateCell<QtPixmapRuntimeObject>(*exec->heap())) QtPixmapRuntimeObject(exec, globalObject, domStructure, instance); 207 QtPixmapRuntimeObject* object = new (allocateCell<QtPixmapRuntimeObject>(*exec->heap())) QtPixmapRuntimeObject(exec, globalObject, domStructure, instance); 208 object->finishCreation(globalObject); 209 return object; 208 210 } 209 211 … … 225 227 : RuntimeObject(exec, globalObject, structure, instance) 226 228 { 227 finishCreation(globalObject);228 229 } 229 230 -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r94875 r95108 1011 1011 , d_ptr(dd) 1012 1012 { 1013 finishCreation(exec, identifier, instance);1014 1013 } 1015 1014 … … 1427 1426 } 1428 1427 1429 QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& ident, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature, bool allowPrivate) 1430 : QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, ident, inst) 1431 { 1428 QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& identifier, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate) 1429 : QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, identifier, instance) 1430 { 1431 finishCreation(exec, identifier, instance, index, signature, allowPrivate); 1432 } 1433 1434 void QtRuntimeMetaMethod::finishCreation(ExecState* exec, const Identifier& identifier, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate) 1435 { 1436 Base::finishCreation(exec, identifier, instance); 1432 1437 QW_D(QtRuntimeMetaMethod); 1433 1438 d->m_signature = signature; … … 1571 1576 QMultiMap<QObject*, QtConnectionObject*> QtRuntimeConnectionMethod::connections; 1572 1577 1573 QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& ident, bool isConnect, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature) 1574 : QtRuntimeMethod (new QtRuntimeConnectionMethodData(), exec, structure, ident, inst) 1575 { 1578 QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& identifier, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature) 1579 : QtRuntimeMethod (new QtRuntimeConnectionMethodData(), exec, structure, identifier, instance) 1580 { 1581 finishCreation(exec, identifier, isConnect, instance, index, signature); 1582 } 1583 1584 void QtRuntimeConnectionMethod::finishCreation(ExecState* exec, const Identifier& identifier, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature) 1585 { 1586 Base::finishCreation(exec, identifier, instance); 1576 1587 QW_D(QtRuntimeConnectionMethod); 1577 1588 -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r94929 r95108 160 160 { 161 161 Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeMethod>(exec); 162 return new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, n, inst, index, signature, allowPrivate); 162 QtRuntimeMetaMethod* method = new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, n, inst, index, signature, allowPrivate); 163 return method; 163 164 } 164 165 … … 174 175 private: 175 176 QtRuntimeMetaMethod(ExecState*, Structure*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray&, bool allowPrivate); 177 void finishCreation(ExecState*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray& signature, bool allowPrivate); 176 178 177 179 virtual CallType getCallData(CallData&); … … 202 204 private: 203 205 QtRuntimeConnectionMethod(ExecState*, Structure*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray&); 206 void finishCreation(ExecState*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray& signature); 204 207 205 208 virtual CallType getCallData(CallData&); -
trunk/Source/WebCore/bridge/runtime_method.cpp
r94875 r95108 44 44 const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", &InternalFunction::s_info, 0, 0 }; 45 45 46 RuntimeMethod::RuntimeMethod( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& ident, Bindings::MethodList& m)46 RuntimeMethod::RuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& m) 47 47 // Callers will need to pass in the right global object corresponding to this native object "m". 48 48 : InternalFunction(globalObject, structure) 49 49 , _methodList(adoptPtr(new MethodList(m))) 50 50 { 51 finishCreation(exec->globalData(), ident);52 51 } 53 52 -
trunk/Source/WebCore/bridge/runtime_method.h
r94929 r95108 40 40 static RuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& methodList) 41 41 { 42 return new (allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(exec, globalObject, structure, name, methodList); 42 RuntimeMethod* method = new (allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(globalObject, structure, methodList); 43 method->finishCreation(exec->globalData(), name); 44 return method; 43 45 } 44 46 … … 58 60 59 61 protected: 60 RuntimeMethod( ExecState*, JSGlobalObject*, Structure*, const Identifier& name, Bindings::MethodList&);62 RuntimeMethod(JSGlobalObject*, Structure*, Bindings::MethodList&); 61 63 void finishCreation(JSGlobalData&, const Identifier&); 62 64 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; -
trunk/Source/WebKit/mac/ChangeLog
r95107 r95108 1 2011-09-14 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (6/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67692 5 6 Reviewed by Geoffrey Garen. 7 8 Completed the sixth level of the refactoring to add finishCreation() 9 methods to all classes within the JSCell hierarchy with non-trivial 10 constructor bodies. 11 12 This primarily consists of pushing the calls to finishCreation() down 13 into the constructors of the subclasses of the fifth level of the hierarchy 14 as well as pulling the finishCreation() calls out into the class's corresponding 15 create() method if it has one. Doing both simultaneously allows us to 16 maintain the invariant that the finishCreation() method chain is called exactly 17 once during the creation of an object, since calling it any other number of 18 times (0, 2, or more) will cause an assertion failure. 19 20 * Plugins/Hosted/ProxyInstance.mm: 21 (WebKit::ProxyRuntimeMethod::ProxyRuntimeMethod): 22 (WebKit::ProxyRuntimeMethod::finishCreation): 23 1 24 2011-09-13 Eric Seidel <eric@webkit.org> 2 25 -
trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
r94929 r95108 199 199 private: 200 200 ProxyRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list) 201 : RuntimeMethod(exec, globalObject, structure, name, list) 202 { 201 : RuntimeMethod(globalObject, structure, list) 202 { 203 finishCreation(exec->globalData(), name); 204 } 205 206 void finishCreation(JSGlobalData& globalData, const Identifier& name) 207 { 208 Base::finishCreation(globalData, name); 203 209 ASSERT(inherits(&s_info)); 204 210 } -
trunk/Source/WebKit2/ChangeLog
r95107 r95108 1 2011-09-14 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (6/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67692 5 6 Reviewed by Geoffrey Garen. 7 8 Completed the sixth level of the refactoring to add finishCreation() 9 methods to all classes within the JSCell hierarchy with non-trivial 10 constructor bodies. 11 12 This primarily consists of pushing the calls to finishCreation() down 13 into the constructors of the subclasses of the fifth level of the hierarchy 14 as well as pulling the finishCreation() calls out into the class's corresponding 15 create() method if it has one. Doing both simultaneously allows us to 16 maintain the invariant that the finishCreation() method chain is called exactly 17 once during the creation of an object, since calling it any other number of 18 times (0, 2, or more) will cause an assertion failure. 19 20 * WebProcess/Plugins/Netscape/JSNPMethod.cpp: 21 (WebKit::JSNPMethod::JSNPMethod): 22 * WebProcess/Plugins/Netscape/JSNPMethod.h: 23 (WebKit::JSNPMethod::create): 24 1 25 2011-09-13 Eric Seidel <eric@webkit.org> 2 26 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp
r94875 r95108 43 43 const ClassInfo JSNPMethod::s_info = { "NPMethod", &InternalFunction::s_info, 0, 0 }; 44 44 45 JSNPMethod::JSNPMethod( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, NPIdentifier npIdentifier)45 JSNPMethod::JSNPMethod(JSGlobalObject* globalObject, Structure* structure, NPIdentifier npIdentifier) 46 46 : InternalFunction(globalObject, structure) 47 47 , m_npIdentifier(npIdentifier) 48 48 { 49 finishCreation(exec->globalData(), name);50 49 } 51 50 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h
r94929 r95108 40 40 typedef JSC::InternalFunction Base; 41 41 42 static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::Identifier& ident, NPIdentifier npIdent)42 static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::Identifier& name, NPIdentifier npIdent) 43 43 { 44 44 JSC::Structure* structure = createStructure(exec->globalData(), globalObject, globalObject->functionPrototype()); 45 return new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(exec, globalObject, structure, ident, npIdent); 45 JSNPMethod* method = new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(globalObject, structure, npIdent); 46 method->finishCreation(exec->globalData(), name); 47 return method; 46 48 } 47 49 … … 54 56 55 57 private: 56 JSNPMethod(JSC:: ExecState*, JSC::JSGlobalObject*, JSC::Structure*, const JSC::Identifier&, NPIdentifier);58 JSNPMethod(JSC::JSGlobalObject*, JSC::Structure*, NPIdentifier); 57 59 58 60 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
Note: See TracChangeset
for help on using the changeset viewer.