Commit 5e10972f authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

Unzip initialization lists and constructors in JSCell hierarchy (6/7)

https://bugs.webkit.org/show_bug.cgi?id=67692

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

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

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

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

Source/JavaScriptGlue:

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

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

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

Source/WebCore:

No new tests.

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

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

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

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

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

Source/WebKit/mac:

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

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

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

Source/WebKit2:

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

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

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1bd412ab
......@@ -42,11 +42,10 @@ ASSERT_CLASS_FITS_IN_CELL(JSCallbackFunction);
const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0 };
JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback)
: InternalFunction(globalObject, globalObject->callbackFunctionStructure())
, m_callback(callback)
{
finishCreation(exec->globalData(), name);
}
void JSCallbackFunction::finishCreation(JSGlobalData& globalData, const Identifier& name)
......
......@@ -33,7 +33,7 @@ namespace JSC {
class JSCallbackFunction : public InternalFunction {
protected:
JSCallbackFunction(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name);
JSCallbackFunction(JSGlobalObject*, JSObjectCallAsFunctionCallback);
void finishCreation(JSGlobalData&, const Identifier& name);
public:
......@@ -41,7 +41,9 @@ public:
static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
{
return new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(exec, globalObject, callback, name);
JSCallbackFunction* function = new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback);
function->finishCreation(exec->globalData(), name);
return function;
}
static const ClassInfo s_info;
......
2011-09-14 Mark Hahnenberg <mhahnenberg@apple.com>
Unzip initialization lists and constructors in JSCell hierarchy (6/7)
https://bugs.webkit.org/show_bug.cgi?id=67692
Reviewed by Geoffrey Garen.
Completed the sixth level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.
This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the fifth level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one. Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.
* API/JSCallbackFunction.cpp:
(JSC::JSCallbackFunction::JSCallbackFunction):
* API/JSCallbackFunction.h:
(JSC::JSCallbackFunction::create):
* jsc.cpp:
(GlobalObject::create):
(GlobalObject::GlobalObject):
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::ArrayConstructor):
* runtime/ArrayConstructor.h:
(JSC::ArrayConstructor::create):
* runtime/BooleanConstructor.cpp:
(JSC::BooleanConstructor::BooleanConstructor):
* runtime/BooleanConstructor.h:
(JSC::BooleanConstructor::create):
* runtime/BooleanPrototype.cpp:
(JSC::BooleanPrototype::BooleanPrototype):
* runtime/BooleanPrototype.h:
(JSC::BooleanPrototype::create):
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::DateConstructor):
* runtime/DateConstructor.h:
(JSC::DateConstructor::create):
* runtime/DatePrototype.cpp:
(JSC::DatePrototype::DatePrototype):
* runtime/DatePrototype.h:
(JSC::DatePrototype::create):
* runtime/Error.cpp:
(JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
(JSC::StrictModeTypeErrorFunction::create):
* runtime/ErrorConstructor.cpp:
(JSC::ErrorConstructor::ErrorConstructor):
* runtime/ErrorConstructor.h:
(JSC::ErrorConstructor::create):
* runtime/FunctionConstructor.cpp:
(JSC::FunctionConstructor::FunctionConstructor):
* runtime/FunctionConstructor.h:
(JSC::FunctionConstructor::create):
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::FunctionPrototype):
* runtime/FunctionPrototype.h:
(JSC::FunctionPrototype::create):
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor::NativeErrorConstructor):
* runtime/NativeErrorConstructor.h:
(JSC::NativeErrorConstructor::create):
* runtime/NativeErrorPrototype.cpp:
(JSC::NativeErrorPrototype::NativeErrorPrototype):
(JSC::NativeErrorPrototype::finishCreation):
* runtime/NativeErrorPrototype.h:
(JSC::NativeErrorPrototype::create):
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::NumberConstructor):
* runtime/NumberConstructor.h:
(JSC::NumberConstructor::create):
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::NumberPrototype):
* runtime/NumberPrototype.h:
(JSC::NumberPrototype::create):
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::ObjectConstructor):
* runtime/ObjectConstructor.h:
(JSC::ObjectConstructor::create):
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::RegExpConstructor):
* runtime/RegExpConstructor.h:
(JSC::RegExpConstructor::create):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::RegExpPrototype):
* runtime/RegExpPrototype.h:
(JSC::RegExpPrototype::create):
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::StringConstructor):
* runtime/StringConstructor.h:
(JSC::StringConstructor::create):
* runtime/StringObjectThatMasqueradesAsUndefined.h:
(JSC::StringObjectThatMasqueradesAsUndefined::create):
(JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::StringPrototype):
* runtime/StringPrototype.h:
(JSC::StringPrototype::create):
2011-09-13 Eric Seidel <eric@webkit.org>
Remove ENABLE_SVG_USE as <use> is required by HTML5
......
......@@ -145,14 +145,16 @@ long StopWatch::getElapsedMS()
class GlobalObject : public JSGlobalObject {
private:
GlobalObject(JSGlobalData&, Structure*, const Vector<UString>& arguments);
GlobalObject(JSGlobalData&, Structure*);
public:
typedef JSGlobalObject Base;
static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
{
return new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure, arguments);
GlobalObject* object = new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
object->finishCreation(globalData, arguments);
return object;
}
virtual UString className() const { return "global"; }
......@@ -188,10 +190,9 @@ protected:
COMPILE_ASSERT(!IsInteger<GlobalObject>::value, WTF_IsInteger_GlobalObject_false);
ASSERT_CLASS_FITS_IN_CELL(GlobalObject);
GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure)
: JSGlobalObject(globalData, structure)
{
finishCreation(globalData, arguments);
}
EncodedJSValue JSC_HOST_CALL functionPrint(ExecState* exec)
......
......@@ -51,10 +51,9 @@ const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_in
ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor);
ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
ArrayConstructor::ArrayConstructor(JSGlobalObject* globalObject, Structure* structure)
: InternalFunction(globalObject, structure)
{
finishCreation(exec, arrayPrototype);
}
void ArrayConstructor::finishCreation(ExecState* exec, ArrayPrototype* arrayPrototype)
......
......@@ -31,9 +31,11 @@ namespace JSC {
public:
typedef InternalFunction Base;
static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrPrototype)
static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
{
return new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(exec, globalObject, structure, arrPrototype);
ArrayConstructor* constructor = new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(globalObject, structure);
constructor->finishCreation(exec, arrayPrototype);
return constructor;
}
static const ClassInfo s_info;
......@@ -48,7 +50,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
private:
ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*);
ArrayConstructor(JSGlobalObject*, Structure*);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
......
......@@ -28,10 +28,9 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(BooleanConstructor);
BooleanConstructor::BooleanConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
BooleanConstructor::BooleanConstructor(JSGlobalObject* globalObject, Structure* structure)
: InternalFunction(globalObject, structure)
{
finishCreation(exec, booleanPrototype);
}
void BooleanConstructor::finishCreation(ExecState* exec, BooleanPrototype* booleanPrototype)
......
......@@ -31,16 +31,18 @@ namespace JSC {
public:
typedef InternalFunction Base;
static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* boolPrototype)
static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
{
return new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(exec, globalObject, structure, boolPrototype);
BooleanConstructor* constructor = new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure);
constructor->finishCreation(exec, booleanPrototype);
return constructor;
}
protected:
void finishCreation(ExecState*, BooleanPrototype*);
private:
BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);
BooleanConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
};
......
......@@ -49,10 +49,9 @@ const ClassInfo BooleanPrototype::s_info = { "Boolean", &BooleanObject::s_info,
ASSERT_CLASS_FITS_IN_CELL(BooleanPrototype);
BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
BooleanPrototype::BooleanPrototype(ExecState* exec, Structure* structure)
: BooleanObject(exec->globalData(), structure)
{
finishCreation(exec, globalObject);
}
void BooleanPrototype::finishCreation(ExecState* exec, JSGlobalObject*)
......
......@@ -31,7 +31,9 @@ namespace JSC {
static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, globalObject, structure);
BooleanPrototype* prototype = new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, structure);
prototype->finishCreation(exec, globalObject);
return prototype;
}
static const ClassInfo s_info;
......@@ -46,7 +48,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | BooleanObject::StructureFlags;
private:
BooleanPrototype(ExecState*, JSGlobalObject*, Structure*);
BooleanPrototype(ExecState*, Structure*);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
};
......
......@@ -73,10 +73,9 @@ const ClassInfo DateConstructor::s_info = { "Function", &InternalFunction::s_inf
ASSERT_CLASS_FITS_IN_CELL(DateConstructor);
DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
DateConstructor::DateConstructor(JSGlobalObject* globalObject, Structure* structure)
: InternalFunction(globalObject, structure)
{
finishCreation(exec, datePrototype);
}
void DateConstructor::finishCreation(ExecState* exec, DatePrototype* datePrototype)
......
......@@ -33,7 +33,9 @@ namespace JSC {
static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
{
return new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(exec, globalObject, structure, datePrototype);
DateConstructor* constructor = new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure);
constructor->finishCreation(exec, datePrototype);
return constructor;
}
static const ClassInfo s_info;
......@@ -48,7 +50,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
private:
DateConstructor(ExecState*, JSGlobalObject*, Structure*, DatePrototype*);
DateConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
......
......@@ -430,10 +430,9 @@ const ClassInfo DatePrototype::s_info = {"Date", &DateInstance::s_info, 0, ExecS
// ECMA 15.9.4
DatePrototype::DatePrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
DatePrototype::DatePrototype(ExecState* exec, Structure* structure)
: DateInstance(exec, structure)
{
finishCreation(exec, globalObject);
}
void DatePrototype::finishCreation(ExecState* exec, JSGlobalObject*)
......
......@@ -29,14 +29,16 @@ namespace JSC {
class DatePrototype : public DateInstance {
private:
DatePrototype(ExecState*, JSGlobalObject*, Structure*);
DatePrototype(ExecState*, Structure*);
public:
typedef DateInstance Base;
static DatePrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, globalObject, structure);
DatePrototype* prototype = new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, structure);
prototype->finishCreation(exec, globalObject);
return prototype;
}
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
......
......@@ -167,11 +167,10 @@ JSObject* throwSyntaxError(ExecState* exec)
class StrictModeTypeErrorFunction : public InternalFunction {
private:
StrictModeTypeErrorFunction(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
StrictModeTypeErrorFunction(JSGlobalObject* globalObject, Structure* structure, const UString& message)
: InternalFunction(globalObject, structure)
, m_message(message)
{
finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);
}
public:
......@@ -179,7 +178,9 @@ public:
static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
{
return new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(exec, globalObject, structure, message);
StrictModeTypeErrorFunction* function = new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
function->finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);
return function;
}
static EncodedJSValue JSC_HOST_CALL constructThrowTypeError(ExecState* exec)
......
......@@ -29,10 +29,9 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(ErrorConstructor);
ErrorConstructor::ErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)
ErrorConstructor::ErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
: InternalFunction(globalObject, structure)
{
finishCreation(exec, errorPrototype);
}
void ErrorConstructor::finishCreation(ExecState* exec, ErrorPrototype* errorPrototype)
......
......@@ -32,16 +32,18 @@ namespace JSC {
public:
typedef InternalFunction Base;
static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errPrototype)
static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)
{
return new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(exec, globalObject, structure, errPrototype);
ErrorConstructor* constructor = new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(globalObject, structure);
constructor->finishCreation(exec, errorPrototype);
return constructor;
}
protected:
void finishCreation(ExecState*, ErrorPrototype*);
private:
ErrorConstructor(ExecState*, JSGlobalObject*, Structure*, ErrorPrototype*);
ErrorConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
};
......
......@@ -37,10 +37,9 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(FunctionConstructor);
FunctionConstructor::FunctionConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)
FunctionConstructor::FunctionConstructor(JSGlobalObject* globalObject, Structure* structure)
: InternalFunction(globalObject, structure)
{
finishCreation(exec, functionPrototype);
}
void FunctionConstructor::finishCreation(ExecState* exec, FunctionPrototype* functionPrototype)
......
......@@ -31,13 +31,15 @@ namespace JSC {
public:
typedef InternalFunction Base;
static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* funcPrototype)
static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)
{
return new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(exec, globalObject, structure, funcPrototype);
FunctionConstructor* constructor = new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(globalObject, structure);
constructor->finishCreation(exec, functionPrototype);
return constructor;
}
private:
FunctionConstructor(ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*);
FunctionConstructor(JSGlobalObject*, Structure*);
void finishCreation(ExecState*, FunctionPrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
......
......@@ -37,10 +37,9 @@ static EncodedJSValue JSC_HOST_CALL functionProtoFuncToString(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionProtoFuncApply(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionProtoFuncCall(ExecState*);
FunctionPrototype::FunctionPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
FunctionPrototype::FunctionPrototype(JSGlobalObject* globalObject, Structure* structure)
: InternalFunction(globalObject, structure)
{
finishCreation(exec, exec->propertyNames().nullIdentifier);
}
void FunctionPrototype::finishCreation(ExecState* exec, const Identifier& name)
......
......@@ -31,7 +31,9 @@ namespace JSC {
static FunctionPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(exec, globalObject, structure);
FunctionPrototype* prototype = new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(globalObject, structure);
prototype->finishCreation(exec, exec->propertyNames().nullIdentifier);
return prototype;
}
void addFunctionProperties(ExecState*, JSGlobalObject*, Structure* functionStructure, JSFunction** callFunction, JSFunction** applyFunction);
......@@ -45,7 +47,7 @@ namespace JSC {
void finishCreation(ExecState*, const Identifier& name);
private:
FunctionPrototype(ExecState*, JSGlobalObject*, Structure*);
FunctionPrototype(JSGlobalObject*, Structure*);
virtual CallType getCallData(CallData&);
};
......
......@@ -32,10 +32,9 @@ ASSERT_CLASS_FITS_IN_CELL(NativeErrorConstructor);
const ClassInfo NativeErrorConstructor::s_info = { "Function", &InternalFunction::s_info, 0, 0 };
NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name)
NativeErrorConstructor::NativeErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
: InternalFunction(globalObject, structure)
{
finishCreation(exec, globalObject, prototypeStructure, name);
}
void NativeErrorConstructor::visitChildren(SlotVisitor& visitor)
......
......@@ -36,7 +36,9 @@ namespace JSC {
static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name)
{
return new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(exec, globalObject, structure, prototypeStructure, name);
NativeErrorConstructor* constructor = new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(globalObject, structure);
constructor->finishCreation(exec, globalObject, prototypeStructure, name);
return constructor;
}
static const ClassInfo s_info;
......@@ -64,7 +66,7 @@ namespace JSC {
}
private:
NativeErrorConstructor(ExecState*, JSGlobalObject*, Structure*, Structure* prototypeStructure, const UString&);
NativeErrorConstructor(JSGlobalObject*, Structure*);
static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags;
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
......
......@@ -30,13 +30,12 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(NativeErrorPrototype);
NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& nameAndMessage, NativeErrorConstructor* constructor)
NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, Structure* structure)
: ErrorPrototype(exec, structure)
{
finishCreation(exec, globalObject, nameAndMessage, constructor);
}
inline void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor)
void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor)
{
Base::finishCreation(exec, globalObject);
putDirect(exec->globalData(), exec->propertyNames().name, jsString(exec, nameAndMessage), DontEnum);
......
......@@ -28,14 +28,16 @@ namespace JSC {
class NativeErrorPrototype : public ErrorPrototype {
private:
NativeErrorPrototype(ExecState*, JSGlobalObject*, Structure*, const UString&, NativeErrorConstructor*);
NativeErrorPrototype(ExecState*, Structure*);
public:
typedef ErrorPrototype Base;
static NativeErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& name, NativeErrorConstructor* constructor)
{
return new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, globalObject, structure, name, constructor);
NativeErrorPrototype* prototype = new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, structure);
prototype->finishCreation(exec, globalObject, name, constructor);
return prototype;
}
protected:
......
......@@ -54,10 +54,9 @@ const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_i
@end
*/
NumberConstructor::NumberConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)
NumberConstructor::NumberConstructor(JSGlobalObject* globalObject, Structure* structure)
: InternalFunction(globalObject, structure)
{
finishCreation(exec, numberPrototype);
}
void NumberConstructor::finishCreation(ExecState* exec, NumberPrototype* numberPrototype)
......
......@@ -31,9 +31,11 @@ namespace JSC {
public:
typedef InternalFunction Base;
static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numPrototype)
static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)
{
return new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(exec, globalObject, structure, numPrototype);
NumberConstructor* constructor = new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(globalObject, structure);
constructor->finishCreation(exec, numberPrototype);
return constructor;
}
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
......@@ -54,7 +56,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags;
private:
NumberConstructor(ExecState*, JSGlobalObject*, Structure*, NumberPrototype*);
NumberConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
};
......
......@@ -70,10 +70,9 @@ const ClassInfo NumberPrototype::s_info = { "Number", &NumberObject::s_info, 0,
ASSERT_CLASS_FITS_IN_CELL(NumberPrototype);
NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
NumberPrototype::NumberPrototype(ExecState* exec, Structure* structure)
: NumberObject(exec->globalData(), structure)
{
finishCreation(exec, globalObject);
}
void NumberPrototype::finishCreation(ExecState* exec, JSGlobalObject*)
......
......@@ -31,7 +31,9 @@ namespace JSC {
static NumberPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
return new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, globalObject, structure);
NumberPrototype* prototype = new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, structure);
prototype->finishCreation(exec, globalObject);
return prototype;
}
static const ClassInfo s_info;
......@@ -46,7 +48,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NumberObject::StructureFlags;