Commit 16e0df51 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

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

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

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

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

JSCallbackObject was missed in previous patches due to the fact that
it's non-obvious (at least to my script) that it is in the JSCell hierarchy, so
this is just a bit of retroactive cleanup.

* API/JSCallbackObject.h:
(JSC::JSCallbackObject::create):
* API/JSCallbackObjectFunctions.h:
(JSC::::JSCallbackObject):

Source/WebCore:

No new tests.

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

This consists of moving the finishCreation() method call into the create methods
of the sixth level of the hierarchy as was done in previous patches.

The special cases for JSAudioConstructor, JSOptionConstructor, and JSImageConstructor
were also lumped in and given finishCreation() methods that are called in their
create methods because we are at the end and want to avoid a trivial patch just
for moving their finishCreation() methods from their constructor to their create method.

* bindings/js/JSAudioConstructor.cpp:
(WebCore::JSAudioConstructor::JSAudioConstructor):
(WebCore::JSAudioConstructor::finishCreation):
* bindings/js/JSAudioConstructor.h:
(WebCore::JSAudioConstructor::create):
* bindings/js/JSDOMBinding.h:
(WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
* bindings/js/JSImageConstructor.cpp:
(WebCore::JSImageConstructor::JSImageConstructor):
(WebCore::JSImageConstructor::finishCreation):
* bindings/js/JSImageConstructor.h:
(WebCore::JSImageConstructor::create):
* bindings/js/JSOptionConstructor.cpp:
(WebCore::JSOptionConstructor::JSOptionConstructor):
(WebCore::JSOptionConstructor::finishCreation):
* bindings/js/JSOptionConstructor.h:
(WebCore::JSOptionConstructor::create):
* bindings/js/JSWorkerContextBase.cpp:
(WebCore::JSWorkerContextBase::JSWorkerContextBase):

The bindings generation script was also changed to move the finishCreation() call into the
create methods for descendants of JSWorkerContextBase and JSDOMWindowBase because those base
classes had it removed from their constructors.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CRuntimeMethod::create):
(JSC::Bindings::CRuntimeMethod::CRuntimeMethod):
* bridge/jni/jsc/JavaInstanceJSC.cpp:
(JavaRuntimeMethod::create):
(JavaRuntimeMethod::JavaRuntimeMethod):
* bridge/objc/objc_instance.mm:
(ObjCRuntimeMethod::create):
(ObjCRuntimeMethod::ObjCRuntimeMethod):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
(JSC::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod):
* bridge/qt/qt_runtime.h:
(JSC::Bindings::QtRuntimeMetaMethod::create):
(JSC::Bindings::QtRuntimeConnectionMethod::create):

Source/WebKit/mac:

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

* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyRuntimeMethod::create):
(WebKit::ProxyRuntimeMethod::ProxyRuntimeMethod):
* Plugins/Hosted/ProxyRuntimeObject.h:
(WebKit::ProxyRuntimeObject::create):
* Plugins/Hosted/ProxyRuntimeObject.mm:
(WebKit::ProxyRuntimeObject::ProxyRuntimeObject):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95250 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 89fcc858
......@@ -134,11 +134,13 @@ public:
{
ASSERT_UNUSED(globalObject, !structure->globalObject() || structure->globalObject() == globalObject);
JSCallbackObject* callbackObject = new (allocateCell<JSCallbackObject>(*exec->heap())) JSCallbackObject(exec, structure, classRef, data);
callbackObject->finishCreation(exec);
return callbackObject;
}
static JSCallbackObject* create(JSGlobalData& globalData, JSClassRef classRef, Structure* structure)
{
JSCallbackObject* callbackObject = new (allocateCell<JSCallbackObject>(globalData.heap)) JSCallbackObject(globalData, classRef, structure);
callbackObject->finishCreation(globalData);
return callbackObject;
}
......
......@@ -54,7 +54,6 @@ JSCallbackObject<Parent>::JSCallbackObject(ExecState* exec, Structure* structure
: Parent(exec->globalData(), structure)
, m_callbackObjectData(adoptPtr(new JSCallbackObjectData(data, jsClass)))
{
finishCreation(exec);
}
// Global object constructor.
......@@ -64,7 +63,6 @@ JSCallbackObject<Parent>::JSCallbackObject(JSGlobalData& globalData, JSClassRef
: Parent(globalData, structure)
, m_callbackObjectData(adoptPtr(new JSCallbackObjectData(0, jsClass)))
{
finishCreation(globalData);
}
template <class Parent>
......
2011-09-15 Mark Hahnenberg <mhahnenberg@apple.com>
Unzip initialization lists and constructors in JSCell hierarchy (7/7)
https://bugs.webkit.org/show_bug.cgi?id=68122
Reviewed by Geoffrey Garen.
Completed the seventh and final level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.
JSCallbackObject was missed in previous patches due to the fact that
it's non-obvious (at least to my script) that it is in the JSCell hierarchy, so
this is just a bit of retroactive cleanup.
* API/JSCallbackObject.h:
(JSC::JSCallbackObject::create):
* API/JSCallbackObjectFunctions.h:
(JSC::::JSCallbackObject):
2011-09-15 Filip Pizlo <fpizlo@apple.com>
The DFG non-speculative JIT is no longer used and should be removed.
2011-09-15 Mark Hahnenberg <mhahnenberg@apple.com>
Unzip initialization lists and constructors in JSCell hierarchy (7/7)
https://bugs.webkit.org/show_bug.cgi?id=68122
Reviewed by Geoffrey Garen.
No new tests.
Completed the seventh and final level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.
This consists of moving the finishCreation() method call into the create methods
of the sixth level of the hierarchy as was done in previous patches.
The special cases for JSAudioConstructor, JSOptionConstructor, and JSImageConstructor
were also lumped in and given finishCreation() methods that are called in their
create methods because we are at the end and want to avoid a trivial patch just
for moving their finishCreation() methods from their constructor to their create method.
* bindings/js/JSAudioConstructor.cpp:
(WebCore::JSAudioConstructor::JSAudioConstructor):
(WebCore::JSAudioConstructor::finishCreation):
* bindings/js/JSAudioConstructor.h:
(WebCore::JSAudioConstructor::create):
* bindings/js/JSDOMBinding.h:
(WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
* bindings/js/JSImageConstructor.cpp:
(WebCore::JSImageConstructor::JSImageConstructor):
(WebCore::JSImageConstructor::finishCreation):
* bindings/js/JSImageConstructor.h:
(WebCore::JSImageConstructor::create):
* bindings/js/JSOptionConstructor.cpp:
(WebCore::JSOptionConstructor::JSOptionConstructor):
(WebCore::JSOptionConstructor::finishCreation):
* bindings/js/JSOptionConstructor.h:
(WebCore::JSOptionConstructor::create):
* bindings/js/JSWorkerContextBase.cpp:
(WebCore::JSWorkerContextBase::JSWorkerContextBase):
The bindings generation script was also changed to move the finishCreation() call into the
create methods for descendants of JSWorkerContextBase and JSDOMWindowBase because those base
classes had it removed from their constructors.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CRuntimeMethod::create):
(JSC::Bindings::CRuntimeMethod::CRuntimeMethod):
* bridge/jni/jsc/JavaInstanceJSC.cpp:
(JavaRuntimeMethod::create):
(JavaRuntimeMethod::JavaRuntimeMethod):
* bridge/objc/objc_instance.mm:
(ObjCRuntimeMethod::create):
(ObjCRuntimeMethod::ObjCRuntimeMethod):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
(JSC::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod):
* bridge/qt/qt_runtime.h:
(JSC::Bindings::QtRuntimeMetaMethod::create):
(JSC::Bindings::QtRuntimeConnectionMethod::create):
2011-09-15 Kentaro Hara <haraken@google.com>
A single line must not be split into two pages.
......@@ -39,9 +39,14 @@ namespace WebCore {
const ClassInfo JSAudioConstructor::s_info = { "AudioConstructor", &DOMConstructorWithDocument::s_info, 0, 0 };
JSAudioConstructor::JSAudioConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
JSAudioConstructor::JSAudioConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorWithDocument(structure, globalObject)
{
}
void JSAudioConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
{
Base::finishCreation(globalObject);
ASSERT(inherits(&s_info));
putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), None);
putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
......
......@@ -40,7 +40,9 @@ namespace WebCore {
static JSAudioConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
{
return new (JSC::allocateCell<JSAudioConstructor>(*exec->heap())) JSAudioConstructor(exec, structure, globalObject);
JSAudioConstructor* constructor = new (JSC::allocateCell<JSAudioConstructor>(*exec->heap())) JSAudioConstructor(structure, globalObject);
constructor->finishCreation(exec, globalObject);
return constructor;
}
static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
......@@ -51,7 +53,8 @@ namespace WebCore {
static const JSC::ClassInfo s_info;
private:
JSAudioConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
JSAudioConstructor(JSC::Structure*, JSDOMGlobalObject*);
void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
};
......
......@@ -73,7 +73,6 @@ namespace WebCore {
DOMConstructorWithDocument(JSC::Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorObject(structure, globalObject)
{
finishCreation(globalObject);
}
void finishCreation(JSDOMGlobalObject* globalObject)
......
......@@ -48,7 +48,6 @@ JSDOMWindowBase::JSDOMWindowBase(JSGlobalData& globalData, Structure* structure,
, m_impl(window)
, m_shell(shell)
{
finishCreation(globalData, shell);
}
void JSDOMWindowBase::finishCreation(JSGlobalData& globalData, JSDOMWindowShell* shell)
......
......@@ -34,9 +34,14 @@ ASSERT_CLASS_FITS_IN_CELL(JSImageConstructor);
const ClassInfo JSImageConstructor::s_info = { "ImageConstructor", &DOMConstructorWithDocument::s_info, 0, 0 };
JSImageConstructor::JSImageConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
JSImageConstructor::JSImageConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorWithDocument(structure, globalObject)
{
}
void JSImageConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
{
Base::finishCreation(globalObject);
ASSERT(inherits(&s_info));
putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLImageElementPrototype::self(exec, globalObject), None);
}
......
......@@ -31,7 +31,9 @@ namespace WebCore {
static JSImageConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
{
return new (JSC::allocateCell<JSImageConstructor>(*exec->heap())) JSImageConstructor(exec, structure, globalObject);
JSImageConstructor* constructor = new (JSC::allocateCell<JSImageConstructor>(*exec->heap())) JSImageConstructor(structure, globalObject);
constructor->finishCreation(exec, globalObject);
return constructor;
}
static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
......@@ -42,7 +44,8 @@ namespace WebCore {
static const JSC::ClassInfo s_info;
private:
JSImageConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
JSImageConstructor(JSC::Structure*, JSDOMGlobalObject*);
void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
};
......
......@@ -35,9 +35,14 @@ ASSERT_CLASS_FITS_IN_CELL(JSOptionConstructor);
const ClassInfo JSOptionConstructor::s_info = { "OptionConstructor", &DOMConstructorWithDocument::s_info, 0, 0 };
JSOptionConstructor::JSOptionConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
JSOptionConstructor::JSOptionConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorWithDocument(structure, globalObject)
{
}
void JSOptionConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
{
Base::finishCreation(globalObject);
ASSERT(inherits(&s_info));
putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLOptionElementPrototype::self(exec, globalObject), None);
putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(4), ReadOnly | DontDelete | DontEnum);
......
......@@ -32,7 +32,9 @@ namespace WebCore {
static JSOptionConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
{
return new (JSC::allocateCell<JSOptionConstructor>(*exec->heap())) JSOptionConstructor(exec, structure, globalObject);
JSOptionConstructor* constructor = new (JSC::allocateCell<JSOptionConstructor>(*exec->heap())) JSOptionConstructor(structure, globalObject);
constructor->finishCreation(exec, globalObject);
return constructor;
}
static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
......@@ -43,7 +45,8 @@ namespace WebCore {
static const JSC::ClassInfo s_info;
private:
JSOptionConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
JSOptionConstructor(JSC::Structure*, JSDOMGlobalObject*);
void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
};
......
......@@ -52,7 +52,6 @@ JSWorkerContextBase::JSWorkerContextBase(JSC::JSGlobalData& globalData, JSC::Str
: JSDOMGlobalObject(globalData, structure, normalWorld(globalData))
, m_impl(impl)
{
finishCreation(globalData, this);
}
void JSWorkerContextBase::finishCreation(JSGlobalData& globalData, JSWorkerContextBase* thisValue)
......
......@@ -731,12 +731,14 @@ sub GenerateHeader
push(@headerContent, " static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* windowShell)\n");
push(@headerContent, " {\n");
push(@headerContent, " $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n");
push(@headerContent, " ptr->finishCreation(globalData, windowShell);\n");
push(@headerContent, " return ptr;\n");
push(@headerContent, " }\n\n");
} elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) {
push(@headerContent, " static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl)\n");
push(@headerContent, " {\n");
push(@headerContent, " $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n");
push(@headerContent, " ptr->finishCreation(globalData, ptr);\n");
push(@headerContent, " return ptr;\n");
push(@headerContent, " }\n\n");
} else {
......
......@@ -118,7 +118,9 @@ public:
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
// We need to pass in the right global object for "i".
Structure* domStructure = WebCore::deprecatedGetDOMStructure<CRuntimeMethod>(exec);
return new (allocateCell<CRuntimeMethod>(*exec->heap())) CRuntimeMethod(exec, globalObject, domStructure, name, list);
CRuntimeMethod* method = new (allocateCell<CRuntimeMethod>(*exec->heap())) CRuntimeMethod(globalObject, domStructure, list);
method->finishCreation(exec->globalData(), name);
return method;
}
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
......@@ -129,10 +131,9 @@ public:
static const ClassInfo s_info;
private:
CRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
CRuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& list)
: RuntimeMethod(globalObject, structure, list)
{
finishCreation(exec->globalData(), name);
}
void finishCreation(JSGlobalData& globalData, const Identifier& name)
......
......@@ -123,7 +123,9 @@ public:
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
// We need to pass in the right global object for "i".
Structure* domStructure = WebCore::deprecatedGetDOMStructure<JavaRuntimeMethod>(exec);
return new (allocateCell<JavaRuntimeMethod>(*exec->heap())) JavaRuntimeMethod(exec, globalObject, domStructure, name, list);
JavaRuntimeMethod* method = new (allocateCell<JavaRuntimeMethod>(*exec->heap())) JavaRuntimeMethod(globalObject, domStructure, list);
method->finishCreation(exec->globalData(), name);
return method;
}
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
......@@ -134,10 +136,9 @@ public:
static const ClassInfo s_info;
private:
JavaRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
JavaRuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& list)
: RuntimeMethod(globalObject, structure, list)
{
finishCreation(exec->globalData(), name);
}
void finishCreation(JSGlobalData& globalData, const Identifier& name)
......
......@@ -178,7 +178,9 @@ public:
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
// We need to pass in the right global object for "i".
Structure* domStructure = WebCore::deprecatedGetDOMStructure<ObjCRuntimeMethod>(exec);
return new (allocateCell<ObjCRuntimeMethod>(*exec->heap())) ObjCRuntimeMethod(exec, globalObject, domStructure, name, list);
ObjCRuntimeMethod* method = new (allocateCell<ObjCRuntimeMethod>(*exec->heap())) ObjCRuntimeMethod(globalObject, domStructure, list);
method->finishCreation(exec->globalData(), name);
return method;
}
static Structure* createStructure(JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSValue prototype)
......@@ -191,10 +193,9 @@ public:
private:
typedef RuntimeMethod Base;
ObjCRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
ObjCRuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& list)
: RuntimeMethod(globalObject, structure, list)
{
finishCreation(exec->globalData(), name);
}
void finishCreation(JSGlobalData& globalData, const Identifier& name)
......
......@@ -1425,10 +1425,9 @@ static int findSignalIndex(const QMetaObject* meta, int initialIndex, QByteArray
return index;
}
QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& identifier, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)
QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, Structure* structure, const Identifier& identifier)
: QtRuntimeMethod (new QtRuntimeMetaMethodData(), exec, structure, identifier)
{
finishCreation(exec, identifier, instance, index, signature, allowPrivate);
}
void QtRuntimeMetaMethod::finishCreation(ExecState* exec, const Identifier& identifier, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)
......@@ -1575,10 +1574,9 @@ JSValue QtRuntimeMetaMethod::disconnectGetter(ExecState* exec, JSValue slotBase,
QMultiMap<QObject*, QtConnectionObject*> QtRuntimeConnectionMethod::connections;
QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& identifier, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)
QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, Structure* structure, const Identifier& identifier)
: QtRuntimeMethod (new QtRuntimeConnectionMethodData(), exec, structure, identifier)
{
finishCreation(exec, identifier, isConnect, instance, index, signature);
}
void QtRuntimeConnectionMethod::finishCreation(ExecState* exec, const Identifier& identifier, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)
......
......@@ -156,10 +156,11 @@ class QtRuntimeMetaMethod : public QtRuntimeMethod {
public:
typedef QtRuntimeMethod Base;
static QtRuntimeMetaMethod* create(ExecState* exec, const Identifier& n, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature, bool allowPrivate)
static QtRuntimeMetaMethod* create(ExecState* exec, const Identifier& name, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature, bool allowPrivate)
{
Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeMethod>(exec);
QtRuntimeMetaMethod* method = new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, n, inst, index, signature, allowPrivate);
QtRuntimeMetaMethod* method = new (allocateCell<QtRuntimeMetaMethod>(*exec->heap())) QtRuntimeMetaMethod(exec, domStructure, name);
method->finishCreation(exec, name, instance, index, signature, allowPrivate);
return method;
}
......@@ -173,7 +174,7 @@ protected:
QtRuntimeMetaMethodData* d_func() const {return reinterpret_cast<QtRuntimeMetaMethodData*>(d_ptr);}
private:
QtRuntimeMetaMethod(ExecState*, Structure*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray&, bool allowPrivate);
QtRuntimeMetaMethod(ExecState*, Structure*, const Identifier&);
void finishCreation(ExecState*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray& signature, bool allowPrivate);
virtual CallType getCallData(CallData&);
......@@ -188,10 +189,12 @@ class QtRuntimeConnectionMethod : public QtRuntimeMethod {
public:
typedef QtRuntimeMethod Base;
static QtRuntimeConnectionMethod* create(ExecState* exec, const Identifier& n, bool isConnect, PassRefPtr<QtInstance> inst, int index, const QByteArray& signature)
static QtRuntimeConnectionMethod* create(ExecState* exec, const Identifier& name, bool isConnect, PassRefPtr<QtInstance> instance, int index, const QByteArray& signature)
{
Structure* domStructure = WebCore::deprecatedGetDOMStructure<QtRuntimeMethod>(exec);
return new (allocateCell<QtRuntimeConnectionMethod>(*exec->heap())) QtRuntimeConnectionMethod(exec, domStructure, n, isConnect, inst, index, signature);
QtRuntimeConnectionMethod* method = new (allocateCell<QtRuntimeConnectionMethod>(*exec->heap())) QtRuntimeConnectionMethod(exec, domStructure, name);
method->finishCreation(exec, name, isConnect, instance, index, signature);
return method;
}
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
......@@ -202,7 +205,7 @@ protected:
QtRuntimeConnectionMethodData* d_func() const {return reinterpret_cast<QtRuntimeConnectionMethodData*>(d_ptr);}
private:
QtRuntimeConnectionMethod(ExecState*, Structure*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray&);
QtRuntimeConnectionMethod(ExecState*, Structure*, const Identifier&);
void finishCreation(ExecState*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray& signature);
virtual CallType getCallData(CallData&);
......
2011-09-15 Mark Hahnenberg <mhahnenberg@apple.com>
Unzip initialization lists and constructors in JSCell hierarchy (7/7)
https://bugs.webkit.org/show_bug.cgi?id=68122
Reviewed by Geoffrey Garen.
Completed the seventh and final level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.
* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyRuntimeMethod::create):
(WebKit::ProxyRuntimeMethod::ProxyRuntimeMethod):
* Plugins/Hosted/ProxyRuntimeObject.h:
(WebKit::ProxyRuntimeObject::create):
* Plugins/Hosted/ProxyRuntimeObject.mm:
(WebKit::ProxyRuntimeObject::ProxyRuntimeObject):
2011-09-15 Kentaro Hara <haraken@google.com>
A single line must not be split into two pages.
......
......@@ -186,7 +186,9 @@ public:
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
// exec-globalData() is also likely wrong.
Structure* domStructure = deprecatedGetDOMStructure<ProxyRuntimeMethod>(exec);
return new (allocateCell<ProxyRuntimeMethod>(*exec->heap())) ProxyRuntimeMethod(exec, globalObject, domStructure, name, list);
ProxyRuntimeMethod* method = new (allocateCell<ProxyRuntimeMethod>(*exec->heap())) ProxyRuntimeMethod(globalObject, domStructure, list);
method->finishCreation(exec->globalData(), name);
return method;
}
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
......@@ -197,10 +199,9 @@ public:
static const ClassInfo s_info;
private:
ProxyRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& list)
ProxyRuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Bindings::MethodList& list)
: RuntimeMethod(globalObject, structure, list)
{
finishCreation(exec->globalData(), name);
}
void finishCreation(JSGlobalData& globalData, const Identifier& name)
......
......@@ -44,7 +44,9 @@ public:
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object.
// exec->globalData() is also likely wrong.
JSC::Structure* structure = WebCore::deprecatedGetDOMStructure<ProxyRuntimeObject>(exec);
return new (JSC::allocateCell<ProxyRuntimeObject>(*exec->heap())) ProxyRuntimeObject(exec, globalObject, structure, instance);
ProxyRuntimeObject* object = new (JSC::allocateCell<ProxyRuntimeObject>(*exec->heap())) ProxyRuntimeObject(exec, globalObject, structure, instance);
object->finishCreation(globalObject);
return object;
}
virtual ~ProxyRuntimeObject();
......
......@@ -39,7 +39,6 @@ const ClassInfo ProxyRuntimeObject::s_info = { "ProxyRuntimeObject", &RuntimeObj
ProxyRuntimeObject::ProxyRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<ProxyInstance> instance)
: RuntimeObject(exec, globalObject, structure, instance)
{
finishCreation(globalObject);
}
void ProxyRuntimeObject::finishCreation(JSGlobalObject* globalObject)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment