Unzip initialization lists and constructors in JSCell hierarchy (6/7)
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Sep 2011 18:55:25 +0000 (18:55 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Sep 2011 18:55:25 +0000 (18:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=67692

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Completed the sixth level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the fifth level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one.  Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

* API/JSCallbackFunction.cpp:
(JSC::JSCallbackFunction::JSCallbackFunction):
* API/JSCallbackFunction.h:
(JSC::JSCallbackFunction::create):
* jsc.cpp:
(GlobalObject::create):
(GlobalObject::GlobalObject):
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::ArrayConstructor):
* runtime/ArrayConstructor.h:
(JSC::ArrayConstructor::create):
* runtime/BooleanConstructor.cpp:
(JSC::BooleanConstructor::BooleanConstructor):
* runtime/BooleanConstructor.h:
(JSC::BooleanConstructor::create):
* runtime/BooleanPrototype.cpp:
(JSC::BooleanPrototype::BooleanPrototype):
* runtime/BooleanPrototype.h:
(JSC::BooleanPrototype::create):
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::DateConstructor):
* runtime/DateConstructor.h:
(JSC::DateConstructor::create):
* runtime/DatePrototype.cpp:
(JSC::DatePrototype::DatePrototype):
* runtime/DatePrototype.h:
(JSC::DatePrototype::create):
* runtime/Error.cpp:
(JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
(JSC::StrictModeTypeErrorFunction::create):
* runtime/ErrorConstructor.cpp:
(JSC::ErrorConstructor::ErrorConstructor):
* runtime/ErrorConstructor.h:
(JSC::ErrorConstructor::create):
* runtime/FunctionConstructor.cpp:
(JSC::FunctionConstructor::FunctionConstructor):
* runtime/FunctionConstructor.h:
(JSC::FunctionConstructor::create):
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::FunctionPrototype):
* runtime/FunctionPrototype.h:
(JSC::FunctionPrototype::create):
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor::NativeErrorConstructor):
* runtime/NativeErrorConstructor.h:
(JSC::NativeErrorConstructor::create):
* runtime/NativeErrorPrototype.cpp:
(JSC::NativeErrorPrototype::NativeErrorPrototype):
(JSC::NativeErrorPrototype::finishCreation):
* runtime/NativeErrorPrototype.h:
(JSC::NativeErrorPrototype::create):
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::NumberConstructor):
* runtime/NumberConstructor.h:
(JSC::NumberConstructor::create):
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::NumberPrototype):
* runtime/NumberPrototype.h:
(JSC::NumberPrototype::create):
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::ObjectConstructor):
* runtime/ObjectConstructor.h:
(JSC::ObjectConstructor::create):
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::RegExpConstructor):
* runtime/RegExpConstructor.h:
(JSC::RegExpConstructor::create):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::RegExpPrototype):
* runtime/RegExpPrototype.h:
(JSC::RegExpPrototype::create):
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::StringConstructor):
* runtime/StringConstructor.h:
(JSC::StringConstructor::create):
* runtime/StringObjectThatMasqueradesAsUndefined.h:
(JSC::StringObjectThatMasqueradesAsUndefined::create):
(JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::StringPrototype):
* runtime/StringPrototype.h:
(JSC::StringPrototype::create):

Source/JavaScriptGlue:

Completed the sixth level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the fifth level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one.  Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

* JSRun.cpp:
(JSGlueGlobalObject::JSGlueGlobalObject):
* JSRun.h:
(JSGlueGlobalObject::create):

Source/WebCore:

No new tests.

Completed the sixth level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the fifth level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one.  Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

* WebCore.exp.in:
* bindings/js/JSDOMBinding.h:
(WebCore::DOMConstructorObject::DOMConstructorObject):
(WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument):
(WebCore::DOMConstructorWithDocument::finishCreation):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
(WebCore::JSDOMWindowBase::finishCreation):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSWorkerContextBase.cpp:
(WebCore::JSWorkerContextBase::JSWorkerContextBase):
(WebCore::JSWorkerContextBase::finishCreation):
* bindings/js/JSWorkerContextBase.h:
* bindings/scripts/CodeGeneratorJS.pm:

Added a finishCreation declaration and Moved the finishCreation call into the
create method for all classes except for subclasses of JSWorkerContextBase and
JSDOMWindowBase because those classes are on the next level, and it's easier
to do all of these classes in one fell swoop rather than level by level.
(GenerateHeader):
Added the implementation of the finishCreation method for the classes described above.
(GenerateImplementation):
Also added the finishCreation calls to the autogenerated DOM constructor classes.
(GenerateConstructorDeclaration):
(GenerateConstructorDefinition):

* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::create):
(WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor):
(WebCore::JSTestInterfaceConstructor::finishCreation):
(WebCore::JSTestInterface::JSTestInterface):
(WebCore::JSTestInterface::finishCreation):
* bindings/scripts/test/JS/JSTestInterface.h:
(WebCore::JSTestInterface::create):
(WebCore::JSTestInterfacePrototype::create):
(WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerConstructor::create):
(WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor):
(WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
(WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
(WebCore::JSTestMediaQueryListListener::finishCreation):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
(WebCore::JSTestMediaQueryListListener::create):
(WebCore::JSTestMediaQueryListListenerPrototype::create):
(WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::create):
(WebCore::JSTestObjConstructor::JSTestObjConstructor):
(WebCore::JSTestObjConstructor::finishCreation):
(WebCore::JSTestObj::JSTestObj):
(WebCore::JSTestObj::finishCreation):
* bindings/scripts/test/JS/JSTestObj.h:
(WebCore::JSTestObj::create):
(WebCore::JSTestObjPrototype::create):
(WebCore::JSTestObjPrototype::JSTestObjPrototype):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::create):
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor):
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
(WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
(WebCore::JSTestSerializedScriptValueInterface::finishCreation):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
(WebCore::JSTestSerializedScriptValueInterface::create):
(WebCore::JSTestSerializedScriptValueInterfacePrototype::create):
(WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
* bridge/c/CRuntimeObject.cpp:
(JSC::Bindings::CRuntimeObject::CRuntimeObject):
* bridge/c/CRuntimeObject.h:
(JSC::Bindings::CRuntimeObject::create):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CRuntimeMethod::CRuntimeMethod):
(JSC::Bindings::CRuntimeMethod::finishCreation):
* bridge/jni/jsc/JavaInstanceJSC.cpp:
(JavaRuntimeMethod::JavaRuntimeMethod):
(JavaRuntimeMethod::finishCreation):
* bridge/jni/jsc/JavaRuntimeObject.cpp:
(JSC::Bindings::JavaRuntimeObject::JavaRuntimeObject):
* bridge/jni/jsc/JavaRuntimeObject.h:
(JSC::Bindings::JavaRuntimeObject::create):
* bridge/objc/ObjCRuntimeObject.h:
(JSC::Bindings::ObjCRuntimeObject::create):
* bridge/objc/ObjCRuntimeObject.mm:
(JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
* bridge/objc/objc_instance.mm:
(ObjCRuntimeMethod::ObjCRuntimeMethod):
(ObjCRuntimeMethod::finishCreation):
* bridge/qt/qt_instance.cpp:
(JSC::Bindings::QtRuntimeObject::create):
(JSC::Bindings::QtRuntimeObject::QtRuntimeObject):
* bridge/qt/qt_pixmapruntime.cpp:
(JSC::Bindings::QtPixmapRuntimeObject::create):
(JSC::Bindings::QtPixmapRuntimeObject::QtPixmapRuntimeObject):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod):
(JSC::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
(JSC::Bindings::QtRuntimeMetaMethod::finishCreation):
(JSC::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod):
(JSC::Bindings::QtRuntimeConnectionMethod::finishCreation):
* bridge/qt/qt_runtime.h:
(JSC::Bindings::QtRuntimeMetaMethod::create):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::RuntimeMethod):
* bridge/runtime_method.h:
(JSC::RuntimeMethod::create):

Source/WebKit/mac:

Completed the sixth level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the fifth level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one.  Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyRuntimeMethod::ProxyRuntimeMethod):
(WebKit::ProxyRuntimeMethod::finishCreation):

Source/WebKit2:

Completed the sixth level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the fifth level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one.  Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
(WebKit::JSNPMethod::JSNPMethod):
* WebProcess/Plugins/Netscape/JSNPMethod.h:
(WebKit::JSNPMethod::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95108 268f45cc-cd09-0410-ab3c-d52691b4dbfc

81 files changed:
Source/JavaScriptCore/API/JSCallbackFunction.cpp
Source/JavaScriptCore/API/JSCallbackFunction.h
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/ArrayConstructor.cpp
Source/JavaScriptCore/runtime/ArrayConstructor.h
Source/JavaScriptCore/runtime/BooleanConstructor.cpp
Source/JavaScriptCore/runtime/BooleanConstructor.h
Source/JavaScriptCore/runtime/BooleanPrototype.cpp
Source/JavaScriptCore/runtime/BooleanPrototype.h
Source/JavaScriptCore/runtime/DateConstructor.cpp
Source/JavaScriptCore/runtime/DateConstructor.h
Source/JavaScriptCore/runtime/DatePrototype.cpp
Source/JavaScriptCore/runtime/DatePrototype.h
Source/JavaScriptCore/runtime/Error.cpp
Source/JavaScriptCore/runtime/ErrorConstructor.cpp
Source/JavaScriptCore/runtime/ErrorConstructor.h
Source/JavaScriptCore/runtime/FunctionConstructor.cpp
Source/JavaScriptCore/runtime/FunctionConstructor.h
Source/JavaScriptCore/runtime/FunctionPrototype.cpp
Source/JavaScriptCore/runtime/FunctionPrototype.h
Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
Source/JavaScriptCore/runtime/NativeErrorConstructor.h
Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
Source/JavaScriptCore/runtime/NativeErrorPrototype.h
Source/JavaScriptCore/runtime/NumberConstructor.cpp
Source/JavaScriptCore/runtime/NumberConstructor.h
Source/JavaScriptCore/runtime/NumberPrototype.cpp
Source/JavaScriptCore/runtime/NumberPrototype.h
Source/JavaScriptCore/runtime/ObjectConstructor.cpp
Source/JavaScriptCore/runtime/ObjectConstructor.h
Source/JavaScriptCore/runtime/RegExpConstructor.cpp
Source/JavaScriptCore/runtime/RegExpConstructor.h
Source/JavaScriptCore/runtime/RegExpPrototype.cpp
Source/JavaScriptCore/runtime/RegExpPrototype.h
Source/JavaScriptCore/runtime/StringConstructor.cpp
Source/JavaScriptCore/runtime/StringConstructor.h
Source/JavaScriptCore/runtime/StringObjectThatMasqueradesAsUndefined.h
Source/JavaScriptCore/runtime/StringPrototype.cpp
Source/JavaScriptCore/runtime/StringPrototype.h
Source/JavaScriptGlue/ChangeLog
Source/JavaScriptGlue/JSRun.cpp
Source/JavaScriptGlue/JSRun.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Source/WebCore/bindings/js/JSDOMGlobalObject.h
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.h
Source/WebCore/bindings/js/JSWorkerContextBase.cpp
Source/WebCore/bindings/js/JSWorkerContextBase.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h
Source/WebCore/bridge/c/CRuntimeObject.cpp
Source/WebCore/bridge/c/CRuntimeObject.h
Source/WebCore/bridge/c/c_instance.cpp
Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.cpp
Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.h
Source/WebCore/bridge/objc/ObjCRuntimeObject.h
Source/WebCore/bridge/objc/ObjCRuntimeObject.mm
Source/WebCore/bridge/objc/objc_instance.mm
Source/WebCore/bridge/qt/qt_instance.cpp
Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
Source/WebCore/bridge/qt/qt_runtime.cpp
Source/WebCore/bridge/qt/qt_runtime.h
Source/WebCore/bridge/runtime_method.cpp
Source/WebCore/bridge/runtime_method.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h

index 64d513e2eaf44358bee2774fdd6a778d3d0d4e9c..a3968c685c3b78b0133e05416f2d60dc3da651b0 100644 (file)
@@ -42,11 +42,10 @@ ASSERT_CLASS_FITS_IN_CELL(JSCallbackFunction);
 
 const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0 };
 
-JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
+JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback)
     : InternalFunction(globalObject, globalObject->callbackFunctionStructure())
     , m_callback(callback)
 {
-    finishCreation(exec->globalData(), name);
 }
 
 void JSCallbackFunction::finishCreation(JSGlobalData& globalData, const Identifier& name)
