Changeset 95250 in webkit
- Timestamp:
- Sep 15, 2011 6:19:49 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObject.h
r94929 r95250 135 135 ASSERT_UNUSED(globalObject, !structure->globalObject() || structure->globalObject() == globalObject); 136 136 JSCallbackObject* callbackObject = new (allocateCell<JSCallbackObject>(*exec->heap())) JSCallbackObject(exec, structure, classRef, data); 137 callbackObject->finishCreation(exec); 137 138 return callbackObject; 138 139 } … … 140 141 { 141 142 JSCallbackObject* callbackObject = new (allocateCell<JSCallbackObject>(globalData.heap)) JSCallbackObject(globalData, classRef, structure); 143 callbackObject->finishCreation(globalData); 142 144 return callbackObject; 143 145 } -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r94875 r95250 55 55 , m_callbackObjectData(adoptPtr(new JSCallbackObjectData(data, jsClass))) 56 56 { 57 finishCreation(exec);58 57 } 59 58 … … 65 64 , m_callbackObjectData(adoptPtr(new JSCallbackObjectData(0, jsClass))) 66 65 { 67 finishCreation(globalData);68 66 } 69 67 -
trunk/Source/JavaScriptCore/ChangeLog
r95240 r95250 1 2011-09-15 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (7/7) 4 https://bugs.webkit.org/show_bug.cgi?id=68122 5 6 Reviewed by Geoffrey Garen. 7 8 Completed the seventh and final level of the refactoring to add finishCreation() 9 methods to all classes within the JSCell hierarchy with non-trivial 10 constructor bodies. 11 12 JSCallbackObject was missed in previous patches due to the fact that 13 it's non-obvious (at least to my script) that it is in the JSCell hierarchy, so 14 this is just a bit of retroactive cleanup. 15 16 * API/JSCallbackObject.h: 17 (JSC::JSCallbackObject::create): 18 * API/JSCallbackObjectFunctions.h: 19 (JSC::::JSCallbackObject): 20 1 21 2011-09-15 Filip Pizlo <fpizlo@apple.com> 2 22 -
trunk/Source/WebCore/ChangeLog
r95249 r95250 1 2011-09-15 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (7/7) 4 https://bugs.webkit.org/show_bug.cgi?id=68122 5 6 Reviewed by Geoffrey Garen. 7 8 No new tests. 9 10 Completed the seventh and final 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 consists of moving the finishCreation() method call into the create methods 15 of the sixth level of the hierarchy as was done in previous patches. 16 17 The special cases for JSAudioConstructor, JSOptionConstructor, and JSImageConstructor 18 were also lumped in and given finishCreation() methods that are called in their 19 create methods because we are at the end and want to avoid a trivial patch just 20 for moving their finishCreation() methods from their constructor to their create method. 21 22 * bindings/js/JSAudioConstructor.cpp: 23 (WebCore::JSAudioConstructor::JSAudioConstructor): 24 (WebCore::JSAudioConstructor::finishCreation): 25 * bindings/js/JSAudioConstructor.h: 26 (WebCore::JSAudioConstructor::create): 27 * bindings/js/JSDOMBinding.h: 28 (WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument): 29 * bindings/js/JSDOMWindowBase.cpp: 30 (WebCore::JSDOMWindowBase::JSDOMWindowBase): 31 * bindings/js/JSImageConstructor.cpp: 32 (WebCore::JSImageConstructor::JSImageConstructor): 33 (WebCore::JSImageConstructor::finishCreation): 34 * bindings/js/JSImageConstructor.h: 35 (WebCore::JSImageConstructor::create): 36 * bindings/js/JSOptionConstructor.cpp: 37 (WebCore::JSOptionConstructor::JSOptionConstructor): 38 (WebCore::JSOptionConstructor::finishCreation): 39 * bindings/js/JSOptionConstructor.h: 40 (WebCore::JSOptionConstructor::create): 41 * bindings/js/JSWorkerContextBase.cpp: 42 (WebCore::JSWorkerContextBase::JSWorkerContextBase): 43 44 The bindings generation script was also changed to move the finishCreation() call into the 45 create methods for descendants of JSWorkerContextBase and JSDOMWindowBase because those base 46 classes had it removed from their constructors. 47 48 * bindings/scripts/CodeGeneratorJS.pm: 49 (GenerateHeader): 50 * bridge/c/c_instance.cpp: 51 (JSC::Bindings::CRuntimeMethod::create): 52 (JSC::Bindings::CRuntimeMethod::CRuntimeMethod): 53 * bridge/jni/jsc/JavaInstanceJSC.cpp: 54 (JavaRuntimeMethod::create): 55 (JavaRuntimeMethod::JavaRuntimeMethod): 56 * bridge/objc/objc_instance.mm: 57 (ObjCRuntimeMethod::create): 58 (ObjCRuntimeMethod::ObjCRuntimeMethod): 59 * bridge/qt/qt_runtime.cpp: 60 (JSC::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod): 61 (JSC::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod): 62 * bridge/qt/qt_runtime.h: 63 (JSC::Bindings::QtRuntimeMetaMethod::create): 64 (JSC::Bindings::QtRuntimeConnectionMethod::create): 65 1 66 2011-09-15 Kentaro Hara <haraken@google.com> 2 67 -
trunk/Source/WebCore/bindings/js/JSAudioConstructor.cpp
r86785 r95250 40 40 const ClassInfo JSAudioConstructor::s_info = { "AudioConstructor", &DOMConstructorWithDocument::s_info, 0, 0 }; 41 41 42 JSAudioConstructor::JSAudioConstructor( ExecState* exec,Structure* structure, JSDOMGlobalObject* globalObject)42 JSAudioConstructor::JSAudioConstructor(Structure* structure, JSDOMGlobalObject* globalObject) 43 43 : DOMConstructorWithDocument(structure, globalObject) 44 44 { 45 } 46 47 void JSAudioConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) 48 { 49 Base::finishCreation(globalObject); 45 50 ASSERT(inherits(&s_info)); 46 51 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), None); -
trunk/Source/WebCore/bindings/js/JSAudioConstructor.h
r94929 r95250 41 41 static JSAudioConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) 42 42 { 43 return new (JSC::allocateCell<JSAudioConstructor>(*exec->heap())) JSAudioConstructor(exec, structure, globalObject); 43 JSAudioConstructor* constructor = new (JSC::allocateCell<JSAudioConstructor>(*exec->heap())) JSAudioConstructor(structure, globalObject); 44 constructor->finishCreation(exec, globalObject); 45 return constructor; 44 46 } 45 47 … … 52 54 53 55 private: 54 JSAudioConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); 56 JSAudioConstructor(JSC::Structure*, JSDOMGlobalObject*); 57 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); 55 58 virtual JSC::ConstructType getConstructData(JSC::ConstructData&); 56 59 }; -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r95108 r95250 74 74 : DOMConstructorObject(structure, globalObject) 75 75 { 76 finishCreation(globalObject);77 76 } 78 77 -
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
r95108 r95250 49 49 , m_shell(shell) 50 50 { 51 finishCreation(globalData, shell);52 51 } 53 52 -
trunk/Source/WebCore/bindings/js/JSImageConstructor.cpp
r86785 r95250 35 35 const ClassInfo JSImageConstructor::s_info = { "ImageConstructor", &DOMConstructorWithDocument::s_info, 0, 0 }; 36 36 37 JSImageConstructor::JSImageConstructor( ExecState* exec,Structure* structure, JSDOMGlobalObject* globalObject)37 JSImageConstructor::JSImageConstructor(Structure* structure, JSDOMGlobalObject* globalObject) 38 38 : DOMConstructorWithDocument(structure, globalObject) 39 39 { 40 } 41 42 void JSImageConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) 43 { 44 Base::finishCreation(globalObject); 40 45 ASSERT(inherits(&s_info)); 41 46 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLImageElementPrototype::self(exec, globalObject), None); -
trunk/Source/WebCore/bindings/js/JSImageConstructor.h
r94929 r95250 32 32 static JSImageConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) 33 33 { 34 return new (JSC::allocateCell<JSImageConstructor>(*exec->heap())) JSImageConstructor(exec, structure, globalObject); 34 JSImageConstructor* constructor = new (JSC::allocateCell<JSImageConstructor>(*exec->heap())) JSImageConstructor(structure, globalObject); 35 constructor->finishCreation(exec, globalObject); 36 return constructor; 35 37 } 36 38 … … 43 45 44 46 private: 45 JSImageConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); 47 JSImageConstructor(JSC::Structure*, JSDOMGlobalObject*); 48 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); 46 49 virtual JSC::ConstructType getConstructData(JSC::ConstructData&); 47 50 }; -
trunk/Source/WebCore/bindings/js/JSOptionConstructor.cpp
r86785 r95250 36 36 const ClassInfo JSOptionConstructor::s_info = { "OptionConstructor", &DOMConstructorWithDocument::s_info, 0, 0 }; 37 37 38 JSOptionConstructor::JSOptionConstructor( ExecState* exec,Structure* structure, JSDOMGlobalObject* globalObject)38 JSOptionConstructor::JSOptionConstructor(Structure* structure, JSDOMGlobalObject* globalObject) 39 39 : DOMConstructorWithDocument(structure, globalObject) 40 40 { 41 } 42 43 void JSOptionConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) 44 { 45 Base::finishCreation(globalObject); 41 46 ASSERT(inherits(&s_info)); 42 47 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLOptionElementPrototype::self(exec, globalObject), None); -
trunk/Source/WebCore/bindings/js/JSOptionConstructor.h
r94929 r95250 33 33 static JSOptionConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) 34 34 { 35 return new (JSC::allocateCell<JSOptionConstructor>(*exec->heap())) JSOptionConstructor(exec, structure, globalObject); 35 JSOptionConstructor* constructor = new (JSC::allocateCell<JSOptionConstructor>(*exec->heap())) JSOptionConstructor(structure, globalObject); 36 constructor->finishCreation(exec, globalObject); 37 return constructor; 36 38 } 37 39 … … 44 46 45 47 private: 46 JSOptionConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); 48 JSOptionConstructor(JSC::Structure*, JSDOMGlobalObject*); 49 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); 47 50 virtual JSC::ConstructType getConstructData(JSC::ConstructData&); 48 51 }; -
trunk/Source/WebCore/bindings/js/JSWorkerContextBase.cpp
r95108 r95250 53 53 , m_impl(impl) 54 54 { 55 finishCreation(globalData, this);56 55 } 57 56 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r95108 r95250 732 732 push(@headerContent, " {\n"); 733 733 push(@headerContent, " $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n"); 734 push(@headerContent, " ptr->finishCreation(globalData, windowShell);\n"); 734 735 push(@headerContent, " return ptr;\n"); 735 736 push(@headerContent, " }\n\n"); … … 738 739 push(@headerContent, " {\n"); 739 740 push(@headerContent, " $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n"); 741 push(@headerContent, " ptr->finishCreation(globalData, ptr);\n"); 740 742 push(@headerContent, " return ptr;\n"); 741 743 push(@headerContent, " }\n\n"); -
trunk/Source/WebCore/bridge/c/c_instance.cpp
r95108 r95250 119 119 // We need to pass in the right global object for "i". 120 120 Structure* domStructure = WebCore::deprecatedGetDOMStructure<CRuntimeMethod>(exec); 121 return new (allocateCell<CRuntimeMethod>(*exec->heap())) CRuntimeMethod(exec, globalObject, domStructure, name, list); 121 CRuntimeMethod* method = new (allocateCell<CRuntimeMethod>(*exec->heap())) CRuntimeMethod(globalObject, domStructure, list); 122 method->finishCreation(exec->globalData(), name); 123 return method; 122 124 } 123 125 … … 130 132 131 133 private: 132 CRuntimeMethod( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)134 CRuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& list) 133 135 : RuntimeMethod(globalObject, structure, list) 134 136 { 135 finishCreation(exec->globalData(), name);136 137 } 137 138 -
trunk/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
r95108 r95250 124 124 // We need to pass in the right global object for "i". 125 125 Structure* domStructure = WebCore::deprecatedGetDOMStructure<JavaRuntimeMethod>(exec); 126 return new (allocateCell<JavaRuntimeMethod>(*exec->heap())) JavaRuntimeMethod(exec, globalObject, domStructure, name, list); 126 JavaRuntimeMethod* method = new (allocateCell<JavaRuntimeMethod>(*exec->heap())) JavaRuntimeMethod(globalObject, domStructure, list); 127 method->finishCreation(exec->globalData(), name); 128 return method; 127 129 } 128 130 … … 135 137 136 138 private: 137 JavaRuntimeMethod( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)139 JavaRuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& list) 138 140 : RuntimeMethod(globalObject, structure, list) 139 141 { 140 finishCreation(exec->globalData(), name);141 142 } 142 143 -
trunk/Source/WebCore/bridge/objc/objc_instance.mm
r95108 r95250 179 179 // We need to pass in the right global object for "i". 180 180 Structure* domStructure = WebCore::deprecatedGetDOMStructure<ObjCRuntimeMethod>(exec); 181 return new (allocateCell<ObjCRuntimeMethod>(*exec->heap())) ObjCRuntimeMethod(exec, globalObject, domStructure, name, list); 181 ObjCRuntimeMethod* method = new (allocateCell<ObjCRuntimeMethod>(*exec->heap())) ObjCRuntimeMethod(globalObject, domStructure, list); 182 method->finishCreation(exec->globalData(), name); 183 return method; 182 184 } 183 185 … … 192 194 typedef RuntimeMethod Base; 193 195 194 ObjCRuntimeMethod( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)196 ObjCRuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& list) 195 197 : RuntimeMethod(globalObject, structure, list) 196 198 { 197 finishCreation(exec->globalData(), name);198 199 } 199 200 -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r95117 r95250 1426 1426 } 1427 1427 1428 QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& identifier , PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)1428 QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& identifier) 1429 1429 : QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, identifier) 1430 1430 { 1431 finishCreation(exec, identifier, instance, index, signature, allowPrivate);1432 1431 } 1433 1432 … … 1576 1575 QMultiMap<QObject*, QtConnectionObject*> QtRuntimeConnectionMethod::connections; 1577 1576 1578 QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& identifier , bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)1577 QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& identifier) 1579 1578 : QtRuntimeMethod (new QtRuntimeConnectionMethodData(), exec, structure, identifier) 1580 1579 { 1581 finishCreation(exec, identifier, isConnect, instance, index, signature);1582 1580 } 1583 1581 -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r95117 r95250 157 157 typedef QtRuntimeMethod Base; 158 158 159 static QtRuntimeMetaMethod* create(ExecState* exec, const Identifier& n , PassRefPtr<QtInstance> inst, int index, const QByteArray& signature, bool allowPrivate)159 static QtRuntimeMetaMethod* create(ExecState* exec, const Identifier& name, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate) 160 160 { 161 161 Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeMethod>(exec); 162 QtRuntimeMetaMethod* method = new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, n, inst, index, signature, allowPrivate); 162 QtRuntimeMetaMethod* method = new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, name); 163 method->finishCreation(exec, name, instance, index, signature, allowPrivate); 163 164 return method; 164 165 } … … 174 175 175 176 private: 176 QtRuntimeMetaMethod(ExecState*, Structure*, const Identifier& , PassRefPtr<QtInstance>, int index, const QByteArray&, bool allowPrivate);177 QtRuntimeMetaMethod(ExecState*, Structure*, const Identifier&); 177 178 void finishCreation(ExecState*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray& signature, bool allowPrivate); 178 179 … … 189 190 typedef QtRuntimeMethod Base; 190 191 191 static QtRuntimeConnectionMethod* create(ExecState* exec, const Identifier& n , bool isConnect, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature)192 static QtRuntimeConnectionMethod* create(ExecState* exec, const Identifier& name, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature) 192 193 { 193 194 Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeMethod>(exec); 194 return new (allocateCell<QtRuntimeConnectionMethod>(*exec->heap())) QtRuntimeConnectionMethod(exec, domStructure, n, isConnect, inst, index, signature); 195 QtRuntimeConnectionMethod* method = new (allocateCell<QtRuntimeConnectionMethod>(*exec->heap())) QtRuntimeConnectionMethod(exec, domStructure, name); 196 method->finishCreation(exec, name, isConnect, instance, index, signature); 197 return method; 195 198 } 196 199 … … 203 206 204 207 private: 205 QtRuntimeConnectionMethod(ExecState*, Structure*, const Identifier& , bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray&);208 QtRuntimeConnectionMethod(ExecState*, Structure*, const Identifier&); 206 209 void finishCreation(ExecState*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray& signature); 207 210 -
trunk/Source/WebKit/mac/ChangeLog
r95249 r95250 1 2011-09-15 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Unzip initialization lists and constructors in JSCell hierarchy (7/7) 4 https://bugs.webkit.org/show_bug.cgi?id=68122 5 6 Reviewed by Geoffrey Garen. 7 8 Completed the seventh and final level of the refactoring to add finishCreation() 9 methods to all classes within the JSCell hierarchy with non-trivial 10 constructor bodies. 11 12 * Plugins/Hosted/ProxyInstance.mm: 13 (WebKit::ProxyRuntimeMethod::create): 14 (WebKit::ProxyRuntimeMethod::ProxyRuntimeMethod): 15 * Plugins/Hosted/ProxyRuntimeObject.h: 16 (WebKit::ProxyRuntimeObject::create): 17 * Plugins/Hosted/ProxyRuntimeObject.mm: 18 (WebKit::ProxyRuntimeObject::ProxyRuntimeObject): 19 1 20 2011-09-15 Kentaro Hara <haraken@google.com> 2 21 -
trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
r95108 r95250 187 187 // exec-globalData() is also likely wrong. 188 188 Structure* domStructure = deprecatedGetDOMStructure<ProxyRuntimeMethod>(exec); 189 return new (allocateCell<ProxyRuntimeMethod>(*exec->heap())) ProxyRuntimeMethod(exec, globalObject, domStructure, name, list); 189 ProxyRuntimeMethod* method = new (allocateCell<ProxyRuntimeMethod>(*exec->heap())) ProxyRuntimeMethod(globalObject, domStructure, list); 190 method->finishCreation(exec->globalData(), name); 191 return method; 190 192 } 191 193 … … 198 200 199 201 private: 200 ProxyRuntimeMethod( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)202 ProxyRuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& list) 201 203 : RuntimeMethod(globalObject, structure, list) 202 204 { 203 finishCreation(exec->globalData(), name);204 205 } 205 206 -
trunk/Source/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h
r94929 r95250 45 45 // exec->globalData() is also likely wrong. 46 46 JSC::Structure* structure = WebCore::deprecatedGetDOMStructure<ProxyRuntimeObject>(exec); 47 return new (JSC::allocateCell<ProxyRuntimeObject>(*exec->heap())) ProxyRuntimeObject(exec, globalObject, structure, instance); 47 ProxyRuntimeObject* object = new (JSC::allocateCell<ProxyRuntimeObject>(*exec->heap())) ProxyRuntimeObject(exec, globalObject, structure, instance); 48 object->finishCreation(globalObject); 49 return object; 48 50 } 49 51 -
trunk/Source/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm
r94875 r95250 40 40 : RuntimeObject(exec, globalObject, structure, instance) 41 41 { 42 finishCreation(globalObject);43 42 } 44 43
Note: See TracChangeset
for help on using the changeset viewer.