Skip to content

Commit 7f579bd

Browse files
author
Mark Hahnenberg
committed
Unzip initialization lists and constructors in JSCell hierarchy (6/7)
https://bugs.webkit.org/show_bug.cgi?id=67692 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Completed the sixth level of the refactoring to add finishCreation() methods to all classes within the JSCell hierarchy with non-trivial constructor bodies. This primarily consists of pushing the calls to finishCreation() down into the constructors of the subclasses of the fifth level of the hierarchy as well as pulling the finishCreation() calls out into the class's corresponding create() method if it has one. Doing both simultaneously allows us to maintain the invariant that the finishCreation() method chain is called exactly once during the creation of an object, since calling it any other number of times (0, 2, or more) will cause an assertion failure. * API/JSCallbackFunction.cpp: (JSC::JSCallbackFunction::JSCallbackFunction): * API/JSCallbackFunction.h: (JSC::JSCallbackFunction::create): * jsc.cpp: (GlobalObject::create): (GlobalObject::GlobalObject): * runtime/ArrayConstructor.cpp: (JSC::ArrayConstructor::ArrayConstructor): * runtime/ArrayConstructor.h: (JSC::ArrayConstructor::create): * runtime/BooleanConstructor.cpp: (JSC::BooleanConstructor::BooleanConstructor): * runtime/BooleanConstructor.h: (JSC::BooleanConstructor::create): * runtime/BooleanPrototype.cpp: (JSC::BooleanPrototype::BooleanPrototype): * runtime/BooleanPrototype.h: (JSC::BooleanPrototype::create): * runtime/DateConstructor.cpp: (JSC::DateConstructor::DateConstructor): * runtime/DateConstructor.h: (JSC::DateConstructor::create): * runtime/DatePrototype.cpp: (JSC::DatePrototype::DatePrototype): * runtime/DatePrototype.h: (JSC::DatePrototype::create): * runtime/Error.cpp: (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction): (JSC::StrictModeTypeErrorFunction::create): * runtime/ErrorConstructor.cpp: (JSC::ErrorConstructor::ErrorConstructor): * runtime/ErrorConstructor.h: (JSC::ErrorConstructor::create): * runtime/FunctionConstructor.cpp: (JSC::FunctionConstructor::FunctionConstructor): * runtime/FunctionConstructor.h: (JSC::FunctionConstructor::create): * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::FunctionPrototype): * runtime/FunctionPrototype.h: (JSC::FunctionPrototype::create): * runtime/NativeErrorConstructor.cpp: (JSC::NativeErrorConstructor::NativeErrorConstructor): * runtime/NativeErrorConstructor.h: (JSC::NativeErrorConstructor::create): * runtime/NativeErrorPrototype.cpp: (JSC::NativeErrorPrototype::NativeErrorPrototype): (JSC::NativeErrorPrototype::finishCreation): * runtime/NativeErrorPrototype.h: (JSC::NativeErrorPrototype::create): * runtime/NumberConstructor.cpp: (JSC::NumberConstructor::NumberConstructor): * runtime/NumberConstructor.h: (JSC::NumberConstructor::create): * runtime/NumberPrototype.cpp: (JSC::NumberPrototype::NumberPrototype): * runtime/NumberPrototype.h: (JSC::NumberPrototype::create): * runtime/ObjectConstructor.cpp: (JSC::ObjectConstructor::ObjectConstructor): * runtime/ObjectConstructor.h: (JSC::ObjectConstructor::create): * runtime/RegExpConstructor.cpp: (JSC::RegExpConstructor::RegExpConstructor): * runtime/RegExpConstructor.h: (JSC::RegExpConstructor::create): * runtime/RegExpPrototype.cpp: (JSC::RegExpPrototype::RegExpPrototype): * runtime/RegExpPrototype.h: (JSC::RegExpPrototype::create): * runtime/StringConstructor.cpp: (JSC::StringConstructor::StringConstructor): * runtime/StringConstructor.h: (JSC::StringConstructor::create): * runtime/StringObjectThatMasqueradesAsUndefined.h: (JSC::StringObjectThatMasqueradesAsUndefined::create): (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): * runtime/StringPrototype.cpp: (JSC::StringPrototype::StringPrototype): * runtime/StringPrototype.h: (JSC::StringPrototype::create): Source/JavaScriptGlue: Completed the sixth level of the refactoring to add finishCreation() methods to all classes within the JSCell hierarchy with non-trivial constructor bodies. This primarily consists of pushing the calls to finishCreation() down into the constructors of the subclasses of the fifth level of the hierarchy as well as pulling the finishCreation() calls out into the class's corresponding create() method if it has one. Doing both simultaneously allows us to maintain the invariant that the finishCreation() method chain is called exactly once during the creation of an object, since calling it any other number of times (0, 2, or more) will cause an assertion failure. * JSRun.cpp: (JSGlueGlobalObject::JSGlueGlobalObject): * JSRun.h: (JSGlueGlobalObject::create): Source/WebCore: No new tests. Completed the sixth level of the refactoring to add finishCreation() methods to all classes within the JSCell hierarchy with non-trivial constructor bodies. This primarily consists of pushing the calls to finishCreation() down into the constructors of the subclasses of the fifth level of the hierarchy as well as pulling the finishCreation() calls out into the class's corresponding create() method if it has one. Doing both simultaneously allows us to maintain the invariant that the finishCreation() method chain is called exactly once during the creation of an object, since calling it any other number of times (0, 2, or more) will cause an assertion failure. * WebCore.exp.in: * bindings/js/JSDOMBinding.h: (WebCore::DOMConstructorObject::DOMConstructorObject): (WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument): (WebCore::DOMConstructorWithDocument::finishCreation): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::JSDOMGlobalObject): * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::JSDOMWindowBase): (WebCore::JSDOMWindowBase::finishCreation): * bindings/js/JSDOMWindowBase.h: * bindings/js/JSWorkerContextBase.cpp: (WebCore::JSWorkerContextBase::JSWorkerContextBase): (WebCore::JSWorkerContextBase::finishCreation): * bindings/js/JSWorkerContextBase.h: * bindings/scripts/CodeGeneratorJS.pm: Added a finishCreation declaration and Moved the finishCreation call into the create method for all classes except for subclasses of JSWorkerContextBase and JSDOMWindowBase because those classes are on the next level, and it's easier to do all of these classes in one fell swoop rather than level by level. (GenerateHeader): Added the implementation of the finishCreation method for the classes described above. (GenerateImplementation): Also added the finishCreation calls to the autogenerated DOM constructor classes. (GenerateConstructorDeclaration): (GenerateConstructorDefinition): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::create): (WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor): (WebCore::JSTestInterfaceConstructor::finishCreation): (WebCore::JSTestInterface::JSTestInterface): (WebCore::JSTestInterface::finishCreation): * bindings/scripts/test/JS/JSTestInterface.h: (WebCore::JSTestInterface::create): (WebCore::JSTestInterfacePrototype::create): (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::JSTestMediaQueryListListenerConstructor::create): (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor): (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation): (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener): (WebCore::JSTestMediaQueryListListener::finishCreation): * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: (WebCore::JSTestMediaQueryListListener::create): (WebCore::JSTestMediaQueryListListenerPrototype::create): (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::create): (WebCore::JSTestObjConstructor::JSTestObjConstructor): (WebCore::JSTestObjConstructor::finishCreation): (WebCore::JSTestObj::JSTestObj): (WebCore::JSTestObj::finishCreation): * bindings/scripts/test/JS/JSTestObj.h: (WebCore::JSTestObj::create): (WebCore::JSTestObjPrototype::create): (WebCore::JSTestObjPrototype::JSTestObjPrototype): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterfaceConstructor::create): (WebCore::JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor): (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation): (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface): (WebCore::JSTestSerializedScriptValueInterface::finishCreation): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: (WebCore::JSTestSerializedScriptValueInterface::create): (WebCore::JSTestSerializedScriptValueInterfacePrototype::create): (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype): * bridge/c/CRuntimeObject.cpp: (JSC::Bindings::CRuntimeObject::CRuntimeObject): * bridge/c/CRuntimeObject.h: (JSC::Bindings::CRuntimeObject::create): * bridge/c/c_instance.cpp: (JSC::Bindings::CRuntimeMethod::CRuntimeMethod): (JSC::Bindings::CRuntimeMethod::finishCreation): * bridge/jni/jsc/JavaInstanceJSC.cpp: (JavaRuntimeMethod::JavaRuntimeMethod): (JavaRuntimeMethod::finishCreation): * bridge/jni/jsc/JavaRuntimeObject.cpp: (JSC::Bindings::JavaRuntimeObject::JavaRuntimeObject): * bridge/jni/jsc/JavaRuntimeObject.h: (JSC::Bindings::JavaRuntimeObject::create): * bridge/objc/ObjCRuntimeObject.h: (JSC::Bindings::ObjCRuntimeObject::create): * bridge/objc/ObjCRuntimeObject.mm: (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject): * bridge/objc/objc_instance.mm: (ObjCRuntimeMethod::ObjCRuntimeMethod): (ObjCRuntimeMethod::finishCreation): * bridge/qt/qt_instance.cpp: (JSC::Bindings::QtRuntimeObject::create): (JSC::Bindings::QtRuntimeObject::QtRuntimeObject): * bridge/qt/qt_pixmapruntime.cpp: (JSC::Bindings::QtPixmapRuntimeObject::create): (JSC::Bindings::QtPixmapRuntimeObject::QtPixmapRuntimeObject): * bridge/qt/qt_runtime.cpp: (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod): (JSC::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod): (JSC::Bindings::QtRuntimeMetaMethod::finishCreation): (JSC::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod): (JSC::Bindings::QtRuntimeConnectionMethod::finishCreation): * bridge/qt/qt_runtime.h: (JSC::Bindings::QtRuntimeMetaMethod::create): * bridge/runtime_method.cpp: (JSC::RuntimeMethod::RuntimeMethod): * bridge/runtime_method.h: (JSC::RuntimeMethod::create): Source/WebKit/mac: Completed the sixth level of the refactoring to add finishCreation() methods to all classes within the JSCell hierarchy with non-trivial constructor bodies. This primarily consists of pushing the calls to finishCreation() down into the constructors of the subclasses of the fifth level of the hierarchy as well as pulling the finishCreation() calls out into the class's corresponding create() method if it has one. Doing both simultaneously allows us to maintain the invariant that the finishCreation() method chain is called exactly once during the creation of an object, since calling it any other number of times (0, 2, or more) will cause an assertion failure. * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyRuntimeMethod::ProxyRuntimeMethod): (WebKit::ProxyRuntimeMethod::finishCreation): Source/WebKit2: Completed the sixth level of the refactoring to add finishCreation() methods to all classes within the JSCell hierarchy with non-trivial constructor bodies. This primarily consists of pushing the calls to finishCreation() down into the constructors of the subclasses of the fifth level of the hierarchy as well as pulling the finishCreation() calls out into the class's corresponding create() method if it has one. Doing both simultaneously allows us to maintain the invariant that the finishCreation() method chain is called exactly once during the creation of an object, since calling it any other number of times (0, 2, or more) will cause an assertion failure. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::JSNPMethod::JSNPMethod): * WebProcess/Plugins/Netscape/JSNPMethod.h: (WebKit::JSNPMethod::create): Canonical link: https://commits.webkit.org/83991@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 88bad55 commit 7f579bd