index 13e7e009dbae65d445970d2ff8a0c90c686952c1..7e2652ed2a1740f11bf72f32c1352a636c4ebacd 100644 (file)
@@ -33,7 +33,7 @@ namespace JSC {
 
 class JSCallbackFunction : public InternalFunction {
 protected:
-    JSCallbackFunction(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name);
+    JSCallbackFunction(JSGlobalObject*, JSObjectCallAsFunctionCallback);
     void finishCreation(JSGlobalData&, const Identifier& name);
 
 public:
@@ -41,7 +41,9 @@ public:
 
     static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
     {
-        return new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(exec, globalObject, callback, name);
+        JSCallbackFunction* function = new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback);
+        function->finishCreation(exec->globalData(), name);
+        return function;
     }
 
     static const ClassInfo s_info;
index 505a42b56bd707cbb68d9c9e76fcbb50b152d7a9..3a7c821e8ee6e86c209df91126e26effae4ac667 100644 (file)
@@ -1,3 +1,105 @@
+2011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Unzip initialization lists and constructors in JSCell hierarchy (6/7)
+        https://bugs.webkit.org/show_bug.cgi?id=67692
+
+        Reviewed by Geoffrey Garen.
+
+        Completed the sixth level of the refactoring to add finishCreation() 
+        methods to all classes within the JSCell hierarchy with non-trivial 
+        constructor bodies.
+
+        This primarily consists of pushing the calls to finishCreation() down 
+        into the constructors of the subclasses of the fifth level of the hierarchy 
+        as well as pulling the finishCreation() calls out into the class's corresponding
+        create() method if it has one.  Doing both simultaneously allows us to 
+        maintain the invariant that the finishCreation() method chain is called exactly 
+        once during the creation of an object, since calling it any other number of 
+        times (0, 2, or more) will cause an assertion failure.
+
+        * API/JSCallbackFunction.cpp:
+        (JSC::JSCallbackFunction::JSCallbackFunction):
+        * API/JSCallbackFunction.h:
+        (JSC::JSCallbackFunction::create):
+        * jsc.cpp:
+        (GlobalObject::create):
+        (GlobalObject::GlobalObject):
+        * runtime/ArrayConstructor.cpp:
+        (JSC::ArrayConstructor::ArrayConstructor):
+        * runtime/ArrayConstructor.h:
+        (JSC::ArrayConstructor::create):
+        * runtime/BooleanConstructor.cpp:
+        (JSC::BooleanConstructor::BooleanConstructor):
+        * runtime/BooleanConstructor.h:
+        (JSC::BooleanConstructor::create):
+        * runtime/BooleanPrototype.cpp:
+        (JSC::BooleanPrototype::BooleanPrototype):
+        * runtime/BooleanPrototype.h:
+        (JSC::BooleanPrototype::create):
+        * runtime/DateConstructor.cpp:
+        (JSC::DateConstructor::DateConstructor):
+        * runtime/DateConstructor.h:
+        (JSC::DateConstructor::create):
+        * runtime/DatePrototype.cpp:
+        (JSC::DatePrototype::DatePrototype):
+        * runtime/DatePrototype.h:
+        (JSC::DatePrototype::create):
+        * runtime/Error.cpp:
+        (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
+        (JSC::StrictModeTypeErrorFunction::create):
+        * runtime/ErrorConstructor.cpp:
+        (JSC::ErrorConstructor::ErrorConstructor):
+        * runtime/ErrorConstructor.h:
+        (JSC::ErrorConstructor::create):
+        * runtime/FunctionConstructor.cpp:
+        (JSC::FunctionConstructor::FunctionConstructor):
+        * runtime/FunctionConstructor.h:
+        (JSC::FunctionConstructor::create):
+        * runtime/FunctionPrototype.cpp:
+        (JSC::FunctionPrototype::FunctionPrototype):
+        * runtime/FunctionPrototype.h:
+        (JSC::FunctionPrototype::create):
+        * runtime/NativeErrorConstructor.cpp:
+        (JSC::NativeErrorConstructor::NativeErrorConstructor):
+        * runtime/NativeErrorConstructor.h:
+        (JSC::NativeErrorConstructor::create):
+        * runtime/NativeErrorPrototype.cpp:
+        (JSC::NativeErrorPrototype::NativeErrorPrototype):
+        (JSC::NativeErrorPrototype::finishCreation):
+        * runtime/NativeErrorPrototype.h:
+        (JSC::NativeErrorPrototype::create):
+        * runtime/NumberConstructor.cpp:
+        (JSC::NumberConstructor::NumberConstructor):
+        * runtime/NumberConstructor.h:
+        (JSC::NumberConstructor::create):
+        * runtime/NumberPrototype.cpp:
+        (JSC::NumberPrototype::NumberPrototype):
+        * runtime/NumberPrototype.h:
+        (JSC::NumberPrototype::create):
+        * runtime/ObjectConstructor.cpp:
+        (JSC::ObjectConstructor::ObjectConstructor):
+        * runtime/ObjectConstructor.h:
+        (JSC::ObjectConstructor::create):
+        * runtime/RegExpConstructor.cpp:
+        (JSC::RegExpConstructor::RegExpConstructor):
+        * runtime/RegExpConstructor.h:
+        (JSC::RegExpConstructor::create):
+        * runtime/RegExpPrototype.cpp:
+        (JSC::RegExpPrototype::RegExpPrototype):
+        * runtime/RegExpPrototype.h:
+        (JSC::RegExpPrototype::create):
+        * runtime/StringConstructor.cpp:
+        (JSC::StringConstructor::StringConstructor):
+        * runtime/StringConstructor.h:
+        (JSC::StringConstructor::create):
+        * runtime/StringObjectThatMasqueradesAsUndefined.h:
+        (JSC::StringObjectThatMasqueradesAsUndefined::create):
+        (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
+        * runtime/StringPrototype.cpp:
+        (JSC::StringPrototype::StringPrototype):
+        * runtime/StringPrototype.h:
+        (JSC::StringPrototype::create):
+
 2011-09-13  Eric Seidel  <eric@webkit.org>
 
         Remove ENABLE_SVG_USE as <use> is required by HTML5
index 018f9572461afe3fd754773d707baf2f92dd3518..91a3e1fe2338512d18476ac7a829b9552f3bc885 100644 (file)
@@ -145,14 +145,16 @@ long StopWatch::getElapsedMS()
 
 class GlobalObject : public JSGlobalObject {
 private:
-    GlobalObject(JSGlobalData&, Structure*, const Vector<UString>& arguments);
+    GlobalObject(JSGlobalData&, Structure*);
 
 public:
     typedef JSGlobalObject Base;
 
     static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
     {
-        return new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure, arguments);
+        GlobalObject* object = new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
+        object->finishCreation(globalData, arguments);
+        return object;
     }
     virtual UString className() const { return "global"; }
 
@@ -188,10 +190,9 @@ protected:
 COMPILE_ASSERT(!IsInteger<GlobalObject>::value, WTF_IsInteger_GlobalObject_false);
 ASSERT_CLASS_FITS_IN_CELL(GlobalObject);
 
-GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
+GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure)
     : JSGlobalObject(globalData, structure)
 {
-    finishCreation(globalData, arguments);
 }
 
 EncodedJSValue JSC_HOST_CALL functionPrint(ExecState* exec)
index d406ba198c0d17ed23423bf980aa21af78e05a85..a8d6458790dccc86515faa0d69e9b0ecfd7d605f 100644 (file)
@@ -51,10 +51,9 @@ const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_in
 
 ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor);
 
-ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
+ArrayConstructor::ArrayConstructor(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure)
 {
-    finishCreation(exec, arrayPrototype);
 }
 
 void ArrayConstructor::finishCreation(ExecState* exec, ArrayPrototype* arrayPrototype)
index c2c7198d66cf2f569b986576351885c6a3c5cfec..96cec6b7b7b3207ad238faaef2812fa2f873458f 100644 (file)
@@ -31,9 +31,11 @@ namespace JSC {
     public:
         typedef InternalFunction Base;
 
-        static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrPrototype)
+        static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
         {
-            return new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(exec, globalObject, structure, arrPrototype);
+            ArrayConstructor* constructor = new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(globalObject, structure);
+            constructor->finishCreation(exec, arrayPrototype);
+            return constructor;
         }
 
         static const ClassInfo s_info;
@@ -48,7 +50,7 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
 
     private:
-        ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*);
+        ArrayConstructor(JSGlobalObject*, Structure*);
         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
 
index 340ff723ca62fcce0cb57b55a85cbc2922a0b627..f6e2a708c3ff90cbe6fb8d30c19adee2fa3779d5 100644 (file)
@@ -28,10 +28,9 @@ namespace JSC {
 
 ASSERT_CLASS_FITS_IN_CELL(BooleanConstructor);
 
-BooleanConstructor::BooleanConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
+BooleanConstructor::BooleanConstructor(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure)
 {
-    finishCreation(exec, booleanPrototype);
 }
 
 void BooleanConstructor::finishCreation(ExecState* exec, BooleanPrototype* booleanPrototype)
index 1eee4f66376a5f37a560abe5ed570a6d3d83b47e..1d94688637910fa9afae15a7405270cc897085c6 100644 (file)
@@ -31,16 +31,18 @@ namespace JSC {
     public:
         typedef InternalFunction Base;
 
-        static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* boolPrototype)
+        static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
         {
-            return new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(exec, globalObject, structure, boolPrototype);
+            BooleanConstructor* constructor = new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure);
+            constructor->finishCreation(exec, booleanPrototype);
+            return constructor;
         }
 
     protected:
         void finishCreation(ExecState*, BooleanPrototype*);
 
     private:
-        BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);
+        BooleanConstructor(JSGlobalObject*, Structure*);
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
     };
index ac7a6e949c0717cc9971227a4a8bd666f7470096..ab62963206732881bf79868b96603d241ba43364 100644 (file)
@@ -49,10 +49,9 @@ const ClassInfo BooleanPrototype::s_info = { "Boolean", &BooleanObject::s_info,
 
 ASSERT_CLASS_FITS_IN_CELL(BooleanPrototype);
 
-BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
+BooleanPrototype::BooleanPrototype(ExecState* exec, Structure* structure)
     : BooleanObject(exec->globalData(), structure)
 {
-    finishCreation(exec, globalObject);
 }
 
 void BooleanPrototype::finishCreation(ExecState* exec, JSGlobalObject*)
index 2a6c81fa3d530d60b82e457e89828ea9878ff196..2dcfc1d56f201e33f7b669941f5b24046b443206 100644 (file)
@@ -31,7 +31,9 @@ namespace JSC {
 
         static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
         {
-            return new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, globalObject, structure);
+            BooleanPrototype* prototype = new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, structure);
+            prototype->finishCreation(exec, globalObject);
+            return prototype;
         }
         
         static const ClassInfo s_info;
@@ -46,7 +48,7 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | BooleanObject::StructureFlags;
 
     private:
-        BooleanPrototype(ExecState*, JSGlobalObject*, Structure*);
+        BooleanPrototype(ExecState*, Structure*);
         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     };
index 7b253488354e023cd1c35d6ef481168c44fcf494..85f544adc7485c23b24f4bb8c868b08765542740 100644 (file)
@@ -73,10 +73,9 @@ const ClassInfo DateConstructor::s_info = { "Function", &InternalFunction::s_inf
 
 ASSERT_CLASS_FITS_IN_CELL(DateConstructor);
 
-DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
+DateConstructor::DateConstructor(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure) 
 {
-    finishCreation(exec, datePrototype);
 }
 
 void DateConstructor::finishCreation(ExecState* exec, DatePrototype* datePrototype)
index 5fa51df9599ed3e146b6b83ca8b02d92102851ad..fdb7a11a1ce7ad2c7bdca5b9177c409c1c6d3d18 100644 (file)
@@ -33,7 +33,9 @@ namespace JSC {
 
         static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
         {
-            return new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(exec, globalObject, structure, datePrototype);
+            DateConstructor* constructor = new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure);
+            constructor->finishCreation(exec, datePrototype);
+            return constructor;
         }
 
         static const ClassInfo s_info;
@@ -48,7 +50,7 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
 
     private:
-        DateConstructor(ExecState*, JSGlobalObject*, Structure*, DatePrototype*);
+        DateConstructor(JSGlobalObject*, Structure*);
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
 
index 78385858db0e627c8c7b64505524258c2c074390..631e478fa6eb8b3fa5360cf571c4d9221f47fa42 100644 (file)
@@ -430,10 +430,9 @@ const ClassInfo DatePrototype::s_info = {"Date", &DateInstance::s_info, 0, ExecS
 
 // ECMA 15.9.4
 
-DatePrototype::DatePrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
+DatePrototype::DatePrototype(ExecState* exec, Structure* structure)
     : DateInstance(exec, structure)
 {
-    finishCreation(exec, globalObject);
 }
 
 void DatePrototype::finishCreation(ExecState* exec, JSGlobalObject*)
index cda6b7afa9715580311f40abf943d5fd2430a401..71d9eda308a4bc95fb9c0647bb157db80c07f69a 100644 (file)
@@ -29,14 +29,16 @@ namespace JSC {
 
     class DatePrototype : public DateInstance {
     private:
-        DatePrototype(ExecState*, JSGlobalObject*, Structure*);
+        DatePrototype(ExecState*, Structure*);
 
     public:
         typedef DateInstance Base;
 
         static DatePrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
         {
-            return new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, globalObject, structure);
+            DatePrototype* prototype = new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, structure);
+            prototype->finishCreation(exec, globalObject);
+            return prototype;
         }
         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
index 2471689cb67cde2c07d3e11c0a8797283df696fb..0081135d981f79e311b776bee5031bae12200c67 100644 (file)
@@ -167,11 +167,10 @@ JSObject* throwSyntaxError(ExecState* exec)
 
 class StrictModeTypeErrorFunction : public InternalFunction {
 private:
-    StrictModeTypeErrorFunction(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
+    StrictModeTypeErrorFunction(JSGlobalObject* globalObject, Structure* structure, const UString& message)
         : InternalFunction(globalObject, structure)
         , m_message(message)
     {
-        finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);
     }
 
 public:
@@ -179,7 +178,9 @@ public:
 
     static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
     {
-        return new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(exec, globalObject, structure, message);
+        StrictModeTypeErrorFunction* function = new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
+        function->finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);
+        return function;
     }
     
     static EncodedJSValue JSC_HOST_CALL constructThrowTypeError(ExecState* exec)
index 3803e035debdab54023da32c7a18e7f2578f284a..a8918d66dacf5388b7e1a758c36d0d918e6d2fa6 100644 (file)
@@ -29,10 +29,9 @@ namespace JSC {
 
 ASSERT_CLASS_FITS_IN_CELL(ErrorConstructor);
 
-ErrorConstructor::ErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)
+ErrorConstructor::ErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure)
 {
-    finishCreation(exec, errorPrototype);
 }
 
 void ErrorConstructor::finishCreation(ExecState* exec, ErrorPrototype* errorPrototype)
index d3bd803e5f82786044c8551932cc037dca15b8e5..5083a8e57ffecf3214ec68f2d51edd46825fef37 100644 (file)
@@ -32,16 +32,18 @@ namespace JSC {
     public:
         typedef InternalFunction Base;
 
-        static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errPrototype)
+        static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)
         {
-            return new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(exec, globalObject, structure, errPrototype);
+            ErrorConstructor* constructor = new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(globalObject, structure);
+            constructor->finishCreation(exec, errorPrototype);
+            return constructor;
         }
 
     protected:
         void finishCreation(ExecState*, ErrorPrototype*);
         
     private:
