Changeset 95108 in webkit


Ignore:
Timestamp:
Sep 14, 2011 11:55:25 AM (13 years ago)
Author:
mhahnenberg@apple.com
Message:

Unzip initialization lists and constructors in JSCell hierarchy (6/7)
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):

Location:
trunk/Source
Files:
81 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.cpp

    r94875 r95108  
    4343const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0 };
    4444
    45 JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
     45JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback)
    4646    : InternalFunction(globalObject, globalObject->callbackFunctionStructure())
    4747    , m_callback(callback)
    4848{
    49     finishCreation(exec->globalData(), name);
    5049}
    5150
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.h

    r94929 r95108  
    3434class JSCallbackFunction : public InternalFunction {
    3535protected:
    36     JSCallbackFunction(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name);
     36    JSCallbackFunction(JSGlobalObject*, JSObjectCallAsFunctionCallback);
    3737    void finishCreation(JSGlobalData&, const Identifier& name);
    3838
     
    4242    static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
    4343    {
    44         return new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(exec, globalObject, callback, name);
     44        JSCallbackFunction* function = new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback);
     45        function->finishCreation(exec->globalData(), name);
     46        return function;
    4547    }
    4648
  • trunk/Source/JavaScriptCore/ChangeLog

    r95107 r95108  
     12011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Unzip initialization lists and constructors in JSCell hierarchy (6/7)
     4        https://bugs.webkit.org/show_bug.cgi?id=67692
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Completed the sixth level of the refactoring to add finishCreation()
     9        methods to all classes within the JSCell hierarchy with non-trivial
     10        constructor bodies.
     11
     12        This primarily consists of pushing the calls to finishCreation() down
     13        into the constructors of the subclasses of the fifth level of the hierarchy
     14        as well as pulling the finishCreation() calls out into the class's corresponding
     15        create() method if it has one.  Doing both simultaneously allows us to
     16        maintain the invariant that the finishCreation() method chain is called exactly
     17        once during the creation of an object, since calling it any other number of
     18        times (0, 2, or more) will cause an assertion failure.
     19
     20        * API/JSCallbackFunction.cpp:
     21        (JSC::JSCallbackFunction::JSCallbackFunction):
     22        * API/JSCallbackFunction.h:
     23        (JSC::JSCallbackFunction::create):
     24        * jsc.cpp:
     25        (GlobalObject::create):
     26        (GlobalObject::GlobalObject):
     27        * runtime/ArrayConstructor.cpp:
     28        (JSC::ArrayConstructor::ArrayConstructor):
     29        * runtime/ArrayConstructor.h:
     30        (JSC::ArrayConstructor::create):
     31        * runtime/BooleanConstructor.cpp:
     32        (JSC::BooleanConstructor::BooleanConstructor):
     33        * runtime/BooleanConstructor.h:
     34        (JSC::BooleanConstructor::create):
     35        * runtime/BooleanPrototype.cpp:
     36        (JSC::BooleanPrototype::BooleanPrototype):
     37        * runtime/BooleanPrototype.h:
     38        (JSC::BooleanPrototype::create):
     39        * runtime/DateConstructor.cpp:
     40        (JSC::DateConstructor::DateConstructor):
     41        * runtime/DateConstructor.h:
     42        (JSC::DateConstructor::create):
     43        * runtime/DatePrototype.cpp:
     44        (JSC::DatePrototype::DatePrototype):
     45        * runtime/DatePrototype.h:
     46        (JSC::DatePrototype::create):
     47        * runtime/Error.cpp:
     48        (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
     49        (JSC::StrictModeTypeErrorFunction::create):
     50        * runtime/ErrorConstructor.cpp:
     51        (JSC::ErrorConstructor::ErrorConstructor):
     52        * runtime/ErrorConstructor.h:
     53        (JSC::ErrorConstructor::create):
     54        * runtime/FunctionConstructor.cpp:
     55        (JSC::FunctionConstructor::FunctionConstructor):
     56        * runtime/FunctionConstructor.h:
     57        (JSC::FunctionConstructor::create):
     58        * runtime/FunctionPrototype.cpp:
     59        (JSC::FunctionPrototype::FunctionPrototype):
     60        * runtime/FunctionPrototype.h:
     61        (JSC::FunctionPrototype::create):
     62        * runtime/NativeErrorConstructor.cpp:
     63        (JSC::NativeErrorConstructor::NativeErrorConstructor):
     64        * runtime/NativeErrorConstructor.h:
     65        (JSC::NativeErrorConstructor::create):
     66        * runtime/NativeErrorPrototype.cpp:
     67        (JSC::NativeErrorPrototype::NativeErrorPrototype):
     68        (JSC::NativeErrorPrototype::finishCreation):
     69        * runtime/NativeErrorPrototype.h:
     70        (JSC::NativeErrorPrototype::create):
     71        * runtime/NumberConstructor.cpp:
     72        (JSC::NumberConstructor::NumberConstructor):
     73        * runtime/NumberConstructor.h:
     74        (JSC::NumberConstructor::create):
     75        * runtime/NumberPrototype.cpp:
     76        (JSC::NumberPrototype::NumberPrototype):
     77        * runtime/NumberPrototype.h:
     78        (JSC::NumberPrototype::create):
     79        * runtime/ObjectConstructor.cpp:
     80        (JSC::ObjectConstructor::ObjectConstructor):
     81        * runtime/ObjectConstructor.h:
     82        (JSC::ObjectConstructor::create):
     83        * runtime/RegExpConstructor.cpp:
     84        (JSC::RegExpConstructor::RegExpConstructor):
     85        * runtime/RegExpConstructor.h:
     86        (JSC::RegExpConstructor::create):
     87        * runtime/RegExpPrototype.cpp:
     88        (JSC::RegExpPrototype::RegExpPrototype):
     89        * runtime/RegExpPrototype.h:
     90        (JSC::RegExpPrototype::create):
     91        * runtime/StringConstructor.cpp:
     92        (JSC::StringConstructor::StringConstructor):
     93        * runtime/StringConstructor.h:
     94        (JSC::StringConstructor::create):
     95        * runtime/StringObjectThatMasqueradesAsUndefined.h:
     96        (JSC::StringObjectThatMasqueradesAsUndefined::create):
     97        (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
     98        * runtime/StringPrototype.cpp:
     99        (JSC::StringPrototype::StringPrototype):
     100        * runtime/StringPrototype.h:
     101        (JSC::StringPrototype::create):
     102
    11032011-09-13  Eric Seidel  <eric@webkit.org>
    2104
  • trunk/Source/JavaScriptCore/jsc.cpp

    r94875 r95108  
    146146class GlobalObject : public JSGlobalObject {
    147147private:
    148     GlobalObject(JSGlobalData&, Structure*, const Vector<UString>& arguments);
     148    GlobalObject(JSGlobalData&, Structure*);
    149149
    150150public:
     
    153153    static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
    154154    {
    155         return new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure, arguments);
     155        GlobalObject* object = new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
     156        object->finishCreation(globalData, arguments);
     157        return object;
    156158    }
    157159    virtual UString className() const { return "global"; }
     
    189191ASSERT_CLASS_FITS_IN_CELL(GlobalObject);
    190192
    191 GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
     193GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure)
    192194    : JSGlobalObject(globalData, structure)
    193195{
    194     finishCreation(globalData, arguments);
    195196}
    196197
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp

    r94875 r95108  
    5252ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor);
    5353
    54 ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
     54ArrayConstructor::ArrayConstructor(JSGlobalObject* globalObject, Structure* structure)
    5555    : InternalFunction(globalObject, structure)
    5656{
    57     finishCreation(exec, arrayPrototype);
    5857}
    5958
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r94929 r95108  
    3232        typedef InternalFunction Base;
    3333
    34         static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrPrototype)
     34        static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
    3535        {
    36             return new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(exec, globalObject, structure, arrPrototype);
     36            ArrayConstructor* constructor = new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(globalObject, structure);
     37            constructor->finishCreation(exec, arrayPrototype);
     38            return constructor;
    3739        }
    3840
     
    4951
    5052    private:
    51         ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*);
     53        ArrayConstructor(JSGlobalObject*, Structure*);
    5254        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    5355        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp

    r94875 r95108  
    2929ASSERT_CLASS_FITS_IN_CELL(BooleanConstructor);
    3030
    31 BooleanConstructor::BooleanConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
     31BooleanConstructor::BooleanConstructor(JSGlobalObject* globalObject, Structure* structure)
    3232    : InternalFunction(globalObject, structure)
    3333{
    34     finishCreation(exec, booleanPrototype);
    3534}
    3635
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h

    r94875 r95108  
    3232        typedef InternalFunction Base;
    3333
    34         static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* boolPrototype)
     34        static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
    3535        {
    36             return new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(exec, globalObject, structure, boolPrototype);
     36            BooleanConstructor* constructor = new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure);
     37            constructor->finishCreation(exec, booleanPrototype);
     38            return constructor;
    3739        }
    3840
     
    4143
    4244    private:
    43         BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);
     45        BooleanConstructor(JSGlobalObject*, Structure*);
    4446        virtual ConstructType getConstructData(ConstructData&);
    4547        virtual CallType getCallData(CallData&);
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp

    r94929 r95108  
    5050ASSERT_CLASS_FITS_IN_CELL(BooleanPrototype);
    5151
    52 BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     52BooleanPrototype::BooleanPrototype(ExecState* exec, Structure* structure)
    5353    : BooleanObject(exec->globalData(), structure)
    5454{
    55     finishCreation(exec, globalObject);
    5655}
    5756
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h

    r94929 r95108  
    3232        static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3333        {
    34             return new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, globalObject, structure);
     34            BooleanPrototype* prototype = new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, structure);
     35            prototype->finishCreation(exec, globalObject);
     36            return prototype;
    3537        }
    3638       
     
    4749
    4850    private:
    49         BooleanPrototype(ExecState*, JSGlobalObject*, Structure*);
     51        BooleanPrototype(ExecState*, Structure*);
    5052        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    5153        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r94875 r95108  
    7474ASSERT_CLASS_FITS_IN_CELL(DateConstructor);
    7575
    76 DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
     76DateConstructor::DateConstructor(JSGlobalObject* globalObject, Structure* structure)
    7777    : InternalFunction(globalObject, structure)
    7878{
    79     finishCreation(exec, datePrototype);
    8079}
    8180
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r94929 r95108  
    3434        static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
    3535        {
    36             return new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(exec, globalObject, structure, datePrototype);
     36            DateConstructor* constructor = new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure);
     37            constructor->finishCreation(exec, datePrototype);
     38            return constructor;
    3739        }
    3840
     
    4951
    5052    private:
    51         DateConstructor(ExecState*, JSGlobalObject*, Structure*, DatePrototype*);
     53        DateConstructor(JSGlobalObject*, Structure*);
    5254        virtual ConstructType getConstructData(ConstructData&);
    5355        virtual CallType getCallData(CallData&);
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp

    r94929 r95108  
    431431// ECMA 15.9.4
    432432
    433 DatePrototype::DatePrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     433DatePrototype::DatePrototype(ExecState* exec, Structure* structure)
    434434    : DateInstance(exec, structure)
    435435{
    436     finishCreation(exec, globalObject);
    437436}
    438437
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.h

    r94929 r95108  
    3030    class DatePrototype : public DateInstance {
    3131    private:
    32         DatePrototype(ExecState*, JSGlobalObject*, Structure*);
     32        DatePrototype(ExecState*, Structure*);
    3333
    3434    public:
     
    3737        static DatePrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3838        {
    39             return new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, globalObject, structure);
     39            DatePrototype* prototype = new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, structure);
     40            prototype->finishCreation(exec, globalObject);
     41            return prototype;
    4042        }
    4143        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/Error.cpp

    r94875 r95108  
    168168class StrictModeTypeErrorFunction : public InternalFunction {
    169169private:
    170     StrictModeTypeErrorFunction(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
     170    StrictModeTypeErrorFunction(JSGlobalObject* globalObject, Structure* structure, const UString& message)
    171171        : InternalFunction(globalObject, structure)
    172172        , m_message(message)
    173173    {
    174         finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);
    175174    }
    176175
     
    180179    static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
    181180    {
    182         return new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(exec, globalObject, structure, message);
     181        StrictModeTypeErrorFunction* function = new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
     182        function->finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);
     183        return function;
    183184    }
    184185   
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp

    r94875 r95108  
    3030ASSERT_CLASS_FITS_IN_CELL(ErrorConstructor);
    3131
    32 ErrorConstructor::ErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)
     32ErrorConstructor::ErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
    3333    : InternalFunction(globalObject, structure)
    3434{
    35     finishCreation(exec, errorPrototype);
    3635}
    3736
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h

    r94875 r95108  
    3333        typedef InternalFunction Base;
    3434
    35         static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errPrototype)
     35        static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)
    3636        {
    37             return new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(exec, globalObject, structure, errPrototype);
     37            ErrorConstructor* constructor = new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(globalObject, structure);
     38            constructor->finishCreation(exec, errorPrototype);
     39            return constructor;
    3840        }
    3941
     
    4244       
    4345    private:
    44         ErrorConstructor(ExecState*, JSGlobalObject*, Structure*, ErrorPrototype*);
     46        ErrorConstructor(JSGlobalObject*, Structure*);
    4547        virtual ConstructType getConstructData(ConstructData&);
    4648        virtual CallType getCallData(CallData&);
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp

    r94875 r95108  
    3838ASSERT_CLASS_FITS_IN_CELL(FunctionConstructor);
    3939
    40 FunctionConstructor::FunctionConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)
     40FunctionConstructor::FunctionConstructor(JSGlobalObject* globalObject, Structure* structure)
    4141    : InternalFunction(globalObject, structure)
    4242{
    43     finishCreation(exec, functionPrototype);
    4443}
    4544
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h

    r94875 r95108  
    3232        typedef InternalFunction Base;
    3333
    34         static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* funcPrototype)
     34        static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)
    3535        {
    36             return new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(exec, globalObject, structure, funcPrototype);
     36            FunctionConstructor* constructor = new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(globalObject, structure);
     37            constructor->finishCreation(exec, functionPrototype);
     38            return constructor;
    3739        }
    3840
    3941    private:
    40         FunctionConstructor(ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*);
     42        FunctionConstructor(JSGlobalObject*, Structure*);
    4143        void finishCreation(ExecState*, FunctionPrototype*);
    4244        virtual ConstructType getConstructData(ConstructData&);
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp

    r94875 r95108  
    3838static EncodedJSValue JSC_HOST_CALL functionProtoFuncCall(ExecState*);
    3939
    40 FunctionPrototype::FunctionPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     40FunctionPrototype::FunctionPrototype(JSGlobalObject* globalObject, Structure* structure)
    4141    : InternalFunction(globalObject, structure)
    4242{
    43     finishCreation(exec, exec->propertyNames().nullIdentifier);
    4443}
    4544
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h

    r94929 r95108  
    3232        static FunctionPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3333        {
    34             return new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(exec, globalObject, structure);
     34            FunctionPrototype* prototype = new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(globalObject, structure);
     35            prototype->finishCreation(exec, exec->propertyNames().nullIdentifier);
     36            return prototype;
    3537        }
    3638       
     
    4648
    4749    private:
    48         FunctionPrototype(ExecState*, JSGlobalObject*, Structure*);
     50        FunctionPrototype(JSGlobalObject*, Structure*);
    4951        virtual CallType getCallData(CallData&);
    5052    };
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp

    r94875 r95108  
    3333const ClassInfo NativeErrorConstructor::s_info = { "Function", &InternalFunction::s_info, 0, 0 };
    3434
    35 NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name)
     35NativeErrorConstructor::NativeErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
    3636    : InternalFunction(globalObject, structure)
    3737{
    38     finishCreation(exec, globalObject, prototypeStructure, name);
    3938}
    4039
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h

    r94929 r95108  
    3737        static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name)
    3838        {
    39             return new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(exec, globalObject, structure, prototypeStructure, name);
     39            NativeErrorConstructor* constructor = new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(globalObject, structure);
     40            constructor->finishCreation(exec, globalObject, prototypeStructure, name);
     41            return constructor;
    4042        }
    4143       
     
    6567
    6668    private:
    67         NativeErrorConstructor(ExecState*, JSGlobalObject*, Structure*, Structure* prototypeStructure, const UString&);
     69        NativeErrorConstructor(JSGlobalObject*, Structure*);
    6870        static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags;
    6971        virtual ConstructType getConstructData(ConstructData&);
  • trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp

    r94875 r95108  
    3131ASSERT_CLASS_FITS_IN_CELL(NativeErrorPrototype);
    3232
    33 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& nameAndMessage, NativeErrorConstructor* constructor)
     33NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, Structure* structure)
    3434    : ErrorPrototype(exec, structure)
    3535{
    36     finishCreation(exec, globalObject, nameAndMessage, constructor);
    3736}
    3837
    39 inline void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor)
     38void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor)
    4039{
    4140    Base::finishCreation(exec, globalObject);
  • trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.h

    r94875 r95108  
    2929    class NativeErrorPrototype : public ErrorPrototype {
    3030    private:
    31         NativeErrorPrototype(ExecState*, JSGlobalObject*, Structure*, const UString&, NativeErrorConstructor*);
     31        NativeErrorPrototype(ExecState*, Structure*);
    3232   
    3333    public:
     
    3636        static NativeErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& name, NativeErrorConstructor* constructor)
    3737        {
    38             return new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, globalObject, structure, name, constructor);
     38            NativeErrorPrototype* prototype = new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, structure);
     39            prototype->finishCreation(exec, globalObject, name, constructor);
     40            return prototype;
    3941        }
    4042
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r94875 r95108  
    5555*/
    5656
    57 NumberConstructor::NumberConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)
     57NumberConstructor::NumberConstructor(JSGlobalObject* globalObject, Structure* structure)
    5858    : InternalFunction(globalObject, structure)
    5959{
    60     finishCreation(exec, numberPrototype);
    6160}
    6261
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r94929 r95108  
    3232        typedef InternalFunction Base;
    3333
    34         static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numPrototype)
     34        static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)
    3535        {
    36             return new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(exec, globalObject, structure, numPrototype);
     36            NumberConstructor* constructor = new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(globalObject, structure);
     37            constructor->finishCreation(exec, numberPrototype);
     38            return constructor;
    3739        }
    3840
     
    5557
    5658    private:
    57         NumberConstructor(ExecState*, JSGlobalObject*, Structure*, NumberPrototype*);
     59        NumberConstructor(JSGlobalObject*, Structure*);
    5860        virtual ConstructType getConstructData(ConstructData&);
    5961        virtual CallType getCallData(CallData&);
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp

    r94929 r95108  
    7171ASSERT_CLASS_FITS_IN_CELL(NumberPrototype);
    7272
    73 NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     73NumberPrototype::NumberPrototype(ExecState* exec, Structure* structure)
    7474    : NumberObject(exec->globalData(), structure)
    7575{
    76     finishCreation(exec, globalObject);
    7776}
    7877
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.h

    r94929 r95108  
    3232        static NumberPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3333        {
    34             return new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, globalObject, structure);
     34            NumberPrototype* prototype = new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, structure);
     35            prototype->finishCreation(exec, globalObject);
     36            return prototype;
    3537        }
    3638       
     
    4749
    4850    private:
    49         NumberPrototype(ExecState*, JSGlobalObject*, Structure*);
     51        NumberPrototype(ExecState*, Structure*);
    5052        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    5153        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp

    r95028 r95108  
    7676*/
    7777
    78 ObjectConstructor::ObjectConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype)
     78ObjectConstructor::ObjectConstructor(JSGlobalObject* globalObject, Structure* structure)
    7979    : InternalFunction(globalObject, structure)
    8080{
    81     finishCreation(exec, objectPrototype);
    8281}
    8382
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h

    r94929 r95108  
    3232        typedef InternalFunction Base;
    3333
    34         static ObjectConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objPrototype)
     34        static ObjectConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype)
    3535        {
    36             return new (allocateCell<ObjectConstructor>(*exec->heap())) ObjectConstructor(exec, globalObject, structure, objPrototype);
     36            ObjectConstructor* constructor = new (allocateCell<ObjectConstructor>(*exec->heap())) ObjectConstructor(globalObject, structure);
     37            constructor->finishCreation(exec, objectPrototype);
     38            return constructor;
    3739        }
    3840
     
    5254
    5355    private:
    54         ObjectConstructor(ExecState*, JSGlobalObject*, Structure*, ObjectPrototype*);
     56        ObjectConstructor(JSGlobalObject*, Structure*);
    5557        virtual ConstructType getConstructData(ConstructData&);
    5658        virtual CallType getCallData(CallData&);
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp

    r94875 r95108  
    9696*/
    9797
    98 RegExpConstructor::RegExpConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)
     98RegExpConstructor::RegExpConstructor(JSGlobalObject* globalObject, Structure* structure)
    9999    : InternalFunction(globalObject, structure)
    100100    , d(adoptPtr(new RegExpConstructorPrivate))
    101101{
    102     finishCreation(exec, regExpPrototype);
    103102}
    104103
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r94929 r95108  
    6262        static RegExpConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)
    6363        {
    64             return new (allocateCell<RegExpConstructor>(*exec->heap())) RegExpConstructor(exec, globalObject, structure, regExpPrototype);
     64            RegExpConstructor* constructor = new (allocateCell<RegExpConstructor>(*exec->heap())) RegExpConstructor(globalObject, structure);
     65            constructor->finishCreation(exec, regExpPrototype);
     66            return constructor;
    6567        }
    6668
     
    9597
    9698    private:
    97         RegExpConstructor(ExecState*, JSGlobalObject*, Structure*, RegExpPrototype*);
     99        RegExpConstructor(JSGlobalObject*, Structure*);
    98100        virtual ConstructType getConstructData(ConstructData&);
    99101        virtual CallType getCallData(CallData&);
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp

    r94875 r95108  
    6363ASSERT_CLASS_FITS_IN_CELL(RegExpPrototype);
    6464
    65 RegExpPrototype::RegExpPrototype(ExecState*, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
     65RegExpPrototype::RegExpPrototype(JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
    6666    : RegExpObject(globalObject, structure, regExp)
    6767{
    68     finishCreation(globalObject);
    6968}
    7069
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h

    r94929 r95108  
    3333        static RegExpPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
    3434        {
    35             return new (allocateCell<RegExpPrototype>(*exec->heap())) RegExpPrototype(exec, globalObject, structure, regExp);
     35            RegExpPrototype* prototype = new (allocateCell<RegExpPrototype>(*exec->heap())) RegExpPrototype(globalObject, structure, regExp);
     36            prototype->finishCreation(globalObject);
     37            return prototype;
    3638        }
    3739       
     
    4446
    4547    protected:
    46         RegExpPrototype(ExecState*, JSGlobalObject*, Structure*, RegExp*);
     48        RegExpPrototype(JSGlobalObject*, Structure*, RegExp*);
    4749        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | RegExpObject::StructureFlags;
    4850
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r94875 r95108  
    4848ASSERT_CLASS_FITS_IN_CELL(StringConstructor);
    4949
    50 StringConstructor::StringConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, StringPrototype* stringPrototype)
     50StringConstructor::StringConstructor(JSGlobalObject* globalObject, Structure* structure)
    5151    : InternalFunction(globalObject, structure)
    5252{
    53     finishCreation(exec, stringPrototype);
    5453}
    5554
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r94929 r95108  
    3232        typedef InternalFunction Base;
    3333
    34         static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* strPrototype)
     34        static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* stringPrototype)
    3535        {
    36             return new (allocateCell<StringConstructor>(*exec->heap())) StringConstructor(exec, globalObject, structure, strPrototype);
     36            StringConstructor* constructor = new (allocateCell<StringConstructor>(*exec->heap())) StringConstructor(globalObject, structure);
     37            constructor->finishCreation(exec, stringPrototype);
     38            return constructor;
    3739        }
    3840
     
    4850
    4951    private:
    50         StringConstructor(ExecState*, JSGlobalObject*, Structure*, StringPrototype*);
     52        StringConstructor(JSGlobalObject*, Structure*);
    5153        void finishCreation(ExecState*, StringPrototype*);
    5254        virtual ConstructType getConstructData(ConstructData&);
  • trunk/Source/JavaScriptCore/runtime/StringObjectThatMasqueradesAsUndefined.h

    r94929 r95108  
    3737            JSString* newString = jsString(exec, string);
    3838            Structure* structure = createStructure(exec->globalData(), exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->stringPrototype());
    39             return new (allocateCell<StringObjectThatMasqueradesAsUndefined>(*exec->heap())) StringObjectThatMasqueradesAsUndefined(exec, structure, newString);
     39            StringObjectThatMasqueradesAsUndefined* object = new (allocateCell<StringObjectThatMasqueradesAsUndefined>(*exec->heap())) StringObjectThatMasqueradesAsUndefined(exec, structure);
     40            object->finishCreation(exec->globalData(), newString);
     41            return object;
    4042        }
    4143
    4244    private:
    43         StringObjectThatMasqueradesAsUndefined(ExecState* exec, Structure* structure, JSString* string)
     45        StringObjectThatMasqueradesAsUndefined(ExecState* exec, Structure* structure)
    4446            : StringObject(exec->globalData(), structure)
    4547        {
    46             finishCreation(exec->globalData(), string);
    4748        }
    4849
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r94929 r95108  
    132132
    133133// ECMA 15.5.4
    134 StringPrototype::StringPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSString* nameAndMessage)
     134StringPrototype::StringPrototype(ExecState* exec, Structure* structure)
    135135    : StringObject(exec->globalData(), structure)
    136136{
    137     finishCreation(exec, globalObject, nameAndMessage);
    138137}
    139138
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.h

    r94929 r95108  
    3030    class StringPrototype : public StringObject {
    3131    private:
    32         StringPrototype(ExecState*, JSGlobalObject*, Structure*, JSString*);
     32        StringPrototype(ExecState*, Structure*);
    3333
    3434    public:
     
    3737        static StringPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3838        {
    39             return new (allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, globalObject, structure, jsEmptyString(exec));
     39            JSString* empty = jsEmptyString(exec);
     40            StringPrototype* prototype = new (allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, structure);
     41            prototype->finishCreation(exec, globalObject, empty);
     42            return prototype;
    4043        }
    4144
  • trunk/Source/JavaScriptGlue/ChangeLog

    r95049 r95108  
     12011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Unzip initialization lists and constructors in JSCell hierarchy (6/7)
     4        https://bugs.webkit.org/show_bug.cgi?id=67692
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Completed the sixth level of the refactoring to add finishCreation()
     9        methods to all classes within the JSCell hierarchy with non-trivial
     10        constructor bodies.
     11
     12        This primarily consists of pushing the calls to finishCreation() down
     13        into the constructors of the subclasses of the fifth level of the hierarchy
     14        as well as pulling the finishCreation() calls out into the class's corresponding
     15        create() method if it has one.  Doing both simultaneously allows us to
     16        maintain the invariant that the finishCreation() method chain is called exactly
     17        once during the creation of an object, since calling it any other number of
     18        times (0, 2, or more) will cause an assertion failure.
     19
     20        * JSRun.cpp:
     21        (JSGlueGlobalObject::JSGlueGlobalObject):
     22        * JSRun.h:
     23        (JSGlueGlobalObject::create):
     24
    1252011-09-13  Anders Carlsson  <andersca@apple.com>
    226
  • trunk/Source/JavaScriptGlue/JSRun.cpp

    r94875 r95108  
    3939    , m_userObjectStructure(globalData, userObjectStructure)
    4040{
    41     finishCreation(globalData, this);
    4241}
    4342
  • trunk/Source/JavaScriptGlue/JSRun.h

    r94811 r95108  
    4242        {
    4343            Structure* userObjectStructure = UserObjectImp::createStructure(globalData, 0, jsNull());
    44             return new (allocateCell<JSGlueGlobalObject>(globalData.heap)) JSGlueGlobalObject(globalData, structure, userObjectStructure, flags);
     44            JSGlueGlobalObject* object = new (allocateCell<JSGlueGlobalObject>(globalData.heap)) JSGlueGlobalObject(globalData, structure, userObjectStructure, flags);
     45            object->finishCreation(globalData, object);
     46            return object;
    4547        }
    4648
  • trunk/Source/WebCore/ChangeLog

    r95107 r95108  
     12011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Unzip initialization lists and constructors in JSCell hierarchy (6/7)
     4        https://bugs.webkit.org/show_bug.cgi?id=67692
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        No new tests.
     9
     10        Completed the sixth level of the refactoring to add finishCreation()
     11        methods to all classes within the JSCell hierarchy with non-trivial
     12        constructor bodies.
     13
     14        This primarily consists of pushing the calls to finishCreation() down
     15        into the constructors of the subclasses of the fifth level of the hierarchy
     16        as well as pulling the finishCreation() calls out into the class's corresponding
     17        create() method if it has one.  Doing both simultaneously allows us to
     18        maintain the invariant that the finishCreation() method chain is called exactly
     19        once during the creation of an object, since calling it any other number of
     20        times (0, 2, or more) will cause an assertion failure.
     21
     22        * WebCore.exp.in:
     23        * bindings/js/JSDOMBinding.h:
     24        (WebCore::DOMConstructorObject::DOMConstructorObject):
     25        (WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument):
     26        (WebCore::DOMConstructorWithDocument::finishCreation):
     27        * bindings/js/JSDOMGlobalObject.cpp:
     28        (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
     29        * bindings/js/JSDOMGlobalObject.h:
     30        * bindings/js/JSDOMWindowBase.cpp:
     31        (WebCore::JSDOMWindowBase::JSDOMWindowBase):
     32        (WebCore::JSDOMWindowBase::finishCreation):
     33        * bindings/js/JSDOMWindowBase.h:
     34        * bindings/js/JSWorkerContextBase.cpp:
     35        (WebCore::JSWorkerContextBase::JSWorkerContextBase):
     36        (WebCore::JSWorkerContextBase::finishCreation):
     37        * bindings/js/JSWorkerContextBase.h:
     38        * bindings/scripts/CodeGeneratorJS.pm:
     39
     40        Added a finishCreation declaration and Moved the finishCreation call into the
     41        create method for all classes except for subclasses of JSWorkerContextBase and
     42        JSDOMWindowBase because those classes are on the next level, and it's easier
     43        to do all of these classes in one fell swoop rather than level by level.
     44        (GenerateHeader):
     45        Added the implementation of the finishCreation method for the classes described above.
     46        (GenerateImplementation):
     47        Also added the finishCreation calls to the autogenerated DOM constructor classes.
     48        (GenerateConstructorDeclaration):
     49        (GenerateConstructorDefinition):
     50
     51        * bindings/scripts/test/JS/JSTestInterface.cpp:
     52        (WebCore::JSTestInterfaceConstructor::create):
     53        (WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor):
     54        (WebCore::JSTestInterfaceConstructor::finishCreation):
     55        (WebCore::JSTestInterface::JSTestInterface):
     56        (WebCore::JSTestInterface::finishCreation):
     57        * bindings/scripts/test/JS/JSTestInterface.h:
     58        (WebCore::JSTestInterface::create):
     59        (WebCore::JSTestInterfacePrototype::create):
     60        (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
     61        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
     62        (WebCore::JSTestMediaQueryListListenerConstructor::create):
     63        (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor):
     64        (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
     65        (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
     66        (WebCore::JSTestMediaQueryListListener::finishCreation):
     67        * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
     68        (WebCore::JSTestMediaQueryListListener::create):
     69        (WebCore::JSTestMediaQueryListListenerPrototype::create):
     70        (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
     71        * bindings/scripts/test/JS/JSTestObj.cpp:
     72        (WebCore::JSTestObjConstructor::create):
     73        (WebCore::JSTestObjConstructor::JSTestObjConstructor):
     74        (WebCore::JSTestObjConstructor::finishCreation):
     75        (WebCore::JSTestObj::JSTestObj):
     76        (WebCore::JSTestObj::finishCreation):
     77        * bindings/scripts/test/JS/JSTestObj.h:
     78        (WebCore::JSTestObj::create):
     79        (WebCore::JSTestObjPrototype::create):
     80        (WebCore::JSTestObjPrototype::JSTestObjPrototype):
     81        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
     82        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::create):
     83        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor):
     84        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
     85        (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
     86        (WebCore::JSTestSerializedScriptValueInterface::finishCreation):
     87        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
     88        (WebCore::JSTestSerializedScriptValueInterface::create):
     89        (WebCore::JSTestSerializedScriptValueInterfacePrototype::create):
     90        (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
     91        * bridge/c/CRuntimeObject.cpp:
     92        (JSC::Bindings::CRuntimeObject::CRuntimeObject):
     93        * bridge/c/CRuntimeObject.h:
     94        (JSC::Bindings::CRuntimeObject::create):
     95        * bridge/c/c_instance.cpp:
     96        (JSC::Bindings::CRuntimeMethod::CRuntimeMethod):
     97        (JSC::Bindings::CRuntimeMethod::finishCreation):
     98        * bridge/jni/jsc/JavaInstanceJSC.cpp:
     99        (JavaRuntimeMethod::JavaRuntimeMethod):
     100        (JavaRuntimeMethod::finishCreation):
     101        * bridge/jni/jsc/JavaRuntimeObject.cpp:
     102        (JSC::Bindings::JavaRuntimeObject::JavaRuntimeObject):
     103        * bridge/jni/jsc/JavaRuntimeObject.h:
     104        (JSC::Bindings::JavaRuntimeObject::create):
     105        * bridge/objc/ObjCRuntimeObject.h:
     106        (JSC::Bindings::ObjCRuntimeObject::create):
     107        * bridge/objc/ObjCRuntimeObject.mm:
     108        (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
     109        * bridge/objc/objc_instance.mm:
     110        (ObjCRuntimeMethod::ObjCRuntimeMethod):
     111        (ObjCRuntimeMethod::finishCreation):
     112        * bridge/qt/qt_instance.cpp:
     113        (JSC::Bindings::QtRuntimeObject::create):
     114        (JSC::Bindings::QtRuntimeObject::QtRuntimeObject):
     115        * bridge/qt/qt_pixmapruntime.cpp:
     116        (JSC::Bindings::QtPixmapRuntimeObject::create):
     117        (JSC::Bindings::QtPixmapRuntimeObject::QtPixmapRuntimeObject):
     118        * bridge/qt/qt_runtime.cpp:
     119        (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod):
     120        (JSC::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
     121        (JSC::Bindings::QtRuntimeMetaMethod::finishCreation):
     122        (JSC::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod):
     123        (JSC::Bindings::QtRuntimeConnectionMethod::finishCreation):
     124        * bridge/qt/qt_runtime.h:
     125        (JSC::Bindings::QtRuntimeMetaMethod::create):
     126        * bridge/runtime_method.cpp:
     127        (JSC::RuntimeMethod::RuntimeMethod):
     128        * bridge/runtime_method.h:
     129        (JSC::RuntimeMethod::create):
     130
    11312011-09-13  Eric Seidel  <eric@webkit.org>
    2132
  • trunk/Source/WebCore/WebCore.exp.in

    r95040 r95108  
    16441644#if USE(PLUGIN_HOST_PROCESS)
    16451645__ZN3JSC13RuntimeMethod11getCallDataERNS_8CallDataE
     1646__ZN3JSC13RuntimeMethod14finishCreationERNS_12JSGlobalDataERKNS_10IdentifierE
    16461647__ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    16471648__ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    16481649__ZN3JSC13RuntimeMethod6s_infoE
    1649 __ZN3JSC13RuntimeMethodC2EPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureERKNS_10IdentifierERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE
     1650__ZN3JSC13RuntimeMethodC2EPNS_14JSGlobalObjectEPNS_9StructureERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE
    16501651__ZN3JSC8Bindings10RootObjectD1Ev
    16511652__ZN3JSC8Bindings13RuntimeObject11getCallDataERNS_8CallDataE
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r94929 r95108  
    4545    // Base class for all constructor objects in the JSC bindings.
    4646    class DOMConstructorObject : public JSDOMWrapper {
     47        typedef JSDOMWrapper Base;
    4748    public:
    4849        static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
     
    5657            : JSDOMWrapper(structure, globalObject)
    5758        {
    58             finishCreation(globalObject->globalData());
    5959        }
    6060    };
     
    6363    // can never be used from a WorkerContext.
    6464    class DOMConstructorWithDocument : public DOMConstructorObject {
     65        typedef DOMConstructorObject Base;
    6566    public:
    6667        Document* document() const
     
    7374            : DOMConstructorObject(structure, globalObject)
    7475        {
     76            finishCreation(globalObject);
     77        }
     78
     79        void finishCreation(JSDOMGlobalObject* globalObject)
     80        {
     81            Base::finishCreation(globalObject->globalData());
    7582            ASSERT(globalObject->scriptExecutionContext()->isDocument());
    7683        }
  • trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp

    r94875 r95108  
    4343const ClassInfo JSDOMGlobalObject::s_info = { "DOMGlobalObject", &JSGlobalObject::s_info, 0, 0 };
    4444
    45 JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWrapperWorld> world, JSObject* thisValue)
     45JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWrapperWorld> world)
    4646    : JSGlobalObject(globalData, structure)
    4747    , m_currentEvent(0)
    4848    , m_world(world)
    4949{
    50     finishCreation(globalData, thisValue);
    5150}
    5251
  • trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.h

    r94929 r95108  
    4747        struct JSDOMGlobalObjectData;
    4848
    49         JSDOMGlobalObject(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWrapperWorld>, JSC::JSObject* thisValue);
     49        JSDOMGlobalObject(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWrapperWorld>);
    5050        void finishCreation(JSC::JSGlobalData&, JSC::JSObject* thisValue);
    5151
  • trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp

    r93913 r95108  
    4545
    4646JSDOMWindowBase::JSDOMWindowBase(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWindow> window, JSDOMWindowShell* shell)
    47     : JSDOMGlobalObject(globalData, structure, shell->world(), shell)
     47    : JSDOMGlobalObject(globalData, structure, shell->world())
    4848    , m_impl(window)
    4949    , m_shell(shell)
    5050{
     51    finishCreation(globalData, shell);
     52}
     53
     54void JSDOMWindowBase::finishCreation(JSGlobalData& globalData, JSDOMWindowShell* shell)
     55{
     56    Base::finishCreation(globalData, shell);
    5157    ASSERT(inherits(&s_info));
    5258
  • trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h

    r94929 r95108  
    3939    protected:
    4040        JSDOMWindowBase(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWindow>, JSDOMWindowShell*);
     41        void finishCreation(JSC::JSGlobalData&, JSDOMWindowShell*);
    4142
    4243    public:
  • trunk/Source/WebCore/bindings/js/JSWorkerContextBase.cpp

    r93086 r95108  
    5050
    5151JSWorkerContextBase::JSWorkerContextBase(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<WorkerContext> impl)
    52     : JSDOMGlobalObject(globalData, structure, normalWorld(globalData), this)
     52    : JSDOMGlobalObject(globalData, structure, normalWorld(globalData))
    5353    , m_impl(impl)
    5454{
     55    finishCreation(globalData, this);
     56}
     57
     58void JSWorkerContextBase::finishCreation(JSGlobalData& globalData, JSWorkerContextBase* thisValue)
     59{
     60    Base::finishCreation(globalData, thisValue);
    5561    ASSERT(inherits(&s_info));
    5662}
  • trunk/Source/WebCore/bindings/js/JSWorkerContextBase.h

    r94929 r95108  
    4242        typedef JSDOMGlobalObject Base;
    4343    public:
    44         JSWorkerContextBase(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<WorkerContext>);
    4544        virtual ~JSWorkerContextBase();
    4645
     
    5453            return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
    5554        }
     55
     56    protected:
     57        JSWorkerContextBase(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<WorkerContext>);
     58        void finishCreation(JSC::JSGlobalData&, JSWorkerContextBase*);
    5659
    5760    private:
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r94929 r95108  
    731731        push(@headerContent, "    static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* windowShell)\n");
    732732        push(@headerContent, "    {\n");
    733         push(@headerContent, "        return new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n");
     733        push(@headerContent, "        $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n");
     734        push(@headerContent, "        return ptr;\n");
    734735        push(@headerContent, "    }\n\n");
    735736    } elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) {
    736737        push(@headerContent, "    static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl)\n");
    737738        push(@headerContent, "    {\n");
    738         push(@headerContent, "        return new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n");
     739        push(@headerContent, "        $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n");
     740        push(@headerContent, "        return ptr;\n");
    739741        push(@headerContent, "    }\n\n");
    740742    } else {
     
    742744        push(@headerContent, "    static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n");
    743745        push(@headerContent, "    {\n");
    744         push(@headerContent, "        return new (JSC::allocateCell<$className>(globalObject->globalData().heap)) $className(structure, globalObject, impl);\n");
     746        push(@headerContent, "        $className* ptr = new (JSC::allocateCell<$className>(globalObject->globalData().heap)) $className(structure, globalObject, impl);\n");
     747        push(@headerContent, "        ptr->finishCreation(globalObject->globalData());\n");
     748        push(@headerContent, "        return ptr;\n");
    745749        push(@headerContent, "    }\n\n");
    746750    }
     
    928932    } else {
    929933        push(@headerContent, "    $className(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<$implType>);\n");
     934        push(@headerContent, "    void finishCreation(JSC::JSGlobalData&);\n");
    930935    }
    931936
     
    10211026    push(@headerContent, "    static ${className}Prototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)\n");
    10221027    push(@headerContent, "    {\n");
    1023     push(@headerContent, "        return new (JSC::allocateCell<${className}Prototype>(globalData.heap)) ${className}Prototype(globalData, globalObject, structure);\n");
     1028    push(@headerContent, "        ${className}Prototype* ptr = new (JSC::allocateCell<${className}Prototype>(globalData.heap)) ${className}Prototype(globalData, globalObject, structure);\n");
     1029    push(@headerContent, "        ptr->finishCreation(globalData);\n");
     1030    push(@headerContent, "        return ptr;\n");
    10241031    push(@headerContent, "    }\n\n");
    10251032
     
    10491056
    10501057    push(@headerContent, "\nprivate:\n");
    1051     push(@headerContent, "    ${className}Prototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }\n");
     1058    push(@headerContent, "    ${className}Prototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }\n");
    10521059
    10531060    # structure flags
     
    15071514        push(@implContent, "    : $parentClassName(globalData, structure, impl, shell)\n");
    15081515        push(@implContent, "{\n");
     1516        push(@implContent, "}\n\n");
    15091517    } elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) {
    15101518        AddIncludesForTypeInImpl($interfaceName);
     
    15121520        push(@implContent, "    : $parentClassName(globalData, structure, impl)\n");
    15131521        push(@implContent, "{\n");
     1522        push(@implContent, "}\n\n");
    15141523    } else {
    15151524        push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n");
    15161525        if ($hasParent) {
    15171526            push(@implContent, "    : $parentClassName(structure, globalObject, impl)\n");
    1518             push(@implContent, "{\n");
    15191527        } else {
    15201528            push(@implContent, "    : $parentClassName(structure, globalObject)\n");
    15211529            push(@implContent, "    , m_impl(impl)\n");
    1522             push(@implContent, "{\n");
    1523             push(@implContent, "    finishCreation(globalObject->globalData());\n");
    1524         }
    1525     }
    1526     push(@implContent, "    ASSERT(inherits(&s_info));\n");
    1527     push(@implContent, "}\n\n");
     1530        }
     1531        push(@implContent, "{\n");
     1532        push(@implContent, "}\n\n");
     1533
     1534        push(@implContent, "void ${className}::finishCreation(JSGlobalData& globalData)\n");
     1535        push(@implContent, "{\n");
     1536        push(@implContent, "    Base::finishCreation(globalData);\n");
     1537        push(@implContent, "    ASSERT(inherits(&s_info));\n");
     1538        push(@implContent, "}\n\n");
     1539    }
    15281540
    15291541    if (!$dataNode->extendedAttributes->{"ExtendsDOMGlobalObject"}) {
     
    31073119    push(@$outputArray, "class ${constructorClassName} : public DOMConstructorObject {\n");
    31083120    push(@$outputArray, "private:\n");
    3109     push(@$outputArray, "    ${constructorClassName}(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);\n\n");
    3110    
     3121    push(@$outputArray, "    ${constructorClassName}(JSC::Structure*, JSDOMGlobalObject*);\n");
     3122    push(@$outputArray, "    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);\n\n");
     3123
    31113124    push(@$outputArray, "public:\n");
    31123125    push(@$outputArray, "    typedef DOMConstructorObject Base;\n");
    31133126    push(@$outputArray, "    static $constructorClassName* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)\n");
    31143127    push(@$outputArray, "    {\n");
    3115     push(@$outputArray, "        return new (JSC::allocateCell<$constructorClassName>(*exec->heap())) $constructorClassName(exec, structure, globalObject);\n");
     3128    push(@$outputArray, "        $constructorClassName* ptr = new (JSC::allocateCell<$constructorClassName>(*exec->heap())) $constructorClassName(structure, globalObject);\n");
     3129    push(@$outputArray, "        ptr->finishCreation(exec, globalObject);\n");
     3130    push(@$outputArray, "        return ptr;\n");
    31163131    push(@$outputArray, "    }\n\n");
    31173132
     
    31533168    push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleClassName}Constructor\", &DOMConstructorObject::s_info, &${constructorClassName}Table, 0 };\n\n");
    31543169
    3155     push(@$outputArray, "${constructorClassName}::${constructorClassName}(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)\n");
     3170    push(@$outputArray, "${constructorClassName}::${constructorClassName}(Structure* structure, JSDOMGlobalObject* globalObject)\n");
    31563171    push(@$outputArray, "    : DOMConstructorObject(structure, globalObject)\n");
    31573172    push(@$outputArray, "{\n");
     3173    push(@$outputArray, "}\n\n");
     3174
     3175    push(@$outputArray, "void ${constructorClassName}::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)\n");
     3176    push(@$outputArray, "{\n");
     3177    push(@$outputArray, "    Base::finishCreation(exec->globalData());\n");
    31583178    push(@$outputArray, "    ASSERT(inherits(&s_info));\n");
    31593179    if ($interfaceName eq "DOMWindow") {
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp

    r94929 r95108  
    6565class JSTestInterfaceConstructor : public DOMConstructorObject {
    6666private:
    67     JSTestInterfaceConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
     67    JSTestInterfaceConstructor(JSC::Structure*, JSDOMGlobalObject*);
     68    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
    6869
    6970public:
     
    7172    static JSTestInterfaceConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
    7273    {
    73         return new (JSC::allocateCell<JSTestInterfaceConstructor>(*exec->heap())) JSTestInterfaceConstructor(exec, structure, globalObject);
     74        JSTestInterfaceConstructor* ptr = new (JSC::allocateCell<JSTestInterfaceConstructor>(*exec->heap())) JSTestInterfaceConstructor(structure, globalObject);
     75        ptr->finishCreation(exec, globalObject);
     76        return ptr;
    7477    }
    7578
     
    8992const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0 };
    9093
    91 JSTestInterfaceConstructor::JSTestInterfaceConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
     94JSTestInterfaceConstructor::JSTestInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    9295    : DOMConstructorObject(structure, globalObject)
    9396{
     97}
     98
     99void JSTestInterfaceConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
     100{
     101    Base::finishCreation(exec->globalData());
    94102    ASSERT(inherits(&s_info));
    95103    putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
     
    147155    , m_impl(impl)
    148156{
    149     finishCreation(globalObject->globalData());
     157}
     158
     159void JSTestInterface::finishCreation(JSGlobalData& globalData)
     160{
     161    Base::finishCreation(globalData);
    150162    ASSERT(inherits(&s_info));
    151163}
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h

    r94929 r95108  
    3737    static JSTestInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
    3838    {
    39         return new (JSC::allocateCell<JSTestInterface>(globalObject->globalData().heap)) JSTestInterface(structure, globalObject, impl);
     39        JSTestInterface* ptr = new (JSC::allocateCell<JSTestInterface>(globalObject->globalData().heap)) JSTestInterface(structure, globalObject, impl);
     40        ptr->finishCreation(globalObject->globalData());
     41        return ptr;
    4042    }
    4143
     
    5759protected:
    5860    JSTestInterface(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestInterface>);
     61    void finishCreation(JSC::JSGlobalData&);
    5962    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    6063};
     
    6972    static JSTestInterfacePrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
    7073    {
    71         return new (JSC::allocateCell<JSTestInterfacePrototype>(globalData.heap)) JSTestInterfacePrototype(globalData, globalObject, structure);
     74        JSTestInterfacePrototype* ptr = new (JSC::allocateCell<JSTestInterfacePrototype>(globalData.heap)) JSTestInterfacePrototype(globalData, globalObject, structure);
     75        ptr->finishCreation(globalData);
     76        return ptr;
    7277    }
    7378
     
    7984
    8085private:
    81     JSTestInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }
     86    JSTestInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
    8287protected:
    8388    static const unsigned StructureFlags = Base::StructureFlags;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp

    r94929 r95108  
    6666class JSTestMediaQueryListListenerConstructor : public DOMConstructorObject {
    6767private:
    68     JSTestMediaQueryListListenerConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
     68    JSTestMediaQueryListListenerConstructor(JSC::Structure*, JSDOMGlobalObject*);
     69    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
    6970
    7071public:
     
    7273    static JSTestMediaQueryListListenerConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
    7374    {
    74         return new (JSC::allocateCell<JSTestMediaQueryListListenerConstructor>(*exec->heap())) JSTestMediaQueryListListenerConstructor(exec, structure, globalObject);
     75        JSTestMediaQueryListListenerConstructor* ptr = new (JSC::allocateCell<JSTestMediaQueryListListenerConstructor>(*exec->heap())) JSTestMediaQueryListListenerConstructor(structure, globalObject);
     76        ptr->finishCreation(exec, globalObject);
     77        return ptr;
    7578    }
    7679
     
    8891const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", &DOMConstructorObject::s_info, &JSTestMediaQueryListListenerConstructorTable, 0 };
    8992
    90 JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
     93JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    9194    : DOMConstructorObject(structure, globalObject)
    9295{
     96}
     97
     98void JSTestMediaQueryListListenerConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
     99{
     100    Base::finishCreation(exec->globalData());
    93101    ASSERT(inherits(&s_info));
    94102    putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestMediaQueryListListenerPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     
    143151    , m_impl(impl)
    144152{
    145     finishCreation(globalObject->globalData());
     153}
     154
     155void JSTestMediaQueryListListener::finishCreation(JSGlobalData& globalData)
     156{
     157    Base::finishCreation(globalData);
    146158    ASSERT(inherits(&s_info));
    147159}
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h

    r94929 r95108  
    3535    static JSTestMediaQueryListListener* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl)
    3636    {
    37         return new (JSC::allocateCell<JSTestMediaQueryListListener>(globalObject->globalData().heap)) JSTestMediaQueryListListener(structure, globalObject, impl);
     37        JSTestMediaQueryListListener* ptr = new (JSC::allocateCell<JSTestMediaQueryListListener>(globalObject->globalData().heap)) JSTestMediaQueryListListener(structure, globalObject, impl);
     38        ptr->finishCreation(globalObject->globalData());
     39        return ptr;
    3840    }
    3941
     
    5557protected:
    5658    JSTestMediaQueryListListener(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestMediaQueryListListener>);
     59    void finishCreation(JSC::JSGlobalData&);
    5760    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    5861};
     
    6770    static JSTestMediaQueryListListenerPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
    6871    {
    69         return new (JSC::allocateCell<JSTestMediaQueryListListenerPrototype>(globalData.heap)) JSTestMediaQueryListListenerPrototype(globalData, globalObject, structure);
     72        JSTestMediaQueryListListenerPrototype* ptr = new (JSC::allocateCell<JSTestMediaQueryListListenerPrototype>(globalData.heap)) JSTestMediaQueryListListenerPrototype(globalData, globalObject, structure);
     73        ptr->finishCreation(globalData);
     74        return ptr;
    7075    }
    7176
     
    7984
    8085private:
    81     JSTestMediaQueryListListenerPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }
     86    JSTestMediaQueryListListenerPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
    8287protected:
    8388    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r94929 r95108  
    168168class JSTestObjConstructor : public DOMConstructorObject {
    169169private:
    170     JSTestObjConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
     170    JSTestObjConstructor(JSC::Structure*, JSDOMGlobalObject*);
     171    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
    171172
    172173public:
     
    174175    static JSTestObjConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
    175176    {
    176         return new (JSC::allocateCell<JSTestObjConstructor>(*exec->heap())) JSTestObjConstructor(exec, structure, globalObject);
     177        JSTestObjConstructor* ptr = new (JSC::allocateCell<JSTestObjConstructor>(*exec->heap())) JSTestObjConstructor(structure, globalObject);
     178        ptr->finishCreation(exec, globalObject);
     179        return ptr;
    177180    }
    178181
     
    190193const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0 };
    191194
    192 JSTestObjConstructor::JSTestObjConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
     195JSTestObjConstructor::JSTestObjConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    193196    : DOMConstructorObject(structure, globalObject)
    194197{
     198}
     199
     200void JSTestObjConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
     201{
     202    Base::finishCreation(exec->globalData());
    195203    ASSERT(inherits(&s_info));
    196204    putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
     
    300308    , m_impl(impl)
    301309{
    302     finishCreation(globalObject->globalData());
     310}
     311
     312void JSTestObj::finishCreation(JSGlobalData& globalData)
     313{
     314    Base::finishCreation(globalData);
    303315    ASSERT(inherits(&s_info));
    304316}
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h

    r94929 r95108  
    3535    static JSTestObj* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
    3636    {
    37         return new (JSC::allocateCell<JSTestObj>(globalObject->globalData().heap)) JSTestObj(structure, globalObject, impl);
     37        JSTestObj* ptr = new (JSC::allocateCell<JSTestObj>(globalObject->globalData().heap)) JSTestObj(structure, globalObject, impl);
     38        ptr->finishCreation(globalObject->globalData());
     39        return ptr;
    3840    }
    3941
     
    6870protected:
    6971    JSTestObj(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestObj>);
     72    void finishCreation(JSC::JSGlobalData&);
    7073    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags;
    7174};
     
    8083    static JSTestObjPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
    8184    {
    82         return new (JSC::allocateCell<JSTestObjPrototype>(globalData.heap)) JSTestObjPrototype(globalData, globalObject, structure);
     85        JSTestObjPrototype* ptr = new (JSC::allocateCell<JSTestObjPrototype>(globalData.heap)) JSTestObjPrototype(globalData, globalObject, structure);
     86        ptr->finishCreation(globalData);
     87        return ptr;
    8388    }
    8489
     
    9297
    9398private:
    94     JSTestObjPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }
     99    JSTestObjPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
    95100protected:
    96101    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp

    r94929 r95108  
    6767class JSTestSerializedScriptValueInterfaceConstructor : public DOMConstructorObject {
    6868private:
    69     JSTestSerializedScriptValueInterfaceConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
     69    JSTestSerializedScriptValueInterfaceConstructor(JSC::Structure*, JSDOMGlobalObject*);
     70    void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
    7071
    7172public:
     
    7374    static JSTestSerializedScriptValueInterfaceConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
    7475    {
    75         return new (JSC::allocateCell<JSTestSerializedScriptValueInterfaceConstructor>(*exec->heap())) JSTestSerializedScriptValueInterfaceConstructor(exec, structure, globalObject);
     76        JSTestSerializedScriptValueInterfaceConstructor* ptr = new (JSC::allocateCell<JSTestSerializedScriptValueInterfaceConstructor>(*exec->heap())) JSTestSerializedScriptValueInterfaceConstructor(structure, globalObject);
     77        ptr->finishCreation(exec, globalObject);
     78        return ptr;
    7679    }
    7780
     
    8992const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestSerializedScriptValueInterfaceConstructorTable, 0 };
    9093
    91 JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
     94JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    9295    : DOMConstructorObject(structure, globalObject)
    9396{
     97}
     98
     99void JSTestSerializedScriptValueInterfaceConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
     100{
     101    Base::finishCreation(exec->globalData());
    94102    ASSERT(inherits(&s_info));
    95103    putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestSerializedScriptValueInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
     
    133141    , m_impl(impl)
    134142{
    135     finishCreation(globalObject->globalData());
     143}
     144
     145void JSTestSerializedScriptValueInterface::finishCreation(JSGlobalData& globalData)
     146{
     147    Base::finishCreation(globalData);
    136148    ASSERT(inherits(&s_info));
    137149}
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h

    r94929 r95108  
    3737    static JSTestSerializedScriptValueInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestSerializedScriptValueInterface> impl)
    3838    {
    39         return new (JSC::allocateCell<JSTestSerializedScriptValueInterface>(globalObject->globalData().heap)) JSTestSerializedScriptValueInterface(structure, globalObject, impl);
     39        JSTestSerializedScriptValueInterface* ptr = new (JSC::allocateCell<JSTestSerializedScriptValueInterface>(globalObject->globalData().heap)) JSTestSerializedScriptValueInterface(structure, globalObject, impl);
     40        ptr->finishCreation(globalObject->globalData());
     41        return ptr;
    4042    }
    4143
     
    5759protected:
    5860    JSTestSerializedScriptValueInterface(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestSerializedScriptValueInterface>);
     61    void finishCreation(JSC::JSGlobalData&);
    5962    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
    6063};
     
    6972    static JSTestSerializedScriptValueInterfacePrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
    7073    {
    71         return new (JSC::allocateCell<JSTestSerializedScriptValueInterfacePrototype>(globalData.heap)) JSTestSerializedScriptValueInterfacePrototype(globalData, globalObject, structure);
     74        JSTestSerializedScriptValueInterfacePrototype* ptr = new (JSC::allocateCell<JSTestSerializedScriptValueInterfacePrototype>(globalData.heap)) JSTestSerializedScriptValueInterfacePrototype(globalData, globalObject, structure);
     75        ptr->finishCreation(globalData);
     76        return ptr;
    7277    }
    7378
     
    7984
    8085private:
    81     JSTestSerializedScriptValueInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { finishCreation(globalData); }
     86    JSTestSerializedScriptValueInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
    8287protected:
    8388    static const unsigned StructureFlags = Base::StructureFlags;
  • trunk/Source/WebCore/bridge/c/CRuntimeObject.cpp

    r94875 r95108  
    4141    : RuntimeObject(exec, globalObject, structure, instance)
    4242{
    43     finishCreation(globalObject);
    4443}
    4544
  • trunk/Source/WebCore/bridge/c/CRuntimeObject.h

    r94929 r95108  
    4646        // We need to pass in the right global object for "i".
    4747        Structure* domStructure = WebCore::deprecatedGetDOMStructure<CRuntimeObject>(exec);
    48         return new (allocateCell<CRuntimeObject>(*exec->heap())) CRuntimeObject(exec, globalObject, domStructure, instance);
     48        CRuntimeObject* object = new (allocateCell<CRuntimeObject>(*exec->heap())) CRuntimeObject(exec, globalObject, domStructure, instance);
     49        object->finishCreation(globalObject);
     50        return object;
    4951    }
    5052
  • trunk/Source/WebCore/bridge/c/c_instance.cpp

    r94929 r95108  
    131131private:
    132132    CRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
    133         : RuntimeMethod(exec, globalObject, structure, name, list)
    134     {
     133        : RuntimeMethod(globalObject, structure, list)
     134    {
     135        finishCreation(exec->globalData(), name);
     136    }
     137
     138    void finishCreation(JSGlobalData& globalData, const Identifier& name)
     139    {
     140        Base::finishCreation(globalData, name);
    135141        ASSERT(inherits(&s_info));
    136142    }
  • trunk/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp

    r94929 r95108  
    136136private:
    137137    JavaRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
    138         : RuntimeMethod(exec, globalObject, structure, name, list)
     138        : RuntimeMethod(globalObject, structure, list)
    139139    {
     140        finishCreation(exec->globalData(), name);
     141    }
     142
     143    void finishCreation(JSGlobalData& globalData, const Identifier& name)
     144    {
     145        Base::finishCreation(globalData, name);
    140146        ASSERT(inherits(&s_info));
    141147    }
    142 
    143148};
    144149
  • trunk/Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.cpp

    r94875 r95108  
    3939    : RuntimeObject(exec, globalObject, structure, instance)
    4040{
    41     finishCreation(globalObject);
    4241}
    4342
  • trunk/Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.h

    r94929 r95108  
    3939    typedef RuntimeObject Base;
    4040
    41     static JavaRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<JavaInstance> javaInst)
     41    static JavaRuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<JavaInstance> javaInstance)
    4242    {
    4343        // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
    4444        // We need to pass in the right global object for "i".
    4545        Structure* domStructure = WebCore::deprecatedGetDOMStructure<JavaRuntimeObject>(exec);
    46         return new (allocateCell<JavaRuntimeObject>(*exec->heap())) JavaRuntimeObject(exec, globalObject, domStructure, javaInst);
     46        JavaRuntimeObject* object = new (allocateCell<JavaRuntimeObject>(*exec->heap())) JavaRuntimeObject(exec, globalObject, domStructure, javaInstance);
     47        object->finishCreation(globalObject);
     48        return object;
    4749    }
    4850
  • trunk/Source/WebCore/bridge/objc/ObjCRuntimeObject.h

    r94929 r95108  
    4343        // We need to pass in the right global object for "i".
    4444        Structure* structure = WebCore::deprecatedGetDOMStructure<ObjCRuntimeObject>(exec);
    45         return new (allocateCell<ObjCRuntimeObject>(*exec->heap())) ObjCRuntimeObject(exec, globalObject, inst, structure);
     45        ObjCRuntimeObject* object = new (allocateCell<ObjCRuntimeObject>(*exec->heap())) ObjCRuntimeObject(exec, globalObject, inst, structure);
     46        object->finishCreation(globalObject);
     47        return object;
    4648    }
    4749
  • trunk/Source/WebCore/bridge/objc/ObjCRuntimeObject.mm

    r94875 r95108  
    3939    : RuntimeObject(exec, globalObject, structure, instance)
    4040{
    41     finishCreation(globalObject);
    4241}
    4342
  • trunk/Source/WebCore/bridge/objc/objc_instance.mm

    r94929 r95108  
    190190
    191191private:
     192    typedef RuntimeMethod Base;
     193
    192194    ObjCRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
    193         : RuntimeMethod(exec, globalObject, structure, name, list)
     195        : RuntimeMethod(globalObject, structure, list)
    194196    {
     197        finishCreation(exec->globalData(), name);
     198    }
     199
     200    void finishCreation(JSGlobalData& globalData, const Identifier& name)
     201    {
     202        Base::finishCreation(globalData, name);
    195203        ASSERT(inherits(&s_info));
    196204    }
  • trunk/Source/WebCore/bridge/qt/qt_instance.cpp

    r94929 r95108  
    5656    {
    5757        Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeObject>(exec);
    58         return new (allocateCell<QtRuntimeObject>(*exec->heap())) QtRuntimeObject(exec, globalObject, domStructure, instance);
     58        QtRuntimeObject* object = new (allocateCell<QtRuntimeObject>(*exec->heap())) QtRuntimeObject(exec, globalObject, domStructure, instance);
     59        object->finishCreation(globalObject);
     60        return object;
    5961    }
    6062   
     
    8688    : RuntimeObject(exec, globalObject, structure, instance)
    8789{
    88     finishCreation(globalObject);
    8990}
    9091
  • trunk/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp

    r94929 r95108  
    205205    {
    206206        Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtPixmapRuntimeObject>(exec);
    207         return new (allocateCell<QtPixmapRuntimeObject>(*exec->heap())) QtPixmapRuntimeObject(exec, globalObject, domStructure, instance);
     207        QtPixmapRuntimeObject* object = new (allocateCell<QtPixmapRuntimeObject>(*exec->heap())) QtPixmapRuntimeObject(exec, globalObject, domStructure, instance);
     208        object->finishCreation(globalObject);
     209        return object;
    208210    }
    209211
     
    225227    : RuntimeObject(exec, globalObject, structure, instance)
    226228{
    227     finishCreation(globalObject);
    228229}
    229230
  • trunk/Source/WebCore/bridge/qt/qt_runtime.cpp

    r94875 r95108  
    10111011    , d_ptr(dd)
    10121012{
    1013     finishCreation(exec, identifier, instance);
    10141013}
    10151014
     
    14271426}
    14281427
    1429 QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& ident, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature, bool allowPrivate)
    1430     : QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, ident, inst)
    1431 {
     1428QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& identifier, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)
     1429    : QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, identifier, instance)
     1430{
     1431    finishCreation(exec, identifier, instance, index, signature, allowPrivate);
     1432}
     1433
     1434void QtRuntimeMetaMethod::finishCreation(ExecState* exec, const Identifier& identifier, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)
     1435{
     1436    Base::finishCreation(exec, identifier, instance);
    14321437    QW_D(QtRuntimeMetaMethod);
    14331438    d->m_signature = signature;
     
    15711576QMultiMap<QObject*, QtConnectionObject*> QtRuntimeConnectionMethod::connections;
    15721577
    1573 QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& ident, bool isConnect, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature)
    1574     : QtRuntimeMethod (new QtRuntimeConnectionMethodData(), exec, structure, ident, inst)
    1575 {
     1578QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& identifier, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)
     1579    : QtRuntimeMethod (new QtRuntimeConnectionMethodData(), exec, structure, identifier, instance)
     1580{
     1581    finishCreation(exec, identifier, isConnect, instance, index, signature);
     1582}
     1583
     1584void QtRuntimeConnectionMethod::finishCreation(ExecState* exec, const Identifier& identifier, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)
     1585{
     1586    Base::finishCreation(exec, identifier, instance);
    15761587    QW_D(QtRuntimeConnectionMethod);
    15771588
  • trunk/Source/WebCore/bridge/qt/qt_runtime.h

    r94929 r95108  
    160160    {
    161161        Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeMethod>(exec);
    162         return new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, n, inst, index, signature, allowPrivate);
     162        QtRuntimeMetaMethod* method = new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, n, inst, index, signature, allowPrivate);
     163        return method;
    163164    }
    164165
     
    174175private:
    175176    QtRuntimeMetaMethod(ExecState*, Structure*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray&, bool allowPrivate);
     177    void finishCreation(ExecState*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray& signature, bool allowPrivate);
    176178
    177179    virtual CallType getCallData(CallData&);
     
    202204private:
    203205    QtRuntimeConnectionMethod(ExecState*, Structure*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray&);
     206    void finishCreation(ExecState*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray& signature);
    204207
    205208    virtual CallType getCallData(CallData&);
  • trunk/Source/WebCore/bridge/runtime_method.cpp

    r94875 r95108  
    4444const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", &InternalFunction::s_info, 0, 0 };
    4545
    46 RuntimeMethod::RuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& ident, Bindings::MethodList& m)
     46RuntimeMethod::RuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& m)
    4747    // Callers will need to pass in the right global object corresponding to this native object "m".
    4848    : InternalFunction(globalObject, structure)
    4949    , _methodList(adoptPtr(new MethodList(m)))
    5050{
    51     finishCreation(exec->globalData(), ident);
    5251}
    5352
  • trunk/Source/WebCore/bridge/runtime_method.h

    r94929 r95108  
    4040    static RuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& methodList)
    4141    {
    42         return new (allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(exec, globalObject, structure, name, methodList);
     42        RuntimeMethod* method = new (allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(globalObject, structure, methodList);
     43        method->finishCreation(exec->globalData(), name);
     44        return method;
    4345    }
    4446
     
    5860
    5961protected:
    60     RuntimeMethod(ExecState*, JSGlobalObject*, Structure*, const Identifier& name, Bindings::MethodList&);
     62    RuntimeMethod(JSGlobalObject*, Structure*, Bindings::MethodList&);
    6163    void finishCreation(JSGlobalData&, const Identifier&);
    6264    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
  • trunk/Source/WebKit/mac/ChangeLog

    r95107 r95108  
     12011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Unzip initialization lists and constructors in JSCell hierarchy (6/7)
     4        https://bugs.webkit.org/show_bug.cgi?id=67692
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Completed the sixth level of the refactoring to add finishCreation()
     9        methods to all classes within the JSCell hierarchy with non-trivial
     10        constructor bodies.
     11
     12        This primarily consists of pushing the calls to finishCreation() down
     13        into the constructors of the subclasses of the fifth level of the hierarchy
     14        as well as pulling the finishCreation() calls out into the class's corresponding
     15        create() method if it has one.  Doing both simultaneously allows us to
     16        maintain the invariant that the finishCreation() method chain is called exactly
     17        once during the creation of an object, since calling it any other number of
     18        times (0, 2, or more) will cause an assertion failure.
     19
     20        * Plugins/Hosted/ProxyInstance.mm:
     21        (WebKit::ProxyRuntimeMethod::ProxyRuntimeMethod):
     22        (WebKit::ProxyRuntimeMethod::finishCreation):
     23
    1242011-09-13  Eric Seidel  <eric@webkit.org>
    225
  • trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm

    r94929 r95108  
    199199private:
    200200    ProxyRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
    201         : RuntimeMethod(exec, globalObject, structure, name, list)
    202     {
     201        : RuntimeMethod(globalObject, structure, list)
     202    {
     203        finishCreation(exec->globalData(), name);
     204    }
     205
     206    void finishCreation(JSGlobalData& globalData, const Identifier& name)
     207    {
     208        Base::finishCreation(globalData, name);
    203209        ASSERT(inherits(&s_info));
    204210    }
  • trunk/Source/WebKit2/ChangeLog

    r95107 r95108  
     12011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Unzip initialization lists and constructors in JSCell hierarchy (6/7)
     4        https://bugs.webkit.org/show_bug.cgi?id=67692
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Completed the sixth level of the refactoring to add finishCreation()
     9        methods to all classes within the JSCell hierarchy with non-trivial
     10        constructor bodies.
     11
     12        This primarily consists of pushing the calls to finishCreation() down
     13        into the constructors of the subclasses of the fifth level of the hierarchy
     14        as well as pulling the finishCreation() calls out into the class's corresponding
     15        create() method if it has one.  Doing both simultaneously allows us to
     16        maintain the invariant that the finishCreation() method chain is called exactly
     17        once during the creation of an object, since calling it any other number of
     18        times (0, 2, or more) will cause an assertion failure.
     19
     20        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
     21        (WebKit::JSNPMethod::JSNPMethod):
     22        * WebProcess/Plugins/Netscape/JSNPMethod.h:
     23        (WebKit::JSNPMethod::create):
     24
    1252011-09-13  Eric Seidel  <eric@webkit.org>
    226
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp

    r94875 r95108  
    4343const ClassInfo JSNPMethod::s_info = { "NPMethod", &InternalFunction::s_info, 0, 0 };
    4444
    45 JSNPMethod::JSNPMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, NPIdentifier npIdentifier)
     45JSNPMethod::JSNPMethod(JSGlobalObject* globalObject, Structure* structure, NPIdentifier npIdentifier)
    4646    : InternalFunction(globalObject, structure)
    4747    , m_npIdentifier(npIdentifier)
    4848{
    49     finishCreation(exec->globalData(), name);
    5049}
    5150
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h

    r94929 r95108  
    4040    typedef JSC::InternalFunction Base;
    4141
    42     static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::Identifier& ident, NPIdentifier npIdent)
     42    static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::Identifier& name, NPIdentifier npIdent)
    4343    {
    4444        JSC::Structure* structure = createStructure(exec->globalData(), globalObject, globalObject->functionPrototype());
    45         return new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(exec, globalObject, structure, ident, npIdent);
     45        JSNPMethod* method = new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(globalObject, structure, npIdent);
     46        method->finishCreation(exec->globalData(), name);
     47        return method;
    4648    }
    4749
     
    5456
    5557private:   
    56     JSNPMethod(JSC::ExecState*, JSC::JSGlobalObject*, JSC::Structure*, const JSC::Identifier&, NPIdentifier);
     58    JSNPMethod(JSC::JSGlobalObject*, JSC::Structure*, NPIdentifier);
    5759
    5860    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
Note: See TracChangeset for help on using the changeset viewer.