81 files changed

Lines changed: 656 additions & 173 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/JavaScriptCore/API/JSCallbackFunction.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ ASSERT_CLASS_FITS_IN_CELL(JSCallbackFunction);
4242

4343
const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0 };
4444

45-
JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
45+
JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback)
4646
: InternalFunction(globalObject, globalObject->callbackFunctionStructure())
4747
, m_callback(callback)
4848
{
49-
finishCreation(exec->globalData(), name);
5049
}
5150

5251
void JSCallbackFunction::finishCreation(JSGlobalData& globalData, const Identifier& name)

‎Source/JavaScriptCore/API/JSCallbackFunction.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@ namespace JSC {
3333

3434
class JSCallbackFunction : public InternalFunction {
3535
protected:
36-
JSCallbackFunction(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name);
36+
JSCallbackFunction(JSGlobalObject*, JSObjectCallAsFunctionCallback);
3737
void finishCreation(JSGlobalData&, const Identifier& name);
3838

3939
public:
4040
typedef InternalFunction Base;
4141

4242
static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
4343
{
44-
return new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(exec, globalObject, callback, name);
44+
JSCallbackFunction* function = new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback);
45+
function->finishCreation(exec->globalData(), name);
46+
return function;
4547
}
4648

4749
static const ClassInfo s_info;

‎Source/JavaScriptCore/ChangeLog‎

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

3105
Remove ENABLE_SVG_USE as <use> is required by HTML5

‎Source/JavaScriptCore/jsc.cpp‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,16 @@ long StopWatch::getElapsedMS()
145145

146146
class GlobalObject : public JSGlobalObject {
147147
private:
148-
GlobalObject(JSGlobalData&, Structure*, const Vector<UString>& arguments);
148+
GlobalObject(JSGlobalData&, Structure*);
149149

150150
public:
151151
typedef JSGlobalObject Base;
152152

153153
static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
154154
{
155-
return new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure, arguments);
155+
GlobalObject* object = new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
156+
object->finishCreation(globalData, arguments);
157+
return object;
156158
}
157159
virtual UString className() const { return "global"; }
158160

@@ -188,10 +190,9 @@ class GlobalObject : public JSGlobalObject {
188190
COMPILE_ASSERT(!IsInteger<GlobalObject>::value, WTF_IsInteger_GlobalObject_false);
189191
ASSERT_CLASS_FITS_IN_CELL(GlobalObject);
190192

191-
GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
193+
GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure)
192194
: JSGlobalObject(globalData, structure)
193195
{
194-
finishCreation(globalData, arguments);
195196
}
196197

197198
EncodedJSValue JSC_HOST_CALL functionPrint(ExecState* exec)

‎Source/JavaScriptCore/runtime/ArrayConstructor.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_in
5151

5252
ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor);
5353