-        ErrorConstructor(ExecState*, JSGlobalObject*, Structure*, ErrorPrototype*);
+        ErrorConstructor(JSGlobalObject*, Structure*);
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
     };
index 458974ea365a5d640b6275e688ee469a9b3adc1b..304249d95492235e168714881784bf22dda186b1 100644 (file)
@@ -37,10 +37,9 @@ namespace JSC {
 
 ASSERT_CLASS_FITS_IN_CELL(FunctionConstructor);
 
-FunctionConstructor::FunctionConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)
+FunctionConstructor::FunctionConstructor(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure)
 {
-    finishCreation(exec, functionPrototype);
 }
 
 void FunctionConstructor::finishCreation(ExecState* exec, FunctionPrototype* functionPrototype)
index d436a27acac89c96faa646b8086a8dcd416cd350..3034ef1ffd21f6ff175dab0c88ec6a83694a2ba1 100644 (file)
@@ -31,13 +31,15 @@ namespace JSC {
     public:
         typedef InternalFunction Base;
 
-        static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* funcPrototype)
+        static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)
         {
-            return new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(exec, globalObject, structure, funcPrototype);
+            FunctionConstructor* constructor = new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(globalObject, structure);
+            constructor->finishCreation(exec, functionPrototype);
+            return constructor;
         }
 
     private:
-        FunctionConstructor(ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*);
+        FunctionConstructor(JSGlobalObject*, Structure*);
         void finishCreation(ExecState*, FunctionPrototype*);
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
index 7212eb783525a2cf2beef4d3ec9fdc27d8c2deeb..a97d96529e1961f419fc2a4cde4eea561397fdff 100644 (file)
@@ -37,10 +37,9 @@ static EncodedJSValue JSC_HOST_CALL functionProtoFuncToString(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionProtoFuncApply(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionProtoFuncCall(ExecState*);
 
-FunctionPrototype::FunctionPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
+FunctionPrototype::FunctionPrototype(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure)
 {
-    finishCreation(exec, exec->propertyNames().nullIdentifier);
 }
 
 void FunctionPrototype::finishCreation(ExecState* exec, const Identifier& name)
index 9ad70f701562c2d957d7dbe983d00b0f56f9390e..90d87891b171df70b41317fa37dd812cb58d7c24 100644 (file)
@@ -31,7 +31,9 @@ namespace JSC {
 
         static FunctionPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
         {
-            return new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(exec, globalObject, structure);
+            FunctionPrototype* prototype = new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(globalObject, structure);
+            prototype->finishCreation(exec, exec->propertyNames().nullIdentifier);
+            return prototype;
         }
         
         void addFunctionProperties(ExecState*, JSGlobalObject*, Structure* functionStructure, JSFunction** callFunction, JSFunction** applyFunction);
@@ -45,7 +47,7 @@ namespace JSC {
         void finishCreation(ExecState*, const Identifier& name);
 
     private:
-        FunctionPrototype(ExecState*, JSGlobalObject*, Structure*);
+        FunctionPrototype(JSGlobalObject*, Structure*);
         virtual CallType getCallData(CallData&);
     };
 
index 537a4576c7023c097025a2bc08e6fb4a3d9f6063..a103c3761362c253b6ce28da1f2c02a61af6cdf7 100644 (file)
@@ -32,10 +32,9 @@ ASSERT_CLASS_FITS_IN_CELL(NativeErrorConstructor);
 
 const ClassInfo NativeErrorConstructor::s_info = { "Function", &InternalFunction::s_info, 0, 0 };
 
-NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name)
+NativeErrorConstructor::NativeErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure)
 {
-    finishCreation(exec, globalObject, prototypeStructure, name);
 }
 
 void NativeErrorConstructor::visitChildren(SlotVisitor& visitor)
index 1a0b4e07862af732c3e5c84f77b2de187f936b2e..a7acc5a2a9694f688ebea49f2cbddd3d3487dffc 100644 (file)
@@ -36,7 +36,9 @@ namespace JSC {
 
         static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name)
         {
-            return new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(exec, globalObject, structure, prototypeStructure, name);
+            NativeErrorConstructor* constructor = new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(globalObject, structure);
+            constructor->finishCreation(exec, globalObject, prototypeStructure, name);
+            return constructor;
         }
         
         static const ClassInfo s_info;
@@ -64,7 +66,7 @@ namespace JSC {
         }
 
     private:
-        NativeErrorConstructor(ExecState*, JSGlobalObject*, Structure*, Structure* prototypeStructure, const UString&);
+        NativeErrorConstructor(JSGlobalObject*, Structure*);
         static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags;
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
index 5b2899ea30c1931787a21234371e6b03be19f1d4..dfdd87f85321b9197977bf5d7f59bc037b08764b 100644 (file)
@@ -30,13 +30,12 @@ namespace JSC {
 
 ASSERT_CLASS_FITS_IN_CELL(NativeErrorPrototype);
 
-NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& nameAndMessage, NativeErrorConstructor* constructor)
+NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, Structure* structure)
     : ErrorPrototype(exec, structure)
 {
-    finishCreation(exec, globalObject, nameAndMessage, constructor);
 }
 
-inline void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor)
+void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor)
 {
     Base::finishCreation(exec, globalObject);
     putDirect(exec->globalData(), exec->propertyNames().name, jsString(exec, nameAndMessage), DontEnum);
index d894ab4f35306a8fa79bea9ac4e97178ff75d09f..76ad706defa90e9435a919f73dc6344ef63434d9 100644 (file)
@@ -28,14 +28,16 @@ namespace JSC {
 
     class NativeErrorPrototype : public ErrorPrototype {
     private:
-        NativeErrorPrototype(ExecState*, JSGlobalObject*, Structure*, const UString&, NativeErrorConstructor*);
+        NativeErrorPrototype(ExecState*, Structure*);
     
     public:
         typedef ErrorPrototype Base;
 
         static NativeErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& name, NativeErrorConstructor* constructor)
         {
-            return new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, globalObject, structure, name, constructor);
+            NativeErrorPrototype* prototype = new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, structure);
+            prototype->finishCreation(exec, globalObject, name, constructor);
+            return prototype;
         }
 
     protected:
index 638e3ff9b55de62a5616d071ae90622fc3d59c81..f78a04e9215889385f89d01f28290b05a09d6c3e 100644 (file)
@@ -54,10 +54,9 @@ const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_i
 @end
 */
 
-NumberConstructor::NumberConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)
+NumberConstructor::NumberConstructor(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure) 
 {
-    finishCreation(exec, numberPrototype);
 }
 
 void NumberConstructor::finishCreation(ExecState* exec, NumberPrototype* numberPrototype)
index 84c4d1fb629682a564f1a1b6f81dd2ed99176727..4d641b984251367b2e9d6ec9a94e131d66cbea09 100644 (file)
@@ -31,9 +31,11 @@ namespace JSC {
     public:
         typedef InternalFunction Base;
 
-        static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numPrototype)
+        static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)
         {
-            return new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(exec, globalObject, structure, numPrototype);
+            NumberConstructor* constructor = new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(globalObject, structure);
+            constructor->finishCreation(exec, numberPrototype);
+            return constructor;
         }
 
         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
@@ -54,7 +56,7 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags;
 
     private:
-        NumberConstructor(ExecState*, JSGlobalObject*, Structure*, NumberPrototype*);
+        NumberConstructor(JSGlobalObject*, Structure*);
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
     };
index 8701e9117fc81e9f930e0cd80b50a0a341fa5a6a..07da1e422c6abc7f5296f654b0a27b5e9072ada1 100644 (file)
@@ -70,10 +70,9 @@ const ClassInfo NumberPrototype::s_info = { "Number", &NumberObject::s_info, 0,
 
 ASSERT_CLASS_FITS_IN_CELL(NumberPrototype);
 
-NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
+NumberPrototype::NumberPrototype(ExecState* exec, Structure* structure)
     : NumberObject(exec->globalData(), structure)
 {
-    finishCreation(exec, globalObject);
 }
 
 void NumberPrototype::finishCreation(ExecState* exec, JSGlobalObject*)
index 8e1007acbbc8bc6ca505241de667f3cde6d48040..341fcccd906f322a00c3ebc07efb8eeb18120433 100644 (file)
@@ -31,7 +31,9 @@ namespace JSC {
 
         static NumberPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
         {
-            return new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, globalObject, structure);
+            NumberPrototype* prototype = new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, structure);
+            prototype->finishCreation(exec, globalObject);
+            return prototype;
         }
         
         static const ClassInfo s_info;
@@ -46,7 +48,7 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NumberObject::StructureFlags;
 
     private:
-        NumberPrototype(ExecState*, JSGlobalObject*, Structure*);
+        NumberPrototype(ExecState*, Structure*);
         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     };
index 1eb3621b16ed1f40aa2e26b0525f030efb738fa1..de56652c4efda19c019415b83213865031b65bc9 100644 (file)
@@ -75,10 +75,9 @@ const ClassInfo ObjectConstructor::s_info = { "Function", &InternalFunction::s_i
 @end
 */
 
-ObjectConstructor::ObjectConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype)
+ObjectConstructor::ObjectConstructor(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure)
 {
-    finishCreation(exec, objectPrototype);
 }
 
 void ObjectConstructor::finishCreation(ExecState* exec, ObjectPrototype* objectPrototype)
index 4c3202881b204cc4128f87428e407a113c2970d0..b84212f0d04c3357b11619f644ab5dc74a54431d 100644 (file)
@@ -31,9 +31,11 @@ namespace JSC {
     public:
         typedef InternalFunction Base;
 
-        static ObjectConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objPrototype)
+        static ObjectConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype)
         {
-            return new (allocateCell<ObjectConstructor>(*exec->heap())) ObjectConstructor(exec, globalObject, structure, objPrototype);
+            ObjectConstructor* constructor = new (allocateCell<ObjectConstructor>(*exec->heap())) ObjectConstructor(globalObject, structure);
+            constructor->finishCreation(exec, objectPrototype);
+            return constructor;
         }
 
         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
@@ -51,7 +53,7 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
 
     private:
-        ObjectConstructor(ExecState*, JSGlobalObject*, Structure*, ObjectPrototype*);
+        ObjectConstructor(JSGlobalObject*, Structure*);
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
     };
index fe06b6cd4973caed770542dbf1d9e426e84c1c18..cafa1291bc25c95e57791b15c0d4a92add0cdc6e 100644 (file)
@@ -95,11 +95,10 @@ const ClassInfo RegExpConstructor::s_info = { "Function", &InternalFunction::s_i
 @end
 */
 
-RegExpConstructor::RegExpConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)
+RegExpConstructor::RegExpConstructor(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure)
     , d(adoptPtr(new RegExpConstructorPrivate))
 {
-    finishCreation(exec, regExpPrototype);
 }
 
 void RegExpConstructor::finishCreation(ExecState* exec, RegExpPrototype* regExpPrototype)
