Changeset 94627 in webkit


Ignore:
Timestamp:
Sep 6, 2011 7:13:37 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Unzip initialization lists and constructors in JSCell hierarchy (5/7)
https://bugs.webkit.org/show_bug.cgi?id=67420

Patch by Mark Hahnenberg <mhahnenberg@apple.com> on 2011-09-06
Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Completed the fifth 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 second 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/JSCallbackConstructor.cpp:

(JSC::JSCallbackConstructor::JSCallbackConstructor):

  • API/JSCallbackConstructor.h:

(JSC::JSCallbackConstructor::create):

  • API/JSCallbackFunction.cpp:

(JSC::JSCallbackFunction::JSCallbackFunction):
(JSC::JSCallbackFunction::finishCreation):

  • API/JSCallbackFunction.h:
  • JavaScriptCore.exp:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • debugger/DebuggerActivation.cpp:
  • debugger/DebuggerActivation.h:

(JSC::DebuggerActivation::create):

  • jsc.cpp:

(GlobalObject::finishCreation):
(GlobalObject::GlobalObject):

  • runtime/ArrayConstructor.cpp:

(JSC::ArrayConstructor::ArrayConstructor):
(JSC::ArrayConstructor::finishCreation):

  • runtime/ArrayConstructor.h:
  • runtime/ArrayPrototype.cpp:

(JSC::ArrayPrototype::ArrayPrototype):

  • runtime/ArrayPrototype.h:

(JSC::ArrayPrototype::create):

  • runtime/BooleanConstructor.cpp:

(JSC::BooleanConstructor::BooleanConstructor):
(JSC::BooleanConstructor::finishCreation):

  • runtime/BooleanConstructor.h:
  • runtime/BooleanObject.cpp:

(JSC::BooleanObject::BooleanObject):

  • runtime/BooleanObject.h:

(JSC::BooleanObject::create):

  • runtime/BooleanPrototype.cpp:

(JSC::BooleanPrototype::BooleanPrototype):
(JSC::BooleanPrototype::finishCreation):

  • runtime/BooleanPrototype.h:
  • runtime/DateConstructor.cpp:

(JSC::DateConstructor::DateConstructor):
(JSC::DateConstructor::finishCreation):

  • runtime/DateConstructor.h:
  • runtime/DateInstance.cpp:

(JSC::DateInstance::DateInstance):

  • runtime/DateInstance.h:

(JSC::DateInstance::create):

  • runtime/DatePrototype.cpp:

(JSC::DatePrototype::DatePrototype):
(JSC::DatePrototype::finishCreation):

  • runtime/DatePrototype.h:
  • runtime/Error.cpp:

(JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):

  • runtime/ErrorConstructor.cpp:

(JSC::ErrorConstructor::ErrorConstructor):
(JSC::ErrorConstructor::finishCreation):

  • runtime/ErrorConstructor.h:
  • runtime/ErrorPrototype.cpp:

(JSC::ErrorPrototype::ErrorPrototype):

  • runtime/ErrorPrototype.h:

(JSC::ErrorPrototype::create):

  • runtime/FunctionConstructor.cpp:

(JSC::FunctionConstructor::FunctionConstructor):
(JSC::FunctionConstructor::finishCreation):

  • runtime/FunctionConstructor.h:
  • runtime/FunctionPrototype.cpp:

(JSC::FunctionPrototype::FunctionPrototype):
(JSC::FunctionPrototype::finishCreation):

  • runtime/FunctionPrototype.h:
  • runtime/InternalFunction.cpp:

(JSC::InternalFunction::InternalFunction):

  • runtime/InternalFunction.h:
  • runtime/JSActivation.cpp:

(JSC::JSActivation::JSActivation):

  • runtime/JSActivation.h:

(JSC::JSActivation::create):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::create):
(JSC::JSGlobalObject::JSGlobalObject):

  • runtime/JSONObject.cpp:

(JSC::JSONObject::JSONObject):

  • runtime/JSONObject.h:

(JSC::JSONObject::create):

  • runtime/JSStaticScopeObject.h:

(JSC::JSStaticScopeObject::create):
(JSC::JSStaticScopeObject::JSStaticScopeObject):

  • runtime/JSString.cpp:

(JSC::StringObject::create):

  • runtime/MathObject.cpp:

(JSC::MathObject::MathObject):

  • runtime/MathObject.h:

(JSC::MathObject::create):

  • runtime/NativeErrorConstructor.cpp:

(JSC::NativeErrorConstructor::NativeErrorConstructor):

  • runtime/NativeErrorConstructor.h:

(JSC::NativeErrorConstructor::finishCreation):

  • runtime/NativeErrorPrototype.cpp:

(JSC::NativeErrorPrototype::NativeErrorPrototype):
(JSC::NativeErrorPrototype::finishCreation):

  • runtime/NativeErrorPrototype.h:
  • runtime/NumberConstructor.cpp:

(JSC::NumberConstructor::NumberConstructor):
(JSC::NumberConstructor::finishCreation):

  • runtime/NumberConstructor.h:
  • runtime/NumberObject.cpp:

(JSC::NumberObject::NumberObject):

  • runtime/NumberObject.h:

(JSC::NumberObject::create):

  • runtime/NumberPrototype.cpp:

(JSC::NumberPrototype::NumberPrototype):
(JSC::NumberPrototype::finishCreation):

  • runtime/NumberPrototype.h:
  • runtime/ObjectConstructor.cpp:

(JSC::ObjectConstructor::ObjectConstructor):
(JSC::ObjectConstructor::finishCreation):

  • runtime/ObjectConstructor.h:
  • runtime/RegExpConstructor.cpp:

(JSC::RegExpConstructor::RegExpConstructor):
(JSC::RegExpConstructor::finishCreation):
(JSC::RegExpMatchesArray::RegExpMatchesArray):

  • runtime/RegExpConstructor.h:
  • runtime/RegExpMatchesArray.h:

(JSC::RegExpMatchesArray::create):

  • runtime/RegExpObject.cpp:

(JSC::RegExpObject::RegExpObject):

  • runtime/RegExpObject.h:

(JSC::RegExpObject::create):

  • runtime/RegExpPrototype.cpp:

(JSC::RegExpPrototype::RegExpPrototype):

  • runtime/StringConstructor.cpp:

(JSC::StringConstructor::StringConstructor):
(JSC::StringConstructor::finishCreation):

  • runtime/StringConstructor.h:
  • runtime/StringObject.cpp:

(JSC::StringObject::StringObject):

  • runtime/StringObject.h:

(JSC::StringObject::create):

  • runtime/StringObjectThatMasqueradesAsUndefined.h:

(JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):

  • runtime/StringPrototype.cpp:

(JSC::StringPrototype::StringPrototype):
(JSC::StringPrototype::finishCreation):

  • runtime/StringPrototype.h:

Source/JavaScriptGlue:

Completed the fifth 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 second 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):

Source/WebCore:

No new tests.

Completed the fifth 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 second 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):

  • bindings/js/JSDOMGlobalObject.cpp:

(WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
(WebCore::JSDOMGlobalObject::finishCreation):

  • bindings/js/JSDOMGlobalObject.h:
  • bindings/js/JSDOMWindowShell.cpp:
  • bindings/js/JSDOMWindowShell.h:

(WebCore::JSDOMWindowShell::create):

  • bindings/js/JSDOMWrapper.h:

(WebCore::JSDOMWrapper::JSDOMWrapper):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateImplementation):

  • bindings/scripts/test/JS/JSTestInterface.cpp:

(WebCore::JSTestInterface::JSTestInterface):

  • bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:

(WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):

  • bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::JSTestObj::JSTestObj):

  • bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:

(WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):

  • bridge/c/CRuntimeObject.cpp:

(JSC::Bindings::CRuntimeObject::CRuntimeObject):
(JSC::Bindings::CRuntimeObject::finishCreation):

  • bridge/c/CRuntimeObject.h:
  • bridge/jni/jsc/JavaRuntimeObject.cpp:

(JSC::Bindings::JavaRuntimeObject::JavaRuntimeObject):
(JSC::Bindings::JavaRuntimeObject::finishCreation):

  • bridge/jni/jsc/JavaRuntimeObject.h:
  • bridge/objc/ObjCRuntimeObject.h:
  • bridge/objc/ObjCRuntimeObject.mm:

(JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
(JSC::Bindings::ObjCRuntimeObject::finishCreation):

  • bridge/objc/objc_runtime.h:

(JSC::Bindings::ObjcFallbackObjectImp::create):

  • bridge/objc/objc_runtime.mm:

(JSC::Bindings::ObjcFallbackObjectImp::ObjcFallbackObjectImp):

  • bridge/qt/qt_instance.cpp:

(JSC::Bindings::QtRuntimeObject::QtRuntimeObject):

  • bridge/qt/qt_pixmapruntime.cpp:

(JSC::Bindings::QtPixmapRuntimeObject::QtPixmapRuntimeObject):

  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod):
(JSC::Bindings::QtRuntimeMethod::finishCreation):

  • bridge/qt/qt_runtime.h:
  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::RuntimeArray):

  • bridge/runtime_array.h:

(JSC::RuntimeArray::create):

  • bridge/runtime_method.cpp:

(JSC::RuntimeMethod::RuntimeMethod):
(JSC::RuntimeMethod::finishCreation):

  • bridge/runtime_method.h:
  • bridge/runtime_object.cpp:

(JSC::Bindings::RuntimeObject::RuntimeObject):

  • bridge/runtime_object.h:

(JSC::Bindings::RuntimeObject::create):

Source/WebKit/mac:

Completed the fifth 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 second 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/ProxyRuntimeObject.h:
  • Plugins/Hosted/ProxyRuntimeObject.mm:

(WebKit::ProxyRuntimeObject::ProxyRuntimeObject):
(WebKit::ProxyRuntimeObject::finishCreation):

Source/WebKit2:

Completed the fifth 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 second 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):
(WebKit::JSNPMethod::finishCreation):

  • WebProcess/Plugins/Netscape/JSNPMethod.h:

(WebKit::JSNPMethod::create):

  • WebProcess/Plugins/Netscape/JSNPObject.cpp:

(WebKit::JSNPObject::JSNPObject):

  • WebProcess/Plugins/Netscape/JSNPObject.h:

(WebKit::JSNPObject::create):

Location:
trunk/Source
Files:
112 edited

Legend:

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

    r94364 r94627  
    4444    , m_callback(callback)
    4545{
    46     finishCreation(globalObject, jsClass);
    4746}
    4847
  • trunk/Source/JavaScriptCore/API/JSCallbackConstructor.h

    r94599 r94627  
    3838    static JSCallbackConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, JSObjectCallAsConstructorCallback callback)
    3939    {
    40         return new (allocateCell<JSCallbackConstructor>(*exec->heap())) JSCallbackConstructor(globalObject, structure, classRef, callback);
     40        JSCallbackConstructor* constructor = new (allocateCell<JSCallbackConstructor>(*exec->heap())) JSCallbackConstructor(globalObject, structure, classRef, callback);
     41        constructor->finishCreation(globalObject, classRef);
     42        return constructor;
    4143    }
    4244   
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.cpp

    r79240 r94627  
    4444
    4545JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
    46     : InternalFunction(&exec->globalData(), globalObject, globalObject->callbackFunctionStructure(), name)
     46    : InternalFunction(globalObject, globalObject->callbackFunctionStructure())
    4747    , m_callback(callback)
    4848{
     49    finishCreation(exec->globalData(), globalObject, name);
     50}
     51
     52void JSCallbackFunction::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject, const Identifier& name)
     53{
     54    Base::finishCreation(globalData, globalObject, name);
    4955    ASSERT(inherits(&s_info));
    5056}
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.h

    r94599 r94627  
    3535protected:
    3636    JSCallbackFunction(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name);
     37    void finishCreation(JSGlobalData&, JSGlobalObject*, const Identifier& name);
    3738
    3839public:
  • trunk/Source/JavaScriptCore/ChangeLog

    r94623 r94627  
     12011-09-06  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Unzip initialization lists and constructors in JSCell hierarchy (5/7)
     4        https://bugs.webkit.org/show_bug.cgi?id=67420
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Completed the fifth level of the refactoring to add finishCreation()
     9        methods to all classes within the JSCell hierarchy with non-trivial
     10        constructor bodies.
     11
     12        This primarily consists of pushing the calls to finishCreation() down
     13        into the constructors of the subclasses of the second level of the hierarchy
     14        as well as pulling the finishCreation() calls out into the class's corresponding
     15        create() method if it has one.  Doing both simultaneously allows us to
     16        maintain the invariant that the finishCreation() method chain is called exactly
     17        once during the creation of an object, since calling it any other number of
     18        times (0, 2, or more) will cause an assertion failure.
     19
     20        * API/JSCallbackConstructor.cpp:
     21        (JSC::JSCallbackConstructor::JSCallbackConstructor):
     22        * API/JSCallbackConstructor.h:
     23        (JSC::JSCallbackConstructor::create):
     24        * API/JSCallbackFunction.cpp:
     25        (JSC::JSCallbackFunction::JSCallbackFunction):
     26        (JSC::JSCallbackFunction::finishCreation):
     27        * API/JSCallbackFunction.h:
     28        * JavaScriptCore.exp:
     29        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
     30        * debugger/DebuggerActivation.cpp:
     31        * debugger/DebuggerActivation.h:
     32        (JSC::DebuggerActivation::create):
     33        * jsc.cpp:
     34        (GlobalObject::finishCreation):
     35        (GlobalObject::GlobalObject):
     36        * runtime/ArrayConstructor.cpp:
     37        (JSC::ArrayConstructor::ArrayConstructor):
     38        (JSC::ArrayConstructor::finishCreation):
     39        * runtime/ArrayConstructor.h:
     40        * runtime/ArrayPrototype.cpp:
     41        (JSC::ArrayPrototype::ArrayPrototype):
     42        * runtime/ArrayPrototype.h:
     43        (JSC::ArrayPrototype::create):
     44        * runtime/BooleanConstructor.cpp:
     45        (JSC::BooleanConstructor::BooleanConstructor):
     46        (JSC::BooleanConstructor::finishCreation):
     47        * runtime/BooleanConstructor.h:
     48        * runtime/BooleanObject.cpp:
     49        (JSC::BooleanObject::BooleanObject):
     50        * runtime/BooleanObject.h:
     51        (JSC::BooleanObject::create):
     52        * runtime/BooleanPrototype.cpp:
     53        (JSC::BooleanPrototype::BooleanPrototype):
     54        (JSC::BooleanPrototype::finishCreation):
     55        * runtime/BooleanPrototype.h:
     56        * runtime/DateConstructor.cpp:
     57        (JSC::DateConstructor::DateConstructor):
     58        (JSC::DateConstructor::finishCreation):
     59        * runtime/DateConstructor.h:
     60        * runtime/DateInstance.cpp:
     61        (JSC::DateInstance::DateInstance):
     62        * runtime/DateInstance.h:
     63        (JSC::DateInstance::create):
     64        * runtime/DatePrototype.cpp:
     65        (JSC::DatePrototype::DatePrototype):
     66        (JSC::DatePrototype::finishCreation):
     67        * runtime/DatePrototype.h:
     68        * runtime/Error.cpp:
     69        (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
     70        * runtime/ErrorConstructor.cpp:
     71        (JSC::ErrorConstructor::ErrorConstructor):
     72        (JSC::ErrorConstructor::finishCreation):
     73        * runtime/ErrorConstructor.h:
     74        * runtime/ErrorPrototype.cpp:
     75        (JSC::ErrorPrototype::ErrorPrototype):
     76        * runtime/ErrorPrototype.h:
     77        (JSC::ErrorPrototype::create):
     78        * runtime/FunctionConstructor.cpp:
     79        (JSC::FunctionConstructor::FunctionConstructor):
     80        (JSC::FunctionConstructor::finishCreation):
     81        * runtime/FunctionConstructor.h:
     82        * runtime/FunctionPrototype.cpp:
     83        (JSC::FunctionPrototype::FunctionPrototype):
     84        (JSC::FunctionPrototype::finishCreation):
     85        * runtime/FunctionPrototype.h:
     86        * runtime/InternalFunction.cpp:
     87        (JSC::InternalFunction::InternalFunction):
     88        * runtime/InternalFunction.h:
     89        * runtime/JSActivation.cpp:
     90        (JSC::JSActivation::JSActivation):
     91        * runtime/JSActivation.h:
     92        (JSC::JSActivation::create):
     93        * runtime/JSGlobalObject.h:
     94        (JSC::JSGlobalObject::create):
     95        (JSC::JSGlobalObject::JSGlobalObject):
     96        * runtime/JSONObject.cpp:
     97        (JSC::JSONObject::JSONObject):
     98        * runtime/JSONObject.h:
     99        (JSC::JSONObject::create):
     100        * runtime/JSStaticScopeObject.h:
     101        (JSC::JSStaticScopeObject::create):
     102        (JSC::JSStaticScopeObject::JSStaticScopeObject):
     103        * runtime/JSString.cpp:
     104        (JSC::StringObject::create):
     105        * runtime/MathObject.cpp:
     106        (JSC::MathObject::MathObject):
     107        * runtime/MathObject.h:
     108        (JSC::MathObject::create):
     109        * runtime/NativeErrorConstructor.cpp:
     110        (JSC::NativeErrorConstructor::NativeErrorConstructor):
     111        * runtime/NativeErrorConstructor.h:
     112        (JSC::NativeErrorConstructor::finishCreation):
     113        * runtime/NativeErrorPrototype.cpp:
     114        (JSC::NativeErrorPrototype::NativeErrorPrototype):
     115        (JSC::NativeErrorPrototype::finishCreation):
     116        * runtime/NativeErrorPrototype.h:
     117        * runtime/NumberConstructor.cpp:
     118        (JSC::NumberConstructor::NumberConstructor):
     119        (JSC::NumberConstructor::finishCreation):
     120        * runtime/NumberConstructor.h:
     121        * runtime/NumberObject.cpp:
     122        (JSC::NumberObject::NumberObject):
     123        * runtime/NumberObject.h:
     124        (JSC::NumberObject::create):
     125        * runtime/NumberPrototype.cpp:
     126        (JSC::NumberPrototype::NumberPrototype):
     127        (JSC::NumberPrototype::finishCreation):
     128        * runtime/NumberPrototype.h:
     129        * runtime/ObjectConstructor.cpp:
     130        (JSC::ObjectConstructor::ObjectConstructor):
     131        (JSC::ObjectConstructor::finishCreation):
     132        * runtime/ObjectConstructor.h:
     133        * runtime/RegExpConstructor.cpp:
     134        (JSC::RegExpConstructor::RegExpConstructor):
     135        (JSC::RegExpConstructor::finishCreation):
     136        (JSC::RegExpMatchesArray::RegExpMatchesArray):
     137        * runtime/RegExpConstructor.h:
     138        * runtime/RegExpMatchesArray.h:
     139        (JSC::RegExpMatchesArray::create):
     140        * runtime/RegExpObject.cpp:
     141        (JSC::RegExpObject::RegExpObject):
     142        * runtime/RegExpObject.h:
     143        (JSC::RegExpObject::create):
     144        * runtime/RegExpPrototype.cpp:
     145        (JSC::RegExpPrototype::RegExpPrototype):
     146        * runtime/StringConstructor.cpp:
     147        (JSC::StringConstructor::StringConstructor):
     148        (JSC::StringConstructor::finishCreation):
     149        * runtime/StringConstructor.h:
     150        * runtime/StringObject.cpp:
     151        (JSC::StringObject::StringObject):
     152        * runtime/StringObject.h:
     153        (JSC::StringObject::create):
     154        * runtime/StringObjectThatMasqueradesAsUndefined.h:
     155        (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
     156        * runtime/StringPrototype.cpp:
     157        (JSC::StringPrototype::StringPrototype):
     158        (JSC::StringPrototype::finishCreation):
     159        * runtime/StringPrototype.h:
     160
    11612011-09-06  Filip Pizlo  <fpizlo@apple.com>
    2162
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r94599 r94627  
    124124__ZN3JSC11createErrorEPNS_9ExecStateERKNS_7UStringE
    125125__ZN3JSC11regExpFlagsERKNS_7UStringE
     126__ZN3JSC12DateInstance14finishCreationERNS_12JSGlobalDataEd
     127__ZN3JSC12DateInstance6createEPNS_9ExecStateEPNS_9StructureEd
    126128__ZN3JSC12DateInstance6s_infoE
    127 __ZN3JSC12DateInstanceC1EPNS_9ExecStateEPNS_9StructureEd
     129__ZN3JSC12DateInstanceC1EPNS_9ExecStateEPNS_9StructureE
    128130__ZN3JSC12JSGlobalData10ClientDataD2Ev
    129131__ZN3JSC12JSGlobalData11jsArrayVPtrE
     
    139141__ZN3JSC12JSGlobalData6createENS_15ThreadStackTypeENS_8HeapSizeE
    140142__ZN3JSC12JSGlobalDataD1Ev
     143__ZN3JSC12RegExpObject14finishCreationEPNS_14JSGlobalObjectE
    141144__ZN3JSC12RegExpObject6s_infoE
    142145__ZN3JSC12RegExpObjectC1EPNS_14JSGlobalObjectEPNS_9StructureEPNS_6RegExpE
     
    145148__ZN3JSC12SmallStrings27createSingleCharacterStringEPNS_12JSGlobalDataEh
    146149__ZN3JSC12StringObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
     150__ZN3JSC12StringObject14finishCreationERNS_12JSGlobalDataEPNS_8JSStringE
    147151__ZN3JSC12StringObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    148152__ZN3JSC12StringObject18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
     
    151155__ZN3JSC12StringObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
    152156__ZN3JSC12StringObject6s_infoE
    153 __ZN3JSC12StringObjectC2ERNS_12JSGlobalDataEPNS_9StructureEPNS_8JSStringE
     157__ZN3JSC12StringObjectC2ERNS_12JSGlobalDataEPNS_9StructureE
    154158__ZN3JSC13SamplingFlags4stopEv
    155159__ZN3JSC13SamplingFlags5startEv
     
    182186__ZN3JSC15createTypeErrorEPNS_9ExecStateERKNS_7UStringE
    183187__ZN3JSC16InternalFunction12vtableAnchorEv
     188__ZN3JSC16InternalFunction14finishCreationERNS_12JSGlobalDataEPNS_14JSGlobalObjectERKNS_10IdentifierE
    184189__ZN3JSC16InternalFunction4nameEPNS_9ExecStateE
    185190__ZN3JSC16InternalFunction6s_infoE
    186 __ZN3JSC16InternalFunctionC2EPNS_12JSGlobalDataEPNS_14JSGlobalObjectEPNS_9StructureERKNS_10IdentifierE
     191__ZN3JSC16InternalFunctionC2EPNS_14JSGlobalObjectEPNS_9StructureE
    187192__ZN3JSC16JSVariableObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
    188193__ZN3JSC16JSVariableObject14symbolTableGetERKNS_10IdentifierERNS_18PropertyDescriptorE
     
    196201__ZN3JSC17constructFunctionEPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
    197202__ZN3JSC17createSyntaxErrorEPNS_9ExecStateERKNS_7UStringE
    198 __ZN3JSC18DebuggerActivation6createERNS_12JSGlobalDataEPNS_8JSObjectE
     203__ZN3JSC18DebuggerActivation14finishCreationERNS_12JSGlobalDataEPNS_8JSObjectE
     204__ZN3JSC18DebuggerActivationC1ERNS_12JSGlobalDataE
    199205__ZN3JSC18PropertyDescriptor11setWritableEb
    200206__ZN3JSC18PropertyDescriptor12setUndefinedEv
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

    r94599 r94627  
    44    ??0CString@WTF@@QAE@PBDI@Z
    55    ??0Collator@WTF@@QAE@PBD@Z
    6     ??0DateInstance@JSC@@IAE@PAVExecState@1@PAVStructure@1@N@Z
     6    ??0DateInstance@JSC@@IAE@PAVExecState@1@PAVStructure@1@@Z
    77    ??0DefaultGCActivityCallback@JSC@@QAE@PAVHeap@1@@Z
    88    ??0DropAllLocks@JSLock@JSC@@QAE@W4JSLockBehavior@2@@Z
    9     ??0DynamicGlobalObjectScope@JSC@@QAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@@Z  
    10     ??0InternalFunction@JSC@@IAE@PAVJSGlobalData@1@PAVJSGlobalObject@1@PAVStructure@1@ABVIdentifier@1@@Z
     9    ??0DynamicGlobalObjectScope@JSC@@QAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@@Z
     10    ??0InternalFunction@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@@Z
    1111    ??0JSArray@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@@Z
    1212    ??0JSByteArray@JSC@@AAE@PAVExecState@1@PAVStructure@1@PAVByteArray@WTF@@@Z
     
    2020    ??0RegExpObject@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@PAVRegExp@1@@Z
    2121    ??0SHA1@WTF@@QAE@XZ
    22     ??0StringObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@PAVJSString@1@@Z
     22    ??0StringObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@@Z
    2323    ??0Structure@JSC@@AAE@AAVJSGlobalData@1@VJSValue@1@ABVTypeInfo@1@IPBUClassInfo@1@@Z
    2424    ??0ThreadCondition@WTF@@QAE@XZ
     
    176176    ?fillGetterPropertySlot@JSObject@JSC@@QAEXAAVPropertySlot@2@PAV?$WriteBarrierBase@W4Unknown@JSC@@@2@@Z
    177177    ?finalize@WeakHandleOwner@JSC@@UAEXV?$Handle@W4Unknown@JSC@@@2@PAX@Z
     178    ?finishCreation@DateInstance@JSC@@IAEXAAVJSGlobalData@2@N@Z
     179    ?finishCreation@InternalFunction@JSC@@IAEXAAVJSGlobalData@2@PAVJSGlobalObject@2@ABVIdentifier@2@@Z
    178180    ?finishCreation@JSArray@JSC@@IAEXAAVJSGlobalData@2@@Z
    179181    ?finishCreation@JSArray@JSC@@IAEXAAVJSGlobalData@2@ABVArgList@2@@Z
    180182    ?finishCreation@JSFunction@JSC@@IAEXPAVExecState@2@PAVJSGlobalObject@2@HABVIdentifier@2@PAVExecutableBase@2@@Z
    181183    ?finishCreation@JSObjectWithGlobalObject@JSC@@IAEXAAVJSGlobalData@2@PAVJSGlobalObject@2@@Z
     184    ?finishCreation@RegExpObject@JSC@@IAEXPAVJSGlobalObject@2@@Z
     185    ?finishCreation@StringObject@JSC@@IAEXAAVJSGlobalData@2@PAVJSString@2@@Z
    182186    ?focus@Profile@JSC@@QAEXPBVProfileNode@2@@Z
    183187    ?from@Identifier@JSC@@SA?AV12@PAVExecState@2@H@Z
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp

    r94364 r94627  
    3434    : JSNonFinalObject(globalData, globalData.debuggerActivationStructure.get())
    3535{
    36 }
    37 
    38 DebuggerActivation* DebuggerActivation::create(JSGlobalData& globalData, JSObject* object)
    39 {
    40     DebuggerActivation* activation = new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData);
    41     activation->finishCreation(globalData, object);
    42     return activation;
    4336}
    4437
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h

    r94599 r94627  
    3535        typedef JSNonFinalObject Base;
    3636
    37         static DebuggerActivation* create(JSGlobalData&, JSObject*);
     37        static DebuggerActivation* create(JSGlobalData& globalData, JSObject* object)
     38        {
     39            DebuggerActivation* activation = new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData);
     40            activation->finishCreation(globalData, object);
     41            return activation;
     42        }
     43
    3844        virtual void visitChildren(SlotVisitor&);
    3945        virtual UString className() const;
  • trunk/Source/JavaScriptCore/jsc.cpp

    r93378 r94627  
    158158
    159159protected:
    160     void constructorBody(const Vector<UString>& arguments)
     160    void finishCreation(JSGlobalData& globalData, const Vector<UString>& arguments)
    161161    {
     162        Base::finishCreation(globalData, this);
    162163        putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "debug"), functionDebug));
    163164        putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "print"), functionPrint));
     
    191192    : JSGlobalObject(globalData, structure)
    192193{
    193     constructorBody(arguments);
     194    finishCreation(globalData, arguments);
    194195}
    195196
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp

    r91194 r94627  
    5353
    5454ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
    55     : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, arrayPrototype->classInfo()->className))
     55    : InternalFunction(globalObject, structure)
    5656{
     57    finishCreation(exec, globalObject, arrayPrototype);
     58}
     59
     60void ArrayConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, ArrayPrototype* arrayPrototype)
     61{
     62    Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, arrayPrototype->classInfo()->className));
    5763    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly);
    5864    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r94599 r94627  
    4545
    4646    protected:
     47        void finishCreation(ExecState*, JSGlobalObject*, ArrayPrototype*);
    4748        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
    4849
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r94364 r94627  
    118118    : JSArray(globalObject->globalData(), structure)
    119119{
    120     finishCreation(globalObject);
    121120}
    122121
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h

    r94599 r94627  
    3636        static ArrayPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3737        {
    38             return new (allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure);
     38            ArrayPrototype* prototype = new (allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure);
     39            prototype->finishCreation(globalObject);
     40            return prototype;
    3941        }
    4042       
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp

    r91194 r94627  
    3030
    3131BooleanConstructor::BooleanConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
    32     : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, booleanPrototype->classInfo()->className))
     32    : InternalFunction(globalObject, structure)
    3333{
     34    finishCreation(exec, globalObject, booleanPrototype);
     35}
     36
     37void BooleanConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, BooleanPrototype* booleanPrototype)
     38{
     39    Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, booleanPrototype->classInfo()->className));
    3440    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, booleanPrototype, DontEnum | DontDelete | ReadOnly);
    3541
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h

    r92706 r94627  
    3737        }
    3838
     39    protected:
     40        void finishCreation(ExecState*, JSGlobalObject*, BooleanPrototype*);
     41
    3942    private:
    4043        BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);
  • trunk/Source/JavaScriptCore/runtime/BooleanObject.cpp

    r94364 r94627  
    3131    : JSWrapperObject(globalData, structure)
    3232{
    33     finishCreation(globalData);
    3433}
    3534
  • trunk/Source/JavaScriptCore/runtime/BooleanObject.h

    r94599 r94627  
    3636        static BooleanObject* create(JSGlobalData& globalData, Structure* structure)
    3737        {
    38             return new (allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure);
     38            BooleanObject* boolean = new (allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure);
     39            boolean->finishCreation(globalData);
     40            return boolean;
    3941        }
    4042       
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp

    r86730 r94627  
    5353    : BooleanObject(exec->globalData(), structure)
    5454{
     55    finishCreation(exec, globalObject);
     56}
     57
     58void BooleanPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
     59{
     60    Base::finishCreation(exec->globalData());
    5561    setInternalValue(exec->globalData(), jsBoolean(false));
    5662
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h

    r94599 r94627  
    4343
    4444    protected:
     45        void finishCreation(ExecState*, JSGlobalObject*);
    4546        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | BooleanObject::StructureFlags;
    4647        static const unsigned AnonymousSlotCount = BooleanObject::AnonymousSlotCount + 1;
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r91194 r94627  
    7575
    7676DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
    77     : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, datePrototype->classInfo()->className))
    78 {
     77    : InternalFunction(globalObject, structure)
     78{
     79    finishCreation(exec, globalObject, datePrototype);
     80}
     81
     82void DateConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, DatePrototype* datePrototype)
     83{
     84    Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, datePrototype->classInfo()->className));
    7985    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, datePrototype, DontEnum | DontDelete | ReadOnly);
    8086    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(7), ReadOnly | DontEnum | DontDelete);
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r94599 r94627  
    4545
    4646    protected:
     47        void finishCreation(ExecState*, JSGlobalObject*, DatePrototype*);
    4748        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
    4849
  • trunk/Source/JavaScriptCore/runtime/DateInstance.cpp

    r94364 r94627  
    3838    : JSWrapperObject(exec->globalData(), structure)
    3939{
    40     finishCreation(exec->globalData());
    41 }
    42 
    43 DateInstance::DateInstance(ExecState* exec, Structure* structure, double time)
    44     : JSWrapperObject(exec->globalData(), structure)
    45 {
    46     finishCreation(exec->globalData(), time);
    4740}
    4841
  • trunk/Source/JavaScriptCore/runtime/DateInstance.h

    r94599 r94627  
    3232    class DateInstance : public JSWrapperObject {
    3333    protected:
    34         DateInstance(ExecState*, Structure*, double);
    3534        DateInstance(ExecState*, Structure*);
    3635        void finishCreation(JSGlobalData&);
     
    4241        static DateInstance* create(ExecState* exec, Structure* structure, double date)
    4342        {
    44             return new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure, date);
     43            DateInstance* instance = new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
     44            instance->finishCreation(exec->globalData(), date);
     45            return instance;
    4546        }
     47
    4648        static DateInstance* create(ExecState* exec, Structure* structure)
    4749        {
    48             return new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
     50            DateInstance* instance = new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
     51            instance->finishCreation(exec->globalData());
     52            return instance;
    4953        }
    50        
     54
    5155        double internalNumber() const { return internalValue().uncheckedGetNumber(); }
    5256
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp

    r91576 r94627  
    433433    : DateInstance(exec, structure)
    434434{
     435    finishCreation(exec, globalObject);
     436}
     437
     438void DatePrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
     439{
     440    Base::finishCreation(exec->globalData(), jsNaN());
    435441    ASSERT(inherits(&s_info));
    436442
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.h

    r94599 r94627  
    5050
    5151    protected:
     52        void finishCreation(ExecState*, JSGlobalObject*);
    5253        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | DateInstance::StructureFlags;
    5354
  • trunk/Source/JavaScriptCore/runtime/Error.cpp

    r92706 r94627  
    169169private:
    170170    StrictModeTypeErrorFunction(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
    171         : InternalFunction(&exec->globalData(), globalObject, structure, exec->globalData().propertyNames->emptyIdentifier)
     171        : InternalFunction(globalObject, structure)
    172172        , m_message(message)
    173173    {
     174        finishCreation(exec->globalData(), globalObject, exec->globalData().propertyNames->emptyIdentifier);
    174175    }
    175176
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp

    r84052 r94627  
    3131
    3232ErrorConstructor::ErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)
    33     : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, errorPrototype->classInfo()->className))
     33    : InternalFunction(globalObject, structure)
    3434{
     35    finishCreation(exec, globalObject, errorPrototype);
     36}
     37
     38void ErrorConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, ErrorPrototype* errorPrototype)
     39{
     40    Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, errorPrototype->classInfo()->className));
    3541    // ECMA 15.11.3.1 Error.prototype
    3642    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, errorPrototype, DontEnum | DontDelete | ReadOnly);
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h

    r92706 r94627  
    3737            return new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(exec, globalObject, structure, errPrototype);
    3838        }
     39
     40    protected:
     41        void finishCreation(ExecState*, JSGlobalObject*, ErrorPrototype*);
    3942       
    4043    private:
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp

    r94364 r94627  
    5151ASSERT_CLASS_FITS_IN_CELL(ErrorPrototype);
    5252
    53 ErrorPrototype::ErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     53ErrorPrototype::ErrorPrototype(ExecState* exec, Structure* structure)
    5454    : ErrorInstance(exec->globalData(), structure)
    5555{
    56     finishCreation(exec, globalObject);
    5756}
    5857
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h

    r94599 r94627  
    3434        static ErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3535        {
    36             return new (allocateCell<ErrorPrototype>(*exec->heap())) ErrorPrototype(exec, globalObject, structure);
     36            ErrorPrototype* prototype = new (allocateCell<ErrorPrototype>(*exec->heap())) ErrorPrototype(exec, structure);
     37            prototype->finishCreation(exec, globalObject);
     38            return prototype;
    3739        }
    3840       
     
    4547
    4648    protected:
    47         ErrorPrototype(ExecState*, JSGlobalObject*, Structure*);
     49        ErrorPrototype(ExecState*, Structure*);
    4850        void finishCreation(ExecState*, JSGlobalObject*);
    4951
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp

    r91194 r94627  
    3939
    4040FunctionConstructor::FunctionConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)
    41     : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, functionPrototype->classInfo()->className))
     41    : InternalFunction(globalObject, structure)
    4242{
     43    finishCreation(exec, globalObject, functionPrototype);
     44}
     45
     46void FunctionConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, FunctionPrototype* functionPrototype)
     47{
     48    Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, functionPrototype->classInfo()->className));
    4349    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, functionPrototype, DontEnum | DontDelete | ReadOnly);
    4450
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h

    r92706 r94627  
    3939    private:
    4040        FunctionConstructor(ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*);
     41        void finishCreation(ExecState*, JSGlobalObject*, FunctionPrototype*);
    4142        virtual ConstructType getConstructData(ConstructData&);
    4243        virtual CallType getCallData(CallData&);
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp

    r91483 r94627  
    3939
    4040FunctionPrototype::FunctionPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    41     : InternalFunction(&exec->globalData(), globalObject, structure, exec->propertyNames().nullIdentifier)
     41    : InternalFunction(globalObject, structure)
    4242{
     43    finishCreation(exec, globalObject, exec->propertyNames().nullIdentifier);
     44}
     45
     46void FunctionPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name)
     47{
     48    Base::finishCreation(exec->globalData(), globalObject, name);
    4349    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum);
    4450}
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h

    r94599 r94627  
    4242        }
    4343
     44    protected:
     45        void finishCreation(ExecState*, JSGlobalObject*, const Identifier& name);
     46
    4447    private:
    4548        FunctionPrototype(ExecState*, JSGlobalObject*, Structure*);
  • trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp

    r94364 r94627  
    4242}
    4343
    44 InternalFunction::InternalFunction(JSGlobalData* globalData, JSGlobalObject* globalObject, Structure* structure, const Identifier& name)
     44InternalFunction::InternalFunction(JSGlobalObject* globalObject, Structure* structure)
    4545    : JSObjectWithGlobalObject(globalObject, structure)
    4646{
    47     finishCreation(*globalData, globalObject, name);
    4847}
    4948
  • trunk/Source/JavaScriptCore/runtime/InternalFunction.h

    r94599 r94627  
    5353        InternalFunction(VPtrStealingHackType);
    5454
    55         InternalFunction(JSGlobalData*, JSGlobalObject*, Structure*, const Identifier&);
     55        InternalFunction(JSGlobalObject*, Structure*);
    5656
    5757        void finishCreation(JSGlobalData&, JSGlobalObject*, const Identifier& name);
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r94364 r94627  
    4747    , m_argumentsRegister(functionExecutable->generatedBytecode().argumentsRegister())
    4848{
    49     finishCreation(callFrame);
    5049}
    5150
  • trunk/Source/JavaScriptCore/runtime/JSActivation.h

    r94599 r94627  
    4949        static JSActivation* create(JSGlobalData& globalData, CallFrame* callFrame, FunctionExecutable* funcExec)
    5050        {
    51             return new (allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec);
     51            JSActivation* activation = new (allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec);
     52            activation->finishCreation(callFrame);
     53            return activation;
    5254        }
    5355
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r94599 r94627  
    147147        static JSGlobalObject* create(JSGlobalData& globalData, Structure* structure)
    148148        {
    149             return new (allocateCell<JSGlobalObject>(globalData.heap)) JSGlobalObject(globalData, structure);
     149            JSGlobalObject* globalObject = new (allocateCell<JSGlobalObject>(globalData.heap)) JSGlobalObject(globalData, structure);
     150            globalObject->finishCreation(globalData, globalObject);
     151            return globalObject;
    150152        }
    151153
     
    160162            , m_evalEnabled(true)
    161163        {
    162             finishCreation(globalData, this);
    163         }
    164 
    165         JSGlobalObject(JSGlobalData& globalData, Structure* structure, JSObject* thisValue)
    166             : JSVariableObject(globalData, structure, &m_symbolTable, 0)
    167             , m_registerArraySize(0)
    168             , m_globalScopeChain()
    169             , m_weakRandom(static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0)))
    170             , m_evalEnabled(true)
    171         {
    172             finishCreation(globalData, thisValue);
    173164        }
    174165
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r94364 r94627  
    5757    : JSObjectWithGlobalObject(globalObject, structure)
    5858{
    59     finishCreation(globalObject);
    6059}
    6160
  • trunk/Source/JavaScriptCore/runtime/JSONObject.h

    r94599 r94627  
    3939        static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    4040        {
    41             return new (allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure);
     41            JSONObject* object = new (allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure);
     42            object->finishCreation(globalObject);
     43            return object;
    4244        }
    4345       
  • trunk/Source/JavaScriptCore/runtime/JSStaticScopeObject.h

    r94599 r94627  
    3737        static JSStaticScopeObject* create(ExecState* exec, const Identifier& identifier, JSValue value, unsigned attributes)
    3838        {
    39             return new (allocateCell<JSStaticScopeObject>(*exec->heap())) JSStaticScopeObject(exec, identifier, value, attributes);
     39            JSStaticScopeObject* scopeObject = new (allocateCell<JSStaticScopeObject>(*exec->heap())) JSStaticScopeObject(exec);
     40            scopeObject->finishCreation(exec, identifier, value, attributes);
     41            return scopeObject;
    4042        }
    4143
     
    6062
    6163    private:
    62         JSStaticScopeObject(ExecState* exec, const Identifier& identifier, JSValue value, unsigned attributes)
     64        JSStaticScopeObject(ExecState* exec)
    6365            : JSVariableObject(exec->globalData(), exec->globalData().staticScopeStructure.get(), &m_symbolTable, reinterpret_cast<Register*>(&m_registerStore + 1))
    6466        {
    65             finishCreation(exec, identifier, value, attributes);
    6667        }
    6768       
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r94336 r94627  
    299299inline StringObject* StringObject::create(ExecState* exec, JSGlobalObject* globalObject, JSString* string)
    300300{
    301     return new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), globalObject->stringObjectStructure(), string);
     301    StringObject* object = new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), globalObject->stringObjectStructure());
     302    object->finishCreation(exec->globalData(), string);
     303    return object;
    302304}
    303305
  • trunk/Source/JavaScriptCore/runtime/MathObject.cpp

    r94364 r94627  
    8585*/
    8686
    87 MathObject::MathObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     87MathObject::MathObject(JSGlobalObject* globalObject, Structure* structure)
    8888    : JSObjectWithGlobalObject(globalObject, structure)
    8989{
    90     finishCreation(exec, globalObject);
    9190}
    9291
  • trunk/Source/JavaScriptCore/runtime/MathObject.h

    r94599 r94627  
    2828    class MathObject : public JSObjectWithGlobalObject {
    2929    private:
    30         MathObject(ExecState*, JSGlobalObject*, Structure*);
     30        MathObject(JSGlobalObject*, Structure*);
    3131
    3232    public:
     
    3535        static MathObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3636        {
    37             return new (allocateCell<MathObject>(*exec->heap())) MathObject(exec, globalObject, structure);
     37            MathObject* object = new (allocateCell<MathObject>(*exec->heap())) MathObject(globalObject, structure);
     38            object->finishCreation(exec, globalObject);
     39            return object;
    3840        }
    3941        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp

    r93624 r94627  
    3434
    3535NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name)
    36     : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, name))
     36    : InternalFunction(globalObject, structure)
    3737{
    38     constructorBody(exec, globalObject, prototypeStructure, name);
     38    finishCreation(exec, globalObject, prototypeStructure, name);
    3939}
    4040
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h

    r94599 r94627  
    5050
    5151    protected:
    52         void constructorBody(ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeStructure, const UString& name)
     52        void finishCreation(ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeStructure, const UString& name)
    5353        {
     54            Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, name));
    5455            ASSERT(inherits(&s_info));
    5556
  • trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp

    r93624 r94627  
    3131ASSERT_CLASS_FITS_IN_CELL(NativeErrorPrototype);
    3232
    33 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& name, NativeErrorConstructor* constructor)
    34     : ErrorPrototype(exec, globalObject, structure)
     33NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& nameAndMessage, NativeErrorConstructor* constructor)
     34    : ErrorPrototype(exec, structure)
    3535{
    36     constructorBody(exec, name, constructor);
     36    finishCreation(exec, globalObject, nameAndMessage, constructor);
    3737}
    3838
    39 inline void NativeErrorPrototype::constructorBody(ExecState* exec, const UString& name, NativeErrorConstructor* constructor)
     39inline void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor)
    4040{
    41     putDirect(exec->globalData(), exec->propertyNames().name, jsString(exec, name), DontEnum);
    42     putDirect(exec->globalData(), exec->propertyNames().message, jsEmptyString(exec), DontEnum);
     41    Base::finishCreation(exec, globalObject);
     42    putDirect(exec->globalData(), exec->propertyNames().name, jsString(exec, nameAndMessage), DontEnum);
     43    putDirect(exec->globalData(), exec->propertyNames().message, jsString(exec, nameAndMessage), DontEnum);
    4344    putDirect(exec->globalData(), exec->propertyNames().constructor, constructor, DontEnum);
    4445}
  • trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.h

    r93624 r94627  
    4040
    4141    protected:
    42         void constructorBody(ExecState*, const UString& name, NativeErrorConstructor*);
     42        void finishCreation(ExecState*, JSGlobalObject*, const UString& nameAndMessage, NativeErrorConstructor*);
    4343    };
    4444
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r91194 r94627  
    5656
    5757NumberConstructor::NumberConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)
    58     : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, numberPrototype->s_info.className))
     58    : InternalFunction(globalObject, structure)
    5959{
     60    finishCreation(exec, globalObject, numberPrototype);
     61}
     62
     63void NumberConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, NumberPrototype* numberPrototype)
     64{
     65    Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, numberPrototype->s_info.className));
    6066    ASSERT(inherits(&s_info));
    6167
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r94599 r94627  
    5151
    5252    protected:
     53        void finishCreation(ExecState*, JSGlobalObject*, NumberPrototype*);
    5354        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags;
    5455
  • trunk/Source/JavaScriptCore/runtime/NumberObject.cpp

    r94364 r94627  
    3535    : JSWrapperObject(globalData, structure)
    3636{
    37     finishCreation(globalData);
    3837}
    3938
  • trunk/Source/JavaScriptCore/runtime/NumberObject.h

    r94599 r94627  
    3636        static NumberObject* create(JSGlobalData& globalData, Structure* structure)
    3737        {
    38             return new (allocateCell<NumberObject>(globalData.heap)) NumberObject(globalData, structure);
     38            NumberObject* number = new (allocateCell<NumberObject>(globalData.heap)) NumberObject(globalData, structure);
     39            number->finishCreation(globalData);
     40            return number;
    3941        }
    4042
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp

    r94452 r94627  
    7070    : NumberObject(exec->globalData(), structure)
    7171{
     72    finishCreation(exec, globalObject);
     73}
     74
     75void NumberPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
     76{
     77    Base::finishCreation(exec->globalData());
    7278    setInternalValue(exec->globalData(), jsNumber(0));
    7379
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.h

    r94599 r94627  
    4343
    4444    protected:
     45        void finishCreation(ExecState*, JSGlobalObject*);
    4546        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NumberObject::StructureFlags;
    4647        static const unsigned AnonymousSlotCount = NumberObject::AnonymousSlotCount + 1;
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp

    r84679 r94627  
    7777
    7878ObjectConstructor::ObjectConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype)
    79     : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, "Object"))
    80 {
     79    : InternalFunction(globalObject, structure)
     80{
     81    finishCreation(exec, globalObject, objectPrototype);
     82}
     83
     84void ObjectConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, ObjectPrototype* objectPrototype)
     85{
     86    Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, "Object"));
    8187    // ECMA 15.2.3.1
    8288    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, objectPrototype, DontEnum | DontDelete | ReadOnly);
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h

    r94599 r94627  
    4848
    4949    protected:
     50        void finishCreation(ExecState*, JSGlobalObject*, ObjectPrototype*);
    5051        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
    5152
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp

    r94364 r94627  
    9797
    9898RegExpConstructor::RegExpConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)
    99     : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, "RegExp"))
     99    : InternalFunction(globalObject, structure)
    100100    , d(adoptPtr(new RegExpConstructorPrivate))
    101101{
     102    finishCreation(exec, globalObject, regExpPrototype);
     103}
     104
     105void RegExpConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, RegExpPrototype* regExpPrototype)
     106{
     107    Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, "RegExp"));
    102108    ASSERT(inherits(&s_info));
    103109
     
    109115}
    110116
    111 RegExpMatchesArray::RegExpMatchesArray(ExecState* exec, RegExpConstructorPrivate* data)
     117RegExpMatchesArray::RegExpMatchesArray(ExecState* exec)
    112118    : JSArray(exec->globalData(), exec->lexicalGlobalObject()->regExpMatchesArrayStructure())
    113119{
    114     finishCreation(exec->globalData(), data);
    115120}
    116121
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r94599 r94627  
    9191
    9292    protected:
     93        void finishCreation(ExecState*, JSGlobalObject*, RegExpPrototype*);
    9394        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags;
    9495
  • trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h

    r94364 r94627  
    2727    class RegExpMatchesArray : public JSArray {
    2828    private:
    29         RegExpMatchesArray(ExecState*, RegExpConstructorPrivate*);
     29        RegExpMatchesArray(ExecState*);
    3030
    3131    public:
     
    3434        static RegExpMatchesArray* create(ExecState* exec, RegExpConstructorPrivate* ctorPrivate)
    3535        {
    36             return new (allocateCell<RegExpMatchesArray>(*exec->heap())) RegExpMatchesArray(exec, ctorPrivate);
     36            RegExpMatchesArray* regExp = new (allocateCell<RegExpMatchesArray>(*exec->heap())) RegExpMatchesArray(exec);
     37            regExp->finishCreation(exec->globalData(), ctorPrivate);
     38            return regExp;
    3739        }
    3840        virtual ~RegExpMatchesArray();
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp

    r94364 r94627  
    6767    , d(adoptPtr(new RegExpObjectData(globalObject->globalData(), this, regExp)))
    6868{
    69     finishCreation(globalObject);
    7069}
    7170
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.h

    r94599 r94627  
    3333        static RegExpObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
    3434        {
    35             return new (allocateCell<RegExpObject>(*exec->heap())) RegExpObject(globalObject, structure, regExp);
     35            RegExpObject* object = new (allocateCell<RegExpObject>(*exec->heap())) RegExpObject(globalObject, structure, regExp);
     36            object->finishCreation(globalObject);
     37            return object;
    3638        }
    3739       
    3840        static RegExpObject* create(JSGlobalData& globalData, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
    3941        {
    40             return new (allocateCell<RegExpObject>(globalData.heap)) RegExpObject(globalObject, structure, regExp);
     42            RegExpObject* object = new (allocateCell<RegExpObject>(globalData.heap)) RegExpObject(globalObject, structure, regExp);
     43            object->finishCreation(globalObject);
     44            return object;
    4145        }
    4246
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp

    r91194 r94627  
    6666    : RegExpObject(globalObject, structure, regExp)
    6767{
     68    finishCreation(globalObject);
    6869}
    6970
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r91194 r94627  
    4949
    5050StringConstructor::StringConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, StringPrototype* stringPrototype)
    51     : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, stringPrototype->classInfo()->className))
     51    : InternalFunction(globalObject, structure)
    5252{
     53    finishCreation(exec, globalObject, stringPrototype);
     54}
     55
     56void StringConstructor::finishCreation(ExecState* exec, JSGlobalObject* globalObject, StringPrototype* stringPrototype)
     57{
     58    Base::finishCreation(exec->globalData(), globalObject, Identifier(exec, stringPrototype->classInfo()->className));
    5359    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, stringPrototype, ReadOnly | DontEnum | DontDelete);
    5460    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r94599 r94627  
    4545
    4646    protected:
     47        void finishCreation(ExecState*, JSGlobalObject*, StringPrototype*);
    4748        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
    4849
  • trunk/Source/JavaScriptCore/runtime/StringObject.cpp

    r94364 r94627  
    3030const ClassInfo StringObject::s_info = { "String", &JSWrapperObject::s_info, 0, 0 };
    3131
    32 StringObject::StringObject(JSGlobalData& globalData, Structure* structure, JSString* string)
     32StringObject::StringObject(JSGlobalData& globalData, Structure* structure)
    3333    : JSWrapperObject(globalData, structure)
    3434{
    35     finishCreation(globalData, string);
    3635}
    3736
  • trunk/Source/JavaScriptCore/runtime/StringObject.h

    r94599 r94627  
    3434        {
    3535            JSString* string = jsEmptyString(exec);
    36             return new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure, string); 
     36            StringObject* object = new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure); 
     37            object->finishCreation(exec->globalData(), string);
     38            return object;
    3739        }
    3840        static StringObject* create(ExecState* exec, Structure* structure, const UString& str)
    3941        {
    4042            JSString* string = jsString(exec, str);
    41             return new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure, string);
     43            StringObject* object = new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure);
     44            object->finishCreation(exec->globalData(), string);
     45            return object;
    4246        }
    4347        static StringObject* create(ExecState*, JSGlobalObject*, JSString*);
     
    6367        void finishCreation(JSGlobalData&, JSString*);
    6468        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSWrapperObject::StructureFlags;
    65         StringObject(JSGlobalData&, Structure*, JSString*);
     69        StringObject(JSGlobalData&, Structure*);
    6670    };
    6771
  • trunk/Source/JavaScriptCore/runtime/StringObjectThatMasqueradesAsUndefined.h

    r94599 r94627  
    4242    private:
    4343        StringObjectThatMasqueradesAsUndefined(ExecState* exec, Structure* structure, JSString* string)
    44             : StringObject(exec->globalData(), structure, string)
     44            : StringObject(exec->globalData(), structure)
    4545        {
     46            finishCreation(exec->globalData(), string);
    4647        }
    4748
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r93624 r94627  
    132132
    133133// ECMA 15.5.4
    134 StringPrototype::StringPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSString* string)
    135     : StringObject(exec->globalData(), structure, string)
    136 {
     134StringPrototype::StringPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSString* nameAndMessage)
     135    : StringObject(exec->globalData(), structure)
     136{
     137    finishCreation(exec, globalObject, nameAndMessage);
     138}
     139
     140void StringPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, JSString* nameAndMessage)
     141{
     142    Base::finishCreation(exec->globalData(), nameAndMessage);
    137143    ASSERT(inherits(&s_info));
    138144
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.h

    r94599 r94627  
    5151       
    5252    protected:
     53        void finishCreation(ExecState*, JSGlobalObject*, JSString*);
    5354        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | StringObject::StructureFlags;
    5455
  • trunk/Source/JavaScriptGlue/ChangeLog

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

    r93059 r94627  
    3939    , m_userObjectStructure(globalData, userObjectStructure)
    4040{
     41    finishCreation(globalData, this);
    4142}
    4243
  • trunk/Source/WebCore/ChangeLog

    r94625 r94627  
     12011-09-06  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Unzip initialization lists and constructors in JSCell hierarchy (5/7)
     4        https://bugs.webkit.org/show_bug.cgi?id=67420
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        No new tests.
     9
     10        Completed the fifth level of the refactoring to add finishCreation()
     11        methods to all classes within the JSCell hierarchy with non-trivial
     12        constructor bodies.
     13
     14        This primarily consists of pushing the calls to finishCreation() down
     15        into the constructors of the subclasses of the second level of the hierarchy
     16        as well as pulling the finishCreation() calls out into the class's corresponding
     17        create() method if it has one.  Doing both simultaneously allows us to
     18        maintain the invariant that the finishCreation() method chain is called exactly
     19        once during the creation of an object, since calling it any other number of
     20        times (0, 2, or more) will cause an assertion failure.
     21
     22        * WebCore.exp.in:
     23        * bindings/js/JSDOMBinding.h:
     24        (WebCore::DOMConstructorObject::DOMConstructorObject):
     25        * bindings/js/JSDOMGlobalObject.cpp:
     26        (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
     27        (WebCore::JSDOMGlobalObject::finishCreation):
     28        * bindings/js/JSDOMGlobalObject.h:
     29        * bindings/js/JSDOMWindowShell.cpp:
     30        * bindings/js/JSDOMWindowShell.h:
     31        (WebCore::JSDOMWindowShell::create):
     32        * bindings/js/JSDOMWrapper.h:
     33        (WebCore::JSDOMWrapper::JSDOMWrapper):
     34        * bindings/scripts/CodeGeneratorJS.pm:
     35        (GenerateImplementation):
     36        * bindings/scripts/test/JS/JSTestInterface.cpp:
     37        (WebCore::JSTestInterface::JSTestInterface):
     38        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
     39        (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
     40        * bindings/scripts/test/JS/JSTestObj.cpp:
     41        (WebCore::JSTestObj::JSTestObj):
     42        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
     43        (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
     44        * bridge/c/CRuntimeObject.cpp:
     45        (JSC::Bindings::CRuntimeObject::CRuntimeObject):
     46        (JSC::Bindings::CRuntimeObject::finishCreation):
     47        * bridge/c/CRuntimeObject.h:
     48        * bridge/jni/jsc/JavaRuntimeObject.cpp:
     49        (JSC::Bindings::JavaRuntimeObject::JavaRuntimeObject):
     50        (JSC::Bindings::JavaRuntimeObject::finishCreation):
     51        * bridge/jni/jsc/JavaRuntimeObject.h:
     52        * bridge/objc/ObjCRuntimeObject.h:
     53        * bridge/objc/ObjCRuntimeObject.mm:
     54        (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
     55        (JSC::Bindings::ObjCRuntimeObject::finishCreation):
     56        * bridge/objc/objc_runtime.h:
     57        (JSC::Bindings::ObjcFallbackObjectImp::create):
     58        * bridge/objc/objc_runtime.mm:
     59        (JSC::Bindings::ObjcFallbackObjectImp::ObjcFallbackObjectImp):
     60        * bridge/qt/qt_instance.cpp:
     61        (JSC::Bindings::QtRuntimeObject::QtRuntimeObject):
     62        * bridge/qt/qt_pixmapruntime.cpp:
     63        (JSC::Bindings::QtPixmapRuntimeObject::QtPixmapRuntimeObject):
     64        * bridge/qt/qt_runtime.cpp:
     65        (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod):
     66        (JSC::Bindings::QtRuntimeMethod::finishCreation):
     67        * bridge/qt/qt_runtime.h:
     68        * bridge/runtime_array.cpp:
     69        (JSC::RuntimeArray::RuntimeArray):
     70        * bridge/runtime_array.h:
     71        (JSC::RuntimeArray::create):
     72        * bridge/runtime_method.cpp:
     73        (JSC::RuntimeMethod::RuntimeMethod):
     74        (JSC::RuntimeMethod::finishCreation):
     75        * bridge/runtime_method.h:
     76        * bridge/runtime_object.cpp:
     77        (JSC::Bindings::RuntimeObject::RuntimeObject):
     78        * bridge/runtime_object.h:
     79        (JSC::Bindings::RuntimeObject::create):
     80
    1812011-09-06  Luke Macpherson   <macpherson@chromium.org>
    282
  • trunk/Source/WebCore/WebCore.exp.in

    r94613 r94627  
    16471647__ZN3JSC8Bindings13RuntimeObject11getCallDataERNS_8CallDataE
    16481648__ZN3JSC8Bindings13RuntimeObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
     1649__ZN3JSC8Bindings13RuntimeObject14finishCreationEPNS_14JSGlobalObjectE
    16491650__ZN3JSC8Bindings13RuntimeObject16getConstructDataERNS_13ConstructDataE
    16501651__ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r94599 r94627  
    5656            : JSDOMWrapper(structure, globalObject)
    5757        {
     58            finishCreation(globalObject->globalData(), globalObject);
    5859        }
    5960    };
  • trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp

    r86499 r94627  
    4444
    4545JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* structure, PassRefPtr<DOMWrapperWorld> world, JSObject* thisValue)
    46     : JSGlobalObject(globalData, structure, thisValue)
     46    : JSGlobalObject(globalData, structure)
    4747    , m_currentEvent(0)
    4848    , m_world(world)
    4949{
     50    finishCreation(globalData, thisValue);
     51}
     52
     53void JSDOMGlobalObject::finishCreation(JSGlobalData& globalData, JSObject* thisValue)
     54{
     55    Base::finishCreation(globalData, thisValue);
    5056    ASSERT(inherits(&s_info));
    5157}
  • trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.h

    r94599 r94627  
    4848
    4949        JSDOMGlobalObject(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWrapperWorld>, JSC::JSObject* thisValue);
     50        void finishCreation(JSC::JSGlobalData&, JSC::JSObject* thisValue);
    5051
    5152    public:
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp

    r94599 r94627  
    182182}
    183183
    184 JSDOMWindowShell* JSDOMWindowShell::create(PassRefPtr<DOMWindow> window, JSC::Structure* structure, DOMWrapperWorld* world)
    185 {
    186     JSDOMWindowShell* shell = new JSDOMWindowShell(structure, world);
    187     shell->finishCreation(*world->globalData(), window);
    188     return shell;
    189 }
    190 
    191184// ----
    192185// Conversion methods
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h

    r94599 r94627  
    5656        DOMWindow* impl() const;
    5757
    58         static JSDOMWindowShell* create(PassRefPtr<DOMWindow>, JSC::Structure*, DOMWrapperWorld*);
     58        static JSDOMWindowShell* create(PassRefPtr<DOMWindow> window, JSC::Structure* structure, DOMWrapperWorld* world)
     59        {
     60            JSDOMWindowShell* shell = new JSDOMWindowShell(structure, world);
     61            shell->finishCreation(*world->globalData(), window);
     62            return shell;
     63        }
    5964
    6065        static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
  • trunk/Source/WebCore/bindings/js/JSDOMWrapper.h

    r94599 r94627  
    6060        // needing to reach through the frame to get to the Document*.  See bug 27640.
    6161        // ASSERT(globalObject->scriptExecutionContext());
    62         finishCreation(globalObject->globalData(), globalObject);
    6362    }
    6463};
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r94599 r94627  
    15151515        push(@implContent, "${className}::$className(JSGlobalData& globalData, Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* shell)\n");
    15161516        push(@implContent, "    : $parentClassName(globalData, structure, impl, shell)\n");
     1517        push(@implContent, "{\n");
    15171518    } elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) {
    15181519        AddIncludesForTypeInImpl($interfaceName);
    15191520        push(@implContent, "${className}::$className(JSGlobalData& globalData, Structure* structure, PassRefPtr<$implType> impl)\n");
    15201521        push(@implContent, "    : $parentClassName(globalData, structure, impl)\n");
     1522        push(@implContent, "{\n");
    15211523    } else {
    15221524        push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n");
    15231525        if ($hasParent) {
    15241526            push(@implContent, "    : $parentClassName(structure, globalObject, impl)\n");
     1527            push(@implContent, "{\n");
    15251528        } else {
    15261529            push(@implContent, "    : $parentClassName(structure, globalObject)\n");
    15271530            push(@implContent, "    , m_impl(impl)\n");
    1528         }
    1529     }
    1530     push(@implContent, "{\n");
     1531            push(@implContent, "{\n");
     1532            push(@implContent, "    finishCreation(globalObject->globalData(), globalObject);\n");
     1533        }
     1534    }
    15311535    push(@implContent, "    ASSERT(inherits(&s_info));\n");
    15321536    if ($numCachedAttributes > 0) {
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp

    r94617 r94627  
    147147    , m_impl(impl)
    148148{
     149    finishCreation(globalObject->globalData(), globalObject);
    149150    ASSERT(inherits(&s_info));
    150151}
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp

    r94617 r94627  
    143143    , m_impl(impl)
    144144{
     145    finishCreation(globalObject->globalData(), globalObject);
    145146    ASSERT(inherits(&s_info));
    146147}
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r94617 r94627  
    298298    , m_impl(impl)
    299299{
     300    finishCreation(globalObject->globalData(), globalObject);
    300301    ASSERT(inherits(&s_info));
    301302}
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp

    r94617 r94627  
    133133    , m_impl(impl)
    134134{
     135    finishCreation(globalObject->globalData(), globalObject);
    135136    ASSERT(inherits(&s_info));
    136137}
  • trunk/Source/WebCore/bridge/c/CRuntimeObject.cpp

    r93059 r94627  
    4141    : RuntimeObject(exec, globalObject, structure, instance)
    4242{
     43    finishCreation(globalObject);
     44}
     45
     46void CRuntimeObject::finishCreation(JSGlobalObject* globalObject)
     47{
     48    Base::finishCreation(globalObject);
    4349    ASSERT(inherits(&s_info));
    4450}
  • trunk/Source/WebCore/bridge/c/CRuntimeObject.h

    r94599 r94627  
    6262private:
    6363    CRuntimeObject(ExecState*, JSGlobalObject*, Structure*, PassRefPtr<CInstance>);
     64    void finishCreation(JSGlobalObject*);
    6465};
    6566
  • trunk/Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.cpp

    r93059 r94627  
    3939    : RuntimeObject(exec, globalObject, structure, instance)
    4040{
     41    finishCreation(globalObject);
     42}
     43
     44void JavaRuntimeObject::finishCreation(JSGlobalObject* globalObject)
     45{
     46    Base::finishCreation(globalObject);
    4147    ASSERT(inherits(&s_info));
    4248}
  • trunk/Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.h

    r94599 r94627  
    6060private:
    6161    JavaRuntimeObject(ExecState*, JSGlobalObject*, Structure*, PassRefPtr<JavaInstance>);
     62    void finishCreation(JSGlobalObject*);
    6263};
    6364
  • trunk/Source/WebCore/bridge/objc/ObjCRuntimeObject.h

    r94599 r94627  
    5959private:
    6060    ObjCRuntimeObject(ExecState*, JSGlobalObject*, PassRefPtr<ObjcInstance>, Structure*);
     61    void finishCreation(JSGlobalObject*);
    6162};
    6263
  • trunk/Source/WebCore/bridge/objc/ObjCRuntimeObject.mm

    r93378 r94627  
    3939    : RuntimeObject(exec, globalObject, structure, instance)
    4040{
     41    finishCreation(globalObject);
     42}
     43
     44void ObjCRuntimeObject::finishCreation(JSGlobalObject* globalObject)
     45{
     46    Base::finishCreation(globalObject);
    4147    ASSERT(inherits(&s_info));
    4248}
  • trunk/Source/WebCore/bridge/objc/objc_runtime.h

    r94599 r94627  
    100100        // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
    101101        Structure* domStructure = WebCore::deprecatedGetDOMStructure<ObjcFallbackObjectImp>(exec);
    102         return new (allocateCell<ObjcFallbackObjectImp>(*exec->heap())) ObjcFallbackObjectImp(globalObject, domStructure, instance, propertyName);
     102        ObjcFallbackObjectImp* fallbackObject = new (allocateCell<ObjcFallbackObjectImp>(*exec->heap())) ObjcFallbackObjectImp(globalObject, domStructure, instance, propertyName);
     103        fallbackObject->finishCreation(globalObject);
     104        return fallbackObject;
    103105    }
    104106
  • trunk/Source/WebCore/bridge/objc/objc_runtime.mm

    r94364 r94627  
    202202    , _item(propertyName)
    203203{
    204     finishCreation(globalObject);
    205204}
    206205
  • trunk/Source/WebCore/bridge/qt/qt_instance.cpp

    r94620 r94627  
    8686    : RuntimeObject(exec, globalObject, structure, instance)
    8787{
     88    finishCreation(globalObject);
    8889}
    8990
  • trunk/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp

    r94599 r94627  
    225225    : RuntimeObject(exec, globalObject, structure, instance)
    226226{
     227    finishCreation(globalObject);
    227228}
    228229
  • trunk/Source/WebCore/bridge/qt/qt_runtime.cpp

    r94599 r94627  
    10071007const ClassInfo QtRuntimeMethod::s_info = { "QtRuntimeMethod", &InternalFunction::s_info, 0, 0 };
    10081008
    1009 QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, Structure* structure, const Identifier& ident, PassRefPtr<QtInstance> inst)
    1010     : InternalFunction(&exec->globalData(), exec->lexicalGlobalObject(), structure, ident)
     1009QtRuntimeMethod::QtRuntimeMethod(QtRuntimeMethodData* dd, ExecState* exec, Structure* structure, const Identifier& identifier, PassRefPtr<QtInstance> instance)
     1010    : InternalFunction(exec->lexicalGlobalObject(), structure)
    10111011    , d_ptr(dd)
    10121012{
     1013    finishCreation(exec, identifier, instance);
     1014}
     1015
     1016void QtRuntimeMethod::finishCreation(ExecState* exec, const Identifier& identifier, PassRefPtr<QtInstance> instance)
     1017{
     1018    Base::finishCreation(exec->globalData(), exec->lexicalGlobalObject(), identifier);
    10131019    QW_D(QtRuntimeMethod);
    1014     d->m_instance = inst;
     1020    d->m_instance = instance;
    10151021    d->m_finalizer.set(exec->globalData(), this, d);
    10161022}
  • trunk/Source/WebCore/bridge/qt/qt_runtime.h

    r94620 r94627  
    145145
    146146protected:
     147    void finishCreation(ExecState*, const Identifier&, PassRefPtr<QtInstance>);
    147148    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | InternalFunction::StructureFlags | OverridesVisitChildren;
    148149
  • trunk/Source/WebCore/bridge/runtime_array.cpp

    r94364 r94627  
    3838const ClassInfo RuntimeArray::s_info = { "RuntimeArray", &JSArray::s_info, 0, 0 };
    3939
    40 RuntimeArray::RuntimeArray(ExecState* exec, Structure* structure, Bindings::Array* array)
     40RuntimeArray::RuntimeArray(ExecState* exec, Structure* structure)
    4141    : JSArray(exec->globalData(), structure)
    4242{
    43     finishCreation(exec->globalData(), array);
    4443}
    4544
  • trunk/Source/WebCore/bridge/runtime_array.h

    r94599 r94627  
    4242        // We need to pass in the right global object for "array".
    4343        Structure* domStructure = WebCore::deprecatedGetDOMStructure<RuntimeArray>(exec);
    44         return new (allocateCell<RuntimeArray>(*exec->heap())) RuntimeArray(exec, domStructure, array);
     44        RuntimeArray* runtimeArray = new (allocateCell<RuntimeArray>(*exec->heap())) RuntimeArray(exec, domStructure);
     45        runtimeArray->finishCreation(exec->globalData(), array);
     46        return runtimeArray;
    4547    }
    4648
     
    8082
    8183private:
    82     RuntimeArray(ExecState*, Structure*, Bindings::Array*);
     84    RuntimeArray(ExecState*, Structure*);
    8385    static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
    8486    static JSValue indexGetter(ExecState*, JSValue, unsigned);
  • trunk/Source/WebCore/bridge/runtime_method.cpp

    r84827 r94627  
    4646RuntimeMethod::RuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& ident, Bindings::MethodList& m)
    4747    // Callers will need to pass in the right global object corresponding to this native object "m".
    48     : InternalFunction(&exec->globalData(), globalObject, structure, ident)
     48    : InternalFunction(globalObject, structure)
    4949    , _methodList(adoptPtr(new MethodList(m)))
    5050{
     51    finishCreation(exec->globalData(), globalObject, ident);
     52}
     53
     54void RuntimeMethod::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject, const Identifier& ident)
     55{
     56    Base::finishCreation(globalData, globalObject, ident);
    5157    ASSERT(inherits(&s_info));
    5258}
  • trunk/Source/WebCore/bridge/runtime_method.h

    r94599 r94627  
    5959protected:
    6060    RuntimeMethod(ExecState*, JSGlobalObject*, Structure*, const Identifier& name, Bindings::MethodList&);
     61    void finishCreation(JSGlobalData&, JSGlobalObject*, const Identifier&);
    6162    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
    6263
  • trunk/Source/WebCore/bridge/runtime_object.cpp

    r94364 r94627  
    4242    , m_instance(instance)
    4343{
    44     finishCreation(globalObject);
    4544}
    4645
  • trunk/Source/WebCore/bridge/runtime_object.h

    r94599 r94627  
    4040    static RuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance)
    4141    {
    42         return new (allocateCell<RuntimeObject>(*exec->heap())) RuntimeObject(exec, globalObject, structure, instance);
     42        RuntimeObject* object = new (allocateCell<RuntimeObject>(*exec->heap())) RuntimeObject(exec, globalObject, structure, instance);
     43        object->finishCreation(globalObject);
     44        return object;
    4345    }
    4446
  • trunk/Source/WebKit/mac/ChangeLog

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

    r94599 r94627  
    6060private:
    6161    ProxyRuntimeObject(JSC::ExecState*, JSC::JSGlobalObject*, JSC::Structure*, PassRefPtr<ProxyInstance>);
     62    void finishCreation(JSC::JSGlobalObject*);
    6263};
    6364
  • trunk/Source/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm

    r93688 r94627  
    4040    : RuntimeObject(exec, globalObject, structure, instance)
    4141{
     42    finishCreation(globalObject);
     43}
     44
     45void ProxyRuntimeObject::finishCreation(JSGlobalObject* globalObject)
     46{
     47    Base::finishCreation(globalObject);
    4248    ASSERT(inherits(&s_info));
    4349}
  • trunk/Source/WebKit2/ChangeLog

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

    r94599 r94627  
    3131#include <JavaScriptCore/FunctionPrototype.h>
    3232#include <JavaScriptCore/JSGlobalObject.h>
     33#include <JavaScriptCore/JSObject.h>
    3334#include <WebCore/JSHTMLElement.h>
    3435#include <WebCore/JSPluginElementFunctions.h>
     
    4243const ClassInfo JSNPMethod::s_info = { "NPMethod", &InternalFunction::s_info, 0, 0 };
    4344
    44 JSNPMethod::JSNPMethod(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, NPIdentifier npIdentifier, Structure* structure)
    45     : InternalFunction(&exec->globalData(), globalObject, structure, name)
    46     , m_npIdentifier(npIdentifier)
     45JSNPMethod::JSNPMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, NPIdentifier npIdentifier)
     46    : InternalFunction(globalObject, structure)
    4747{
    48     ASSERT(inherits(&s_info));
     48    finishCreation(exec->globalData(), globalObject, name);
    4949}
    5050
    51 JSNPMethod* JSNPMethod::create(ExecState* exec, JSGlobalObject* globalObject, const Identifier& ident, NPIdentifier npIdent)
     51void JSNPMethod::finishCreation(JSGlobalData& globalData, JSGlobalObject* globalObject, const Identifier& name)
    5252{
    53     JSC::Structure* structure = createStructure(exec->globalData(), globalObject, globalObject->functionPrototype());
    54     return new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(exec, globalObject, ident, npIdent, structure);
     53    Base::finishCreation(globalData, globalObject, name);
     54    ASSERT(inherits(&s_info));
    5555}
    5656
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h

    r94599 r94627  
    2727#define JSNPMethod_h
    2828
     29#include <JavaScriptCore/FunctionPrototype.h>
    2930#include <JavaScriptCore/InternalFunction.h>
    3031
     
    3839    typedef JSC::InternalFunction Base;
    3940
    40     static JSNPMethod* create(JSC::ExecState*, JSC::JSGlobalObject*, const JSC::Identifier&, NPIdentifier);
     41    static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::Identifier& ident, NPIdentifier npIdent)
     42    {
     43        JSC::Structure* structure = createStructure(exec->globalData(), globalObject, globalObject->functionPrototype());
     44        return new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(exec, globalObject, structure, ident, npIdent);
     45    }
    4146
    4247    static const JSC::ClassInfo s_info;
     
    4449    NPIdentifier npIdentifier() const { return m_npIdentifier; }
    4550
     51protected:
     52    void finishCreation(JSC::JSGlobalData&, JSC::JSGlobalObject*, const JSC::Identifier& name);
     53
    4654private:   
    47     JSNPMethod(JSC::ExecState*, JSC::JSGlobalObject*, const JSC::Identifier&, NPIdentifier, JSC::Structure*);
     55    JSNPMethod(JSC::ExecState*, JSC::JSGlobalObject*, JSC::Structure*, const JSC::Identifier&, NPIdentifier);
    4856
    4957    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp

    r94599 r94627  
    5151const ClassInfo JSNPObject::s_info = { "NPObject", &JSObjectWithGlobalObject::s_info, 0, 0 };
    5252
    53 JSNPObject::JSNPObject(JSGlobalObject* globalObject, NPRuntimeObjectMap* objectMap, NPObject* npObject, Structure* structure)
     53JSNPObject::JSNPObject(JSGlobalObject* globalObject, Structure* structure, NPRuntimeObjectMap* objectMap, NPObject* npObject)
    5454    : JSObjectWithGlobalObject(globalObject, structure)
    5555    , m_objectMap(objectMap)
    5656    , m_npObject(npObject)
    5757{
    58     finishCreation(globalObject);
    5958}
    6059
     
    6867
    6968    retainNPObject(m_npObject);
    70 }
    71 
    72 JSNPObject* JSNPObject::create(JSC::JSGlobalObject* globalObject, NPRuntimeObjectMap* objectMap, NPObject* npObject)
    73 {
    74     Structure* structure = createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype());
    75     return new (JSC::allocateCell<JSNPObject>(globalObject->globalData().heap)) JSNPObject(globalObject, objectMap, npObject, structure);
    7669}
    7770
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h

    r94599 r94627  
    2828
    2929#include <JavaScriptCore/JSObjectWithGlobalObject.h>
     30#include <JavaScriptCore/ObjectPrototype.h>
    3031
    3132typedef void* NPIdentifier;
     
    4243    typedef JSC::JSObjectWithGlobalObject Base;
    4344
    44     static JSNPObject* create(JSC::JSGlobalObject*, NPRuntimeObjectMap*, NPObject*);
     45    static JSNPObject* create(JSC::JSGlobalObject* globalObject, NPRuntimeObjectMap* objectMap, NPObject* npObject)
     46    {
     47        JSC::Structure* structure = createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype());
     48        JSNPObject* object = new (JSC::allocateCell<JSNPObject>(globalObject->globalData().heap)) JSNPObject(globalObject, structure, objectMap, npObject);
     49        object->finishCreation(globalObject);
     50        return object;
     51    }
     52
    4553    ~JSNPObject();
    4654
     
    6270
    6371private:
    64     JSNPObject(JSC::JSGlobalObject*, NPRuntimeObjectMap*, NPObject*, JSC::Structure*);
     72    JSNPObject(JSC::JSGlobalObject*, JSC::Structure*, NPRuntimeObjectMap*, NPObject*);
    6573
    6674    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | JSObject::StructureFlags;
Note: See TracChangeset for help on using the changeset viewer.