54-
ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
54+
ArrayConstructor::ArrayConstructor(JSGlobalObject* globalObject, Structure* structure)
5555
: InternalFunction(globalObject, structure)
5656
{
57-
finishCreation(exec, arrayPrototype);
5857
}
5958

6059
void ArrayConstructor::finishCreation(ExecState* exec, ArrayPrototype* arrayPrototype)

‎Source/JavaScriptCore/runtime/ArrayConstructor.h‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ namespace JSC {
3131
public:
3232
typedef InternalFunction Base;
3333

34-
static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrPrototype)
34+
static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
3535
{
36-
return new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(exec, globalObject, structure, arrPrototype);
36+
ArrayConstructor* constructor = new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(globalObject, structure);
37+
constructor->finishCreation(exec, arrayPrototype);
38+
return constructor;
3739
}
3840

3941
static const ClassInfo s_info;
@@ -48,7 +50,7 @@ namespace JSC {
4850
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
4951

5052
private:
51-
ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*);
53+
ArrayConstructor(JSGlobalObject*, Structure*);
5254
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
5355
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
5456

‎Source/JavaScriptCore/runtime/BooleanConstructor.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ namespace JSC {
2828

2929
ASSERT_CLASS_FITS_IN_CELL(BooleanConstructor);
3030

31-
BooleanConstructor::BooleanConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
31+
BooleanConstructor::BooleanConstructor(JSGlobalObject* globalObject, Structure* structure)
3232
: InternalFunction(globalObject, structure)
3333
{
34-
finishCreation(exec, booleanPrototype);
3534
}
3635

3736
void BooleanConstructor::finishCreation(ExecState* exec, BooleanPrototype* booleanPrototype)

‎Source/JavaScriptCore/runtime/BooleanConstructor.h‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,18 @@ namespace JSC {
3131
public:
3232
typedef InternalFunction Base;
3333

34-
static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* boolPrototype)
34+
static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
3535
{
36-
return new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(exec, globalObject, structure, boolPrototype);
36+
BooleanConstructor* constructor = new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure);
37+
constructor->finishCreation(exec, booleanPrototype);
38+
return constructor;
3739
}
3840