index 5fa761ea6b0afa755d9843b33b6d3b782c638a3c..a9a9e693af12d413849c1d6e447a0946dfec7af4 100644 (file)
@@ -61,7 +61,9 @@ namespace JSC {
 
         static RegExpConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)
         {
-            return new (allocateCell<RegExpConstructor>(*exec->heap())) RegExpConstructor(exec, globalObject, structure, regExpPrototype);
+            RegExpConstructor* constructor = new (allocateCell<RegExpConstructor>(*exec->heap())) RegExpConstructor(globalObject, structure);
+            constructor->finishCreation(exec, regExpPrototype);
+            return constructor;
         }
 
         static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
@@ -94,7 +96,7 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags;
 
     private:
-        RegExpConstructor(ExecState*, JSGlobalObject*, Structure*, RegExpPrototype*);
+        RegExpConstructor(JSGlobalObject*, Structure*);
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
 
index 91b88697f3db8b7804aff2b08ead8d8278493fe6..6c18729f7022c6dae13ff1c841ae8fa076477bb6 100644 (file)
@@ -62,10 +62,9 @@ const ClassInfo RegExpPrototype::s_info = { "RegExp", &RegExpObject::s_info, 0,
 
 ASSERT_CLASS_FITS_IN_CELL(RegExpPrototype);
 
-RegExpPrototype::RegExpPrototype(ExecState*, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
+RegExpPrototype::RegExpPrototype(JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
     : RegExpObject(globalObject, structure, regExp)
 {
-    finishCreation(globalObject);
 }
 
 bool RegExpPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
index c32a9bf87eef635e0a862dffbdc3752efae77d59..ca2a26d81533f34cdb7877bf35ca7dd7959ef008 100644 (file)
@@ -32,7 +32,9 @@ namespace JSC {
 
         static RegExpPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
         {
-            return new (allocateCell<RegExpPrototype>(*exec->heap())) RegExpPrototype(exec, globalObject, structure, regExp);
+            RegExpPrototype* prototype = new (allocateCell<RegExpPrototype>(*exec->heap())) RegExpPrototype(globalObject, structure, regExp);
+            prototype->finishCreation(globalObject);
+            return prototype;
         }
         
         static const ClassInfo s_info;
@@ -43,7 +45,7 @@ namespace JSC {
         }
 
     protected:
-        RegExpPrototype(ExecState*, JSGlobalObject*, Structure*, RegExp*);
+        RegExpPrototype(JSGlobalObject*, Structure*, RegExp*);
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | RegExpObject::StructureFlags;
 
     private:
index dbb161f0bd1e53e0bf94f51359aa5cba802fe055..6f352664de145a137188f7cf717dde3da3d9ca13 100644 (file)
@@ -47,10 +47,9 @@ const ClassInfo StringConstructor::s_info = { "Function", &InternalFunction::s_i
 
 ASSERT_CLASS_FITS_IN_CELL(StringConstructor);
 
-StringConstructor::StringConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, StringPrototype* stringPrototype)
+StringConstructor::StringConstructor(JSGlobalObject* globalObject, Structure* structure)
     : InternalFunction(globalObject, structure)
 {
-    finishCreation(exec, stringPrototype);
 }
 
 void StringConstructor::finishCreation(ExecState* exec, StringPrototype* stringPrototype)
index 80e371620905e098bc31feef12707cc78ce0b2d4..957b4b31930b6e5f0dae683788c54d5db3051847 100644 (file)
@@ -31,9 +31,11 @@ namespace JSC {
     public:
         typedef InternalFunction Base;
 
-        static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* strPrototype)
+        static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* stringPrototype)
         {
-            return new (allocateCell<StringConstructor>(*exec->heap())) StringConstructor(exec, globalObject, structure, strPrototype);
+            StringConstructor* constructor = new (allocateCell<StringConstructor>(*exec->heap())) StringConstructor(globalObject, structure);
+            constructor->finishCreation(exec, stringPrototype);
+            return constructor;
         }
 
         static const ClassInfo s_info;
@@ -47,7 +49,7 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
 
     private:
-        StringConstructor(ExecState*, JSGlobalObject*, Structure*, StringPrototype*);
+        StringConstructor(JSGlobalObject*, Structure*);
         void finishCreation(ExecState*, StringPrototype*);
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
index c04efde3e1add257bf7daa96b0cd6b18144e1c0e..e021eb543722653c33fc4b1bf76bd1bc5015e884 100644 (file)
@@ -36,14 +36,15 @@ namespace JSC {
         {
             JSString* newString = jsString(exec, string);
             Structure* structure = createStructure(exec->globalData(), exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->stringPrototype());
-            return new (allocateCell<StringObjectThatMasqueradesAsUndefined>(*exec->heap())) StringObjectThatMasqueradesAsUndefined(exec, structure, newString);
+            StringObjectThatMasqueradesAsUndefined* object = new (allocateCell<StringObjectThatMasqueradesAsUndefined>(*exec->heap())) StringObjectThatMasqueradesAsUndefined(exec, structure);
+            object->finishCreation(exec->globalData(), newString);
+            return object;
         }
 
     private:
-        StringObjectThatMasqueradesAsUndefined(ExecState* exec, Structure* structure, JSString* string)
+        StringObjectThatMasqueradesAsUndefined(ExecState* exec, Structure* structure)
             : StringObject(exec->globalData(), structure)
         {
-            finishCreation(exec->globalData(), string);
         }
 
         static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) 
index a1c9aa9f1cb6e85014532810ae23c0c84bba529c..8e19f01dcbd400053b23748a35d06aaa931e1b1e 100644 (file)
@@ -131,10 +131,9 @@ const ClassInfo StringPrototype::s_info = { "String", &StringObject::s_info, 0,
 */
 
 // ECMA 15.5.4
-StringPrototype::StringPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSString* nameAndMessage)
+StringPrototype::StringPrototype(ExecState* exec, Structure* structure)
     : StringObject(exec->globalData(), structure)
 {
-    finishCreation(exec, globalObject, nameAndMessage);
 }
 
 void StringPrototype::finishCreation(ExecState* exec, JSGlobalObject*, JSString* nameAndMessage)
index 49a1da208d1e0c182854325b84444c237be838d9..121433c563af9de541a65c07a67c9a0b13812d52 100644 (file)
@@ -29,14 +29,17 @@ namespace JSC {
 
     class StringPrototype : public StringObject {
     private:
-        StringPrototype(ExecState*, JSGlobalObject*, Structure*, JSString*);
+        StringPrototype(ExecState*, Structure*);
 
     public:
         typedef StringObject Base;
 
         static StringPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
         {
-            return new (allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, globalObject, structure, jsEmptyString(exec));
+            JSString* empty = jsEmptyString(exec);
+            StringPrototype* prototype = new (allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, structure);
+            prototype->finishCreation(exec, globalObject, empty);
+            return prototype;
         }
 
         virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
index 6f1be1485b6b0a47074ab7fe1347b2d40068dde6..a72c5ced59fb3d8af3d2c0c1e8404c81313f2c8b 100644 (file)
@@ -1,3 +1,27 @@
+2011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Unzip initialization lists and constructors in JSCell hierarchy (6/7)
+        https://bugs.webkit.org/show_bug.cgi?id=67692
+
+        Reviewed by Geoffrey Garen.
+
+        Completed the sixth level of the refactoring to add finishCreation() 
+        methods to all classes within the JSCell hierarchy with non-trivial 
+        constructor bodies.
+
+        This primarily consists of pushing the calls to finishCreation() down 
+        into the constructors of the subclasses of the fifth level of the hierarchy 
+        as well as pulling the finishCreation() calls out into the class's corresponding
+        create() method if it has one.  Doing both simultaneously allows us to 
+        maintain the invariant that the finishCreation() method chain is called exactly 
+        once during the creation of an object, since calling it any other number of 
+        times (0, 2, or more) will cause an assertion failure.
+
+        * JSRun.cpp:
+        (JSGlueGlobalObject::JSGlueGlobalObject):
+        * JSRun.h:
+        (JSGlueGlobalObject::create):
+
 2011-09-13  Anders Carlsson  <andersca@apple.com>
 
         Disable C++ exceptions when building with clang
index 0642634e77826fa3f1cd277899b5ac5fc3795a2d..63192e2c8a32ff70e0afd9b4e35f36903213ad83 100644 (file)
@@ -38,7 +38,6 @@ JSGlueGlobalObject::JSGlueGlobalObject(JSGlobalData& globalData, Structure* stru
     , m_flags(flags)
     , m_userObjectStructure(globalData, userObjectStructure)
 {
-    finishCreation(globalData, this);
 }
 
 JSRun::JSRun(CFStringRef source, JSFlags inFlags)
index af9ea490a5cc4d08426d44ddbf2eec3ed6a4001f..c8cd0113fe2e2df0ecf14fb161c254b6eed6bee6 100644 (file)
@@ -41,7 +41,9 @@ class JSGlueGlobalObject : public JSGlobalObject {
         static JSGlueGlobalObject* create(JSGlobalData& globalData, Structure* structure, JSFlags flags = kJSFlagNone)
         {
             Structure* userObjectStructure = UserObjectImp::createStructure(globalData, 0, jsNull());
-            return new (allocateCell<JSGlueGlobalObject>(globalData.heap)) JSGlueGlobalObject(globalData, structure, userObjectStructure, flags);
+            JSGlueGlobalObject* object = new (allocateCell<JSGlueGlobalObject>(globalData.heap)) JSGlueGlobalObject(globalData, structure, userObjectStructure, flags);
+            object->finishCreation(globalData, object);
+            return object;
         }
 
         JSFlags Flags() const { return m_flags; }
index 352a8aad72b14a0a8f0fc2949a3db4488c2520da..4158de67de1b022d1243b7b09d7374e5d7eb3f34 100644 (file)
@@ -1,3 +1,133 @@
+2011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Unzip initialization lists and constructors in JSCell hierarchy (6/7)
+        https://bugs.webkit.org/show_bug.cgi?id=67692
+
+        Reviewed by Geoffrey Garen.
+
+        No new tests.
+
+        Completed the sixth level of the refactoring to add finishCreation() 
+        methods to all classes within the JSCell hierarchy with non-trivial 
+        constructor bodies.
+
+        This primarily consists of pushing the calls to finishCreation() down 
+        into the constructors of the subclasses of the fifth level of the hierarchy 
+        as well as pulling the finishCreation() calls out into the class's corresponding
+        create() method if it has one.  Doing both simultaneously allows us to 
+        maintain the invariant that the finishCreation() method chain is called exactly 
+        once during the creation of an object, since calling it any other number of 
+        times (0, 2, or more) will cause an assertion failure.
+
+        * WebCore.exp.in:
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::DOMConstructorObject::DOMConstructorObject):
+        (WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument):
+        (WebCore::DOMConstructorWithDocument::finishCreation):
+        * bindings/js/JSDOMGlobalObject.cpp:
+        (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
+        * bindings/js/JSDOMGlobalObject.h:
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::JSDOMWindowBase):
+        (WebCore::JSDOMWindowBase::finishCreation):
+        * bindings/js/JSDOMWindowBase.h:
+        * bindings/js/JSWorkerContextBase.cpp:
+        (WebCore::JSWorkerContextBase::JSWorkerContextBase):
+        (WebCore::JSWorkerContextBase::finishCreation):
+        * bindings/js/JSWorkerContextBase.h:
+        * bindings/scripts/CodeGeneratorJS.pm:
+
+        Added a finishCreation declaration and Moved the finishCreation call into the 
+        create method for all classes except for subclasses of JSWorkerContextBase and 
+        JSDOMWindowBase because those classes are on the next level, and it's easier 
+        to do all of these classes in one fell swoop rather than level by level.
+        (GenerateHeader):
+        Added the implementation of the finishCreation method for the classes described above.
+        (GenerateImplementation):
+        Also added the finishCreation calls to the autogenerated DOM constructor classes.
+        (GenerateConstructorDeclaration):
+        (GenerateConstructorDefinition):
+
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        (WebCore::JSTestInterfaceConstructor::create):
+        (WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor):
+        (WebCore::JSTestInterfaceConstructor::finishCreation):
+        (WebCore::JSTestInterface::JSTestInterface):
+        (WebCore::JSTestInterface::finishCreation):
+        * bindings/scripts/test/JS/JSTestInterface.h:
+        (WebCore::JSTestInterface::create):
+        (WebCore::JSTestInterfacePrototype::create):
+        (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
+        (WebCore::JSTestMediaQueryListListenerConstructor::create):
+        (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor):
+        (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
+        (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
+        (WebCore::JSTestMediaQueryListListener::finishCreation):
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
+        (WebCore::JSTestMediaQueryListListener::create):
+        (WebCore::JSTestMediaQueryListListenerPrototype::create):
+        (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::JSTestObjConstructor::create):
+        (WebCore::JSTestObjConstructor::JSTestObjConstructor):
+        (WebCore::JSTestObjConstructor::finishCreation):
+        (WebCore::JSTestObj::JSTestObj):
+        (WebCore::JSTestObj::finishCreation):
+        * bindings/scripts/test/JS/JSTestObj.h:
+        (WebCore::JSTestObj::create):
+        (WebCore::JSTestObjPrototype::create):
+        (WebCore::JSTestObjPrototype::JSTestObjPrototype):
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::create):
+        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor):
+        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
+        (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
+        (WebCore::JSTestSerializedScriptValueInterface::finishCreation):
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
+        (WebCore::JSTestSerializedScriptValueInterface::create):
+        (WebCore::JSTestSerializedScriptValueInterfacePrototype::create):
+        (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
+        * bridge/c/CRuntimeObject.cpp:
+        (JSC::Bindings::CRuntimeObject::CRuntimeObject):
+        * bridge/c/CRuntimeObject.h:
+        (JSC::Bindings::CRuntimeObject::create):
+        * bridge/c/c_instance.cpp:
+        (JSC::Bindings::CRuntimeMethod::CRuntimeMethod):
+        (JSC::Bindings::CRuntimeMethod::finishCreation):
+        * bridge/jni/jsc/JavaInstanceJSC.cpp:
+        (JavaRuntimeMethod::JavaRuntimeMethod):
+        (JavaRuntimeMethod::finishCreation):
+        * bridge/jni/jsc/JavaRuntimeObject.cpp:
+        (JSC::Bindings::JavaRuntimeObject::JavaRuntimeObject):
+        * bridge/jni/jsc/JavaRuntimeObject.h:
+        (JSC::Bindings::JavaRuntimeObject::create):
+        * bridge/objc/ObjCRuntimeObject.h:
+        (JSC::Bindings::ObjCRuntimeObject::create):
+        * bridge/objc/ObjCRuntimeObject.mm:
+        (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
+        * bridge/objc/objc_instance.mm:
+        (ObjCRuntimeMethod::ObjCRuntimeMethod):
+        (ObjCRuntimeMethod::finishCreation):
+        * bridge/qt/qt_instance.cpp:
+        (JSC::Bindings::QtRuntimeObject::create):
+        (JSC::Bindings::QtRuntimeObject::QtRuntimeObject):
+        * bridge/qt/qt_pixmapruntime.cpp:
+        (JSC::Bindings::QtPixmapRuntimeObject::create):
+        (JSC::Bindings::QtPixmapRuntimeObject::QtPixmapRuntimeObject):
+        * bridge/qt/qt_runtime.cpp:
+        (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod):
+        (JSC::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
+        (JSC::Bindings::QtRuntimeMetaMethod::finishCreation):
+        (JSC::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod):
+        (JSC::Bindings::QtRuntimeConnectionMethod::finishCreation):
+        * bridge/qt/qt_runtime.h:
+        (JSC::Bindings::QtRuntimeMetaMethod::create):
+        * bridge/runtime_method.cpp:
+        (JSC::RuntimeMethod::RuntimeMethod):
+        * bridge/runtime_method.h:
+        (JSC::RuntimeMethod::create):
+
 2011-09-13  Eric Seidel  <eric@webkit.org>
 
         Remove ENABLE_SVG_USE as <use> is required by HTML5
index 7de37b57273a0d75c8363f10539fbb485278b7b3..fddd6a8652b8b11a202a726c968e1eca6f923310 100644 (file)
@@ -1643,10 +1643,11 @@ __ZN7WebCore5Frame26sendOrientationChangeEventEi
 
 #if USE(PLUGIN_HOST_PROCESS)
 __ZN3JSC13RuntimeMethod11getCallDataERNS_8CallDataE
+__ZN3JSC13RuntimeMethod14finishCreationERNS_12JSGlobalDataERKNS_10IdentifierE
 __ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
 __ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
 __ZN3JSC13RuntimeMethod6s_infoE
-__ZN3JSC13RuntimeMethodC2EPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureERKNS_10IdentifierERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE
+__ZN3JSC13RuntimeMethodC2EPNS_14JSGlobalObjectEPNS_9StructureERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE
 __ZN3JSC8Bindings10RootObjectD1Ev
 __ZN3JSC8Bindings13RuntimeObject11getCallDataERNS_8CallDataE
 __ZN3JSC8Bindings13RuntimeObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
index ac8e9808a45cb42bff3e635bbe25fa7e30afa133..4e290ed91932ccc9e626897c08d14794559b7b16 100644 (file)
@@ -44,6 +44,7 @@ namespace WebCore {
 
     // Base class for all constructor objects in the JSC bindings.
     class DOMConstructorObject : public JSDOMWrapper {
+        typedef JSDOMWrapper Base;
     public:
         static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
         {
@@ -55,13 +56,13 @@ namespace WebCore {
         DOMConstructorObject(JSC::Structure* structure, JSDOMGlobalObject* globalObject)
             : JSDOMWrapper(structure, globalObject)
         {
-            finishCreation(globalObject->globalData());
         }
     };
 
     // Constructors using this base class depend on being in a Document and
     // can never be used from a WorkerContext.
     class DOMConstructorWithDocument : public DOMConstructorObject {
+        typedef DOMConstructorObject Base;
     public:
         Document* document() const
         {
@@ -72,6 +73,12 @@ namespace WebCore {
         DOMConstructorWithDocument(JSC::Structure* structure, JSDOMGlobalObject* globalObject)
             : DOMConstructorObject(structure, globalObject)
         {
+            finishCreation(globalObject);
+        }
+
+        void finishCreation(JSDOMGlobalObject* globalObject)
+        {
+            Base::finishCreation(globalObject->globalData());
             ASSERT(globalObject->scriptExecutionContext()->isDocument());
         }
     };
index f9eaf6a49b1e9f4bc8597e0c921569f314866c04..71d98c91a57d7b613317da6a7b4812547051420c 100644 (file)
@@ -42,12 +42,11 @@ namespace WebCore {
 
 const ClassInfo JSDOMGlobalObject::s_info = { "DOMGlobalObject", &JSGlobalObject::s_info, 0, 0 };
 
-JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWrapperWorld> world, JSObject* thisValue)
+JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWrapperWorld> world)
     : JSGlobalObject(globalData, structure)
     , m_currentEvent(0)
     , m_world(world)
 {
-    finishCreation(globalData, thisValue);
 }
 
 void JSDOMGlobalObject::finishCreation(JSGlobalData& globalData, JSObject* thisValue)
index 014b569ba2b31e9539d76e535b05e976f43bbedd..9002830834e0f30b1be0d42f816b92e9312594c0 100644 (file)
@@ -46,7 +46,7 @@ namespace WebCore {
     protected:
         struct JSDOMGlobalObjectData;
 
-        JSDOMGlobalObject(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWrapperWorld>, JSC::JSObject* thisValue);
+        JSDOMGlobalObject(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWrapperWorld>);
         void finishCreation(JSC::JSGlobalData&, JSC::JSObject* thisValue);
 
     public:
index 982eb6ced58cc720516ccfdd90fe58202448195a..7fcae7646b64378db490256e0d4427f59170b13b 100644 (file)
@@ -44,10 +44,16 @@ namespace WebCore {
 const ClassInfo JSDOMWindowBase::s_info = { "Window", &JSDOMGlobalObject::s_info, 0, 0 };
 
 JSDOMWindowBase::JSDOMWindowBase(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWindow> window, JSDOMWindowShell* shell)
-    : JSDOMGlobalObject(globalData, structure, shell->world(), shell)
+    : JSDOMGlobalObject(globalData, structure, shell->world())
     , m_impl(window)
     , m_shell(shell)
 {
+    finishCreation(globalData, shell);
+}
+
+void JSDOMWindowBase::finishCreation(JSGlobalData& globalData, JSDOMWindowShell* shell)
+{
+    Base::finishCreation(globalData, shell);
     ASSERT(inherits(&s_info));
 
     GlobalPropertyInfo staticGlobals[] = {
index a2c4785532897e0618c195904729083f77381d2b..ff7953725e4c44de738fdb73f6db61455448d0e8 100644 (file)
@@ -38,6 +38,7 @@ namespace WebCore {
         typedef JSDOMGlobalObject Base;
     protected:
         JSDOMWindowBase(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWindow>, JSDOMWindowShell*);
+        void finishCreation(JSC::JSGlobalData&, JSDOMWindowShell*);
 
     public:
         void updateDocument();
index 687f74c8eecab0ee6f410b1af329320253a27827..6584e86f744bd49fb1ce30dc59eeb076410f969d 100644 (file)
@@ -49,9 +49,15 @@ ASSERT_CLASS_FITS_IN_CELL(JSWorkerContextBase);
 const ClassInfo JSWorkerContextBase::s_info = { "WorkerContext", &JSDOMGlobalObject::s_info, 0, 0 };
 
 JSWorkerContextBase::JSWorkerContextBase(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<WorkerContext> impl)
-    : JSDOMGlobalObject(globalData, structure, normalWorld(globalData), this)
+    : JSDOMGlobalObject(globalData, structure, normalWorld(globalData))
     , m_impl(impl)
 {
+    finishCreation(globalData, this);
+}
+
+void JSWorkerContextBase::finishCreation(JSGlobalData& globalData, JSWorkerContextBase* thisValue)
+{
+    Base::finishCreation(globalData, thisValue);
     ASSERT(inherits(&s_info));
 }
 
index b086336c442d58dd38e7a639b4bb60f8adf0bfa8..6dc80c87865c9856262c6902a3ca70e219844258 100644 (file)
@@ -41,7 +41,6 @@ namespace WebCore {
     class JSWorkerContextBase : public JSDOMGlobalObject {
         typedef JSDOMGlobalObject Base;
     public:
-        JSWorkerContextBase(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<WorkerContext>);
         virtual ~JSWorkerContextBase();
 
         static const JSC::ClassInfo s_info;
@@ -54,6 +53,10 @@ namespace WebCore {
             return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
         }
 
+    protected:
+        JSWorkerContextBase(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<WorkerContext>);
+        void finishCreation(JSC::JSGlobalData&, JSWorkerContextBase*);
+
     private:
         RefPtr<WorkerContext> m_impl;
     };
index e89fb3fed43d0e5d43b629b49aca712795e7d022..2625205d783c9070cb2d81d168ffe307e60f41a1 100644 (file)
@@ -730,18 +730,22 @@ sub GenerateHeader
     if ($interfaceName eq "DOMWindow") {
         push(@headerContent, "    static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* windowShell)\n");
         push(@headerContent, "    {\n");
-        push(@headerContent, "        return new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n");
+        push(@headerContent, "        $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n");
+        push(@headerContent, "        return ptr;\n");
         push(@headerContent, "    }\n\n");
     } elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) {
         push(@headerContent, "    static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl)\n");
         push(@headerContent, "    {\n");
-        push(@headerContent, "        return new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n");
+        push(@headerContent, "        $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n");
+        push(@headerContent, "        return ptr;\n");
         push(@headerContent, "    }\n\n");
     } else {
         AddIncludesForTypeInHeader($implType) unless $svgPropertyOrListPropertyType;
         push(@headerContent, "    static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n");
         push(@headerContent, "    {\n");
-        push(@headerContent, "        return new (JSC::allocateCell<$className>(globalObject->globalData().heap)) $className(structure, globalObject, impl);\n");
+        push(@headerContent, "        $className* ptr = new (JSC::allocateCell<$className>(globalObject->globalData().heap)) $className(structure, globalObject, impl);\n");
+        push(@headerContent, "        ptr->finishCreation(globalObject->globalData());\n");
+        push(@headerContent, "        return ptr;\n");
         push(@headerContent, "    }\n\n");
     }
 
@@ -927,6 +931,7 @@ sub GenerateHeader
         push(@headerContent, "    $className(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<$implType>);\n");
     } else {
         push(@headerContent, "    $className(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<$implType>);\n");
+        push(@headerContent, "    void finishCreation(JSC::JSGlobalData&);\n");
     }
 
     # structure flags
@@ -1020,7 +1025,9 @@ sub GenerateHeader
 
     push(@headerContent, "    static ${className}Prototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)\n");
     push(@headerContent, "    {\n");
-    push(@headerContent, "        return new (JSC::allocateCell<${className}Prototype>(globalData.heap)) ${className}Prototype(globalData, globalObject, structure);\n");
+    push(@headerContent, "        ${className}Prototype* ptr = new (JSC::allocateCell<${className}Prototype>(globalData.heap)) ${className}Prototype(globalData, globalObject, structure);\n");
+    push(@headerContent, "        ptr->finishCreation(globalData);\n");
+    push(@headerContent, "        return ptr;\n");
     push(@headerContent, "    }\n\n");
 
     push(@headerContent, "    static const JSC::ClassInfo s_info;\n");
@@ -1048,7 +1055,7 @@ sub GenerateHeader
     push(@headerContent, "    virtual void defineGetter(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSObject* getterFunction, unsigned attributes);\n") if $dataNode->extendedAttributes->{"CustomPrototypeDefineGetter"};
 
     push(@headerContent, "\nprivate:\n");
-    push(@headerContent, "    ${className}Prototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }\n");
+    push(@headerContent, "    ${className}Prototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }\n");
 
     # structure flags
     push(@headerContent, "protected:\n");
@@ -1506,25 +1513,30 @@ sub GenerateImplementation
         push(@implContent, "${className}::$className(JSGlobalData& globalData, Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* shell)\n");
         push(@implContent, "    : $parentClassName(globalData, structure, impl, shell)\n");
         push(@implContent, "{\n");
+        push(@implContent, "}\n\n");
     } elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) {
         AddIncludesForTypeInImpl($interfaceName);
         push(@implContent, "${className}::$className(JSGlobalData& globalData, Structure* structure, PassRefPtr<$implType> impl)\n");
         push(@implContent, "    : $parentClassName(globalData, structure, impl)\n");
         push(@implContent, "{\n");
+        push(@implContent, "}\n\n");
     } else {
         push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n");
         if ($hasParent) {
             push(@implContent, "    : $parentClassName(structure, globalObject, impl)\n");
-            push(@implContent, "{\n");
         } else {
             push(@implContent, "    : $parentClassName(structure, globalObject)\n");
             push(@implContent, "    , m_impl(impl)\n");
-            push(@implContent, "{\n");
-            push(@implContent, "    finishCreation(globalObject->globalData());\n");
         }
+        push(@implContent, "{\n");
+        push(@implContent, "}\n\n");
+
+        push(@implContent, "void ${className}::finishCreation(JSGlobalData& globalData)\n");
+        push(@implContent, "{\n");
+        push(@implContent, "    Base::finishCreation(globalData);\n");
+        push(@implContent, "    ASSERT(inherits(&s_info));\n");
+        push(@implContent, "}\n\n");
     }
-    push(@implContent, "    ASSERT(inherits(&s_info));\n");
-    push(@implContent, "}\n\n");
 
     if (!$dataNode->extendedAttributes->{"ExtendsDOMGlobalObject"}) {
         push(@implContent, "JSObject* ${className}::createPrototype(ExecState* exec, JSGlobalObject* globalObject)\n");
@@ -3106,13 +3118,16 @@ sub GenerateConstructorDeclaration
 
     push(@$outputArray, "class ${constructorClassName} : public DOMConstructorObject {\n");
     push(@$outputArray, "private:\n");
-    push(@$outputArray, "    ${constructorClassName}(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);\n\n");
-    
+    push(@$outputArray, "    ${constructorClassName}(JSC::Structure*, JSDOMGlobalObject*);\n");
+    push(@$outputArray, "    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);\n\n");
+
     push(@$outputArray, "public:\n");
     push(@$outputArray, "    typedef DOMConstructorObject Base;\n");
     push(@$outputArray, "    static $constructorClassName* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)\n");
     push(@$outputArray, "    {\n");
-    push(@$outputArray, "        return new (JSC::allocateCell<$constructorClassName>(*exec->heap())) $constructorClassName(exec, structure, globalObject);\n");
+    push(@$outputArray, "        $constructorClassName* ptr = new (JSC::allocateCell<$constructorClassName>(*exec->heap())) $constructorClassName(structure, globalObject);\n");
+    push(@$outputArray, "        ptr->finishCreation(exec, globalObject);\n");
+    push(@$outputArray, "        return ptr;\n");
     push(@$outputArray, "    }\n\n");
 
     push(@$outputArray, "    virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n");
@@ -3152,9 +3167,14 @@ sub GenerateConstructorDefinition
 
     push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleClassName}Constructor\", &DOMConstructorObject::s_info, &${constructorClassName}Table, 0 };\n\n");
 
-    push(@$outputArray, "${constructorClassName}::${constructorClassName}(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)\n");
+    push(@$outputArray, "${constructorClassName}::${constructorClassName}(Structure* structure, JSDOMGlobalObject* globalObject)\n");
     push(@$outputArray, "    : DOMConstructorObject(structure, globalObject)\n");
     push(@$outputArray, "{\n");
+    push(@$outputArray, "}\n\n");
+
+    push(@$outputArray, "void ${constructorClassName}::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)\n");
+    push(@$outputArray, "{\n");
+    push(@$outputArray, "    Base::finishCreation(exec->globalData());\n");
     push(@$outputArray, "    ASSERT(inherits(&s_info));\n");
     if ($interfaceName eq "DOMWindow") {
         push(@$outputArray, "    putDirect(exec->globalData(), exec->propertyNames().prototype, globalObject->prototype(), DontDelete | ReadOnly);\n");
index 5047c61363602c3f73cbf7bc96bf459029b4fd98..45cf85694a9580dad388bcb7715fabea8cc6c281 100644 (file)
@@ -64,13 +64,16 @@ static const HashTableValue JSTestInterfaceConstructorTableValues[] =
 static JSC_CONST_HASHTABLE HashTable JSTestInterfaceConstructorTable = { 1, 0, JSTestInterfaceConstructorTableValues, 0 };
 class JSTestInterfaceConstructor : public DOMConstructorObject {
 private:
-    JSTestInterfaceConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
+    JSTestInterfaceConstructor(JSC::Structure*, JSDOMGlobalObject*);
+    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
 
 public:
     typedef DOMConstructorObject Base;
     static JSTestInterfaceConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
     {
-        return new (JSC::allocateCell<JSTestInterfaceConstructor>(*exec->heap())) JSTestInterfaceConstructor(exec, structure, globalObject);
+        JSTestInterfaceConstructor* ptr = new (JSC::allocateCell<JSTestInterfaceConstructor>(*exec->heap())) JSTestInterfaceConstructor(structure, globalObject);
+        ptr->finishCreation(exec, globalObject);
+        return ptr;
     }
 
     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
@@ -88,9 +91,14 @@ protected:
 
 const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0 };
 
-JSTestInterfaceConstructor::JSTestInterfaceConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
+JSTestInterfaceConstructor::JSTestInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
     : DOMConstructorObject(structure, globalObject)
 {
+}
+
+void JSTestInterfaceConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
+{
+    Base::finishCreation(exec->globalData());
     ASSERT(inherits(&s_info));
     putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
 }
@@ -146,7 +154,11 @@ JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject* global
     : JSDOMWrapper(structure, globalObject)
     , m_impl(impl)
 {
-    finishCreation(globalObject->globalData());
+}
+
+void JSTestInterface::finishCreation(JSGlobalData& globalData)
+{
+    Base::finishCreation(globalData);
     ASSERT(inherits(&s_info));
 }
 
index 432f73b74aa381d181a7c1319225aaacfe1efde0..5bfd89f223a75f859e7f33cdb281895a0c77902d 100644 (file)
@@ -36,7 +36,9 @@ public:
     typedef JSDOMWrapper Base;
     static JSTestInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
     {
-        return new (JSC::allocateCell<JSTestInterface>(globalObject->globalData().heap)) JSTestInterface(structure, globalObject, impl);
+        JSTestInterface* ptr = new (JSC::allocateCell<JSTestInterface>(globalObject->globalData().heap)) JSTestInterface(structure, globalObject, impl);
+        ptr->finishCreation(globalObject->globalData());
+        return ptr;
     }
 
     static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
@@ -56,6 +58,7 @@ private:
     RefPtr<TestInterface> m_impl;
 protected:
     JSTestInterface(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestInterface>);
+    void finishCreation(JSC::JSGlobalData&);
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 };
 
@@ -68,7 +71,9 @@ public:
     static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
     static JSTestInterfacePrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
     {
-        return new (JSC::allocateCell<JSTestInterfacePrototype>(globalData.heap)) JSTestInterfacePrototype(globalData, globalObject, structure);
+        JSTestInterfacePrototype* ptr = new (JSC::allocateCell<JSTestInterfacePrototype>(globalData.heap)) JSTestInterfacePrototype(globalData, globalObject, structure);
+        ptr->finishCreation(globalData);
+        return ptr;
     }
 
     static const JSC::ClassInfo s_info;
@@ -78,7 +83,7 @@ public:
     }
 
 private:
-    JSTestInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }
+    JSTestInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
 protected:
     static const unsigned StructureFlags = Base::StructureFlags;
 };
index 326bb2b178a8968a4e3c27e2dc66016e729c479a..cc9f5c06f5f31c36811858cade5f2bf11e4603c6 100644 (file)
@@ -65,13 +65,16 @@ static const HashTableValue JSTestMediaQueryListListenerConstructorTableValues[]
 static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerConstructorTable = { 1, 0, JSTestMediaQueryListListenerConstructorTableValues, 0 };
 class JSTestMediaQueryListListenerConstructor : public DOMConstructorObject {
 private:
-    JSTestMediaQueryListListenerConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
+    JSTestMediaQueryListListenerConstructor(JSC::Structure*, JSDOMGlobalObject*);
+    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
 
 public:
     typedef DOMConstructorObject Base;
     static JSTestMediaQueryListListenerConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
     {
-        return new (JSC::allocateCell<JSTestMediaQueryListListenerConstructor>(*exec->heap())) JSTestMediaQueryListListenerConstructor(exec, structure, globalObject);
+        JSTestMediaQueryListListenerConstructor* ptr = new (JSC::allocateCell<JSTestMediaQueryListListenerConstructor>(*exec->heap())) JSTestMediaQueryListListenerConstructor(structure, globalObject);
+        ptr->finishCreation(exec, globalObject);
+        return ptr;
     }
 
     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
@@ -87,9 +90,14 @@ protected:
 
 const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0 };
 
-JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
+JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
     : DOMConstructorObject(structure, globalObject)
 {
+}
+
+void JSTestMediaQueryListListenerConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
+{
+    Base::finishCreation(exec->globalData());
     ASSERT(inherits(&s_info));
     putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestMediaQueryListListenerPrototype::self(exec, globalObject), DontDelete | ReadOnly);
 }
@@ -142,7 +150,11 @@ JSTestMediaQueryListListener::JSTestMediaQueryListListener(Structure* structure,
     : JSDOMWrapper(structure, globalObject)
     , m_impl(impl)
 {
-    finishCreation(globalObject->globalData());
+}
+
+void JSTestMediaQueryListListener::finishCreation(JSGlobalData& globalData)
+{
+    Base::finishCreation(globalData);
     ASSERT(inherits(&s_info));
 }
 
index d4d5f65419edd90ee96650c97b192e8fd78503cb..6c142e9d9fa6df14e99cef74132781e2c9694216 100644 (file)
@@ -34,7 +34,9 @@ public:
     typedef JSDOMWrapper Base;
     static JSTestMediaQueryListListener* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl)
     {
-        return new (JSC::allocateCell<JSTestMediaQueryListListener>(globalObject->globalData().heap)) JSTestMediaQueryListListener(structure, globalObject, impl);
+        JSTestMediaQueryListListener* ptr = new (JSC::allocateCell<JSTestMediaQueryListListener>(globalObject->globalData().heap)) JSTestMediaQueryListListener(structure, globalObject, impl);
+        ptr->finishCreation(globalObject->globalData());
+        return ptr;
     }
 
     static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
@@ -54,6 +56,7 @@ private:
     RefPtr<TestMediaQueryListListener> m_impl;
 protected:
     JSTestMediaQueryListListener(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestMediaQueryListListener>);
+    void finishCreation(JSC::JSGlobalData&);
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 };
 
@@ -66,7 +69,9 @@ public:
     static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
     static JSTestMediaQueryListListenerPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
     {
-        return new (JSC::allocateCell<JSTestMediaQueryListListenerPrototype>(globalData.heap)) JSTestMediaQueryListListenerPrototype(globalData, globalObject, structure);
+        JSTestMediaQueryListListenerPrototype* ptr = new (JSC::allocateCell<JSTestMediaQueryListListenerPrototype>(globalData.heap)) JSTestMediaQueryListListenerPrototype(globalData, globalObject, structure);
+        ptr->finishCreation(globalData);
+        return ptr;
     }
 
     static const JSC::ClassInfo s_info;
@@ -78,7 +83,7 @@ public:
     }
 
 private:
-    JSTestMediaQueryListListenerPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }
+    JSTestMediaQueryListListenerPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
 protected:
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 };
index 3bb307e679ba923343c1152372df411cc3359b77..eebf825bcb3e6a1ee1a799e9979b9100e0a75b5b 100644 (file)
@@ -167,13 +167,16 @@ COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWro
 
 class JSTestObjConstructor : public DOMConstructorObject {
 private:
-    JSTestObjConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
+    JSTestObjConstructor(JSC::Structure*, JSDOMGlobalObject*);
+    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
 
 public:
     typedef DOMConstructorObject Base;
     static JSTestObjConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
     {
-        return new (JSC::allocateCell<JSTestObjConstructor>(*exec->heap())) JSTestObjConstructor(exec, structure, globalObject);
+        JSTestObjConstructor* ptr = new (JSC::allocateCell<JSTestObjConstructor>(*exec->heap())) JSTestObjConstructor(structure, globalObject);
+        ptr->finishCreation(exec, globalObject);
+        return ptr;
     }
 
     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
@@ -189,9 +192,14 @@ protected:
 
 const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0 };
 
-JSTestObjConstructor::JSTestObjConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
+JSTestObjConstructor::JSTestObjConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
     : DOMConstructorObject(structure, globalObject)
 {
+}
+
+void JSTestObjConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
+{
+    Base::finishCreation(exec->globalData());
     ASSERT(inherits(&s_info));
     putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
 }
@@ -299,7 +307,11 @@ JSTestObj::JSTestObj(Structure* structure, JSDOMGlobalObject* globalObject, Pass
     : JSDOMWrapper(structure, globalObject)
     , m_impl(impl)
 {
-    finishCreation(globalObject->globalData());
+}
+
+void JSTestObj::finishCreation(JSGlobalData& globalData)
+{
+    Base::finishCreation(globalData);
     ASSERT(inherits(&s_info));
 }
 
index fb74b5609979e266435d7d5459bd766ac0341960..8d53412e8676396c4e162153e12c7d3b8e74dd1f 100644 (file)
@@ -34,7 +34,9 @@ public:
     typedef JSDOMWrapper Base;
     static JSTestObj* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
     {
-        return new (JSC::allocateCell<JSTestObj>(globalObject->globalData().heap)) JSTestObj(structure, globalObject, impl);
+        JSTestObj* ptr = new (JSC::allocateCell<JSTestObj>(globalObject->globalData().heap)) JSTestObj(structure, globalObject, impl);
+        ptr->finishCreation(globalObject->globalData());
+        return ptr;
     }
 
     static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
@@ -67,6 +69,7 @@ private:
     RefPtr<TestObj> m_impl;
 protected:
     JSTestObj(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestObj>);
+    void finishCreation(JSC::JSGlobalData&);
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags;
 };
 
@@ -79,7 +82,9 @@ public:
     static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
     static JSTestObjPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
     {
-        return new (JSC::allocateCell<JSTestObjPrototype>(globalData.heap)) JSTestObjPrototype(globalData, globalObject, structure);
+        JSTestObjPrototype* ptr = new (JSC::allocateCell<JSTestObjPrototype>(globalData.heap)) JSTestObjPrototype(globalData, globalObject, structure);
+        ptr->finishCreation(globalData);
+        return ptr;
     }
 
     static const JSC::ClassInfo s_info;
@@ -91,7 +96,7 @@ public:
     }
 
 private:
-    JSTestObjPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }
+    JSTestObjPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
 protected:
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags;
 };
index 732b27281a08a52b7207d1fd226a388df2f82dfa..19071cba2f1611e52537d7aa96eae0f1154af972 100644 (file)
@@ -66,13 +66,16 @@ static const HashTableValue JSTestSerializedScriptValueInterfaceConstructorTable
 static JSC_CONST_HASHTABLE HashTable JSTestSerializedScriptValueInterfaceConstructorTable = { 1, 0, JSTestSerializedScriptValueInterfaceConstructorTableValues, 0 };
 class JSTestSerializedScriptValueInterfaceConstructor : public DOMConstructorObject {
 private:
-    JSTestSerializedScriptValueInterfaceConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
+    JSTestSerializedScriptValueInterfaceConstructor(JSC::Structure*, JSDOMGlobalObject*);
+    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
 
 public:
     typedef DOMConstructorObject Base;
     static JSTestSerializedScriptValueInterfaceConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
     {
-        return new (JSC::allocateCell<JSTestSerializedScriptValueInterfaceConstructor>(*exec->heap())) JSTestSerializedScriptValueInterfaceConstructor(exec, structure, globalObject);
+        JSTestSerializedScriptValueInterfaceConstructor* ptr = new (JSC::allocateCell<JSTestSerializedScriptValueInterfaceConstructor>(*exec->heap())) JSTestSerializedScriptValueInterfaceConstructor(structure, globalObject);
+        ptr->finishCreation(exec, globalObject);
+        return ptr;
     }
 
     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
@@ -88,9 +91,14 @@ protected:
 
 const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestSerializedScriptValueInterfaceConstructorTable, 0 };
 
-JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
+JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
     : DOMConstructorObject(structure, globalObject)
 {
+}
+
+void JSTestSerializedScriptValueInterfaceConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
+{
+    Base::finishCreation(exec->globalData());
     ASSERT(inherits(&s_info));
     putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestSerializedScriptValueInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
 }
@@ -132,7 +140,11 @@ JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface(Struc
     : JSDOMWrapper(structure, globalObject)
     , m_impl(impl)
 {
-    finishCreation(globalObject->globalData());
+}
+
+void JSTestSerializedScriptValueInterface::finishCreation(JSGlobalData& globalData)
+{
+    Base::finishCreation(globalData);
     ASSERT(inherits(&s_info));
 }
 
index c14dd90b4fb664e426ace27b306068fe5da380fc..f1fa4d44f0be5a3062b6b9708a4ebaad36753871 100644 (file)
@@ -36,7 +36,9 @@ public:
     typedef JSDOMWrapper Base;
     static JSTestSerializedScriptValueInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestSerializedScriptValueInterface> impl)
     {
-        return new (JSC::allocateCell<JSTestSerializedScriptValueInterface>(globalObject->globalData().heap)) JSTestSerializedScriptValueInterface(structure, globalObject, impl);
+        JSTestSerializedScriptValueInterface* ptr = new (JSC::allocateCell<JSTestSerializedScriptValueInterface>(globalObject->globalData().heap)) JSTestSerializedScriptValueInterface(structure, globalObject, impl);
+        ptr->finishCreation(globalObject->globalData());
+        return ptr;
     }
 
     static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
@@ -56,6 +58,7 @@ private:
     RefPtr<TestSerializedScriptValueInterface> m_impl;
 protected:
     JSTestSerializedScriptValueInterface(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestSerializedScriptValueInterface>);
+    void finishCreation(JSC::JSGlobalData&);
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 };
 
@@ -68,7 +71,9 @@ public:
     static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
     static JSTestSerializedScriptValueInterfacePrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
     {
-        return new (JSC::allocateCell<JSTestSerializedScriptValueInterfacePrototype>(globalData.heap)) JSTestSerializedScriptValueInterfacePrototype(globalData, globalObject, structure);
+        JSTestSerializedScriptValueInterfacePrototype* ptr = new (JSC::allocateCell<JSTestSerializedScriptValueInterfacePrototype>(globalData.heap)) JSTestSerializedScriptValueInterfacePrototype(globalData, globalObject, structure);
+        ptr->finishCreation(globalData);
+        return ptr;
     }
 
     static const JSC::ClassInfo s_info;
@@ -78,7 +83,7 @@ public:
     }
 
 private:
-    JSTestSerializedScriptValueInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }
+    JSTestSerializedScriptValueInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
 protected:
     static const unsigned StructureFlags = Base::StructureFlags;
 };
index b460a91452f656b0339783574685acf0de21d149..5adf42351fe915fad4664d4f8d4ff89a157cfb93 100644 (file)
@@ -40,7 +40,6 @@ const ClassInfo CRuntimeObject::s_info = { "CRuntimeObject", &RuntimeObject::s_i
 CRuntimeObject::CRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<CInstance> instance)
     : RuntimeObject(exec, globalObject, structure, instance)
 {
-    finishCreation(globalObject);
 }
 
 void CRuntimeObject::finishCreation(JSGlobalObject* globalObject)
index f984a5ca8a7eba6b347830e16c16abd38be2d0f2..beeddbb2832cc4a1aeffca208306367883d48257 100644 (file)
@@ -45,7 +45,9 @@ public:
         // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
         // We need to pass in the right global object for "i".
         Structure* domStructure = WebCore::deprecatedGetDOMStructure<CRuntimeObject>(exec);
-        return new (allocateCell<CRuntimeObject>(*exec->heap())) CRuntimeObject(exec, globalObject, domStructure, instance);
+        CRuntimeObject* object = new (allocateCell<CRuntimeObject>(*exec->heap())) CRuntimeObject(exec, globalObject, domStructure, instance);
+        object->finishCreation(globalObject);
+        return object;
     }
 
     virtual ~CRuntimeObject();
