Commit 2413eb86 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

Source/JavaScriptCore: Add static version of JSCell::getCallData

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

Reviewed by Darin Adler.

In this patch we just extract the bodies of the virtual getCallData methods
throughout the JSCell inheritance hierarchy out into static methods, which are 
now called from the virtual methods.  This is an intermediate step in trying to 
move the virtual-ness of getCallData into our own method table stored in 
ClassInfo.  We need to convert the methods to static methods because static methods 
can be represented as function pointers rather than pointers to member functions, and
function pointers are smaller and faster to call than pointers to member functions.

* API/JSCallbackFunction.cpp:
(JSC::JSCallbackFunction::getCallDataVirtual):
(JSC::JSCallbackFunction::getCallData):
* API/JSCallbackFunction.h:
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::::getCallDataVirtual):
(JSC::::getCallData):
* API/JSObjectRef.cpp:
(JSObjectIsFunction):
(JSObjectCallAsFunction):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::getCallDataVirtual):
(JSC::ArrayConstructor::getCallData):
* runtime/ArrayConstructor.h:
* runtime/BooleanConstructor.cpp:
(JSC::BooleanConstructor::getCallDataVirtual):
(JSC::BooleanConstructor::getCallData):
* runtime/BooleanConstructor.h:
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::getCallDataVirtual):
(JSC::DateConstructor::getCallData):
* runtime/DateConstructor.h:
* runtime/Error.cpp:
(JSC::StrictModeTypeErrorFunction::getCallDataVirtual):
(JSC::StrictModeTypeErrorFunction::getCallData):
* runtime/ErrorConstructor.cpp:
(JSC::ErrorConstructor::getCallDataVirtual):
(JSC::ErrorConstructor::getCallData):
* runtime/ErrorConstructor.h:
* runtime/FunctionConstructor.cpp:
(JSC::FunctionConstructor::getCallDataVirtual):
(JSC::FunctionConstructor::getCallData):
* runtime/FunctionConstructor.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::getCallDataVirtual):
(JSC::FunctionPrototype::getCallData):
* runtime/FunctionPrototype.h:
* runtime/InternalFunction.h:
* runtime/JSCell.cpp:
(JSC::JSCell::getCallDataVirtual):
(JSC::JSCell::getCallData):
* runtime/JSCell.h:
(JSC::getCallData):
* runtime/JSFunction.cpp:
(JSC::JSFunction::getCallDataVirtual):
(JSC::JSFunction::getCallData):
* runtime/JSFunction.h:
* runtime/JSONObject.cpp:
(JSC::Stringifier::Stringifier):
(JSC::Stringifier::toJSON):
(JSC::Stringifier::appendStringifiedValue):
* runtime/JSObject.cpp:
(JSC::JSObject::put):
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor::getCallDataVirtual):
(JSC::NativeErrorConstructor::getCallData):
* runtime/NativeErrorConstructor.h:
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::getCallDataVirtual):
(JSC::NumberConstructor::getCallData):
* runtime/NumberConstructor.h:
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::getCallDataVirtual):
(JSC::ObjectConstructor::getCallData):
* runtime/ObjectConstructor.h:
* runtime/Operations.cpp:
(JSC::jsTypeStringForValue):
(JSC::jsIsObjectType):
(JSC::jsIsFunctionType):
* runtime/PropertySlot.cpp:
(JSC::PropertySlot::functionGetter):
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::getCallDataVirtual):
(JSC::RegExpConstructor::getCallData):
* runtime/RegExpConstructor.h:
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::getCallDataVirtual):
(JSC::StringConstructor::getCallData):
* runtime/StringConstructor.h:

Source/JavaScriptGlue: Add static version of JSCell::getCallData
https://bugs.webkit.org/show_bug.cgi?id=68741

Reviewed by Darin Adler.