3941
protected:
4042
void finishCreation(ExecState*, BooleanPrototype*);
4143

4244
private:
43-
BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);
45+
BooleanConstructor(JSGlobalObject*, Structure*);
4446
virtual ConstructType getConstructData(ConstructData&);
4547
virtual CallType getCallData(CallData&);
4648
};

‎Source/JavaScriptCore/runtime/BooleanPrototype.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ const ClassInfo BooleanPrototype::s_info = { "Boolean", &BooleanObject::s_info,
4949

5050
ASSERT_CLASS_FITS_IN_CELL(BooleanPrototype);
5151

52-
BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
52+
BooleanPrototype::BooleanPrototype(ExecState* exec, Structure* structure)
5353
: BooleanObject(exec->globalData(), structure)
5454
{
55-
finishCreation(exec, globalObject);
5655
}
5756

5857
void BooleanPrototype::finishCreation(ExecState* exec, JSGlobalObject*)

‎Source/JavaScriptCore/runtime/BooleanPrototype.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ namespace JSC {
3131

3232
static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
3333
{
34-
return new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, globalObject, structure);
34+
BooleanPrototype* prototype = new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, structure);
35+
prototype->finishCreation(exec, globalObject);
36+
return prototype;
3537
}
3638

3739
static const ClassInfo s_info;
@@ -46,7 +48,7 @@ namespace JSC {
4648
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | BooleanObject::StructureFlags;
4749

4850
private:
49-
BooleanPrototype(ExecState*, JSGlobalObject*, Structure*);
51+
BooleanPrototype(ExecState*, Structure*);
5052
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
5153
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
5254
};

0 commit comments

Comments
 (0)