index de614495172dcbda5ea93b01041014c261c67f97..415cb494ef4f86fc1959dd1c3008b3f7c5526c7a 100644 (file)
@@ -130,8 +130,14 @@ public:
 
 private:
     CRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
-        : RuntimeMethod(exec, globalObject, structure, name, list)
+        : RuntimeMethod(globalObject, structure, list)
     {
+        finishCreation(exec->globalData(), name);
+    }
+
+    void finishCreation(JSGlobalData& globalData, const Identifier& name)
+    {
+        Base::finishCreation(globalData, name);
         ASSERT(inherits(&s_info));
     }
 
index 39720097d5a2a2875f370c9fb04ec026c106001a..4862918cf23a2125db3a03c53d04ef299fcc5284 100644 (file)
@@ -135,11 +135,16 @@ public:
 
 private:
     JavaRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
-        : RuntimeMethod(exec, globalObject, structure, name, list)
+        : RuntimeMethod(globalObject, structure, list)
     {
-        ASSERT(inherits(&s_info));
+        finishCreation(exec->globalData(), name);
     }
 
+    void finishCreation(JSGlobalData& globalData, const Identifier& name)
+    {
+        Base::finishCreation(globalData, name);
+        ASSERT(inherits(&s_info));
+    }
 };
 
 const ClassInfo JavaRuntimeMethod::s_info = { "JavaRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
index d684ab02e397029f11f5a2514acb0ad313db0eed..36d91fcf6a734ab9bf111f7fbe45b5be61908e9b 100644 (file)
@@ -38,7 +38,6 @@ const ClassInfo JavaRuntimeObject::s_info = { "JavaRuntimeObject", &RuntimeObjec
 JavaRuntimeObject::JavaRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<JavaInstance> instance)
     : RuntimeObject(exec, globalObject, structure, instance)
 {
-    finishCreation(globalObject);
 }
 
 void JavaRuntimeObject::finishCreation(JSGlobalObject* globalObject)
index 8fa452ee8db74d69a72e91668fe281df470de83d..ebedd766f3cd9df51b857e97fbd132e4983e0f4c 100644 (file)
@@ -38,12 +38,14 @@ class JavaRuntimeObject : public RuntimeObject {
 public:
     typedef RuntimeObject Base;
 
-    static JavaRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<JavaInstance> javaInst)
+    static JavaRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<JavaInstance> javaInstance)
     {
         // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
         // We need to pass in the right global object for "i".
         Structure* domStructure = WebCore::deprecatedGetDOMStructure<JavaRuntimeObject>(exec);
-        return new (allocateCell<JavaRuntimeObject>(*exec->heap())) JavaRuntimeObject(exec, globalObject, domStructure, javaInst);
+        JavaRuntimeObject* object = new (allocateCell<JavaRuntimeObject>(*exec->heap())) JavaRuntimeObject(exec, globalObject, domStructure, javaInstance);
+        object->finishCreation(globalObject);
+        return object;
     }
 
     virtual ~JavaRuntimeObject();
