Changeset 94035 in webkit
- Timestamp:
- Aug 29, 2011, 6:43:46 PM (15 years ago)
- Location:
- trunk/Source
- Files:
-
- 27 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/debugger/DebuggerActivation.cpp (modified) (1 diff)
-
JavaScriptCore/debugger/DebuggerActivation.h (modified) (3 diffs)
-
JavaScriptCore/runtime/Arguments.h (modified) (4 diffs)
-
JavaScriptCore/runtime/ErrorInstance.cpp (modified) (2 diffs)
-
JavaScriptCore/runtime/ErrorInstance.h (modified) (1 diff)
-
JavaScriptCore/runtime/ExceptionHelpers.cpp (modified) (2 diffs)
-
JavaScriptCore/runtime/Executable.cpp (modified) (3 diffs)
-
JavaScriptCore/runtime/Executable.h (modified) (6 diffs)
-
JavaScriptCore/runtime/JSArray.cpp (modified) (3 diffs)
-
JavaScriptCore/runtime/JSArray.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSByteArray.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/JSByteArray.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSNotAnObject.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSObject.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSObjectWithGlobalObject.cpp (modified) (2 diffs)
-
JavaScriptCore/runtime/JSObjectWithGlobalObject.h (modified) (2 diffs)
-
JavaScriptCore/runtime/JSVariableObject.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSWrapperObject.h (modified) (1 diff)
-
JavaScriptCore/runtime/ObjectPrototype.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/ObjectPrototype.h (modified) (1 diff)
-
JavaScriptCore/runtime/StrictEvalActivation.cpp (modified) (1 diff)
-
JavaScriptGlue/ChangeLog (modified) (1 diff)
-
JavaScriptGlue/UserObjectImp.cpp (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/bindings/js/JSDOMWindowShell.cpp (modified) (1 diff)
-
WebCore/bindings/js/JSDOMWindowShell.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r93991 r94035 1 2011-08-29 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (3/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67064 5 6 Reviewed by Darin Adler. 7 8 Completed the third 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 * debugger/DebuggerActivation.cpp: 21 (JSC::DebuggerActivation::DebuggerActivation): 22 (JSC::DebuggerActivation::finishCreation): 23 * debugger/DebuggerActivation.h: 24 (JSC::DebuggerActivation::create): 25 * runtime/Arguments.h: 26 (JSC::Arguments::create): 27 (JSC::Arguments::createNoParameters): 28 (JSC::Arguments::Arguments): 29 (JSC::Arguments::finishCreation): 30 * runtime/ErrorInstance.cpp: 31 (JSC::ErrorInstance::ErrorInstance): 32 * runtime/ErrorInstance.h: 33 (JSC::ErrorInstance::finishCreation): 34 * runtime/ExceptionHelpers.cpp: 35 (JSC::InterruptedExecutionError::InterruptedExecutionError): 36 (JSC::TerminatedExecutionError::TerminatedExecutionError): 37 * runtime/Executable.cpp: 38 (JSC::EvalExecutable::EvalExecutable): 39 (JSC::ProgramExecutable::ProgramExecutable): 40 (JSC::FunctionExecutable::FunctionExecutable): 41 Moved the assignment of m_firstLine and m_lastLine into the 42 FunctionExecutable::finishCreation() method in Executable.h 43 * runtime/Executable.h: 44 (JSC::ScriptExecutable::ScriptExecutable): 45 (JSC::EvalExecutable::create): 46 (JSC::ProgramExecutable::create): 47 (JSC::FunctionExecutable::create): 48 (JSC::FunctionExecutable::finishCreation): 49 * runtime/JSArray.cpp: 50 (JSC::JSArray::JSArray): 51 (JSC::JSArray::finishCreation): 52 * runtime/JSArray.h: 53 * runtime/JSByteArray.cpp: 54 (JSC::JSByteArray::JSByteArray): 55 * runtime/JSByteArray.h: 56 (JSC::JSByteArray::finishCreation): 57 * runtime/JSNotAnObject.h: 58 (JSC::JSNotAnObject::JSNotAnObject): 59 * runtime/JSObject.h: 60 (JSC::JSNonFinalObject::JSNonFinalObject): 61 * runtime/JSObjectWithGlobalObject.cpp: 62 (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject): 63 (JSC::JSObjectWithGlobalObject::finishCreation): 64 * runtime/JSObjectWithGlobalObject.h: 65 * runtime/JSVariableObject.h: 66 (JSC::JSVariableObject::JSVariableObject): 67 (JSC::JSVariableObject::finishCreation): 68 * runtime/JSWrapperObject.h: 69 (JSC::JSWrapperObject::JSWrapperObject): 70 * runtime/ObjectPrototype.cpp: 71 (JSC::ObjectPrototype::ObjectPrototype): 72 (JSC::ObjectPrototype::finishCreation): 73 * runtime/ObjectPrototype.h: 74 * runtime/StrictEvalActivation.cpp: 75 (JSC::StrictEvalActivation::StrictEvalActivation): 76 1 77 2011-08-29 Andreas Kling <kling@webkit.org> 2 78 -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
r86785 r94035 34 34 : JSNonFinalObject(globalData, globalData.debuggerActivationStructure.get()) 35 35 { 36 finishCreation(globalData, activation); 37 } 38 39 void DebuggerActivation::finishCreation(JSGlobalData& globalData, JSObject* activation) 40 { 41 Base::finishCreation(globalData); 36 42 ASSERT(activation); 37 43 ASSERT(activation->isActivationObject()); -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h
r92706 r94035 31 31 namespace JSC { 32 32 33 class JSActivation;34 35 33 class DebuggerActivation : public JSNonFinalObject { 36 34 public: … … 39 37 static DebuggerActivation* create(JSGlobalData& globalData, JSObject* object) 40 38 { 41 return new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData, object); 39 DebuggerActivation* activation = new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData, object); 40 return activation; 42 41 } 43 42 … … 63 62 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | JSObject::StructureFlags; 64 63 64 void finishCreation(JSGlobalData&, JSObject* activation); 65 65 66 private: 66 67 DebuggerActivation(JSGlobalData&, JSObject*); -
trunk/Source/JavaScriptCore/runtime/Arguments.h
r92706 r94035 64 64 static Arguments* create(JSGlobalData& globalData, CallFrame* callFrame) 65 65 { 66 return new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame); 66 Arguments* arguments = new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame); 67 return arguments; 67 68 } 68 69 69 70 static Arguments* createNoParameters(JSGlobalData& globalData, CallFrame* callFrame) 70 71 { 71 return new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame, NoParameters); 72 Arguments* arguments = new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame, NoParameters); 73 return arguments; 72 74 } 73 75 … … 115 117 protected: 116 118 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags; 119 120 void finishCreation(CallFrame*); 121 void finishCreation(CallFrame*, NoParametersType); 117 122 118 123 private: … … 162 167 , d(adoptPtr(new ArgumentsData)) 163 168 { 169 finishCreation(callFrame); 170 } 171 172 inline Arguments::Arguments(CallFrame* callFrame, NoParametersType) 173 : JSNonFinalObject(callFrame->globalData(), callFrame->lexicalGlobalObject()->argumentsStructure()) 174 , d(adoptPtr(new ArgumentsData)) 175 { 176 finishCreation(callFrame, NoParameters); 177 } 178 179 inline void Arguments::finishCreation(CallFrame* callFrame) 180 { 181 Base::finishCreation(callFrame->globalData()); 164 182 ASSERT(inherits(&s_info)); 165 183 … … 200 218 } 201 219 202 inline Arguments::Arguments(CallFrame* callFrame, NoParametersType) 203 : JSNonFinalObject(callFrame->globalData(), callFrame->lexicalGlobalObject()->argumentsStructure()) 204 , d(adoptPtr(new ArgumentsData)) 205 { 220 inline void Arguments::finishCreation(CallFrame* callFrame, NoParametersType) 221 { 222 Base::finishCreation(callFrame->globalData()); 206 223 ASSERT(inherits(&s_info)); 207 224 ASSERT(!asFunction(callFrame->callee())->jsExecutable()->parameterCount()); -
trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp
r93710 r94035 30 30 , m_appendSourceToMessage(false) 31 31 { 32 constructorBody(globalData);32 finishCreation(globalData, UString("", 0)); 33 33 } 34 34 … … 37 37 , m_appendSourceToMessage(false) 38 38 { 39 ASSERT(inherits(&s_info)); 40 putDirect(globalData, globalData.propertyNames->message, jsString(&globalData, message), DontEnum); 39 finishCreation(globalData, message); 41 40 } 42 41 -
trunk/Source/JavaScriptCore/runtime/ErrorInstance.h
r93378 r94035 51 51 explicit ErrorInstance(JSGlobalData&, Structure*, const UString&); 52 52 53 void constructorBody(JSGlobalData& globalData)53 void finishCreation(JSGlobalData& globalData, const UString& message) 54 54 { 55 Base::finishCreation(globalData); 55 56 ASSERT(inherits(&s_info)); 56 putDirect(globalData, globalData.propertyNames->message, jsString(&globalData, ""), DontEnum);57 putDirect(globalData, globalData.propertyNames->message, jsString(&globalData, message), DontEnum); 57 58 } 58 59 -
trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
r92706 r94035 47 47 : JSNonFinalObject(globalData, globalData.interruptedExecutionErrorStructure.get()) 48 48 { 49 finishCreation(globalData); 49 50 } 50 51 … … 72 73 : JSNonFinalObject(globalData, globalData.terminatedExecutionErrorStructure.get()) 73 74 { 75 finishCreation(globalData); 74 76 } 75 77 -
trunk/Source/JavaScriptCore/runtime/Executable.cpp
r93947 r94035 128 128 : ScriptExecutable(exec->globalData().evalExecutableStructure.get(), exec, source, inStrictContext) 129 129 { 130 finishCreation(exec->globalData()); 130 131 } 131 132 … … 139 140 : ScriptExecutable(exec->globalData().programExecutableStructure.get(), exec, source, false) 140 141 { 142 finishCreation(exec->globalData()); 141 143 } 142 144 … … 166 168 , m_symbolTable(0) 167 169 { 168 m_firstLine = firstLine;169 m_lastLine = lastLine;170 170 finishCreation(exec->globalData(), name, firstLine, lastLine); 171 171 } -
trunk/Source/JavaScriptCore/runtime/Executable.h
r93947 r94035 244 244 , m_features(isInStrictContext ? StrictModeFeature : 0) 245 245 { 246 finishCreation(globalData);247 246 } 248 247 … … 252 251 , m_features(isInStrictContext ? StrictModeFeature : 0) 253 252 { 254 finishCreation(exec->globalData());255 253 } 256 254 … … 319 317 static EvalExecutable* create(ExecState* exec, const SourceCode& source, bool isInStrictContext) 320 318 { 321 return new (allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext); 319 EvalExecutable* executable = new (allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext); 320 return executable; 322 321 } 323 322 … … 355 354 static ProgramExecutable* create(ExecState* exec, const SourceCode& source) 356 355 { 357 return new (allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source); 356 ProgramExecutable* executable = new (allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source); 357 return executable; 358 358 } 359 359 … … 413 413 static FunctionExecutable* create(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine) 414 414 { 415 return new (allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine); 415 FunctionExecutable* executable = new (allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine); 416 return executable; 416 417 } 417 418 418 419 static FunctionExecutable* create(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine) 419 420 { 420 return new (allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine); 421 FunctionExecutable* executable = new (allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine); 422 return executable; 421 423 } 422 424 … … 531 533 void finishCreation(JSGlobalData& globalData, const Identifier& name, int firstLine, int lastLine) 532 534 { 535 Base::finishCreation(globalData); 533 536 m_firstLine = firstLine; 534 537 m_lastLine = lastLine; -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r90282 r94035 135 135 : JSNonFinalObject(globalData, structure) 136 136 { 137 finishCreation(globalData); 138 } 139 140 JSArray::JSArray(JSGlobalData& globalData, Structure* structure, unsigned initialLength, ArrayCreationMode creationMode) 141 : JSNonFinalObject(globalData, structure) 142 { 143 finishCreation(globalData, initialLength, creationMode); 144 } 145 146 JSArray::JSArray(JSGlobalData& globalData, Structure* structure, const ArgList& list) 147 : JSNonFinalObject(globalData, structure) 148 { 149 finishCreation(globalData, list); 150 } 151 152 void JSArray::finishCreation(JSGlobalData& globalData) 153 { 154 Base::finishCreation(globalData); 137 155 ASSERT(inherits(&s_info)); 138 156 … … 149 167 } 150 168 151 JSArray::JSArray(JSGlobalData& globalData, Structure* structure, unsigned initialLength, ArrayCreationMode creationMode)152 : JSNonFinalObject(globalData, structure) 153 { 169 void JSArray::finishCreation(JSGlobalData& globalData, unsigned initialLength, ArrayCreationMode creationMode) 170 { 171 Base::finishCreation(globalData); 154 172 ASSERT(inherits(&s_info)); 155 173 … … 191 209 } 192 210 193 JSArray::JSArray(JSGlobalData& globalData, Structure* structure, const ArgList& list)194 : JSNonFinalObject(globalData, structure) 195 { 211 void JSArray::finishCreation(JSGlobalData& globalData, const ArgList& list) 212 { 213 Base::finishCreation(globalData); 196 214 ASSERT(inherits(&s_info)); 197 215 -
trunk/Source/JavaScriptCore/runtime/JSArray.h
r92706 r94035 65 65 JSArray(JSGlobalData&, Structure*, unsigned initialLength, ArrayCreationMode); 66 66 JSArray(JSGlobalData&, Structure*, const ArgList& initialValues); 67 67 68 void finishCreation(JSGlobalData&); 69 void finishCreation(JSGlobalData&, unsigned initialLength, ArrayCreationMode); 70 void finishCreation(JSGlobalData&, const ArgList&); 71 68 72 public: 69 73 typedef JSNonFinalObject Base; -
trunk/Source/JavaScriptCore/runtime/JSByteArray.cpp
r93378 r94035 40 40 , m_storage(storage) 41 41 { 42 constructorBody(exec);42 finishCreation(exec); 43 43 } 44 44 -
trunk/Source/JavaScriptCore/runtime/JSByteArray.h
r93378 r94035 105 105 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags; 106 106 107 void constructorBody(ExecState* exec)107 void finishCreation(ExecState* exec) 108 108 { 109 Base::finishCreation(exec->globalData()); 109 110 putDirect(exec->globalData(), exec->globalData().propertyNames->length, jsNumber(m_storage->length()), ReadOnly | DontDelete); 110 111 } -
trunk/Source/JavaScriptCore/runtime/JSNotAnObject.h
r92706 r94035 42 42 : JSNonFinalObject(exec->globalData(), exec->globalData().notAnObjectStructure.get()) 43 43 { 44 finishCreation(exec->globalData()); 44 45 } 45 46 -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r93920 r94035 362 362 : JSObject(globalData, structure, m_inlineStorage) 363 363 { 364 finishCreation(globalData);365 364 } 366 365 -
trunk/Source/JavaScriptCore/runtime/JSObjectWithGlobalObject.cpp
r84052 r94035 34 34 : JSNonFinalObject(globalObject->globalData(), structure) 35 35 { 36 COMPILE_ASSERT(AnonymousSlotCount == 1, AnonymousSlotCount_must_be_one); 37 ASSERT(!globalObject || globalObject->isGlobalObject()); 38 if (!globalObject) 39 clearAnonymousValue(GlobalObjectSlot); 40 else 41 putAnonymousValue(globalObject->globalData(), GlobalObjectSlot, globalObject); 36 finishCreation(globalObject->globalData(), globalObject); 42 37 } 43 38 … … 45 40 : JSNonFinalObject(globalData, structure) 46 41 { 42 finishCreation(globalData, globalObject); 43 } 44 45 void JSObjectWithGlobalObject::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject) 46 { 47 Base::finishCreation(globalData); 47 48 COMPILE_ASSERT(AnonymousSlotCount == 1, AnonymousSlotCount_must_be_one); 48 49 ASSERT(!globalObject || globalObject->isGlobalObject()); -
trunk/Source/JavaScriptCore/runtime/JSObjectWithGlobalObject.h
r84052 r94035 35 35 class JSObjectWithGlobalObject : public JSNonFinalObject { 36 36 public: 37 typedef JSNonFinalObject Base; 38 37 39 static Structure* createStructure(JSGlobalData& globalData, JSValue proto) 38 40 { … … 54 56 // Should only be used by JSFunction when we aquire the JSFunction vptr. 55 57 } 58 59 void finishCreation(JSGlobalData&, JSGlobalObject*); 60 56 61 static const unsigned AnonymousSlotCount = JSObject::AnonymousSlotCount + 1; 57 62 static const unsigned GlobalObjectSlot = 0; -
trunk/Source/JavaScriptCore/runtime/JSVariableObject.h
r92706 r94035 75 75 , m_registers(reinterpret_cast<WriteBarrier<Unknown>*>(registers)) 76 76 { 77 finishCreation(globalData); 78 } 79 80 void finishCreation(JSGlobalData& globalData) 81 { 82 Base::finishCreation(globalData); 77 83 ASSERT(m_symbolTable); 78 84 COMPILE_ASSERT(sizeof(WriteBarrier<Unknown>) == sizeof(Register), Register_should_be_same_size_as_WriteBarrier); -
trunk/Source/JavaScriptCore/runtime/JSWrapperObject.h
r92706 r94035 54 54 : JSNonFinalObject(globalData, structure) 55 55 { 56 finishCreation(globalData); 56 57 } 57 58 -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
r91351 r94035 68 68 , m_hasNoPropertiesWithUInt32Names(true) 69 69 { 70 finishCreation(exec->globalData(), globalObject); 71 } 72 73 void ObjectPrototype::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject) 74 { 75 Base::finishCreation(globalData); 70 76 ASSERT(inherits(&s_info)); 71 77 putAnonymousValue(globalObject->globalData(), 0, globalObject); -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h
r92706 r94035 46 46 static const unsigned AnonymousSlotCount = JSNonFinalObject::AnonymousSlotCount + 1; 47 47 48 void finishCreation(JSGlobalData&, JSGlobalObject*); 49 48 50 private: 49 51 ObjectPrototype(ExecState*, JSGlobalObject*, Structure*); -
trunk/Source/JavaScriptCore/runtime/StrictEvalActivation.cpp
r84052 r94035 32 32 : JSNonFinalObject(exec->globalData(), exec->globalData().strictEvalActivationStructure.get()) 33 33 { 34 finishCreation(exec->globalData()); 34 35 } 35 36 -
trunk/Source/JavaScriptGlue/ChangeLog
r93059 r94035 1 2011-08-29 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (3/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67064 5 6 Reviewed by Darin Adler. 7 8 Completed the third 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 * UserObjectImp.cpp: 21 (UserObjectImp::UserObjectImp): 22 1 23 2011-08-15 Mark Hahnenberg <mhahnenberg@apple.com> 2 24 -
trunk/Source/JavaScriptGlue/UserObjectImp.cpp
r84556 r94035 39 39 , fJSUserObject((JSUserObject*)userObject->Retain()) 40 40 { 41 finishCreation(globalData); 41 42 } 42 43 -
trunk/Source/WebCore/ChangeLog
r94026 r94035 1 2011-08-29 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (3/7) 4 https://bugs.webkit.org/show_bug.cgi?id=67064 5 6 Reviewed by Darin Adler. 7 8 No new tests. 9 10 Completed the third 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 * bindings/js/JSDOMWindowShell.cpp: 23 (WebCore::JSDOMWindowShell::JSDOMWindowShell): 24 (WebCore::JSDOMWindowShell::finishCreation): 25 * bindings/js/JSDOMWindowShell.h: 26 1 27 2011-08-29 John Bauman <jbauman@chromium.org> 2 28 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
r93688 r94035 48 48 , m_world(world) 49 49 { 50 finishCreation(*world->globalData(), window); 51 } 52 53 void JSDOMWindowShell::finishCreation(JSGlobalData& globalData, PassRefPtr<DOMWindow> window) 54 { 55 Base::finishCreation(globalData); 50 56 ASSERT(inherits(&s_info)); 51 57 setWindow(window); -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h
r92788 r94035 65 65 DOMWrapperWorld* world() { return m_world.get(); } 66 66 67 protected: 68 void finishCreation(JSC::JSGlobalData&, PassRefPtr<DOMWindow>); 69 67 70 private: 68 71 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | JSC::OverridesGetPropertyNames | Base::StructureFlags;
Note:
See TracChangeset
for help on using the changeset viewer.