Commit 99f1bca0 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

Remove getConstructDataVirtual

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

Reviewed by Darin Adler.

Source/JavaScriptCore: 

Removed all declarations and definitions of getConstructDataVirtual.
Also replaced all call sites to getConstructDataVirtual with a 
corresponding lookup in the MethodTable.

* API/JSCallbackConstructor.cpp:
* API/JSCallbackConstructor.h:
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
* API/JSObjectRef.cpp:
(JSObjectIsConstructor):
(JSObjectCallAsConstructor):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* dfg/DFGOperations.cpp:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/ArrayConstructor.cpp:
* runtime/ArrayConstructor.h:
* runtime/BooleanConstructor.cpp:
* runtime/BooleanConstructor.h:
* runtime/DateConstructor.cpp:
* runtime/DateConstructor.h:
* runtime/Error.h:
(JSC::StrictModeTypeErrorFunction::getConstructData):
* runtime/ErrorConstructor.cpp:
* runtime/ErrorConstructor.h:
* runtime/FunctionConstructor.cpp:
* runtime/FunctionConstructor.h:
* runtime/JSCell.cpp:
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSObject.h:
(JSC::getConstructData):
* runtime/NativeErrorConstructor.cpp:
* runtime/NativeErrorConstructor.h:
* runtime/NumberConstructor.cpp:
* runtime/NumberConstructor.h:
* runtime/ObjectConstructor.cpp:
* runtime/ObjectConstructor.h:
* runtime/RegExpConstructor.cpp:
* runtime/RegExpConstructor.h:
* runtime/StringConstructor.cpp:
* runtime/StringConstructor.h:

Source/WebCore: 

No new tests.

Removed all declarations and definitions of getConstructDataVirtual.
Also replaced all call sites to getConstructDataVirtual with a 
corresponding lookup in the MethodTable.

* WebCore.exp.in:
* bindings/js/JSAudioConstructor.cpp:
* bindings/js/JSAudioConstructor.h:
* bindings/js/JSImageConstructor.cpp:
* bindings/js/JSImageConstructor.h:
* bindings/js/JSOptionConstructor.cpp:
* bindings/js/JSOptionConstructor.h:
* bindings/js/ScriptFunctionCall.cpp:
(WebCore::ScriptFunctionCall::construct):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDeclaration):
(GenerateConstructorDefinition):
* bridge/runtime_object.cpp:
* bridge/runtime_object.h:

Source/WebKit/mac: 

Removed all declarations and definitions of getConstructDataVirtual.
Also replaced all call sites to getConstructDataVirtual with a 
corresponding lookup in the MethodTable.

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::construct):

Source/WebKit2: 

Removed all declarations and definitions of getConstructDataVirtual.
Also replaced all call sites to getConstructDataVirtual with a 
corresponding lookup in the MethodTable.