index dd73390d77de1a938acec81fa321a56b5484495a..2dabfc40c17d576e39099df24938a7e9ae4fb02c 100644 (file)
@@ -42,7 +42,9 @@ public:
         // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
         // We need to pass in the right global object for "i".
         Structure* structure = WebCore::deprecatedGetDOMStructure<ObjCRuntimeObject>(exec);
-        return new (allocateCell<ObjCRuntimeObject>(*exec->heap())) ObjCRuntimeObject(exec, globalObject, inst, structure);
+        ObjCRuntimeObject* object = new (allocateCell<ObjCRuntimeObject>(*exec->heap())) ObjCRuntimeObject(exec, globalObject, inst, structure);
+        object->finishCreation(globalObject);
+        return object;
     }
 
     virtual ~ObjCRuntimeObject();
index c51bd4d20c93b6ac8088ddcddba28cf20d87896d..21ff41264bbd03387de1ff2b9645c67e72a82888 100644 (file)
@@ -38,7 +38,6 @@ const ClassInfo ObjCRuntimeObject::s_info = { "ObjCRuntimeObject", &RuntimeObjec
 ObjCRuntimeObject::ObjCRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<ObjcInstance> instance, Structure* structure)
     : RuntimeObject(exec, globalObject, structure, instance)
 {
-    finishCreation(globalObject);
 }
 
 void ObjCRuntimeObject::finishCreation(JSGlobalObject* globalObject)
index a6aaf60538da1067764996b0229df6856fdc2f68..06fc90f799c4d593157816d1f5ca79b68e9b9b76 100644 (file)
@@ -189,9 +189,17 @@ public:
     static const ClassInfo s_info;
 
 private:
+    typedef RuntimeMethod Base;
+
     ObjCRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
-        : RuntimeMethod(exec, globalObject, structure, name, list)
+        : RuntimeMethod(globalObject, structure, list)
+    {
+        finishCreation(exec->globalData(), name);
+    }
+
+    void finishCreation(JSGlobalData& globalData, const Identifier& name)
     {
+        Base::finishCreation(globalData, name);
         ASSERT(inherits(&s_info));
     }
 };
index 6a48b146e0f65edcee2096dfcd30d1b27a5ac3a5..4bbe65e0113dbfc984d7a546447dde65c09926aa 100644 (file)
@@ -55,7 +55,9 @@ public:
     static QtRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<Instance> instance)
     {
         Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeObject>(exec);
-        return new (allocateCell<QtRuntimeObject>(*exec->heap())) QtRuntimeObject(exec, globalObject, domStructure, instance);
+        QtRuntimeObject* object = new (allocateCell<QtRuntimeObject>(*exec->heap())) QtRuntimeObject(exec, globalObject, domStructure, instance);
+        object->finishCreation(globalObject);
+        return object;
     }
     
     static const ClassInfo s_info;