In this patch we just extract the bodies of the virtual getCallData methods
throughout the JSCell inheritance hierarchy out into static methods, which are 
now called from the virtual methods.  This is an intermediate step in trying to 
move the virtual-ness of getCallData into our own method table stored in 
ClassInfo.  We need to convert the methods to static methods because static methods 
can be represented as function pointers rather than pointers to member functions, and
function pointers are smaller and faster to call than pointers to member functions.

* JSValueWrapper.cpp:
(JSValueWrapper::JSObjectCallFunction):
* UserObjectImp.cpp:
(UserObjectImp::getCallDataVirtual):
(UserObjectImp::getCallData):
* UserObjectImp.h:

Source/WebCore: Add static version of JSCell::visitChildren
https://bugs.webkit.org/show_bug.cgi?id=68404

Reviewed by Darin Adler.

No new tests.

In this patch we just extract the bodies of the virtual visitChildren methods
throughout the JSCell inheritance hierarchy out into static methods, which are 
now called from the virtual methods.  This is an intermediate step in trying to 
move the virtual-ness of visitChildren into our own custom vtable stored in 
ClassInfo.  We need to convert the methods to static methods in order to be 
able to more easily store and refer to them in our custom vtable since normal 
member methods store some implicit information in their types, making it 
impossible to store them generically in ClassInfo.

* WebCore.exp.in:
* bindings/js/JSAttrCustom.cpp:
(WebCore::JSAttr::visitChildrenVirtual):
(WebCore::JSAttr::visitChildren):
* bindings/js/JSAudioContextCustom.cpp:
(WebCore::JSAudioContext::visitChildrenVirtual):
(WebCore::JSAudioContext::visitChildren):
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::JSCSSRule::visitChildrenVirtual):
(WebCore::JSCSSRule::visitChildren):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::visitChildrenVirtual):
(WebCore::JSCSSStyleDeclaration::visitChildren):
* bindings/js/JSCanvasRenderingContextCustom.cpp:
(WebCore::JSCanvasRenderingContext::visitChildrenVirtual):
(WebCore::JSCanvasRenderingContext::visitChildren):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::visitChildrenVirtual):
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::visitChildrenVirtual):
(WebCore::JSDOMWindow::visitChildren):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::visitChildrenVirtual):
(WebCore::JSDOMWindowShell::visitChildren):
* bindings/js/JSDOMWindowShell.h:
* bindings/js/JSJavaScriptAudioNodeCustom.cpp:
(WebCore::JSJavaScriptAudioNode::visitChildrenVirtual):
(WebCore::JSJavaScriptAudioNode::visitChildren):
* bindings/js/JSMessageChannelCustom.cpp:
(WebCore::JSMessageChannel::visitChildrenVirtual):
(WebCore::JSMessageChannel::visitChildren):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::visitChildrenVirtual):
(WebCore::JSMessagePort::visitChildren):
* bindings/js/JSNamedNodeMapCustom.cpp:
(WebCore::JSNamedNodeMap::visitChildrenVirtual):
(WebCore::JSNamedNodeMap::visitChildren):
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::visitChildrenVirtual):
(WebCore::JSNode::visitChildren):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::visitChildrenVirtual):
(WebCore::JSNodeFilter::visitChildren):
* bindings/js/JSNodeIteratorCustom.cpp:
(WebCore::JSNodeIterator::visitChildrenVirtual):
(WebCore::JSNodeIterator::visitChildren):
* bindings/js/JSSVGElementInstanceCustom.cpp:
(WebCore::JSSVGElementInstance::visitChildrenVirtual):
(WebCore::JSSVGElementInstance::visitChildren):
* bindings/js/JSSharedWorkerCustom.cpp:
(WebCore::JSSharedWorker::visitChildrenVirtual):
(WebCore::JSSharedWorker::visitChildren):
* bindings/js/JSStyleSheetCustom.cpp:
(WebCore::JSStyleSheet::visitChildrenVirtual):
(WebCore::JSStyleSheet::visitChildren):
* bindings/js/JSTreeWalkerCustom.cpp:
(WebCore::JSTreeWalker::visitChildrenVirtual):
(WebCore::JSTreeWalker::visitChildren):
* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::JSWebGLRenderingContext::visitChildrenVirtual):
(WebCore::JSWebGLRenderingContext::visitChildren):
* bindings/js/JSWorkerContextCustom.cpp:
(WebCore::JSWorkerContext::visitChildrenVirtual):
(WebCore::JSWorkerContext::visitChildren):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::visitChildrenVirtual):
(WebCore::JSXMLHttpRequest::visitChildren):
* bindings/js/JSXPathResultCustom.cpp:
(WebCore::JSXPathResult::visitChildrenVirtual):
(WebCore::JSXPathResult::visitChildren):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::visitChildrenVirtual):
(WebCore::JSTestObj::visitChildren):
* bindings/scripts/test/JS/JSTestObj.h:
* bridge/qt/qt_instance.cpp:
(JSC::Bindings::QtRuntimeObject::visitChildrenVirtual):
(JSC::Bindings::QtRuntimeObject::visitChildren):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMetaMethod::visitChildrenVirtual):
(JSC::Bindings::QtRuntimeMetaMethod::visitChildren):
* bridge/qt/qt_runtime.h:
* workers/WorkerContext.h:

Source/WebKit/mac: Add static version of JSCell::getCallData
https://bugs.webkit.org/show_bug.cgi?id=68741

Reviewed by Darin Adler.

In this patch we just extract the bodies of the virtual getCallData methods
throughout the JSCell inheritance hierarchy out into static methods, which are 
now called from the virtual methods.  This is an intermediate step in trying to 
move the virtual-ness of getCallData into our own method table stored in 
ClassInfo.  We need to convert the methods to static methods because static methods 
can be represented as function pointers rather than pointers to member functions, and
function pointers are smaller and faster to call than pointers to member functions.

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

Source/WebKit2: Add static version of JSCell::getCallData
https://bugs.webkit.org/show_bug.cgi?id=68741

Reviewed by Darin Adler.

In this patch we just extract the bodies of the virtual getCallData methods
throughout the JSCell inheritance hierarchy out into static methods, which are 
now called from the virtual methods.  This is an intermediate step in trying to 
move the virtual-ness of getCallData into our own method table stored in 
ClassInfo.  We need to convert the methods to static methods because static methods 
can be represented as function pointers rather than pointers to member functions, and
function pointers are smaller and faster to call than pointers to member functions.

* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
(WebKit::JSNPMethod::getCallDataVirtual):
(WebKit::JSNPMethod::getCallData):
* WebProcess/Plugins/Netscape/JSNPMethod.h:
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::JSNPObject::getCallDataVirtual):
(WebKit::JSNPObject::getCallData):
* WebProcess/Plugins/Netscape/JSNPObject.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 48e7e44e
......@@ -77,7 +77,12 @@ EncodedJSValue JSCallbackFunction::call(ExecState* exec)
return JSValue::encode(toJS(exec, result));
}
CallType JSCallbackFunction::getCallData(CallData& callData)
CallType JSCallbackFunction::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
CallType JSCallbackFunction::getCallData(JSCell*, CallData& callData)
{
callData.native.function = call;
return CallTypeHost;
......
......@@ -56,7 +56,8 @@ public:
}
private:
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
static EncodedJSValue JSC_HOST_CALL call(ExecState*);
......
......@@ -194,7 +194,8 @@ private:
virtual UString toString(ExecState*) const;
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
virtual void visitChildrenVirtual(SlotVisitor& visitor)
{
......
......@@ -372,9 +372,16 @@ bool JSCallbackObject<Parent>::hasInstance(ExecState* exec, JSValue value, JSVal
}
template <class Parent>
CallType JSCallbackObject<Parent>::getCallData(CallData& callData)
CallType JSCallbackObject<Parent>::getCallDataVirtual(CallData& callData)
{
for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
return getCallData(this, callData);
}
template <class Parent>
CallType JSCallbackObject<Parent>::getCallData(JSCell* cell, CallData& callData)
{
JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) {
if (jsClass->callAsFunction) {
callData.native.function = call;
return CallTypeHost;
......
......@@ -416,7 +416,7 @@ bool JSObjectDeletePrivateProperty(JSContextRef ctx, JSObjectRef object, JSStrin
bool JSObjectIsFunction(JSContextRef, JSObjectRef object)
{
CallData callData;
return toJS(object)->getCallData(callData) != CallTypeNone;
return toJS(object)->getCallDataVirtual(callData) != CallTypeNone;
}
JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
......@@ -435,7 +435,7 @@ JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObject
argList.append(toJS(exec, arguments[i]));
CallData callData;
CallType callType = jsObject->getCallData(callData);
CallType callType = jsObject->getCallDataVirtual(callData);
if (callType == CallTypeNone)
return 0;
......
2011-09-27 Mark Hahnenberg <mhahnenberg@apple.com>
Add static version of JSCell::getCallData
https://bugs.webkit.org/show_bug.cgi?id=68741
Reviewed by Darin Adler.
In this patch we just extract the bodies of the virtual getCallData methods
throughout the JSCell inheritance hierarchy out into static methods, which are
now called from the virtual methods. This is an intermediate step in trying to
move the virtual-ness of getCallData into our own method table stored in
ClassInfo. We need to convert the methods to static methods because static methods
can be represented as function pointers rather than pointers to member functions, and
function pointers are smaller and faster to call than pointers to member functions.
* API/JSCallbackFunction.cpp:
(JSC::JSCallbackFunction::getCallDataVirtual):
(JSC::JSCallbackFunction::getCallData):
* API/JSCallbackFunction.h:
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::::getCallDataVirtual):
(JSC::::getCallData):
* API/JSObjectRef.cpp:
(JSObjectIsFunction):
(JSObjectCallAsFunction):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::getCallDataVirtual):
(JSC::ArrayConstructor::getCallData):
* runtime/ArrayConstructor.h:
* runtime/BooleanConstructor.cpp:
(JSC::BooleanConstructor::getCallDataVirtual):
(JSC::BooleanConstructor::getCallData):
* runtime/BooleanConstructor.h:
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::getCallDataVirtual):
(JSC::DateConstructor::getCallData):
* runtime/DateConstructor.h:
* runtime/Error.cpp:
(JSC::StrictModeTypeErrorFunction::getCallDataVirtual):
(JSC::StrictModeTypeErrorFunction::getCallData):
* runtime/ErrorConstructor.cpp:
(JSC::ErrorConstructor::getCallDataVirtual):
(JSC::ErrorConstructor::getCallData):
* runtime/ErrorConstructor.h:
* runtime/FunctionConstructor.cpp:
(JSC::FunctionConstructor::getCallDataVirtual):
(JSC::FunctionConstructor::getCallData):
* runtime/FunctionConstructor.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::getCallDataVirtual):
(JSC::FunctionPrototype::getCallData):
* runtime/FunctionPrototype.h:
* runtime/InternalFunction.h:
* runtime/JSCell.cpp:
(JSC::JSCell::getCallDataVirtual):
(JSC::JSCell::getCallData):
* runtime/JSCell.h:
(JSC::getCallData):
* runtime/JSFunction.cpp:
(JSC::JSFunction::getCallDataVirtual):
(JSC::JSFunction::getCallData):
* runtime/JSFunction.h:
* runtime/JSONObject.cpp:
(JSC::Stringifier::Stringifier):
(JSC::Stringifier::toJSON):
(JSC::Stringifier::appendStringifiedValue):
* runtime/JSObject.cpp:
(JSC::JSObject::put):
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor::getCallDataVirtual):
(JSC::NativeErrorConstructor::getCallData):
* runtime/NativeErrorConstructor.h:
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::getCallDataVirtual):
(JSC::NumberConstructor::getCallData):
* runtime/NumberConstructor.h:
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::getCallDataVirtual):
(JSC::ObjectConstructor::getCallData):
* runtime/ObjectConstructor.h:
* runtime/Operations.cpp:
(JSC::jsTypeStringForValue):
(JSC::jsIsObjectType):
(JSC::jsIsFunctionType):
* runtime/PropertySlot.cpp:
(JSC::PropertySlot::functionGetter):
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::getCallDataVirtual):
(JSC::RegExpConstructor::getCallData):
* runtime/RegExpConstructor.h:
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::getCallDataVirtual):
(JSC::StringConstructor::getCallData):
* runtime/StringConstructor.h:
2011-09-27 Tim Horton <timothy_horton@apple.com>
Rapidly refreshing a feMorphology[erode] with r=0 can sometimes cause display corruption
......@@ -252,10 +252,10 @@ __ZN3JSC4Yarr11YarrPatternC1ERKNS_7UStringEbbPPKc
__ZN3JSC4Yarr11byteCompileERNS0_11YarrPatternEPN3WTF20BumpPointerAllocatorE
__ZN3JSC4Yarr9interpretEPNS0_15BytecodePatternERKNS_7UStringEjjPi
__ZN3JSC4callEPNS_9ExecStateENS_7JSValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE
__ZN3JSC6JSCell11getCallDataERNS_8CallDataE
__ZN3JSC6JSCell14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC6JSCell14deletePropertyEPNS_9ExecStateEj
__ZN3JSC6JSCell16getConstructDataERNS_13ConstructDataE
__ZN3JSC6JSCell18getCallDataVirtualERNS_8CallDataE
__ZN3JSC6JSCell18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
__ZN3JSC6JSCell18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
__ZN3JSC6JSCell3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
......
......@@ -186,7 +186,7 @@ EXPORTS
?functionName@DebuggerCallFrame@JSC@@QBEPBVUString@2@XZ
?get@Structure@JSC@@QAEIAAVJSGlobalData@2@ABVIdentifier@2@AAIAAPAVJSCell@2@@Z
?get@Structure@JSC@@QAEIAAVJSGlobalData@2@PAVStringImpl@WTF@@AAIAAPAVJSCell@2@@Z
?getCallData@JSCell@JSC@@UAE?AW4CallType@2@AATCallData@2@@Z
?getCallDataVirtual@JSCell@JSC@@UAE?AW4CallType@2@AATCallData@2@@Z
?getConstructData@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
......
......@@ -2829,7 +2829,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
if (GetterSetter* getterSetter = asGetterSetter(protoObject->getDirectOffset(offset).asCell())) {
JSObject* getter = getterSetter->getter();
CallData callData;
CallType callType = getter->getCallData(callData);
CallType callType = getter->getCallDataVirtual(callData);
JSValue result = call(callFrame, getter, callType, callData, asObject(baseCell), ArgList());
CHECK_FOR_EXCEPTION();
callFrame->uncheckedR(dst) = result;
......@@ -2964,7 +2964,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
if (GetterSetter* getterSetter = asGetterSetter(baseObject->getDirectOffset(offset).asCell())) {
JSObject* getter = getterSetter->getter();
CallData callData;
CallType callType = getter->getCallData(callData);
CallType callType = getter->getCallDataVirtual(callData);
JSValue result = call(callFrame, getter, callType, callData, baseObject, ArgList());
CHECK_FOR_EXCEPTION();
callFrame->uncheckedR(dst) = result;
......@@ -3072,7 +3072,7 @@ skip_id_custom_self:
if (GetterSetter* getterSetter = asGetterSetter(baseObject->getDirectOffset(offset).asCell())) {
JSObject* getter = getterSetter->getter();
CallData callData;
CallType callType = getter->getCallData(callData);
CallType callType = getter->getCallDataVirtual(callData);
JSValue result = call(callFrame, getter, callType, callData, baseValue, ArgList());
CHECK_FOR_EXCEPTION();
callFrame->uncheckedR(dst) = result;
......
......@@ -1755,7 +1755,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_getter_stub)
return JSValue::encode(jsUndefined());
JSObject* getter = asObject(getterSetter->getter());
CallData callData;
CallType callType = getter->getCallData(callData);
CallType callType = getter->getCallDataVirtual(callData);
JSValue result = call(callFrame, getter, callType, callData, stackFrame.args[1].jsObject(), ArgList());
if (callFrame->hadException())
returnToThrowTrampoline(&callFrame->globalData(), stackFrame.args[2].returnAddress(), STUB_RETURN_ADDRESS);
......@@ -2158,7 +2158,7 @@ DEFINE_STUB_FUNCTION(void*, op_call_jitCompile)
#if !ASSERT_DISABLED
CallData callData;
ASSERT(stackFrame.callFrame->callee()->getCallData(callData) == CallTypeJS);
ASSERT(stackFrame.callFrame->callee()->getCallDataVirtual(callData) == CallTypeJS);
#endif
return jitCompileFor(stackFrame, CodeForCall);
......
......@@ -109,7 +109,12 @@ static EncodedJSValue JSC_HOST_CALL callArrayConstructor(ExecState* exec)
return JSValue::encode(constructArrayWithSizeQuirk(exec, args));
}
CallType ArrayConstructor::getCallData(CallData& callData)
CallType ArrayConstructor::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
CallType ArrayConstructor::getCallData(JSCell*, CallData& callData)
{
// equivalent to 'new Array(....)'
callData.native.function = callArrayConstructor;
......
......@@ -55,7 +55,8 @@ namespace JSC {
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
};
} // namespace JSC
......
......@@ -68,7 +68,12 @@ static EncodedJSValue JSC_HOST_CALL callBooleanConstructor(ExecState* exec)
return JSValue::encode(jsBoolean(exec->argument(0).toBoolean(exec)));
}
CallType BooleanConstructor::getCallData(CallData& callData)
CallType BooleanConstructor::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
CallType BooleanConstructor::getCallData(JSCell*, CallData& callData)
{
callData.native.function = callBooleanConstructor;
return CallTypeHost;
......
......@@ -44,7 +44,8 @@ namespace JSC {
private:
BooleanConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
};
JSObject* constructBooleanFromImmediateBoolean(ExecState*, JSGlobalObject*, JSValue);
......
......@@ -176,7 +176,12 @@ static EncodedJSValue JSC_HOST_CALL callDate(ExecState* exec)
return JSValue::encode(jsMakeNontrivialString(exec, date, " ", time));
}
CallType DateConstructor::getCallData(CallData& callData)
CallType DateConstructor::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
CallType DateConstructor::getCallData(JSCell*, CallData& callData)
{
callData.native.function = callDate;
return CallTypeHost;
......
......@@ -52,7 +52,8 @@ namespace JSC {
private:
DateConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
......
......@@ -201,7 +201,12 @@ public:
return JSValue::encode(jsNull());
}
CallType getCallData(CallData& callData)
CallType getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
CallType getCallData(JSCell*, CallData& callData)
{
callData.native.function = callThrowTypeError;
return CallTypeHost;
......
......@@ -64,7 +64,12 @@ static EncodedJSValue JSC_HOST_CALL callErrorConstructor(ExecState* exec)
return JSValue::encode(ErrorInstance::create(exec, errorStructure, message));
}
CallType ErrorConstructor::getCallData(CallData& callData)
CallType ErrorConstructor::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
CallType ErrorConstructor::getCallData(JSCell*, CallData& callData)
{
callData.native.function = callErrorConstructor;
return CallTypeHost;
......
......@@ -45,7 +45,8 @@ namespace JSC {
private:
ErrorConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
};
} // namespace JSC
......
......@@ -69,8 +69,13 @@ static EncodedJSValue JSC_HOST_CALL callFunctionConstructor(ExecState* exec)
return JSValue::encode(constructFunction(exec, asInternalFunction(exec->callee())->globalObject(), args));
}
CallType FunctionConstructor::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
// ECMA 15.3.1 The Function Constructor Called as a Function
CallType FunctionConstructor::getCallData(CallData& callData)
CallType FunctionConstructor::getCallData(JSCell*, CallData& callData)
{
callData.native.function = callFunctionConstructor;
return CallTypeHost;
......
......@@ -42,7 +42,8 @@ namespace JSC {
FunctionConstructor(JSGlobalObject*, Structure*);
void finishCreation(ExecState*, FunctionPrototype*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
};
JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&, const Identifier& functionName, const UString& sourceURL, int lineNumber);
......
......@@ -70,8 +70,13 @@ static EncodedJSValue JSC_HOST_CALL callFunctionPrototype(ExecState*)
return JSValue::encode(jsUndefined());
}
CallType FunctionPrototype::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
// ECMA 15.3.4
CallType FunctionPrototype::getCallData(CallData& callData)
CallType FunctionPrototype::getCallData(JSCell*, CallData& callData)
{
callData.native.function = callFunctionPrototype;
return CallTypeHost;
......
......@@ -48,7 +48,8 @@ namespace JSC {
private:
FunctionPrototype(JSGlobalObject*, Structure*);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
};
} // namespace JSC
......
......@@ -57,7 +57,7 @@ namespace JSC {
void finishCreation(JSGlobalData&, const Identifier& name);
private:
virtual CallType getCallData(CallData&) = 0;
virtual CallType getCallDataVirtual(CallData&) = 0;
virtual void vtableAnchor();
};
......
......@@ -54,7 +54,12 @@ const JSObject* JSCell::getObject() const
return isObject() ? static_cast<const JSObject*>(this) : 0;
}
CallType JSCell::getCallData(CallData&)
CallType JSCell::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
CallType JSCell::getCallData(JSCell*, CallData&)
{
return CallTypeNone;
}
......
......@@ -73,7 +73,8 @@ namespace JSC {
JSObject* getObject(); // NULL if not an object
const JSObject* getObject() const; // NULL if not an object
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
virtual ConstructType getConstructData(ConstructData&);
// Basic conversions.
......@@ -235,7 +236,7 @@ namespace JSC {
inline CallType getCallData(JSValue value, CallData& callData)
{
CallType result = value.isCell() ? value.asCell()->getCallData(callData) : CallTypeNone;
CallType result = value.isCell() ? value.asCell()->getCallDataVirtual(callData) : CallTypeNone;
ASSERT(result == CallTypeNone || value.isValidCallee());
return result;
}
......
......@@ -169,14 +169,20 @@ void JSFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
visitor.append(&thisObject->m_executable);
}
CallType JSFunction::getCallData(CallData& callData)
CallType JSFunction::getCallDataVirtual(CallData& callData)
{
if (isHostFunction()) {
callData.native.function = nativeFunction();
return getCallData(this, callData);
}
CallType JSFunction::getCallData(JSCell* cell, CallData& callData)
{
JSFunction* thisObject = static_cast<JSFunction*>(cell);
if (thisObject->isHostFunction()) {
callData.native.function = thisObject->nativeFunction();
return CallTypeHost;
}
callData.js.functionExecutable = jsExecutable();
callData.js.scopeChain = scope();
callData.js.functionExecutable = thisObject->jsExecutable();
callData.js.scopeChain = thisObject->scope();
return CallTypeJS;
}
......
......@@ -109,7 +109,8 @@ namespace JSC {
NativeFunction nativeConstructor();
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
static inline size_t offsetOfScopeChain()
{
......
......@@ -246,7 +246,7 @@ Stringifier::Stringifier(ExecState* exec, const Local<Unknown>& replacer, const
return;
}
m_replacerCallType = m_replacer.asObject()->getCallData(m_replacerCallData);
m_replacerCallType = m_replacer.asObject()->getCallDataVirtual(m_replacerCallData);
}
Local<Unknown> Stringifier::stringify(Handle<Unknown> value)
......@@ -337,7 +337,7 @@ inline JSValue Stringifier::toJSON(JSValue value, const PropertyNameForFunctionC
JSObject* object = asObject(toJSONFunction);
CallData callData;
CallType callType = object->getCallData(callData);
CallType callType = object->getCallDataVirtual(callData);
if (callType == CallTypeNone)
return value;
......@@ -401,7 +401,7 @@ Stringifier::StringifyResult Stringifier::appendStringifiedValue(UStringBuilder&
JSObject* object = asObject(value);
CallData callData;
if (object->getCallData(callData) != CallTypeNone) {
if (object->getCallDataVirtual(callData) != CallTypeNone) {
if (holder->inherits(&JSArray::s_info)) {
builder.append("null");
return StringifySucceeded;
......
......@@ -158,7 +158,7 @@ void JSObject::put(ExecState* exec, const Identifier& propertyName, JSValue valu
}
CallData callData;
CallType callType = setterFunc->getCallData(callData);
CallType callType = setterFunc->getCallDataVirtual(callData);
MarkedArgumentBuffer args;
args.append(value);
......
......@@ -74,7 +74,12 @@ static EncodedJSValue JSC_HOST_CALL callNativeErrorConstructor(ExecState* exec)
return JSValue::encode(ErrorInstance::create(exec, errorStructure, message));
}
CallType NativeErrorConstructor::getCallData(CallData& callData)
CallType NativeErrorConstructor::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
CallType NativeErrorConstructor::getCallData(JSCell*, CallData& callData)
{
callData.native.function = callNativeErrorConstructor;
return CallTypeHost;
......
......@@ -69,7 +69,8 @@ namespace JSC {
NativeErrorConstructor(JSGlobalObject*, Structure*);
static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags;
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
virtual void visitChildrenVirtual(SlotVisitor&);
static void visitChildren(JSCell*, SlotVisitor&);
......
......@@ -127,7 +127,12 @@ static EncodedJSValue JSC_HOST_CALL callNumberConstructor(ExecState* exec)
return JSValue::encode(jsNumber(!exec->argumentCount() ? 0 : exec->argument(0).toNumber(exec)));
}
CallType NumberConstructor::getCallData(CallData& callData)
CallType NumberConstructor::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
CallType NumberConstructor::getCallData(JSCell*, CallData& callData)
{
callData.native.function = callNumberConstructor;
return CallTypeHost;
......
......@@ -58,7 +58,8 @@ namespace JSC {
private:
NumberConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
};
} // namespace JSC
......
......@@ -126,7 +126,12 @@ static EncodedJSValue JSC_HOST_CALL callObjectConstructor(ExecState* exec)
return JSValue::encode(constructObject(exec, asInternalFunction(exec->callee())->globalObject(), args));
}
CallType ObjectConstructor::getCallData(CallData& callData)
CallType ObjectConstructor::getCallDataVirtual(CallData& callData)
{
return getCallData(this, callData);
}
CallType ObjectConstructor::getCallData(JSCell*, CallData& callData)
{
callData.native.function = callObjectConstructor;
return CallTypeHost;
......
......@@ -55,7 +55,8 @@ namespace JSC {
private:
ObjectConstructor(JSGlobalObject*, Structure*);
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
virtual CallType getCallDataVirtual(CallData&);
static CallType getCallData(JSCell*, CallData&);
};
} // namespace JSC
......
......@@ -74,7 +74,7 @@ JSValue jsTypeStringForValue(CallFrame* callFrame, JSValue v)
if (asObject(v)->structure()->typeInfo().masqueradesAsUndefined())
return jsNontrivialString(callFrame, "undefined");
CallData callData;
if (asObject(v)->getCallData(callData) != CallTypeNone)
if (asObject(v)->getCallDataVirtual(callData) != CallTypeNone)
return jsNontrivialString(callFrame, "function");
}
return jsNontrivialString(callFrame, "object");
......@@ -92,7 +92,7 @@ bool jsIsObjectType(JSValue v)
if (asObject(v)->structure()->typeInfo().masqueradesAsUndefined())
return false;
CallData callData;
if (asObject(v)->getCallData(callData) != CallTypeNone)