Changeset 94627 in webkit
- Timestamp:
- Sep 6, 2011 7:13:37 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 112 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackConstructor.cpp
r94364 r94627 44 44 , m_callback(callback) 45 45 { 46 finishCreation(globalObject, jsClass);47 46 } 48 47 -
trunk/Source/JavaScriptCore/API/JSCallbackConstructor.h
r94599 r94627 38 38 static JSCallbackConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, JSObjectCallAsConstructorCallback callback) 39 39 { 40 return new (allocateCell<JSCallbackConstructor>(*exec->heap())) JSCallbackConstructor(globalObject, structure, classRef, callback); 40 JSCallbackConstructor* constructor = new (allocateCell<JSCallbackConstructor>(*exec->heap())) JSCallbackConstructor(globalObject, structure, classRef, callback); 41 constructor->finishCreation(globalObject, classRef); 42 return constructor; 41 43 } 42 44 -
trunk/Source/JavaScriptCore/API/JSCallbackFunction.cpp
r79240 r94627 44 44 45 45 JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name) 46 : InternalFunction( &exec->globalData(), globalObject, globalObject->callbackFunctionStructure(), name)46 : InternalFunction(globalObject, globalObject->callbackFunctionStructure()) 47 47 , m_callback(callback) 48 48 { 49 finishCreation(exec->globalData(), globalObject, name); 50 } 51 52 void JSCallbackFunction::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject, const Identifier& name) 53 { 54 Base::finishCreation(globalData, globalObject, name); 49 55 ASSERT(inherits(&s_info)); 50 56 } -
trunk/Source/JavaScriptCore/API/JSCallbackFunction.h
r94599 r94627 35 35 protected: 36 36 JSCallbackFunction(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name); 37 void finishCreation(JSGlobalData&, JSGlobalObject*, const Identifier& name); 37 38 38 39 public: -
trunk/Source/JavaScriptCore/ChangeLog
r94623 r94627 1 2011-09-06 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (5/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67420 5 6 Reviewed by Geoffrey Garen. 7 8 Completed the fifth 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 second 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/JSCallbackConstructor.cpp: 21 (JSC::JSCallbackConstructor::JSCallbackConstructor): 22 * API/JSCallbackConstructor.h: 23 (JSC::JSCallbackConstructor::create): 24 * API/JSCallbackFunction.cpp: 25 (JSC::JSCallbackFunction::JSCallbackFunction): 26 (JSC::JSCallbackFunction::finishCreation): 27 * API/JSCallbackFunction.h: 28 * JavaScriptCore.exp: 29 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 30 * debugger/DebuggerActivation.cpp: 31 * debugger/DebuggerActivation.h: 32 (JSC::DebuggerActivation::create): 33 * jsc.cpp: 34 (GlobalObject::finishCreation): 35 (GlobalObject::GlobalObject): 36 * runtime/ArrayConstructor.cpp: 37 (JSC::ArrayConstructor::ArrayConstructor): 38 (JSC::ArrayConstructor::finishCreation): 39 * runtime/ArrayConstructor.h: 40 * runtime/ArrayPrototype.cpp: 41 (JSC::ArrayPrototype::ArrayPrototype): 42 * runtime/ArrayPrototype.h: 43 (JSC::ArrayPrototype::create): 44 * runtime/BooleanConstructor.cpp: 45 (JSC::BooleanConstructor::BooleanConstructor): 46 (JSC::BooleanConstructor::finishCreation): 47 * runtime/BooleanConstructor.h: 48 * runtime/BooleanObject.cpp: 49 (JSC::BooleanObject::BooleanObject): 50 * runtime/BooleanObject.h: 51 (JSC::BooleanObject::create): 52 * runtime/BooleanPrototype.cpp: 53 (JSC::BooleanPrototype::BooleanPrototype): 54 (JSC::BooleanPrototype::finishCreation): 55 * runtime/BooleanPrototype.h: 56 * runtime/DateConstructor.cpp: 57 (JSC::DateConstructor::DateConstructor): 58 (JSC::DateConstructor::finishCreation): 59 * runtime/DateConstructor.h: 60 * runtime/DateInstance.cpp: 61 (JSC::DateInstance::DateInstance): 62 * runtime/DateInstance.h: 63 (JSC::DateInstance::create): 64 * runtime/DatePrototype.cpp: 65 (JSC::DatePrototype::DatePrototype): 66 (JSC::DatePrototype::finishCreation): 67 * runtime/DatePrototype.h: 68 * runtime/Error.cpp: 69 (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction): 70 * runtime/ErrorConstructor.cpp: 71 (JSC::ErrorConstructor::ErrorConstructor): 72 (JSC::ErrorConstructor::finishCreation): 73 * runtime/ErrorConstructor.h: 74 * runtime/ErrorPrototype.cpp: 75 (JSC::ErrorPrototype::ErrorPrototype): 76 * runtime/ErrorPrototype.h: 77 (JSC::ErrorPrototype::create): 78 * runtime/FunctionConstructor.cpp: 79 (JSC::FunctionConstructor::FunctionConstructor): 80 (JSC::FunctionConstructor::finishCreation): 81 * runtime/FunctionConstructor.h: 82 * runtime/FunctionPrototype.cpp: 83 (JSC::FunctionPrototype::FunctionPrototype): 84 (JSC::FunctionPrototype::finishCreation): 85 * runtime/FunctionPrototype.h: 86 * runtime/InternalFunction.cpp: 87 (JSC::InternalFunction::InternalFunction): 88 * runtime/InternalFunction.h: 89 * runtime/JSActivation.cpp: 90 (JSC::JSActivation::JSActivation): 91 * runtime/JSActivation.h: 92 (JSC::JSActivation::create): 93 * runtime/JSGlobalObject.h: 94 (JSC::JSGlobalObject::create): 95 (JSC::JSGlobalObject::JSGlobalObject): 96 * runtime/JSONObject.cpp: 97 (JSC::JSONObject::JSONObject): 98 * runtime/JSONObject.h: 99 (JSC::JSONObject::create): 100 * runtime/JSStaticScopeObject.h: 101 (JSC::JSStaticScopeObject::create): 102 (JSC::JSStaticScopeObject::JSStaticScopeObject): 103 * runtime/JSString.cpp: 104 (JSC::StringObject::create): 105 * runtime/MathObject.cpp: 106 (JSC::MathObject::MathObject): 107 * runtime/MathObject.h: 108 (JSC::MathObject::create): 109 * runtime/NativeErrorConstructor.cpp: 110 (JSC::NativeErrorConstructor::NativeErrorConstructor): 111 * runtime/NativeErrorConstructor.h: 112 (JSC::NativeErrorConstructor::finishCreation): 113 * runtime/NativeErrorPrototype.cpp: 114 (JSC::NativeErrorPrototype::NativeErrorPrototype): 115 (JSC::NativeErrorPrototype::finishCreation): 116 * runtime/NativeErrorPrototype.h: 117 * runtime/NumberConstructor.cpp: 118 (JSC::NumberConstructor::NumberConstructor): 119 (JSC::NumberConstructor::finishCreation): 120 * runtime/NumberConstructor.h: 121 * runtime/NumberObject.cpp: 122 (JSC::NumberObject::NumberObject): 123 * runtime/NumberObject.h: 124 (JSC::NumberObject::create): 125 * runtime/NumberPrototype.cpp: 126 (JSC::NumberPrototype::NumberPrototype): 127 (JSC::NumberPrototype::finishCreation): 128 * runtime/NumberPrototype.h: 129 * runtime/ObjectConstructor.cpp: 130 (JSC::ObjectConstructor::ObjectConstructor): 131 (JSC::ObjectConstructor::finishCreation): 132 * runtime/ObjectConstructor.h: 133 * runtime/RegExpConstructor.cpp: 134 (JSC::RegExpConstructor::RegExpConstructor): 135 (JSC::RegExpConstructor::finishCreation): 136 (JSC::RegExpMatchesArray::RegExpMatchesArray): 137 * runtime/RegExpConstructor.h: 138 * runtime/RegExpMatchesArray.h: 139 (JSC::RegExpMatchesArray::create): 140 * runtime/RegExpObject.cpp: 141 (JSC::RegExpObject::RegExpObject): 142 * runtime/RegExpObject.h: 143 (JSC::RegExpObject::create): 144 * runtime/RegExpPrototype.cpp: 145 (JSC::RegExpPrototype::RegExpPrototype): 146 * runtime/StringConstructor.cpp: 147 (JSC::StringConstructor::StringConstructor): 148 (JSC::StringConstructor::finishCreation): 149 * runtime/StringConstructor.h: 150 * runtime/StringObject.cpp: 151 (JSC::StringObject::StringObject): 152 * runtime/StringObject.h: 153 (JSC::StringObject::create): 154 * runtime/StringObjectThatMasqueradesAsUndefined.h: 155 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): 156 * runtime/StringPrototype.cpp: 157 (JSC::StringPrototype::StringPrototype): 158 (JSC::StringPrototype::finishCreation): 159 * runtime/StringPrototype.h: 160 1 161 2011-09-06 Filip Pizlo <fpizlo@apple.com> 2 162 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r94599 r94627 124 124 __ZN3JSC11createErrorEPNS_9ExecStateERKNS_7UStringE 125 125 __ZN3JSC11regExpFlagsERKNS_7UStringE 126 __ZN3JSC12DateInstance14finishCreationERNS_12JSGlobalDataEd 127 __ZN3JSC12DateInstance6createEPNS_9ExecStateEPNS_9StructureEd 126 128 __ZN3JSC12DateInstance6s_infoE 127 __ZN3JSC12DateInstanceC1EPNS_9ExecStateEPNS_9StructureE d129 __ZN3JSC12DateInstanceC1EPNS_9ExecStateEPNS_9StructureE 128 130 __ZN3JSC12JSGlobalData10ClientDataD2Ev 129 131 __ZN3JSC12JSGlobalData11jsArrayVPtrE … … 139 141 __ZN3JSC12JSGlobalData6createENS_15ThreadStackTypeENS_8HeapSizeE 140 142 __ZN3JSC12JSGlobalDataD1Ev 143 __ZN3JSC12RegExpObject14finishCreationEPNS_14JSGlobalObjectE 141 144 __ZN3JSC12RegExpObject6s_infoE 142 145 __ZN3JSC12RegExpObjectC1EPNS_14JSGlobalObjectEPNS_9StructureEPNS_6RegExpE … … 145 148 __ZN3JSC12SmallStrings27createSingleCharacterStringEPNS_12JSGlobalDataEh 146 149 __ZN3JSC12StringObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE 150 __ZN3JSC12StringObject14finishCreationERNS_12JSGlobalDataEPNS_8JSStringE 147 151 __ZN3JSC12StringObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 148 152 __ZN3JSC12StringObject18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE … … 151 155 __ZN3JSC12StringObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE 152 156 __ZN3JSC12StringObject6s_infoE 153 __ZN3JSC12StringObjectC2ERNS_12JSGlobalDataEPNS_9StructureE PNS_8JSStringE157 __ZN3JSC12StringObjectC2ERNS_12JSGlobalDataEPNS_9StructureE 154 158 __ZN3JSC13SamplingFlags4stopEv 155 159 __ZN3JSC13SamplingFlags5startEv … … 182 186 __ZN3JSC15createTypeErrorEPNS_9ExecStateERKNS_7UStringE 183 187 __ZN3JSC16InternalFunction12vtableAnchorEv 188 __ZN3JSC16InternalFunction14finishCreationERNS_12JSGlobalDataEPNS_14JSGlobalObjectERKNS_10IdentifierE 184 189 __ZN3JSC16InternalFunction4nameEPNS_9ExecStateE 185 190 __ZN3JSC16InternalFunction6s_infoE 186 __ZN3JSC16InternalFunctionC2EPNS_1 2JSGlobalDataEPNS_14JSGlobalObjectEPNS_9StructureERKNS_10IdentifierE191 __ZN3JSC16InternalFunctionC2EPNS_14JSGlobalObjectEPNS_9StructureE 187 192 __ZN3JSC16JSVariableObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE 188 193 __ZN3JSC16JSVariableObject14symbolTableGetERKNS_10IdentifierERNS_18PropertyDescriptorE … … 196 201 __ZN3JSC17constructFunctionEPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi 197 202 __ZN3JSC17createSyntaxErrorEPNS_9ExecStateERKNS_7UStringE 198 __ZN3JSC18DebuggerActivation6createERNS_12JSGlobalDataEPNS_8JSObjectE 203 __ZN3JSC18DebuggerActivation14finishCreationERNS_12JSGlobalDataEPNS_8JSObjectE 204 __ZN3JSC18DebuggerActivationC1ERNS_12JSGlobalDataE 199 205 __ZN3JSC18PropertyDescriptor11setWritableEb 200 206 __ZN3JSC18PropertyDescriptor12setUndefinedEv -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r94599 r94627 4 4 ??0CString@WTF@@QAE@PBDI@Z 5 5 ??0Collator@WTF@@QAE@PBD@Z 6 ??0DateInstance@JSC@@IAE@PAVExecState@1@PAVStructure@1@ N@Z6 ??0DateInstance@JSC@@IAE@PAVExecState@1@PAVStructure@1@@Z 7 7 ??0DefaultGCActivityCallback@JSC@@QAE@PAVHeap@1@@Z 8 8 ??0DropAllLocks@JSLock@JSC@@QAE@W4JSLockBehavior@2@@Z 9 ??0DynamicGlobalObjectScope@JSC@@QAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@@Z 10 ??0InternalFunction@JSC@@IAE@PAVJSGlobal Data@1@PAVJSGlobalObject@1@PAVStructure@1@ABVIdentifier@1@@Z9 ??0DynamicGlobalObjectScope@JSC@@QAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@@Z 10 ??0InternalFunction@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@@Z 11 11 ??0JSArray@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@@Z 12 12 ??0JSByteArray@JSC@@AAE@PAVExecState@1@PAVStructure@1@PAVByteArray@WTF@@@Z … … 20 20 ??0RegExpObject@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@PAVRegExp@1@@Z 21 21 ??0SHA1@WTF@@QAE@XZ 22 ??0StringObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@ PAVJSString@1@@Z22 ??0StringObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@@Z 23 23 ??0Structure@JSC@@AAE@AAVJSGlobalData@1@VJSValue@1@ABVTypeInfo@1@IPBUClassInfo@1@@Z 24 24 ??0ThreadCondition@WTF@@QAE@XZ … … 176 176 ?fillGetterPropertySlot@JSObject@JSC@@QAEXAAVPropertySlot@2@PAV?$WriteBarrierBase@W4Unknown@JSC@@@2@@Z 177 177 ?finalize@WeakHandleOwner@JSC@@UAEXV?$Handle@W4Unknown@JSC@@@2@PAX@Z 178 ?finishCreation@DateInstance@JSC@@IAEXAAVJSGlobalData@2@N@Z 179 ?finishCreation@InternalFunction@JSC@@IAEXAAVJSGlobalData@2@PAVJSGlobalObject@2@ABVIdentifier@2@@Z 178 180 ?finishCreation@JSArray@JSC@@IAEXAAVJSGlobalData@2@@Z 179 181 ?finishCreation@JSArray@JSC@@IAEXAAVJSGlobalData@2@ABVArgList@2@@Z 180 182 ?finishCreation@JSFunction@JSC@@IAEXPAVExecState@2@PAVJSGlobalObject@2@HABVIdentifier@2@PAVExecutableBase@2@@Z 181 183 ?finishCreation@JSObjectWithGlobalObject@JSC@@IAEXAAVJSGlobalData@2@PAVJSGlobalObject@2@@Z 184 ?finishCreation@RegExpObject@JSC@@IAEXPAVJSGlobalObject@2@@Z 185 ?finishCreation@StringObject@JSC@@IAEXAAVJSGlobalData@2@PAVJSString@2@@Z 182 186 ?focus@Profile@JSC@@QAEXPBVProfileNode@2@@Z 183 187 ?from@Identifier@JSC@@SA?AV12@PAVExecState@2@H@Z -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
r94364 r94627 34 34 : JSNonFinalObject(globalData, globalData.debuggerActivationStructure.get()) 35 35 { 36 }37 38 DebuggerActivation* DebuggerActivation::create(JSGlobalData& globalData, JSObject* object)39 {40 DebuggerActivation* activation = new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData);41 activation->finishCreation(globalData, object);42 return activation;43 36 } 44 37 -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h
r94599 r94627 35 35 typedef JSNonFinalObject Base; 36 36 37 static DebuggerActivation* create(JSGlobalData&, JSObject*); 37 static DebuggerActivation* create(JSGlobalData& globalData, JSObject* object) 38 { 39 DebuggerActivation* activation = new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData); 40 activation->finishCreation(globalData, object); 41 return activation; 42 } 43 38 44 virtual void visitChildren(SlotVisitor&); 39 45 virtual UString className() const; -
trunk/Source/JavaScriptCore/jsc.cpp
r93378 r94627 158 158 159 159 protected: 160 void constructorBody(const Vector<UString>& arguments)160 void finishCreation(JSGlobalData& globalData, const Vector<UString>& arguments) 161 161 { 162 Base::finishCreation(globalData, this); 162 163 putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "debug"), functionDebug)); 163 164 putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "print"), functionPrint)); … … 191 192 : JSGlobalObject(globalData, structure) 192 193 { 193 constructorBody(arguments);194 finishCreation(globalData, arguments); 194 195 } 195 196 -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r91194 r94627 53 53 54 54 ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype) 55 : InternalFunction( &exec->globalData(), globalObject, structure, Identifier(exec, arrayPrototype->classInfo()->className))55 : InternalFunction(globalObject, structure) 56 56 { 57 finishCreation(exec, globalObject, arrayPrototype); 58 } 59 60 void ArrayConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, ArrayPrototype* arrayPrototype) 61 { 62 Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, arrayPrototype->classInfo()->className)); 57 63 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly); 58 64 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h
r94599 r94627 45 45 46 46 protected: 47 void finishCreation(ExecState*, JSGlobalObject*, ArrayPrototype*); 47 48 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; 48 49 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r94364 r94627 118 118 : JSArray(globalObject->globalData(), structure) 119 119 { 120 finishCreation(globalObject);121 120 } 122 121 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h
r94599 r94627 36 36 static ArrayPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 37 37 { 38 return new (allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure); 38 ArrayPrototype* prototype = new (allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure); 39 prototype->finishCreation(globalObject); 40 return prototype; 39 41 } 40 42 -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
r91194 r94627 30 30 31 31 BooleanConstructor::BooleanConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype) 32 : InternalFunction( &exec->globalData(), globalObject, structure, Identifier(exec, booleanPrototype->classInfo()->className))32 : InternalFunction(globalObject, structure) 33 33 { 34 finishCreation(exec, globalObject, booleanPrototype); 35 } 36 37 void BooleanConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, BooleanPrototype* booleanPrototype) 38 { 39 Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, booleanPrototype->classInfo()->className)); 34 40 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, booleanPrototype, DontEnum | DontDelete | ReadOnly); 35 41 -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h
r92706 r94627 37 37 } 38 38 39 protected: 40 void finishCreation(ExecState*, JSGlobalObject*, BooleanPrototype*); 41 39 42 private: 40 43 BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*); -
trunk/Source/JavaScriptCore/runtime/BooleanObject.cpp
r94364 r94627 31 31 : JSWrapperObject(globalData, structure) 32 32 { 33 finishCreation(globalData);34 33 } 35 34 -
trunk/Source/JavaScriptCore/runtime/BooleanObject.h
r94599 r94627 36 36 static BooleanObject* create(JSGlobalData& globalData, Structure* structure) 37 37 { 38 return new (allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure); 38 BooleanObject* boolean = new (allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure); 39 boolean->finishCreation(globalData); 40 return boolean; 39 41 } 40 42 -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
r86730 r94627 53 53 : BooleanObject(exec->globalData(), structure) 54 54 { 55 finishCreation(exec, globalObject); 56 } 57 58 void BooleanPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject) 59 { 60 Base::finishCreation(exec->globalData()); 55 61 setInternalValue(exec->globalData(), jsBoolean(false)); 56 62 -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h
r94599 r94627 43 43 44 44 protected: 45 void finishCreation(ExecState*, JSGlobalObject*); 45 46 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | BooleanObject::StructureFlags; 46 47 static const unsigned AnonymousSlotCount = BooleanObject::AnonymousSlotCount + 1; -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r91194 r94627 75 75 76 76 DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype) 77 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, datePrototype->classInfo()->className)) 78 { 77 : InternalFunction(globalObject, structure) 78 { 79 finishCreation(exec, globalObject, datePrototype); 80 } 81 82 void DateConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, DatePrototype* datePrototype) 83 { 84 Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, datePrototype->classInfo()->className)); 79 85 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, datePrototype, DontEnum | DontDelete | ReadOnly); 80 86 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(7), ReadOnly | DontEnum | DontDelete); -
trunk/Source/JavaScriptCore/runtime/DateConstructor.h
r94599 r94627 45 45 46 46 protected: 47 void finishCreation(ExecState*, JSGlobalObject*, DatePrototype*); 47 48 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; 48 49 -
trunk/Source/JavaScriptCore/runtime/DateInstance.cpp
r94364 r94627 38 38 : JSWrapperObject(exec->globalData(), structure) 39 39 { 40 finishCreation(exec->globalData());41 }42 43 DateInstance::DateInstance(ExecState* exec, Structure* structure, double time)44 : JSWrapperObject(exec->globalData(), structure)45 {46 finishCreation(exec->globalData(), time);47 40 } 48 41 -
trunk/Source/JavaScriptCore/runtime/DateInstance.h
r94599 r94627 32 32 class DateInstance : public JSWrapperObject { 33 33 protected: 34 DateInstance(ExecState*, Structure*, double);35 34 DateInstance(ExecState*, Structure*); 36 35 void finishCreation(JSGlobalData&); … … 42 41 static DateInstance* create(ExecState* exec, Structure* structure, double date) 43 42 { 44 return new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure, date); 43 DateInstance* instance = new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure); 44 instance->finishCreation(exec->globalData(), date); 45 return instance; 45 46 } 47 46 48 static DateInstance* create(ExecState* exec, Structure* structure) 47 49 { 48 return new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure); 50 DateInstance* instance = new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure); 51 instance->finishCreation(exec->globalData()); 52 return instance; 49 53 } 50 54 51 55 double internalNumber() const { return internalValue().uncheckedGetNumber(); } 52 56 -
trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp
r91576 r94627 433 433 : DateInstance(exec, structure) 434 434 { 435 finishCreation(exec, globalObject); 436 } 437 438 void DatePrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject) 439 { 440 Base::finishCreation(exec->globalData(), jsNaN()); 435 441 ASSERT(inherits(&s_info)); 436 442 -
trunk/Source/JavaScriptCore/runtime/DatePrototype.h
r94599 r94627 50 50 51 51 protected: 52 void finishCreation(ExecState*, JSGlobalObject*); 52 53 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | DateInstance::StructureFlags; 53 54 -
trunk/Source/JavaScriptCore/runtime/Error.cpp
r92706 r94627 169 169 private: 170 170 StrictModeTypeErrorFunction(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message) 171 : InternalFunction( &exec->globalData(), globalObject, structure, exec->globalData().propertyNames->emptyIdentifier)171 : InternalFunction(globalObject, structure) 172 172 , m_message(message) 173 173 { 174 finishCreation(exec->globalData(), globalObject, exec->globalData().propertyNames->emptyIdentifier); 174 175 } 175 176 -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
r84052 r94627 31 31 32 32 ErrorConstructor::ErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype) 33 : InternalFunction( &exec->globalData(), globalObject, structure, Identifier(exec, errorPrototype->classInfo()->className))33 : InternalFunction(globalObject, structure) 34 34 { 35 finishCreation(exec, globalObject, errorPrototype); 36 } 37 38 void ErrorConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, ErrorPrototype* errorPrototype) 39 { 40 Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, errorPrototype->classInfo()->className)); 35 41 // ECMA 15.11.3.1 Error.prototype 36 42 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, errorPrototype, DontEnum | DontDelete | ReadOnly); -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h
r92706 r94627 37 37 return new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(exec, globalObject, structure, errPrototype); 38 38 } 39 40 protected: 41 void finishCreation(ExecState*, JSGlobalObject*, ErrorPrototype*); 39 42 40 43 private: -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
r94364 r94627 51 51 ASSERT_CLASS_FITS_IN_CELL(ErrorPrototype); 52 52 53 ErrorPrototype::ErrorPrototype(ExecState* exec, JSGlobalObject* globalObject,Structure* structure)53 ErrorPrototype::ErrorPrototype(ExecState* exec, Structure* structure) 54 54 : ErrorInstance(exec->globalData(), structure) 55 55 { 56 finishCreation(exec, globalObject);57 56 } 58 57 -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h
r94599 r94627 34 34 static ErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 35 35 { 36 return new (allocateCell<ErrorPrototype>(*exec->heap())) ErrorPrototype(exec, globalObject, structure); 36 ErrorPrototype* prototype = new (allocateCell<ErrorPrototype>(*exec->heap())) ErrorPrototype(exec, structure); 37 prototype->finishCreation(exec, globalObject); 38 return prototype; 37 39 } 38 40 … … 45 47 46 48 protected: 47 ErrorPrototype(ExecState*, JSGlobalObject*,Structure*);49 ErrorPrototype(ExecState*, Structure*); 48 50 void finishCreation(ExecState*, JSGlobalObject*); 49 51 -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r91194 r94627 39 39 40 40 FunctionConstructor::FunctionConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype) 41 : InternalFunction( &exec->globalData(), globalObject, structure, Identifier(exec, functionPrototype->classInfo()->className))41 : InternalFunction(globalObject, structure) 42 42 { 43 finishCreation(exec, globalObject, functionPrototype); 44 } 45 46 void FunctionConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, FunctionPrototype* functionPrototype) 47 { 48 Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, functionPrototype->classInfo()->className)); 43 49 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, functionPrototype, DontEnum | DontDelete | ReadOnly); 44 50 -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h
r92706 r94627 39 39 private: 40 40 FunctionConstructor(ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*); 41 void finishCreation(ExecState*, JSGlobalObject*, FunctionPrototype*); 41 42 virtual ConstructType getConstructData(ConstructData&); 42 43 virtual CallType getCallData(CallData&); -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r91483 r94627 39 39 40 40 FunctionPrototype::FunctionPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 41 : InternalFunction( &exec->globalData(), globalObject, structure, exec->propertyNames().nullIdentifier)41 : InternalFunction(globalObject, structure) 42 42 { 43 finishCreation(exec, globalObject, exec->propertyNames().nullIdentifier); 44 } 45 46 void FunctionPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name) 47 { 48 Base::finishCreation(exec->globalData(), globalObject, name); 43 49 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum); 44 50 } -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h
r94599 r94627 42 42 } 43 43 44 protected: 45 void finishCreation(ExecState*, JSGlobalObject*, const Identifier& name); 46 44 47 private: 45 48 FunctionPrototype(ExecState*, JSGlobalObject*, Structure*); -
trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp
r94364 r94627 42 42 } 43 43 44 InternalFunction::InternalFunction(JSGlobal Data* globalData, JSGlobalObject* globalObject, Structure* structure, const Identifier& name)44 InternalFunction::InternalFunction(JSGlobalObject* globalObject, Structure* structure) 45 45 : JSObjectWithGlobalObject(globalObject, structure) 46 46 { 47 finishCreation(*globalData, globalObject, name);48 47 } 49 48 -
trunk/Source/JavaScriptCore/runtime/InternalFunction.h
r94599 r94627 53 53 InternalFunction(VPtrStealingHackType); 54 54 55 InternalFunction(JSGlobal Data*, JSGlobalObject*, Structure*, const Identifier&);55 InternalFunction(JSGlobalObject*, Structure*); 56 56 57 57 void finishCreation(JSGlobalData&, JSGlobalObject*, const Identifier& name); -
trunk/Source/JavaScriptCore/runtime/JSActivation.cpp
r94364 r94627 47 47 , m_argumentsRegister(functionExecutable->generatedBytecode().argumentsRegister()) 48 48 { 49 finishCreation(callFrame);50 49 } 51 50 -
trunk/Source/JavaScriptCore/runtime/JSActivation.h
r94599 r94627 49 49 static JSActivation* create(JSGlobalData& globalData, CallFrame* callFrame, FunctionExecutable* funcExec) 50 50 { 51 return new (allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec); 51 JSActivation* activation = new (allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec); 52 activation->finishCreation(callFrame); 53 return activation; 52 54 } 53 55 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r94599 r94627 147 147 static JSGlobalObject* create(JSGlobalData& globalData, Structure* structure) 148 148 { 149 return new (allocateCell<JSGlobalObject>(globalData.heap)) JSGlobalObject(globalData, structure); 149 JSGlobalObject* globalObject = new (allocateCell<JSGlobalObject>(globalData.heap)) JSGlobalObject(globalData, structure); 150 globalObject->finishCreation(globalData, globalObject); 151 return globalObject; 150 152 } 151 153 … … 160 162 , m_evalEnabled(true) 161 163 { 162 finishCreation(globalData, this);163 }164 165 JSGlobalObject(JSGlobalData& globalData, Structure* structure, JSObject* thisValue)166 : JSVariableObject(globalData, structure, &m_symbolTable, 0)167 , m_registerArraySize(0)168 , m_globalScopeChain()169 , m_weakRandom(static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0)))170 , m_evalEnabled(true)171 {172 finishCreation(globalData, thisValue);173 164 } 174 165 -
trunk/Source/JavaScriptCore/runtime/JSONObject.cpp
r94364 r94627 57 57 : JSObjectWithGlobalObject(globalObject, structure) 58 58 { 59 finishCreation(globalObject);60 59 } 61 60 -
trunk/Source/JavaScriptCore/runtime/JSONObject.h
r94599 r94627 39 39 static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 40 40 { 41 return new (allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure); 41 JSONObject* object = new (allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure); 42 object->finishCreation(globalObject); 43 return object; 42 44 } 43 45 -
trunk/Source/JavaScriptCore/runtime/JSStaticScopeObject.h
r94599 r94627 37 37 static JSStaticScopeObject* create(ExecState* exec, const Identifier& identifier, JSValue value, unsigned attributes) 38 38 { 39 return new (allocateCell<JSStaticScopeObject>(*exec->heap())) JSStaticScopeObject(exec, identifier, value, attributes); 39 JSStaticScopeObject* scopeObject = new (allocateCell<JSStaticScopeObject>(*exec->heap())) JSStaticScopeObject(exec); 40 scopeObject->finishCreation(exec, identifier, value, attributes); 41 return scopeObject; 40 42 } 41 43 … … 60 62 61 63 private: 62 JSStaticScopeObject(ExecState* exec , const Identifier& identifier, JSValue value, unsigned attributes)64 JSStaticScopeObject(ExecState* exec) 63 65 : JSVariableObject(exec->globalData(), exec->globalData().staticScopeStructure.get(), &m_symbolTable, reinterpret_cast<Register*>(&m_registerStore + 1)) 64 66 { 65 finishCreation(exec, identifier, value, attributes);66 67 } 67 68 -
trunk/Source/JavaScriptCore/runtime/JSString.cpp
r94336 r94627 299 299 inline StringObject* StringObject::create(ExecState* exec, JSGlobalObject* globalObject, JSString* string) 300 300 { 301 return new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), globalObject->stringObjectStructure(), string); 301 StringObject* object = new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), globalObject->stringObjectStructure()); 302 object->finishCreation(exec->globalData(), string); 303 return object; 302 304 } 303 305 -
trunk/Source/JavaScriptCore/runtime/MathObject.cpp
r94364 r94627 85 85 */ 86 86 87 MathObject::MathObject( ExecState* exec,JSGlobalObject* globalObject, Structure* structure)87 MathObject::MathObject(JSGlobalObject* globalObject, Structure* structure) 88 88 : JSObjectWithGlobalObject(globalObject, structure) 89 89 { 90 finishCreation(exec, globalObject);91 90 } 92 91 -
trunk/Source/JavaScriptCore/runtime/MathObject.h
r94599 r94627 28 28 class MathObject : public JSObjectWithGlobalObject { 29 29 private: 30 MathObject( ExecState*,JSGlobalObject*, Structure*);30 MathObject(JSGlobalObject*, Structure*); 31 31 32 32 public: … … 35 35 static MathObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 36 36 { 37 return new (allocateCell<MathObject>(*exec->heap())) MathObject(exec, globalObject, structure); 37 MathObject* object = new (allocateCell<MathObject>(*exec->heap())) MathObject(globalObject, structure); 38 object->finishCreation(exec, globalObject); 39 return object; 38 40 } 39 41 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
r93624 r94627 34 34 35 35 NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name) 36 : InternalFunction( &exec->globalData(), globalObject, structure, Identifier(exec, name))36 : InternalFunction(globalObject, structure) 37 37 { 38 constructorBody(exec, globalObject, prototypeStructure, name);38 finishCreation(exec, globalObject, prototypeStructure, name); 39 39 } 40 40 -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h
r94599 r94627 50 50 51 51 protected: 52 void constructorBody(ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeStructure, const UString& name)52 void finishCreation(ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeStructure, const UString& name) 53 53 { 54 Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, name)); 54 55 ASSERT(inherits(&s_info)); 55 56 -
trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
r93624 r94627 31 31 ASSERT_CLASS_FITS_IN_CELL(NativeErrorPrototype); 32 32 33 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& name , NativeErrorConstructor* constructor)34 : ErrorPrototype(exec, globalObject,structure)33 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& nameAndMessage, NativeErrorConstructor* constructor) 34 : ErrorPrototype(exec, structure) 35 35 { 36 constructorBody(exec, name, constructor);36 finishCreation(exec, globalObject, nameAndMessage, constructor); 37 37 } 38 38 39 inline void NativeErrorPrototype:: constructorBody(ExecState* exec, const UString& name, NativeErrorConstructor* constructor)39 inline void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor) 40 40 { 41 putDirect(exec->globalData(), exec->propertyNames().name, jsString(exec, name), DontEnum); 42 putDirect(exec->globalData(), exec->propertyNames().message, jsEmptyString(exec), DontEnum); 41 Base::finishCreation(exec, globalObject); 42 putDirect(exec->globalData(), exec->propertyNames().name, jsString(exec, nameAndMessage), DontEnum); 43 putDirect(exec->globalData(), exec->propertyNames().message, jsString(exec, nameAndMessage), DontEnum); 43 44 putDirect(exec->globalData(), exec->propertyNames().constructor, constructor, DontEnum); 44 45 } -
trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.h
r93624 r94627 40 40 41 41 protected: 42 void constructorBody(ExecState*, const UString& name, NativeErrorConstructor*);42 void finishCreation(ExecState*, JSGlobalObject*, const UString& nameAndMessage, NativeErrorConstructor*); 43 43 }; 44 44 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r91194 r94627 56 56 57 57 NumberConstructor::NumberConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype) 58 : InternalFunction( &exec->globalData(), globalObject, structure, Identifier(exec, numberPrototype->s_info.className))58 : InternalFunction(globalObject, structure) 59 59 { 60 finishCreation(exec, globalObject, numberPrototype); 61 } 62 63 void NumberConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, NumberPrototype* numberPrototype) 64 { 65 Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, numberPrototype->s_info.className)); 60 66 ASSERT(inherits(&s_info)); 61 67 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.h
r94599 r94627 51 51 52 52 protected: 53 void finishCreation(ExecState*, JSGlobalObject*, NumberPrototype*); 53 54 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags; 54 55 -
trunk/Source/JavaScriptCore/runtime/NumberObject.cpp
r94364 r94627 35 35 : JSWrapperObject(globalData, structure) 36 36 { 37 finishCreation(globalData);38 37 } 39 38 -
trunk/Source/JavaScriptCore/runtime/NumberObject.h
r94599 r94627 36 36 static NumberObject* create(JSGlobalData& globalData, Structure* structure) 37 37 { 38 return new (allocateCell<NumberObject>(globalData.heap)) NumberObject(globalData, structure); 38 NumberObject* number = new (allocateCell<NumberObject>(globalData.heap)) NumberObject(globalData, structure); 39 number->finishCreation(globalData); 40 return number; 39 41 } 40 42 -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r94452 r94627 70 70 : NumberObject(exec->globalData(), structure) 71 71 { 72 finishCreation(exec, globalObject); 73 } 74 75 void NumberPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject) 76 { 77 Base::finishCreation(exec->globalData()); 72 78 setInternalValue(exec->globalData(), jsNumber(0)); 73 79 -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.h
r94599 r94627 43 43 44 44 protected: 45 void finishCreation(ExecState*, JSGlobalObject*); 45 46 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NumberObject::StructureFlags; 46 47 static const unsigned AnonymousSlotCount = NumberObject::AnonymousSlotCount + 1; -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r84679 r94627 77 77 78 78 ObjectConstructor::ObjectConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype) 79 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, "Object")) 80 { 79 : InternalFunction(globalObject, structure) 80 { 81 finishCreation(exec, globalObject, objectPrototype); 82 } 83 84 void ObjectConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, ObjectPrototype* objectPrototype) 85 { 86 Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, "Object")); 81 87 // ECMA 15.2.3.1 82 88 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, objectPrototype, DontEnum | DontDelete | ReadOnly); -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h
r94599 r94627 48 48 49 49 protected: 50 void finishCreation(ExecState*, JSGlobalObject*, ObjectPrototype*); 50 51 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; 51 52 -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r94364 r94627 97 97 98 98 RegExpConstructor::RegExpConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype) 99 : InternalFunction( &exec->globalData(), globalObject, structure, Identifier(exec, "RegExp"))99 : InternalFunction(globalObject, structure) 100 100 , d(adoptPtr(new RegExpConstructorPrivate)) 101 101 { 102 finishCreation(exec, globalObject, regExpPrototype); 103 } 104 105 void RegExpConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, RegExpPrototype* regExpPrototype) 106 { 107 Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, "RegExp")); 102 108 ASSERT(inherits(&s_info)); 103 109 … … 109 115 } 110 116 111 RegExpMatchesArray::RegExpMatchesArray(ExecState* exec , RegExpConstructorPrivate* data)117 RegExpMatchesArray::RegExpMatchesArray(ExecState* exec) 112 118 : JSArray(exec->globalData(), exec->lexicalGlobalObject()->regExpMatchesArrayStructure()) 113 119 { 114 finishCreation(exec->globalData(), data);115 120 } 116 121 -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h
r94599 r94627 91 91 92 92 protected: 93 void finishCreation(ExecState*, JSGlobalObject*, RegExpPrototype*); 93 94 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags; 94 95 -
trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
r94364 r94627 27 27 class RegExpMatchesArray : public JSArray { 28 28 private: 29 RegExpMatchesArray(ExecState* , RegExpConstructorPrivate*);29 RegExpMatchesArray(ExecState*); 30 30 31 31 public: … … 34 34 static RegExpMatchesArray* create(ExecState* exec, RegExpConstructorPrivate* ctorPrivate) 35 35 { 36 return new (allocateCell<RegExpMatchesArray>(*exec->heap())) RegExpMatchesArray(exec, ctorPrivate); 36 RegExpMatchesArray* regExp = new (allocateCell<RegExpMatchesArray>(*exec->heap())) RegExpMatchesArray(exec); 37 regExp->finishCreation(exec->globalData(), ctorPrivate); 38 return regExp; 37 39 } 38 40 virtual ~RegExpMatchesArray(); -
trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp
r94364 r94627 67 67 , d(adoptPtr(new RegExpObjectData(globalObject->globalData(), this, regExp))) 68 68 { 69 finishCreation(globalObject);70 69 } 71 70 -
trunk/Source/JavaScriptCore/runtime/RegExpObject.h
r94599 r94627 33 33 static RegExpObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp) 34 34 { 35 return new (allocateCell<RegExpObject>(*exec->heap())) RegExpObject(globalObject, structure, regExp); 35 RegExpObject* object = new (allocateCell<RegExpObject>(*exec->heap())) RegExpObject(globalObject, structure, regExp); 36 object->finishCreation(globalObject); 37 return object; 36 38 } 37 39 38 40 static RegExpObject* create(JSGlobalData& globalData, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp) 39 41 { 40 return new (allocateCell<RegExpObject>(globalData.heap)) RegExpObject(globalObject, structure, regExp); 42 RegExpObject* object = new (allocateCell<RegExpObject>(globalData.heap)) RegExpObject(globalObject, structure, regExp); 43 object->finishCreation(globalObject); 44 return object; 41 45 } 42 46 -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r91194 r94627 66 66 : RegExpObject(globalObject, structure, regExp) 67 67 { 68 finishCreation(globalObject); 68 69 } 69 70 -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r91194 r94627 49 49 50 50 StringConstructor::StringConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, StringPrototype* stringPrototype) 51 : InternalFunction( &exec->globalData(), globalObject, structure, Identifier(exec, stringPrototype->classInfo()->className))51 : InternalFunction(globalObject, structure) 52 52 { 53 finishCreation(exec, globalObject, stringPrototype); 54 } 55 56 void StringConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, StringPrototype* stringPrototype) 57 { 58 Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, stringPrototype->classInfo()->className)); 53 59 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, stringPrototype, ReadOnly | DontEnum | DontDelete); 54 60 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); -
trunk/Source/JavaScriptCore/runtime/StringConstructor.h
r94599 r94627 45 45 46 46 protected: 47 void finishCreation(ExecState*, JSGlobalObject*, StringPrototype*); 47 48 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; 48 49 -
trunk/Source/JavaScriptCore/runtime/StringObject.cpp
r94364 r94627 30 30 const ClassInfo StringObject::s_info = { "String", &JSWrapperObject::s_info, 0, 0 }; 31 31 32 StringObject::StringObject(JSGlobalData& globalData, Structure* structure , JSString* string)32 StringObject::StringObject(JSGlobalData& globalData, Structure* structure) 33 33 : JSWrapperObject(globalData, structure) 34 34 { 35 finishCreation(globalData, string);36 35 } 37 36 -
trunk/Source/JavaScriptCore/runtime/StringObject.h
r94599 r94627 34 34 { 35 35 JSString* string = jsEmptyString(exec); 36 return new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure, string); 36 StringObject* object = new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure); 37 object->finishCreation(exec->globalData(), string); 38 return object; 37 39 } 38 40 static StringObject* create(ExecState* exec, Structure* structure, const UString& str) 39 41 { 40 42 JSString* string = jsString(exec, str); 41 return new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure, string); 43 StringObject* object = new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure); 44 object->finishCreation(exec->globalData(), string); 45 return object; 42 46 } 43 47 static StringObject* create(ExecState*, JSGlobalObject*, JSString*); … … 63 67 void finishCreation(JSGlobalData&, JSString*); 64 68 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSWrapperObject::StructureFlags; 65 StringObject(JSGlobalData&, Structure* , JSString*);69 StringObject(JSGlobalData&, Structure*); 66 70 }; 67 71 -
trunk/Source/JavaScriptCore/runtime/StringObjectThatMasqueradesAsUndefined.h
r94599 r94627 42 42 private: 43 43 StringObjectThatMasqueradesAsUndefined(ExecState* exec, Structure* structure, JSString* string) 44 : StringObject(exec->globalData(), structure , string)44 : StringObject(exec->globalData(), structure) 45 45 { 46 finishCreation(exec->globalData(), string); 46 47 } 47 48 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r93624 r94627 132 132 133 133 // ECMA 15.5.4 134 StringPrototype::StringPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSString* string) 135 : StringObject(exec->globalData(), structure, string) 136 { 134 StringPrototype::StringPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSString* nameAndMessage) 135 : StringObject(exec->globalData(), structure) 136 { 137 finishCreation(exec, globalObject, nameAndMessage); 138 } 139 140 void StringPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, JSString* nameAndMessage) 141 { 142 Base::finishCreation(exec->globalData(), nameAndMessage); 137 143 ASSERT(inherits(&s_info)); 138 144 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.h
r94599 r94627 51 51 52 52 protected: 53 void finishCreation(ExecState*, JSGlobalObject*, JSString*); 53 54 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | StringObject::StructureFlags; 54 55 -
trunk/Source/JavaScriptGlue/ChangeLog
r94599 r94627 1 2011-09-06 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (5/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67420 5 6 Reviewed by Geoffrey Garen. 7 8 Completed the fifth 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 second 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 1 23 2011-09-05 Oliver Hunt <oliver@apple.com> 2 24 -
trunk/Source/JavaScriptGlue/JSRun.cpp
r93059 r94627 39 39 , m_userObjectStructure(globalData, userObjectStructure) 40 40 { 41 finishCreation(globalData, this); 41 42 } 42 43 -
trunk/Source/WebCore/ChangeLog
r94625 r94627 1 2011-09-06 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (5/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67420 5 6 Reviewed by Geoffrey Garen. 7 8 No new tests. 9 10 Completed the fifth 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 second 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 * bindings/js/JSDOMGlobalObject.cpp: 26 (WebCore::JSDOMGlobalObject::JSDOMGlobalObject): 27 (WebCore::JSDOMGlobalObject::finishCreation): 28 * bindings/js/JSDOMGlobalObject.h: 29 * bindings/js/JSDOMWindowShell.cpp: 30 * bindings/js/JSDOMWindowShell.h: 31 (WebCore::JSDOMWindowShell::create): 32 * bindings/js/JSDOMWrapper.h: 33 (WebCore::JSDOMWrapper::JSDOMWrapper): 34 * bindings/scripts/CodeGeneratorJS.pm: 35 (GenerateImplementation): 36 * bindings/scripts/test/JS/JSTestInterface.cpp: 37 (WebCore::JSTestInterface::JSTestInterface): 38 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: 39 (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener): 40 * bindings/scripts/test/JS/JSTestObj.cpp: 41 (WebCore::JSTestObj::JSTestObj): 42 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 43 (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface): 44 * bridge/c/CRuntimeObject.cpp: 45 (JSC::Bindings::CRuntimeObject::CRuntimeObject): 46 (JSC::Bindings::CRuntimeObject::finishCreation): 47 * bridge/c/CRuntimeObject.h: 48 * bridge/jni/jsc/JavaRuntimeObject.cpp: 49 (JSC::Bindings::JavaRuntimeObject::JavaRuntimeObject): 50 (JSC::Bindings::JavaRuntimeObject::finishCreation): 51 * bridge/jni/jsc/JavaRuntimeObject.h: 52 * bridge/objc/ObjCRuntimeObject.h: 53 * bridge/objc/ObjCRuntimeObject.mm: 54 (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject): 55 (JSC::Bindings::ObjCRuntimeObject::finishCreation): 56 * bridge/objc/objc_runtime.h: 57 (JSC::Bindings::ObjcFallbackObjectImp::create): 58 * bridge/objc/objc_runtime.mm: 59 (JSC::Bindings::ObjcFallbackObjectImp::ObjcFallbackObjectImp): 60 * bridge/qt/qt_instance.cpp: 61 (JSC::Bindings::QtRuntimeObject::QtRuntimeObject): 62 * bridge/qt/qt_pixmapruntime.cpp: 63 (JSC::Bindings::QtPixmapRuntimeObject::QtPixmapRuntimeObject): 64 * bridge/qt/qt_runtime.cpp: 65 (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod): 66 (JSC::Bindings::QtRuntimeMethod::finishCreation): 67 * bridge/qt/qt_runtime.h: 68 * bridge/runtime_array.cpp: 69 (JSC::RuntimeArray::RuntimeArray): 70 * bridge/runtime_array.h: 71 (JSC::RuntimeArray::create): 72 * bridge/runtime_method.cpp: 73 (JSC::RuntimeMethod::RuntimeMethod): 74 (JSC::RuntimeMethod::finishCreation): 75 * bridge/runtime_method.h: 76 * bridge/runtime_object.cpp: 77 (JSC::Bindings::RuntimeObject::RuntimeObject): 78 * bridge/runtime_object.h: 79 (JSC::Bindings::RuntimeObject::create): 80 1 81 2011-09-06 Luke Macpherson <macpherson@chromium.org> 2 82 -
trunk/Source/WebCore/WebCore.exp.in
r94613 r94627 1647 1647 __ZN3JSC8Bindings13RuntimeObject11getCallDataERNS_8CallDataE 1648 1648 __ZN3JSC8Bindings13RuntimeObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE 1649 __ZN3JSC8Bindings13RuntimeObject14finishCreationEPNS_14JSGlobalObjectE 1649 1650 __ZN3JSC8Bindings13RuntimeObject16getConstructDataERNS_13ConstructDataE 1650 1651 __ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r94599 r94627 56 56 : JSDOMWrapper(structure, globalObject) 57 57 { 58 finishCreation(globalObject->globalData(), globalObject); 58 59 } 59 60 }; -
trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
r86499 r94627 44 44 45 45 JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWrapperWorld> world, JSObject* thisValue) 46 : JSGlobalObject(globalData, structure , thisValue)46 : JSGlobalObject(globalData, structure) 47 47 , m_currentEvent(0) 48 48 , m_world(world) 49 49 { 50 finishCreation(globalData, thisValue); 51 } 52 53 void JSDOMGlobalObject::finishCreation(JSGlobalData& globalData, JSObject* thisValue) 54 { 55 Base::finishCreation(globalData, thisValue); 50 56 ASSERT(inherits(&s_info)); 51 57 } -
trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.h
r94599 r94627 48 48 49 49 JSDOMGlobalObject(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWrapperWorld>, JSC::JSObject* thisValue); 50 void finishCreation(JSC::JSGlobalData&, JSC::JSObject* thisValue); 50 51 51 52 public: -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
r94599 r94627 182 182 } 183 183 184 JSDOMWindowShell* JSDOMWindowShell::create(PassRefPtr<DOMWindow> window, JSC::Structure* structure, DOMWrapperWorld* world)185 {186 JSDOMWindowShell* shell = new JSDOMWindowShell(structure, world);187 shell->finishCreation(*world->globalData(), window);188 return shell;189 }190 191 184 // ---- 192 185 // Conversion methods -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h
r94599 r94627 56 56 DOMWindow* impl() const; 57 57 58 static JSDOMWindowShell* create(PassRefPtr<DOMWindow>, JSC::Structure*, DOMWrapperWorld*); 58 static JSDOMWindowShell* create(PassRefPtr<DOMWindow> window, JSC::Structure* structure, DOMWrapperWorld* world) 59 { 60 JSDOMWindowShell* shell = new JSDOMWindowShell(structure, world); 61 shell->finishCreation(*world->globalData(), window); 62 return shell; 63 } 59 64 60 65 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) -
trunk/Source/WebCore/bindings/js/JSDOMWrapper.h
r94599 r94627 60 60 // needing to reach through the frame to get to the Document*. See bug 27640. 61 61 // ASSERT(globalObject->scriptExecutionContext()); 62 finishCreation(globalObject->globalData(), globalObject);63 62 } 64 63 }; -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r94599 r94627 1515 1515 push(@implContent, "${className}::$className(JSGlobalData& globalData, Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* shell)\n"); 1516 1516 push(@implContent, " : $parentClassName(globalData, structure, impl, shell)\n"); 1517 push(@implContent, "{\n"); 1517 1518 } elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) { 1518 1519 AddIncludesForTypeInImpl($interfaceName); 1519 1520 push(@implContent, "${className}::$className(JSGlobalData& globalData, Structure* structure, PassRefPtr<$implType> impl)\n"); 1520 1521 push(@implContent, " : $parentClassName(globalData, structure, impl)\n"); 1522 push(@implContent, "{\n"); 1521 1523 } else { 1522 1524 push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n"); 1523 1525 if ($hasParent) { 1524 1526 push(@implContent, " : $parentClassName(structure, globalObject, impl)\n"); 1527 push(@implContent, "{\n"); 1525 1528 } else { 1526 1529 push(@implContent, " : $parentClassName(structure, globalObject)\n"); 1527 1530 push(@implContent, " , m_impl(impl)\n"); 1528 } 1529 } 1530 push(@implContent, "{\n"); 1531 push(@implContent, "{\n"); 1532 push(@implContent, " finishCreation(globalObject->globalData(), globalObject);\n"); 1533 } 1534 } 1531 1535 push(@implContent, " ASSERT(inherits(&s_info));\n"); 1532 1536 if ($numCachedAttributes > 0) { -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r94617 r94627 147 147 , m_impl(impl) 148 148 { 149 finishCreation(globalObject->globalData(), globalObject); 149 150 ASSERT(inherits(&s_info)); 150 151 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
r94617 r94627 143 143 , m_impl(impl) 144 144 { 145 finishCreation(globalObject->globalData(), globalObject); 145 146 ASSERT(inherits(&s_info)); 146 147 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r94617 r94627 298 298 , m_impl(impl) 299 299 { 300 finishCreation(globalObject->globalData(), globalObject); 300 301 ASSERT(inherits(&s_info)); 301 302 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r94617 r94627 133 133 , m_impl(impl) 134 134 { 135 finishCreation(globalObject->globalData(), globalObject); 135 136 ASSERT(inherits(&s_info)); 136 137 } -
trunk/Source/WebCore/bridge/c/CRuntimeObject.cpp
r93059 r94627 41 41 : RuntimeObject(exec, globalObject, structure, instance) 42 42 { 43 finishCreation(globalObject); 44 } 45 46 void CRuntimeObject::finishCreation(JSGlobalObject* globalObject) 47 { 48 Base::finishCreation(globalObject); 43 49 ASSERT(inherits(&s_info)); 44 50 } -
trunk/Source/WebCore/bridge/c/CRuntimeObject.h
r94599 r94627 62 62 private: 63 63 CRuntimeObject(ExecState*, JSGlobalObject*, Structure*, PassRefPtr<CInstance>); 64 void finishCreation(JSGlobalObject*); 64 65 }; 65 66 -
trunk/Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.cpp
r93059 r94627 39 39 : RuntimeObject(exec, globalObject, structure, instance) 40 40 { 41 finishCreation(globalObject); 42 } 43 44 void JavaRuntimeObject::finishCreation(JSGlobalObject* globalObject) 45 { 46 Base::finishCreation(globalObject); 41 47 ASSERT(inherits(&s_info)); 42 48 } -
trunk/Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.h
r94599 r94627 60 60 private: 61 61 JavaRuntimeObject(ExecState*, JSGlobalObject*, Structure*, PassRefPtr<JavaInstance>); 62 void finishCreation(JSGlobalObject*); 62 63 }; 63 64 -
trunk/Source/WebCore/bridge/objc/ObjCRuntimeObject.h
r94599 r94627 59 59 private: 60 60 ObjCRuntimeObject(ExecState*, JSGlobalObject*, PassRefPtr<ObjcInstance>, Structure*); 61 void finishCreation(JSGlobalObject*); 61 62 }; 62 63 -
trunk/Source/WebCore/bridge/objc/ObjCRuntimeObject.mm
r93378 r94627 39 39 : RuntimeObject(exec, globalObject, structure, instance) 40 40 { 41 finishCreation(globalObject); 42 } 43 44 void ObjCRuntimeObject::finishCreation(JSGlobalObject* globalObject) 45 { 46 Base::finishCreation(globalObject); 41 47 ASSERT(inherits(&s_info)); 42 48 } -
trunk/Source/WebCore/bridge/objc/objc_runtime.h
r94599 r94627 100 100 // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object 101 101 Structure* domStructure = WebCore::deprecatedGetDOMStructure<ObjcFallbackObjectImp>(exec); 102 return new (allocateCell<ObjcFallbackObjectImp>(*exec->heap())) ObjcFallbackObjectImp(globalObject, domStructure, instance, propertyName); 102 ObjcFallbackObjectImp* fallbackObject = new (allocateCell<ObjcFallbackObjectImp>(*exec->heap())) ObjcFallbackObjectImp(globalObject, domStructure, instance, propertyName); 103 fallbackObject->finishCreation(globalObject); 104 return fallbackObject; 103 105 } 104 106 -
trunk/Source/WebCore/bridge/objc/objc_runtime.mm
r94364 r94627 202 202 , _item(propertyName) 203 203 { 204 finishCreation(globalObject);205 204 } 206 205 -
trunk/Source/WebCore/bridge/qt/qt_instance.cpp
r94620 r94627 86 86 : RuntimeObject(exec, globalObject, structure, instance) 87 87 { 88 finishCreation(globalObject); 88 89 } 89 90 -
trunk/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
r94599 r94627 225 225 : RuntimeObject(exec, globalObject, structure, instance) 226 226 { 227 finishCreation(globalObject); 227 228 } 228 229 -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r94599 r94627 1007 1007 const ClassInfo QtRuntimeMethod::s_info = { "QtRuntimeMethod", &InternalFunction::s_info, 0, 0 }; 1008 1008 1009 QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, Structure* structure, const Identifier& ident , PassRefPtr<QtInstance> inst)1010 : InternalFunction( &exec->globalData(), exec->lexicalGlobalObject(), structure, ident)1009 QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, Structure* structure, const Identifier& identifier, PassRefPtr<QtInstance> instance) 1010 : InternalFunction(exec->lexicalGlobalObject(), structure) 1011 1011 , d_ptr(dd) 1012 1012 { 1013 finishCreation(exec, identifier, instance); 1014 } 1015 1016 void QtRuntimeMethod::finishCreation(ExecState* exec, const Identifier& identifier, PassRefPtr<QtInstance> instance) 1017 { 1018 Base::finishCreation(exec->globalData(), exec->lexicalGlobalObject(), identifier); 1013 1019 QW_D(QtRuntimeMethod); 1014 d->m_instance = inst ;1020 d->m_instance = instance; 1015 1021 d->m_finalizer.set(exec->globalData(), this, d); 1016 1022 } -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r94620 r94627 145 145 146 146 protected: 147 void finishCreation(ExecState*, const Identifier&, PassRefPtr<QtInstance>); 147 148 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | InternalFunction::StructureFlags | OverridesVisitChildren; 148 149 -
trunk/Source/WebCore/bridge/runtime_array.cpp
r94364 r94627 38 38 const ClassInfo RuntimeArray::s_info = { "RuntimeArray", &JSArray::s_info, 0, 0 }; 39 39 40 RuntimeArray::RuntimeArray(ExecState* exec, Structure* structure , Bindings::Array* array)40 RuntimeArray::RuntimeArray(ExecState* exec, Structure* structure) 41 41 : JSArray(exec->globalData(), structure) 42 42 { 43 finishCreation(exec->globalData(), array);44 43 } 45 44 -
trunk/Source/WebCore/bridge/runtime_array.h
r94599 r94627 42 42 // We need to pass in the right global object for "array". 43 43 Structure* domStructure = WebCore::deprecatedGetDOMStructure<RuntimeArray>(exec); 44 return new (allocateCell<RuntimeArray>(*exec->heap())) RuntimeArray(exec, domStructure, array); 44 RuntimeArray* runtimeArray = new (allocateCell<RuntimeArray>(*exec->heap())) RuntimeArray(exec, domStructure); 45 runtimeArray->finishCreation(exec->globalData(), array); 46 return runtimeArray; 45 47 } 46 48 … … 80 82 81 83 private: 82 RuntimeArray(ExecState*, Structure* , Bindings::Array*);84 RuntimeArray(ExecState*, Structure*); 83 85 static JSValue lengthGetter(ExecState*, JSValue, const Identifier&); 84 86 static JSValue indexGetter(ExecState*, JSValue, unsigned); -
trunk/Source/WebCore/bridge/runtime_method.cpp
r84827 r94627 46 46 RuntimeMethod::RuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& ident, Bindings::MethodList& m) 47 47 // Callers will need to pass in the right global object corresponding to this native object "m". 48 : InternalFunction( &exec->globalData(), globalObject, structure, ident)48 : InternalFunction(globalObject, structure) 49 49 , _methodList(adoptPtr(new MethodList(m))) 50 50 { 51 finishCreation(exec->globalData(), globalObject, ident); 52 } 53 54 void RuntimeMethod::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject, const Identifier& ident) 55 { 56 Base::finishCreation(globalData, globalObject, ident); 51 57 ASSERT(inherits(&s_info)); 52 58 } -
trunk/Source/WebCore/bridge/runtime_method.h
r94599 r94627 59 59 protected: 60 60 RuntimeMethod(ExecState*, JSGlobalObject*, Structure*, const Identifier& name, Bindings::MethodList&); 61 void finishCreation(JSGlobalData&, JSGlobalObject*, const Identifier&); 61 62 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; 62 63 -
trunk/Source/WebCore/bridge/runtime_object.cpp
r94364 r94627 42 42 , m_instance(instance) 43 43 { 44 finishCreation(globalObject);45 44 } 46 45 -
trunk/Source/WebCore/bridge/runtime_object.h
r94599 r94627 40 40 static RuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance) 41 41 { 42 return new (allocateCell<RuntimeObject>(*exec->heap())) RuntimeObject(exec, globalObject, structure, instance); 42 RuntimeObject* object = new (allocateCell<RuntimeObject>(*exec->heap())) RuntimeObject(exec, globalObject, structure, instance); 43 object->finishCreation(globalObject); 44 return object; 43 45 } 44 46 -
trunk/Source/WebKit/mac/ChangeLog
r94613 r94627 1 2011-09-06 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (5/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67420 5 6 Reviewed by Geoffrey Garen. 7 8 Completed the fifth 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 second 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/ProxyRuntimeObject.h: 21 * Plugins/Hosted/ProxyRuntimeObject.mm: 22 (WebKit::ProxyRuntimeObject::ProxyRuntimeObject): 23 (WebKit::ProxyRuntimeObject::finishCreation): 24 1 25 2011-09-06 Ryosuke Niwa <rniwa@webkit.org> 2 26 -
trunk/Source/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h
r94599 r94627 60 60 private: 61 61 ProxyRuntimeObject(JSC::ExecState*, JSC::JSGlobalObject*, JSC::Structure*, PassRefPtr<ProxyInstance>); 62 void finishCreation(JSC::JSGlobalObject*); 62 63 }; 63 64 -
trunk/Source/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm
r93688 r94627 40 40 : RuntimeObject(exec, globalObject, structure, instance) 41 41 { 42 finishCreation(globalObject); 43 } 44 45 void ProxyRuntimeObject::finishCreation(JSGlobalObject* globalObject) 46 { 47 Base::finishCreation(globalObject); 42 48 ASSERT(inherits(&s_info)); 43 49 } -
trunk/Source/WebKit2/ChangeLog
r94613 r94627 1 2011-09-06 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (5/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67420 5 6 Reviewed by Geoffrey Garen. 7 8 Completed the fifth 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 second 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 (WebKit::JSNPMethod::finishCreation): 23 * WebProcess/Plugins/Netscape/JSNPMethod.h: 24 (WebKit::JSNPMethod::create): 25 * WebProcess/Plugins/Netscape/JSNPObject.cpp: 26 (WebKit::JSNPObject::JSNPObject): 27 * WebProcess/Plugins/Netscape/JSNPObject.h: 28 (WebKit::JSNPObject::create): 29 1 30 2011-09-06 Ryosuke Niwa <rniwa@webkit.org> 2 31 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp
r94599 r94627 31 31 #include <JavaScriptCore/FunctionPrototype.h> 32 32 #include <JavaScriptCore/JSGlobalObject.h> 33 #include <JavaScriptCore/JSObject.h> 33 34 #include <WebCore/JSHTMLElement.h> 34 35 #include <WebCore/JSPluginElementFunctions.h> … … 42 43 const ClassInfo JSNPMethod::s_info = { "NPMethod", &InternalFunction::s_info, 0, 0 }; 43 44 44 JSNPMethod::JSNPMethod(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, NPIdentifier npIdentifier, Structure* structure) 45 : InternalFunction(&exec->globalData(), globalObject, structure, name) 46 , m_npIdentifier(npIdentifier) 45 JSNPMethod::JSNPMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, NPIdentifier npIdentifier) 46 : InternalFunction(globalObject, structure) 47 47 { 48 ASSERT(inherits(&s_info));48 finishCreation(exec->globalData(), globalObject, name); 49 49 } 50 50 51 JSNPMethod* JSNPMethod::create(ExecState* exec, JSGlobalObject* globalObject, const Identifier& ident, NPIdentifier npIdent)51 void JSNPMethod::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject, const Identifier& name) 52 52 { 53 JSC::Structure* structure = createStructure(exec->globalData(), globalObject, globalObject->functionPrototype());54 return new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(exec, globalObject, ident, npIdent, structure);53 Base::finishCreation(globalData, globalObject, name); 54 ASSERT(inherits(&s_info)); 55 55 } 56 56 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h
r94599 r94627 27 27 #define JSNPMethod_h 28 28 29 #include <JavaScriptCore/FunctionPrototype.h> 29 30 #include <JavaScriptCore/InternalFunction.h> 30 31 … … 38 39 typedef JSC::InternalFunction Base; 39 40 40 static JSNPMethod* create(JSC::ExecState*, JSC::JSGlobalObject*, const JSC::Identifier&, NPIdentifier); 41 static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::Identifier& ident, NPIdentifier npIdent) 42 { 43 JSC::Structure* structure = createStructure(exec->globalData(), globalObject, globalObject->functionPrototype()); 44 return new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(exec, globalObject, structure, ident, npIdent); 45 } 41 46 42 47 static const JSC::ClassInfo s_info; … … 44 49 NPIdentifier npIdentifier() const { return m_npIdentifier; } 45 50 51 protected: 52 void finishCreation(JSC::JSGlobalData&, JSC::JSGlobalObject*, const JSC::Identifier& name); 53 46 54 private: 47 JSNPMethod(JSC::ExecState*, JSC::JSGlobalObject*, const JSC::Identifier&, NPIdentifier, JSC::Structure*);55 JSNPMethod(JSC::ExecState*, JSC::JSGlobalObject*, JSC::Structure*, const JSC::Identifier&, NPIdentifier); 48 56 49 57 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
r94599 r94627 51 51 const ClassInfo JSNPObject::s_info = { "NPObject", &JSObjectWithGlobalObject::s_info, 0, 0 }; 52 52 53 JSNPObject::JSNPObject(JSGlobalObject* globalObject, NPRuntimeObjectMap* objectMap, NPObject* npObject, Structure* structure)53 JSNPObject::JSNPObject(JSGlobalObject* globalObject, Structure* structure, NPRuntimeObjectMap* objectMap, NPObject* npObject) 54 54 : JSObjectWithGlobalObject(globalObject, structure) 55 55 , m_objectMap(objectMap) 56 56 , m_npObject(npObject) 57 57 { 58 finishCreation(globalObject);59 58 } 60 59 … … 68 67 69 68 retainNPObject(m_npObject); 70 }71 72 JSNPObject* JSNPObject::create(JSC::JSGlobalObject* globalObject, NPRuntimeObjectMap* objectMap, NPObject* npObject)73 {74 Structure* structure = createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype());75 return new (JSC::allocateCell<JSNPObject>(globalObject->globalData().heap)) JSNPObject(globalObject, objectMap, npObject, structure);76 69 } 77 70 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h
r94599 r94627 28 28 29 29 #include <JavaScriptCore/JSObjectWithGlobalObject.h> 30 #include <JavaScriptCore/ObjectPrototype.h> 30 31 31 32 typedef void* NPIdentifier; … … 42 43 typedef JSC::JSObjectWithGlobalObject Base; 43 44 44 static JSNPObject* create(JSC::JSGlobalObject*, NPRuntimeObjectMap*, NPObject*); 45 static JSNPObject* create(JSC::JSGlobalObject* globalObject, NPRuntimeObjectMap* objectMap, NPObject* npObject) 46 { 47 JSC::Structure* structure = createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()); 48 JSNPObject* object = new (JSC::allocateCell<JSNPObject>(globalObject->globalData().heap)) JSNPObject(globalObject, structure, objectMap, npObject); 49 object->finishCreation(globalObject); 50 return object; 51 } 52 45 53 ~JSNPObject(); 46 54 … … 62 70 63 71 private: 64 JSNPObject(JSC::JSGlobalObject*, NPRuntimeObjectMap*, NPObject*, JSC::Structure*);72 JSNPObject(JSC::JSGlobalObject*, JSC::Structure*, NPRuntimeObjectMap*, NPObject*); 65 73 66 74 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | JSObject::StructureFlags;
Note: See TracChangeset
for help on using the changeset viewer.