@@ -85,7 +87,6 @@ const ClassInfo QtRuntimeObject::s_info = { "QtRuntimeObject", &RuntimeObject::s
 QtRuntimeObject::QtRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance)
     : RuntimeObject(exec, globalObject, structure, instance)
 {
-    finishCreation(globalObject);
 }
 
 // QtInstance
index f0b26a8c5cd8797b7bbd59899d8f3ad3a6c4ffb1..f93950cbdcbc1dfd86cc860f0f81d80503399170 100644 (file)
@@ -204,7 +204,9 @@ public:
     static QtPixmapRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<Instance> instance)
     {
         Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtPixmapRuntimeObject>(exec);
-        return new (allocateCell<QtPixmapRuntimeObject>(*exec->heap())) QtPixmapRuntimeObject(exec, globalObject, domStructure, instance);
+        QtPixmapRuntimeObject* object = new (allocateCell<QtPixmapRuntimeObject>(*exec->heap())) QtPixmapRuntimeObject(exec, globalObject, domStructure, instance);
+        object->finishCreation(globalObject);
+        return object;
     }
 
     static const ClassInfo s_info;
@@ -224,7 +226,6 @@ private:
 QtPixmapRuntimeObject::QtPixmapRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance)
     : RuntimeObject(exec, globalObject, structure, instance)
 {
-    finishCreation(globalObject);
 }
 
 const ClassInfo QtPixmapRuntimeObject::s_info = { "QtPixmapRuntimeObject", &RuntimeObject::s_info, 0, 0 };
index 581e443d53e7615c349de502c92b4b516eff612f..51161c531414cfc918eea42480ee4a11f85bc49c 100644 (file)
@@ -1010,7 +1010,6 @@ QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, Struc
     : InternalFunction(exec->lexicalGlobalObject(), structure)
     , d_ptr(dd)
 {
-    finishCreation(exec, identifier, instance);
 }
 
 void QtRuntimeMethod::finishCreation(ExecState* exec, const Identifier& identifier, PassRefPtr<QtInstance> instance)
@@ -1426,9 +1425,15 @@ static int findSignalIndex(const QMetaObject* meta, int initialIndex, QByteArray
     return index;
 }
 
-QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& ident, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature, bool allowPrivate)
-    : QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, ident, inst)
+QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& identifier, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)
+    : QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, identifier, instance)
 {
+    finishCreation(exec, identifier, instance, index, signature, allowPrivate);
+}
+
+void QtRuntimeMetaMethod::finishCreation(ExecState* exec, const Identifier& identifier, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)
+{
+    Base::finishCreation(exec, identifier, instance);
     QW_D(QtRuntimeMetaMethod);
     d->m_signature = signature;
     d->m_index = index;
@@ -1570,9 +1575,15 @@ JSValue QtRuntimeMetaMethod::disconnectGetter(ExecState* exec, JSValue slotBase,
 
 QMultiMap<QObject*, QtConnectionObject*> QtRuntimeConnectionMethod::connections;
 
-QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& ident, bool isConnect, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature)
-    : QtRuntimeMethod (new QtRuntimeConnectionMethodData(), exec, structure, ident, inst)
+QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& identifier, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)
+    : QtRuntimeMethod (new QtRuntimeConnectionMethodData(), exec, structure, identifier, instance)
+{
+    finishCreation(exec, identifier, isConnect, instance, index, signature);
+}
+
+void QtRuntimeConnectionMethod::finishCreation(ExecState* exec, const Identifier& identifier, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)
 {
+    Base::finishCreation(exec, identifier, instance);
     QW_D(QtRuntimeConnectionMethod);
 
     d->m_signature = signature;
index 24de255c1481e466a4c7773710cfee453e5b82ce..f3499adaffb03cc3c4cf484750b4ec57e4e0e1c9 100644 (file)
@@ -159,7 +159,8 @@ public:
     static QtRuntimeMetaMethod* create(ExecState* exec, const Identifier& n, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature, bool allowPrivate)
     {
         Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeMethod>(exec);
-        return new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, n, inst, index, signature, allowPrivate);
+        QtRuntimeMetaMethod* method = new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, n, inst, index, signature, allowPrivate);
+        return method;
     }
 
     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
@@ -173,6 +174,7 @@ protected:
 
 private:
     QtRuntimeMetaMethod(ExecState*, Structure*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray&, bool allowPrivate);
+    void finishCreation(ExecState*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray& signature, bool allowPrivate);
 
     virtual CallType getCallData(CallData&);
     static EncodedJSValue JSC_HOST_CALL call(ExecState* exec);
@@ -201,6 +203,7 @@ protected:
 
 private:
     QtRuntimeConnectionMethod(ExecState*, Structure*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray&);
+    void finishCreation(ExecState*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray& signature);
 
     virtual CallType getCallData(CallData&);
     static EncodedJSValue JSC_HOST_CALL call(ExecState* exec);
index cf235551d3846509d116f82ad7fbe14b25df266c..ac004fd91ef83d955d6537d5b45e162acf4a9a2e 100644 (file)
@@ -43,12 +43,11 @@ ASSERT_CLASS_FITS_IN_CELL(RuntimeMethod);
 
 const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", &InternalFunction::s_info, 0, 0 };
 
-RuntimeMethod::RuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& ident, Bindings::MethodList& m)
+RuntimeMethod::RuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& m)
     // Callers will need to pass in the right global object corresponding to this native object "m".
     : InternalFunction(globalObject, structure)
     , _methodList(adoptPtr(new MethodList(m)))
 {
-    finishCreation(exec->globalData(), ident);
 }
 
 void RuntimeMethod::finishCreation(JSGlobalData& globalData, const Identifier& ident)
index d1ab99de7eb02df24c4f04b45266f864cb0f216e..c5d0a6d0fbe828947ba331930efdaefd8770d530 100644 (file)
@@ -39,7 +39,9 @@ public:
 
     static RuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& methodList)
     {
-        return new (allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(exec, globalObject, structure, name, methodList);
+        RuntimeMethod* method = new (allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(globalObject, structure, methodList);
+        method->finishCreation(exec->globalData(), name);
+        return method;
     }
 
     Bindings::MethodList* methods() const { return _methodList.get(); }
@@ -57,7 +59,7 @@ public:
     }
 
 protected:
-    RuntimeMethod(ExecState*, JSGlobalObject*, Structure*, const Identifier& name, Bindings::MethodList&);
+    RuntimeMethod(JSGlobalObject*, Structure*, Bindings::MethodList&);
     void finishCreation(JSGlobalData&, const Identifier&);
     static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
 
index cc502c2de6c8978be86c860c62dc5cebf45973f4..31d3b7dd88c4682e8c76d9d215e00a59073a0302 100644 (file)
@@ -1,3 +1,26 @@
+2011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Unzip initialization lists and constructors in JSCell hierarchy (6/7)
+        https://bugs.webkit.org/show_bug.cgi?id=67692
+
+        Reviewed by Geoffrey Garen.
+
+        Completed the sixth level of the refactoring to add finishCreation() 
+        methods to all classes within the JSCell hierarchy with non-trivial 
+        constructor bodies.
+
+        This primarily consists of pushing the calls to finishCreation() down 
+        into the constructors of the subclasses of the fifth level of the hierarchy 
+        as well as pulling the finishCreation() calls out into the class's corresponding
+        create() method if it has one.  Doing both simultaneously allows us to 
+        maintain the invariant that the finishCreation() method chain is called exactly 
+        once during the creation of an object, since calling it any other number of 
+        times (0, 2, or more) will cause an assertion failure.
+
+        * Plugins/Hosted/ProxyInstance.mm:
+        (WebKit::ProxyRuntimeMethod::ProxyRuntimeMethod):
+        (WebKit::ProxyRuntimeMethod::finishCreation):
+
 2011-09-13  Eric Seidel  <eric@webkit.org>
 
         Remove ENABLE_SVG_USE as <use> is required by HTML5
index a8a27a92ae45b0a0d6a3e4e62a159c3794e368ac..43d549239cff21b90d4990c7ba930b4b3afea46c 100644 (file)
@@ -198,8 +198,14 @@ public:
 
 private:
     ProxyRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
-        : RuntimeMethod(exec, globalObject, structure, name, list)
+        : RuntimeMethod(globalObject, structure, list)
     {
+        finishCreation(exec->globalData(), name);
+    }
+
+    void finishCreation(JSGlobalData& globalData, const Identifier& name)
+    {
+        Base::finishCreation(globalData, name);
         ASSERT(inherits(&s_info));
     }
 };
index ae657d23edd37fd08ad05cb78a79aafae08b754e..2eceac613d038fbb1a178b3f72d5ec42864650be 100644 (file)
@@ -1,3 +1,27 @@
+2011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Unzip initialization lists and constructors in JSCell hierarchy (6/7)
+        https://bugs.webkit.org/show_bug.cgi?id=67692
+
+        Reviewed by Geoffrey Garen.
+
+        Completed the sixth level of the refactoring to add finishCreation() 
+        methods to all classes within the JSCell hierarchy with non-trivial 
+        constructor bodies.
+
+        This primarily consists of pushing the calls to finishCreation() down 
+        into the constructors of the subclasses of the fifth level of the hierarchy 
+        as well as pulling the finishCreation() calls out into the class's corresponding
+        create() method if it has one.  Doing both simultaneously allows us to 
+        maintain the invariant that the finishCreation() method chain is called exactly 
+        once during the creation of an object, since calling it any other number of 
+        times (0, 2, or more) will cause an assertion failure.
+
+        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
+        (WebKit::JSNPMethod::JSNPMethod):
+        * WebProcess/Plugins/Netscape/JSNPMethod.h:
+        (WebKit::JSNPMethod::create):
+
 2011-09-13  Eric Seidel  <eric@webkit.org>
 
         Remove ENABLE_SVG_USE as <use> is required by HTML5
index 410b200630dd4f61f2cd97677bc556de52005b5a..2e8b7ccc8abf0f16f89036157ab144d5949e83e5 100644 (file)
@@ -42,11 +42,10 @@ namespace WebKit {
 
 const ClassInfo JSNPMethod::s_info = { "NPMethod", &InternalFunction::s_info, 0, 0 };
 
-JSNPMethod::JSNPMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, NPIdentifier npIdentifier)
+JSNPMethod::JSNPMethod(JSGlobalObject* globalObject, Structure* structure, NPIdentifier npIdentifier)
     : InternalFunction(globalObject, structure)
     , m_npIdentifier(npIdentifier)
 {
-    finishCreation(exec->globalData(), name);
 }
 
 void JSNPMethod::finishCreation(JSGlobalData& globalData, const Identifier& name)
index 929901b9a5efa30195f84412acc6792aa30a1678..3cbe9b996b2b852b5671fbc2f98b12b3f52bc6f9 100644 (file)
@@ -39,10 +39,12 @@ class JSNPMethod : public JSC::InternalFunction {
 public:
     typedef JSC::InternalFunction Base;
 
-    static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::Identifier& ident, NPIdentifier npIdent)
+    static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::Identifier& name, NPIdentifier npIdent)
     {
         JSC::Structure* structure = createStructure(exec->globalData(), globalObject, globalObject->functionPrototype());
-        return new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(exec, globalObject, structure, ident, npIdent);
+        JSNPMethod* method = new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(globalObject, structure, npIdent);
+        method->finishCreation(exec->globalData(), name);
+        return method;
     }
 
     static const JSC::ClassInfo s_info;
@@ -53,7 +55,7 @@ protected:
     void finishCreation(JSC::JSGlobalData&, const JSC::Identifier& name);
 
 private:    
-    JSNPMethod(JSC::ExecState*, JSC::JSGlobalObject*, JSC::Structure*, const JSC::Identifier&, NPIdentifier);
+    JSNPMethod(JSC::JSGlobalObject*, JSC::Structure*, NPIdentifier);
 
     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
     {