* WebProcess/Plugins/Netscape/JSNPObject.cpp:
* WebProcess/Plugins/Netscape/JSNPObject.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ad20934f
......@@ -86,11 +86,6 @@ static EncodedJSValue JSC_HOST_CALL constructJSCallback(ExecState* exec)
return JSValue::encode(toJS(JSObjectMake(ctx, static_cast<JSCallbackConstructor*>(constructor)->classRef(), 0)));
}
ConstructType JSCallbackConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType JSCallbackConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructJSCallback;
......
......@@ -58,7 +58,6 @@ protected:
static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags;
private:
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
JSClassRef m_class;
......
......@@ -194,7 +194,6 @@ private:
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
......
......@@ -334,12 +334,6 @@ bool JSCallbackObject<Parent>::deletePropertyByIndex(JSCell* cell, ExecState* ex
return static_cast<JSCallbackObject*>(cell)->deletePropertyVirtual(exec, Identifier::from(exec, propertyName));
}
template <class Parent>
ConstructType JSCallbackObject<Parent>::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
template <class Parent>
ConstructType JSCallbackObject<Parent>::getConstructData(JSCell* cell, ConstructData& constructData)
{
......
......@@ -454,7 +454,7 @@ bool JSObjectIsConstructor(JSContextRef, JSObjectRef object)
{
JSObject* jsObject = toJS(object);
ConstructData constructData;
return jsObject->getConstructDataVirtual(constructData) != ConstructTypeNone;
return jsObject->methodTable()->getConstructData(jsObject, constructData) != ConstructTypeNone;
}
JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
......@@ -465,7 +465,7 @@ JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size
JSObject* jsObject = toJS(object);
ConstructData constructData;
ConstructType constructType = jsObject->getConstructDataVirtual(constructData);
ConstructType constructType = jsObject->methodTable()->getConstructData(jsObject, constructData);
if (constructType == ConstructTypeNone)
return 0;
......
2011-10-23 Mark Hahnenberg <mhahnenberg@apple.com>
Remove getConstructDataVirtual
https://bugs.webkit.org/show_bug.cgi?id=70638
Reviewed by Darin Adler.
Removed all declarations and definitions of getConstructDataVirtual.
Also replaced all call sites to getConstructDataVirtual with a
corresponding lookup in the MethodTable.
* API/JSCallbackConstructor.cpp:
* API/JSCallbackConstructor.h:
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
* API/JSObjectRef.cpp:
(JSObjectIsConstructor):
(JSObjectCallAsConstructor):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* dfg/DFGOperations.cpp:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/ArrayConstructor.cpp:
* runtime/ArrayConstructor.h:
* runtime/BooleanConstructor.cpp:
* runtime/BooleanConstructor.h:
* runtime/DateConstructor.cpp:
* runtime/DateConstructor.h:
* runtime/Error.h:
(JSC::StrictModeTypeErrorFunction::getConstructData):
* runtime/ErrorConstructor.cpp:
* runtime/ErrorConstructor.h:
* runtime/FunctionConstructor.cpp:
* runtime/FunctionConstructor.h:
* runtime/JSCell.cpp:
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSObject.h:
(JSC::getConstructData):
* runtime/NativeErrorConstructor.cpp:
* runtime/NativeErrorConstructor.h:
* runtime/NumberConstructor.cpp:
* runtime/NumberConstructor.h:
* runtime/ObjectConstructor.cpp:
* runtime/ObjectConstructor.h:
* runtime/RegExpConstructor.cpp:
* runtime/RegExpConstructor.h:
* runtime/StringConstructor.cpp:
* runtime/StringConstructor.h:
2011-10-23 Geoffrey Garen <ggaren@apple.com>
Try to fix the SL build.
......@@ -264,7 +264,6 @@ __ZN3JSC6JSCell11getCallDataEPS0_RNS_8CallDataE
__ZN3JSC6JSCell16getConstructDataEPS0_RNS_13ConstructDataE
__ZN3JSC6JSCell21deletePropertyVirtualEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC6JSCell21deletePropertyVirtualEPNS_9ExecStateEj
__ZN3JSC6JSCell23getConstructDataVirtualERNS_13ConstructDataE
__ZN3JSC6JSCell25getOwnPropertySlotVirtualEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
__ZN3JSC6JSCell25getOwnPropertySlotVirtualEPNS_9ExecStateEjRNS_12PropertySlotE
__ZN3JSC6JSCell9getObjectEv
......
......@@ -193,7 +193,6 @@ EXPORTS
?get@Structure@JSC@@QAEIAAVJSGlobalData@2@PAVStringImpl@WTF@@AAIAAPAVJSCell@2@@Z
?getCallData@JSCell@JSC@@SA?AW4CallType@2@PAV12@AATCallData@2@@Z
?getConstructData@JSCell@JSC@@SA?AW4ConstructType@2@PAV12@AATConstructData@2@@Z
?getConstructDataVirtual@JSCell@JSC@@UAE?AW4ConstructType@2@AATConstructData@2@@Z
?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ
?getOwnPropertyDescriptor@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@JSObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
......
......@@ -161,7 +161,7 @@ JSCell* DFG_OPERATION operationCreateThis(ExecState* exec, JSCell* prototype)
#if !ASSERT_DISABLED
ConstructData constructData;
ASSERT(constructor->getConstructDataVirtual(constructData) == ConstructTypeJS);
ASSERT(constructor->methodTable()->getConstructData(constructor, constructData) == ConstructTypeJS);
#endif
JSGlobalData& globalData = exec->globalData();
......
......@@ -4609,7 +4609,7 @@ skip_id_custom_self:
JSFunction* constructor = asFunction(callFrame->callee());
#if !ASSERT_DISABLED
ConstructData constructData;
ASSERT(constructor->getConstructDataVirtual(constructData) == ConstructTypeJS);
ASSERT(constructor->methodTable()->getConstructData(constructor, constructData) == ConstructTypeJS);
#endif
Structure* structure;
......
......@@ -1267,7 +1267,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_create_this)
JSFunction* constructor = asFunction(callFrame->callee());
#if !ASSERT_DISABLED
ConstructData constructData;
ASSERT(constructor->getConstructDataVirtual(constructData) == ConstructTypeJS);
ASSERT(constructor->methodTable()->getConstructData(constructor, constructData) == ConstructTypeJS);
#endif
Structure* structure;
......@@ -2173,7 +2173,7 @@ DEFINE_STUB_FUNCTION(void*, op_construct_jitCompile)
#if !ASSERT_DISABLED
ConstructData constructData;
ASSERT(asFunction(stackFrame.callFrame->callee())->getConstructDataVirtual(constructData) == ConstructTypeJS);
ASSERT(asFunction(stackFrame.callFrame->callee())->methodTable()->getConstructData(stackFrame.callFrame->callee(), constructData) == ConstructTypeJS);
#endif
return jitCompileFor(stackFrame, CodeForConstruct);
......
......@@ -102,11 +102,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithArrayConstructor(ExecState* exe
return JSValue::encode(constructArrayWithSizeQuirk(exec, args));
}
ConstructType ArrayConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType ArrayConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructWithArrayConstructor;
......
......@@ -56,7 +56,6 @@ namespace JSC {
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
};
......
......@@ -58,11 +58,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithBooleanConstructor(ExecState* e
return JSValue::encode(constructBoolean(exec, args));
}
ConstructType BooleanConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType BooleanConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructWithBooleanConstructor;
......
......@@ -50,7 +50,6 @@ namespace JSC {
private:
BooleanConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
};
......
......@@ -161,11 +161,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithDateConstructor(ExecState* exec
return JSValue::encode(constructDate(exec, asInternalFunction(exec->callee())->globalObject(), args));
}
ConstructType DateConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType DateConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructWithDateConstructor;
......
......@@ -51,7 +51,6 @@ namespace JSC {
private:
DateConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
......
......@@ -98,7 +98,7 @@ namespace JSC {
return JSValue::encode(jsNull());
}
virtual ConstructType getConstructDataVirtual(ConstructData& constructData)
static ConstructType getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructThrowTypeError;
return ConstructTypeHost;
......
......@@ -53,11 +53,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithErrorConstructor(ExecState* exe
return JSValue::encode(ErrorInstance::create(exec, errorStructure, message));
}
ConstructType ErrorConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType ErrorConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructWithErrorConstructor;
......
......@@ -51,7 +51,6 @@ namespace JSC {
private:
ErrorConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
};
......
......@@ -59,11 +59,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithFunctionConstructor(ExecState*
return JSValue::encode(constructFunction(exec, asInternalFunction(exec->callee())->globalObject(), args));
}
ConstructType FunctionConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType FunctionConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructWithFunctionConstructor;
......
......@@ -48,7 +48,6 @@ namespace JSC {
private:
FunctionConstructor(JSGlobalObject*, Structure*);
void finishCreation(ExecState*, FunctionPrototype*);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
};
......
......@@ -59,11 +59,6 @@ CallType JSCell::getCallData(JSCell*, CallData&)
return CallTypeNone;
}
ConstructType JSCell::getConstructDataVirtual(ConstructData&)
{
return ConstructTypeNone;
}
ConstructType JSCell::getConstructData(JSCell*, ConstructData&)
{
return ConstructTypeNone;
......
......@@ -74,7 +74,6 @@ namespace JSC {
const JSObject* getObject() const; // NULL if not an object
static CallType getCallData(JSCell*, CallData&);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
// Basic conversions.
......@@ -232,13 +231,6 @@ namespace JSC {
return isCell() ? asCell()->getObject() : 0;
}
inline ConstructType getConstructData(JSValue value, ConstructData& constructData)
{
ConstructType result = value.isCell() ? value.asCell()->getConstructDataVirtual(constructData) : ConstructTypeNone;
ASSERT(result == ConstructTypeNone || value.isValidCallee());
return result;
}
ALWAYS_INLINE bool JSValue::getUInt32(uint32_t& v) const
{
if (isInt32()) {
......
......@@ -362,11 +362,6 @@ bool JSFunction::deleteProperty(JSCell* cell, ExecState* exec, const Identifier&
return Base::deleteProperty(thisObject, exec, propertyName);
}
ConstructType JSFunction::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
// ECMA 13.2.2 [[Construct]]
ConstructType JSFunction::getConstructData(JSCell* cell, ConstructData& constructData)
{
......
......@@ -107,7 +107,6 @@ namespace JSC {
NativeFunction nativeFunction();
NativeFunction nativeConstructor();
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
......
......@@ -422,6 +422,13 @@ inline CallType getCallData(JSValue value, CallData& callData)
return result;
}
inline ConstructType getConstructData(JSValue value, ConstructData& constructData)
{
ConstructType result = value.isCell() ? value.asCell()->methodTable()->getConstructData(value.asCell(), constructData) : ConstructTypeNone;
ASSERT(result == ConstructTypeNone || value.isValidCallee());
return result;
}
inline Structure* createEmptyObjectStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
{
return JSFinalObject::createStructure(globalData, globalObject, prototype);
......
......@@ -56,11 +56,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithNativeErrorConstructor(ExecStat
return JSValue::encode(ErrorInstance::create(exec, errorStructure, message));
}
ConstructType NativeErrorConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType NativeErrorConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructWithNativeErrorConstructor;
......
......@@ -68,7 +68,6 @@ namespace JSC {
private:
NativeErrorConstructor(JSGlobalObject*, Structure*);
static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags;
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
static void visitChildren(JSCell*, SlotVisitor&);
......
......@@ -120,11 +120,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithNumberConstructor(ExecState* ex
return JSValue::encode(object);
}
ConstructType NumberConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType NumberConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructWithNumberConstructor;
......
......@@ -58,7 +58,6 @@ namespace JSC {
private:
NumberConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
};
......
......@@ -119,11 +119,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithObjectConstructor(ExecState* ex
return JSValue::encode(constructObject(exec, asInternalFunction(exec->callee())->globalObject(), args));
}
ConstructType ObjectConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType ObjectConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructWithObjectConstructor;
......
......@@ -55,7 +55,6 @@ namespace JSC {
private:
ObjectConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
};
......
......@@ -354,11 +354,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithRegExpConstructor(ExecState* ex
return JSValue::encode(constructRegExp(exec, asInternalFunction(exec->callee())->globalObject(), args, true));
}
ConstructType RegExpConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType RegExpConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructWithRegExpConstructor;
......
......@@ -100,7 +100,6 @@ namespace JSC {
private:
RegExpConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
......
......@@ -105,11 +105,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithStringConstructor(ExecState* ex
return JSValue::encode(StringObject::create(exec, globalObject->stringObjectStructure(), string));
}
ConstructType StringConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType StringConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructWithStringConstructor;
......
......@@ -51,7 +51,6 @@ namespace JSC {
private:
StringConstructor(JSGlobalObject*, Structure*);
void finishCreation(ExecState*, StringPrototype*);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
......
2011-10-23 Mark Hahnenberg <mhahnenberg@apple.com>
Remove getConstructDataVirtual
https://bugs.webkit.org/show_bug.cgi?id=70638
Reviewed by Darin Adler.
No new tests.
Removed all declarations and definitions of getConstructDataVirtual.
Also replaced all call sites to getConstructDataVirtual with a
corresponding lookup in the MethodTable.
* WebCore.exp.in:
* bindings/js/JSAudioConstructor.cpp:
* bindings/js/JSAudioConstructor.h:
* bindings/js/JSImageConstructor.cpp:
* bindings/js/JSImageConstructor.h:
* bindings/js/JSOptionConstructor.cpp:
* bindings/js/JSOptionConstructor.h:
* bindings/js/ScriptFunctionCall.cpp:
(WebCore::ScriptFunctionCall::construct):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDeclaration):
(GenerateConstructorDefinition):
* bridge/runtime_object.cpp:
* bridge/runtime_object.h:
2011-10-22 Geoffrey Garen <ggaren@apple.com>
Separated string lifetime bits from character buffer state bits
......
......@@ -1703,7 +1703,6 @@ __ZN3JSC8Bindings13RuntimeObject14finishCreationEPNS_14JSGlobalObjectE
__ZN3JSC8Bindings13RuntimeObject16getConstructDataEPNS_6JSCellERNS_13ConstructDataE
__ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
__ZN3JSC8Bindings13RuntimeObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
__ZN3JSC8Bindings13RuntimeObject23getConstructDataVirtualERNS_13ConstructDataE
__ZN3JSC8Bindings13RuntimeObject21deletePropertyVirtualEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC8Bindings13RuntimeObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC8Bindings13RuntimeObject25getOwnPropertySlotVirtualEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
......
......@@ -75,11 +75,6 @@ static EncodedJSValue JSC_HOST_CALL constructAudio(ExecState* exec)
HTMLAudioElement::createForJSConstructor(document, src))));
}
ConstructType JSAudioConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType JSAudioConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructAudio;
......
......@@ -55,7 +55,6 @@ namespace WebCore {
private:
JSAudioConstructor(JSC::Structure*, JSDOMGlobalObject*);
void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
virtual JSC::ConstructType getConstructDataVirtual(JSC::ConstructData&);
static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
};
......
......@@ -74,11 +74,6 @@ static EncodedJSValue JSC_HOST_CALL constructImage(ExecState* exec)
HTMLImageElement::createForJSConstructor(document, optionalWidth, optionalHeight))));
}
ConstructType JSImageConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType JSImageConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructImage;
......
......@@ -46,7 +46,6 @@ namespace WebCore {
private:
JSImageConstructor(JSC::Structure*, JSDOMGlobalObject*);
void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
virtual JSC::ConstructType getConstructDataVirtual(JSC::ConstructData&);
static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
};
......
......@@ -75,11 +75,6 @@ static EncodedJSValue JSC_HOST_CALL constructHTMLOptionElement(ExecState* exec)
return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), element.release())));
}
ConstructType JSOptionConstructor::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType JSOptionConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
constructData.native.function = constructHTMLOptionElement;
......
......@@ -47,7 +47,6 @@ namespace WebCore {
private:
JSOptionConstructor(JSC::Structure*, JSDOMGlobalObject*);
void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
virtual JSC::ConstructType getConstructDataVirtual(JSC::ConstructData&);
static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
};
......
......@@ -175,7 +175,7 @@ ScriptObject ScriptFunctionCall::construct(bool& hadException, bool reportExcept
}
ConstructData constructData;
ConstructType constructType = constructor->getConstructDataVirtual(constructData);
ConstructType constructType = constructor->methodTable()->getConstructData(constructor, constructData);
if (constructType == ConstructTypeNone)
return ScriptObject();
......
......@@ -3222,7 +3222,6 @@ sub GenerateConstructorDeclaration
if ($canConstruct) {
push(@$outputArray, " static JSC::EncodedJSValue JSC_HOST_CALL construct${className}(JSC::ExecState*);\n");
push(@$outputArray, " virtual JSC::ConstructType getConstructDataVirtual(JSC::ConstructData&);\n");
push(@$outputArray, " static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);\n");
}
push(@$outputArray, "};\n\n");
......@@ -3340,11 +3339,6 @@ sub GenerateConstructorDefinition
push(@$outputArray, "}\n\n");
}
push(@$outputArray, "ConstructType ${constructorClassName}::getConstructDataVirtual(ConstructData& constructData)\n");
push(@$outputArray, "{\n");
push(@$outputArray, " return getConstructData(this, constructData);\n");
push(@$outputArray, "}\n\n");
push(@$outputArray, "ConstructType ${constructorClassName}::getConstructData(JSCell*, ConstructData& constructData)\n");
push(@$outputArray, "{\n");
push(@$outputArray, " constructData.native.function = construct${className};\n");
......
......@@ -304,11 +304,6 @@ static EncodedJSValue JSC_HOST_CALL callRuntimeConstructor(ExecState* exec)
return JSValue::encode(result.isObject() ? static_cast<JSObject*>(result.asCell()) : constructor);
}
ConstructType RuntimeObject::getConstructDataVirtual(ConstructData& constructData)
{
return getConstructData(this, constructData);
}
ConstructType RuntimeObject::getConstructData(JSCell* cell, ConstructData& constructData)
{
RuntimeObject* thisObject = static_cast<RuntimeObject*>(cell);
......
......@@ -54,7 +54,6 @@ public:
static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
static CallType getCallData(JSCell*, CallData&);
virtual ConstructType getConstructDataVirtual(ConstructData&);
static ConstructType getConstructData(JSCell*, ConstructData&);
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
......
2011-10-23 Mark Hahnenberg <mhahnenberg@apple.com>
Remove getConstructDataVirtual
https://bugs.webkit.org/show_bug.cgi?id=70638
Reviewed by Darin Adler.
Removed all declarations and definitions of getConstructDataVirtual.
Also replaced all call sites to getConstructDataVirtual with a
corresponding lookup in the MethodTable.