Commit 1e94a8fc authored by ggaren@apple.com's avatar ggaren@apple.com

JavaScriptCore:

2008-06-02  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Alexey Proskuryakov.

        Removed JSObject::call, since it just called JSObject::callAsFunction.

        SunSpider reports no change.

JavaScriptGlue:

2008-06-02  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Alexey Proskuryakov.

        Removed JSObject::call, since it just called JSObject::callAsFunction.

        SunSpider reports no change.

WebCore:

2008-06-02  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Alexey Proskuryakov.
        
        Removed JSObject::call, since it just called JSObject::callAsFunction.
        
        SunSpider reports no change.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent abe678df
......@@ -285,7 +285,7 @@ JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObject
for (size_t i = 0; i < argumentCount; i++)
argList.append(toJS(arguments[i]));
JSValueRef result = toRef(jsObject->call(exec, jsThisObject, argList)); // returns NULL if object->implementsCall() is false
JSValueRef result = toRef(jsObject->callAsFunction(exec, jsThisObject, argList)); // returns NULL if object->implementsCall() is false
if (exec->hadException()) {
if (exception)
*exception = toRef(exec->exception());
......
2008-06-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Alexey Proskuryakov.
Removed JSObject::call, since it just called JSObject::callAsFunction.
SunSpider reports no change.
2008-06-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
......
......@@ -198,7 +198,6 @@ __ZN3KJS8JSObject18getPrimitiveNumberEPNS_9ExecStateERdRPNS_7JSValueE
__ZN3KJS8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPPNS_7JSValueE
__ZN3KJS8JSObject3putEPNS_9ExecStateERKNS_10IdentifierEPNS_7JSValueE
__ZN3KJS8JSObject3putEPNS_9ExecStateEjPNS_7JSValueE
__ZN3KJS8JSObject4callEPNS_9ExecStateEPS0_RKNS_4ListE
__ZN3KJS8JSObject4markEv
__ZN3KJS8JSObject9constructEPNS_9ExecStateERKNS_4ListE
__ZN3KJS8JSObject9constructEPNS_9ExecStateERKNS_4ListERKNS_10IdentifierERKNS_7UStringEi
......
......@@ -546,7 +546,7 @@ struct AVLTreeAbstractorForArrayCompare {
List arguments;
arguments.append(va);
arguments.append(vb);
double compareResult = m_compareFunction->call(m_exec, m_globalThisValue, arguments)->toNumber(m_exec);
double compareResult = m_compareFunction->callAsFunction(m_exec, m_globalThisValue, arguments)->toNumber(m_exec);
return (compareResult < 0) ? -1 : 1; // Not passing equality through, because we need to store all values, even if equivalent.
}
......
......@@ -163,7 +163,7 @@ JSValue* arrayProtoFuncToLocaleString(ExecState* exec, JSObject* thisObj, const
JSValue* conversionFunction = o->get(exec, exec->propertyNames().toLocaleString);
UString str;
if (conversionFunction->isObject() && static_cast<JSObject*>(conversionFunction)->implementsCall())
str = static_cast<JSObject*>(conversionFunction)->call(exec, o, exec->emptyList())->toString(exec);
str = static_cast<JSObject*>(conversionFunction)->callAsFunction(exec, o, exec->emptyList())->toString(exec);
else
str = element->toString(exec);
strBuffer.append(str.data(), str.size());
......@@ -409,7 +409,7 @@ JSValue* arrayProtoFuncSort(ExecState* exec, JSObject* thisObj, const List& args
List l;
l.append(jObj);
l.append(minObj);
compareResult = sortFunction->call(exec, exec->globalThisValue(), l)->toNumber(exec);
compareResult = sortFunction->callAsFunction(exec, exec->globalThisValue(), l)->toNumber(exec);
} else
compareResult = (jObj->toString(exec) < minObj->toString(exec)) ? -1 : 1;
......@@ -526,7 +526,7 @@ JSValue* arrayProtoFuncFilter(ExecState* exec, JSObject* thisObj, const List& ar
eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
JSValue* result = eachFunction->call(exec, applyThis, eachArguments);
JSValue* result = eachFunction->callAsFunction(exec, applyThis, eachArguments);
if (result->toBoolean(exec))
resultArray->put(exec, filterIndex++, v);
......@@ -561,7 +561,7 @@ JSValue* arrayProtoFuncMap(ExecState* exec, JSObject* thisObj, const List& args)
eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
JSValue* result = eachFunction->call(exec, applyThis, eachArguments);
JSValue* result = eachFunction->callAsFunction(exec, applyThis, eachArguments);
resultArray->put(exec, k, result);
}
......@@ -597,7 +597,7 @@ JSValue* arrayProtoFuncEvery(ExecState* exec, JSObject* thisObj, const List& arg
eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
bool predicateResult = eachFunction->call(exec, applyThis, eachArguments)->toBoolean(exec);
bool predicateResult = eachFunction->callAsFunction(exec, applyThis, eachArguments)->toBoolean(exec);
if (!predicateResult) {
result = jsBoolean(false);
......@@ -628,7 +628,7 @@ JSValue* arrayProtoFuncForEach(ExecState* exec, JSObject* thisObj, const List& a
eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
eachFunction->call(exec, applyThis, eachArguments);
eachFunction->callAsFunction(exec, applyThis, eachArguments);
}
return jsUndefined();
}
......@@ -655,7 +655,7 @@ JSValue* arrayProtoFuncSome(ExecState* exec, JSObject* thisObj, const List& args
eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
bool predicateResult = eachFunction->call(exec, applyThis, eachArguments)->toBoolean(exec);
bool predicateResult = eachFunction->callAsFunction(exec, applyThis, eachArguments)->toBoolean(exec);
if (predicateResult) {
result = jsBoolean(true);
......
......@@ -104,7 +104,7 @@ JSValue* functionProtoFuncApply(ExecState* exec, JSObject* thisObj, const List&
return throwError(exec, TypeError);
}
return thisObj->call(exec, applyThis, applyArgs);
return thisObj->callAsFunction(exec, applyThis, applyArgs);
}
JSValue* functionProtoFuncCall(ExecState* exec, JSObject* thisObj, const List& args)
......@@ -122,7 +122,7 @@ JSValue* functionProtoFuncCall(ExecState* exec, JSObject* thisObj, const List& a
List argsTail;
args.getSlice(1, argsTail);
return thisObj->call(exec, callThis, argsTail);
return thisObj->callAsFunction(exec, callThis, argsTail);
}
// ------------------------------ FunctionObjectImp ----------------------------
......
......@@ -1281,7 +1281,7 @@ inline JSValue* ExpressionNode::resolveAndCall(OldInterpreterExecState* exec, co
}
JSObject* thisObj = base->toThisObject(exec);
return func->call(exec, thisObj, argList);
return func->callAsFunction(exec, thisObj, argList);
}
++iter;
} while (iter != end);
......@@ -1340,7 +1340,7 @@ JSValue* FunctionCallValueNode::evaluate(OldInterpreterExecState* exec)
KJS_CHECKEXCEPTIONVALUE
JSObject* thisObj = exec->globalThisValue();
return func->call(exec, thisObj, argList);
return func->callAsFunction(exec, thisObj, argList);
}
RegisterID* FunctionCallResolveNode::emitCode(CodeGenerator& generator, RegisterID* dst)
......@@ -1441,7 +1441,7 @@ JSValue* LocalVarFunctionCallNode::inlineEvaluate(OldInterpreterExecState* exec)
KJS_CHECKEXCEPTIONVALUE
JSObject* thisObj = exec->globalThisValue();
return func->call(exec, thisObj, argList);
return func->callAsFunction(exec, thisObj, argList);
}
JSValue* LocalVarFunctionCallNode::evaluate(OldInterpreterExecState* exec)
......@@ -1495,7 +1495,7 @@ JSValue* ScopedVarFunctionCallNode::inlineEvaluate(OldInterpreterExecState* exec
KJS_CHECKEXCEPTIONVALUE
JSObject* thisObj = exec->globalThisValue();
return func->call(exec, thisObj, argList);
return func->callAsFunction(exec, thisObj, argList);
}
JSValue* ScopedVarFunctionCallNode::evaluate(OldInterpreterExecState* exec)
......@@ -1633,7 +1633,7 @@ JSValue* FunctionCallBracketNode::evaluate(OldInterpreterExecState* exec)
ASSERT(!thisObj->isActivationObject());
// No need to call toThisObject() on the thisObj as it is known not to be the GlobalObject or ActivationObject
return func->call(exec, thisObj, argList);
return func->callAsFunction(exec, thisObj, argList);
}
static const char* dotExprNotAnObjectString() KJS_FAST_CALL;
......@@ -1690,7 +1690,7 @@ JSValue* FunctionCallDotNode::inlineEvaluate(OldInterpreterExecState* exec)
ASSERT(!thisObj->isActivationObject());
// No need to call toThisObject() on the thisObj as it is known not to be the GlobalObject or ActivationObject
return func->call(exec, thisObj, argList);
return func->callAsFunction(exec, thisObj, argList);
}
JSValue* FunctionCallDotNode::evaluate(OldInterpreterExecState* exec)
......
......@@ -38,14 +38,6 @@
namespace KJS {
// ------------------------------ Object ---------------------------------------
JSValue* JSObject::call(ExecState* exec, JSObject* thisObj, const List& args)
{
ASSERT(implementsCall());
return callAsFunction(exec, thisObj, args);
}
// ------------------------------ JSObject ------------------------------------
void JSObject::mark()
......@@ -158,7 +150,7 @@ void JSObject::put(ExecState* exec, const Identifier &propertyName, JSValue *val
List args;
args.append(value);
setterFunc->call(exec, this->toThisObject(exec), args);
setterFunc->callAsFunction(exec, this->toThisObject(exec), args);
return;
} else {
// If there's an existing property on the object or one of its
......@@ -246,7 +238,7 @@ static ALWAYS_INLINE JSValue *tryGetAndCallProperty(ExecState *exec, const JSObj
// spec says "not primitive type" but ...
if (callType != CallTypeNone) {
JSObject* thisObj = const_cast<JSObject*>(object);
JSValue* def = o->call(exec, thisObj->toThisObject(exec), exec->emptyList());
JSValue* def = o->callAsFunction(exec, thisObj->toThisObject(exec), exec->emptyList());
JSType defType = def->type();
ASSERT(defType != GetterSetterType);
if (defType != ObjectType)
......
......@@ -364,8 +364,6 @@ namespace KJS {
* @return The return value from the function
*/
bool implementsCall();
JSValue *call(ExecState *exec, JSObject *thisObj, const List &args);
virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
/**
......
......@@ -46,11 +46,11 @@ JSValue *PropertySlot::functionGetter(ExecState* exec, JSObject* originalObject,
CallData data;
CallType callType = slot.m_data.getterFunc->getCallData(data);
if (callType == CallTypeNative)
return slot.m_data.getterFunc->call(exec, originalObject, exec->emptyList());
return slot.m_data.getterFunc->callAsFunction(exec, originalObject, exec->emptyList());
ASSERT(callType == CallTypeJS);
RegisterFileStack* stack = &exec->dynamicGlobalObject()->registerFileStack();
stack->pushFunctionRegisterFile();
JSValue* result = slot.m_data.getterFunc->call(exec, originalObject, exec->emptyList());
JSValue* result = slot.m_data.getterFunc->callAsFunction(exec, originalObject, exec->emptyList());
stack->popFunctionRegisterFile();
return result;
}
......
......@@ -350,7 +350,7 @@ static JSValue *replace(ExecState *exec, StringImp* sourceVal, JSValue *pattern,
args.append(jsNumber(completeMatchStart));
args.append(sourceVal);
substitutedReplacement = replacementFunction->call(exec, exec->globalThisValue(), args)->toString(exec);
substitutedReplacement = replacementFunction->callAsFunction(exec, exec->globalThisValue(), args)->toString(exec);
} else
substitutedReplacement = substituteBackreferences(replacementString, source, ovector, reg);
......@@ -399,7 +399,7 @@ static JSValue *replace(ExecState *exec, StringImp* sourceVal, JSValue *pattern,
args.append(jsNumber(matchPos));
args.append(sourceVal);
replacementString = replacementFunction->call(exec, exec->globalThisValue(), args)->toString(exec);
replacementString = replacementFunction->callAsFunction(exec, exec->globalThisValue(), args)->toString(exec);
}
return jsString(source.substr(0, matchPos) + replacementString + source.substr(matchPos + matchLen));
......
2008-06-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Alexey Proskuryakov.
Removed JSObject::call, since it just called JSObject::callAsFunction.
SunSpider reports no change.
2008-05-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Oliver Hunt.
......
......@@ -207,7 +207,7 @@ JSObjectRef JSValueWrapper::JSObjectCallFunction(void *data, JSObjectRef thisObj
listArgs.append(kgsArg);
}
JSValue *resultValue = objValue->call(exec, ksjThisObj, listArgs);
JSValue *resultValue = objValue->callAsFunction(exec, ksjThisObj, listArgs);
JSValueWrapper* wrapperValue = new JSValueWrapper(resultValue);
JSObjectCallBacks callBacks;
GetJSObectCallBacks(callBacks);
......
......@@ -324,6 +324,7 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 14AC662B08CE7791006915A8 /* Build configuration list for PBXProject "JavaScriptGlue" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 0867D691FE84028FC02AAC07 /* JavaScriptGlue */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
......
2008-06-02 Geoffrey Garen <ggaren@apple.com>
Reviewed by Alexey Proskuryakov.
Removed JSObject::call, since it just called JSObject::callAsFunction.
SunSpider reports no change.
2008-06-02 Alp Toker <alp@nuanti.com>
Reviewed by Maciej.
......@@ -81,9 +81,9 @@ void JSCustomSQLStatementCallback::handleEvent(SQLTransaction* transaction, SQLR
globalObject->startTimeoutCheck();
if (handleEventFunc)
handleEventFunc->call(exec, m_callback, args);
handleEventFunc->callAsFunction(exec, m_callback, args);
else
m_callback->call(exec, m_callback, args);
m_callback->callAsFunction(exec, m_callback, args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
......
......@@ -82,9 +82,9 @@ bool JSCustomSQLStatementErrorCallback::handleEvent(SQLTransaction* transaction,
JSValue *result;
globalObject->startTimeoutCheck();
if (handleEventFunc)
result = handleEventFunc->call(exec, m_callback, args);
result = handleEventFunc->callAsFunction(exec, m_callback, args);
else
result = m_callback->call(exec, m_callback, args);
result = m_callback->callAsFunction(exec, m_callback, args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
......
......@@ -134,9 +134,9 @@ void JSCustomSQLTransactionCallback::handleEvent(SQLTransaction* transaction, bo
globalObject->startTimeoutCheck();
if (handleEventFunc)
handleEventFunc->call(exec, m_data->callback(), args);
handleEventFunc->callAsFunction(exec, m_data->callback(), args);
else
m_data->callback()->call(exec, m_data->callback(), args);
m_data->callback()->callAsFunction(exec, m_data->callback(), args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
......
......@@ -80,9 +80,9 @@ bool JSCustomSQLTransactionErrorCallback::handleEvent(SQLError* error)
JSValue *result;
globalObject->startTimeoutCheck();
if (handleEventFunc)
result = handleEventFunc->call(exec, m_callback, args);
result = handleEventFunc->callAsFunction(exec, m_callback, args);
else
result = m_callback->call(exec, m_callback, args);
result = m_callback->callAsFunction(exec, m_callback, args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
......
......@@ -79,9 +79,9 @@ void JSCustomVoidCallback::handleEvent()
globalObject->startTimeoutCheck();
if (handleEventFunc)
handleEventFunc->call(exec, m_callback, args);
handleEventFunc->callAsFunction(exec, m_callback, args);
else
m_callback->call(exec, m_callback, args);
m_callback->callAsFunction(exec, m_callback, args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
......
......@@ -103,9 +103,9 @@ String JSCustomXPathNSResolver::lookupNamespaceURI(const String& prefix)
JSValue* retval;
globalObject->startTimeoutCheck();
if (lookupNamespaceURIFunc)
retval = lookupNamespaceURIFunc->call(exec, m_customResolver, args);
retval = lookupNamespaceURIFunc->callAsFunction(exec, m_customResolver, args);
else
retval = m_customResolver->call(exec, m_customResolver, args);
retval = m_customResolver->callAsFunction(exec, m_customResolver, args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
......
......@@ -105,7 +105,7 @@ JSValue* JSHTMLDocument::open(ExecState* exec, const List& args)
JSObject* functionObject = wrapper->get(exec, "open")->getObject();
if (!functionObject || !functionObject->implementsCall())
return throwError(exec, TypeError);
return functionObject->call(exec, wrapper, args);
return functionObject->callAsFunction(exec, wrapper, args);
}
}
return jsUndefined();
......
......@@ -68,7 +68,7 @@ short JSNodeFilterCondition::acceptNode(Node* filterNode, JSValue*& exception) c
exception = takeException(exec);
return NodeFilter::FILTER_REJECT;
}
JSValue* result = m_filter->call(exec, m_filter, args);
JSValue* result = m_filter->callAsFunction(exec, m_filter, args);
if (exec->hadException()) {
exception = takeException(exec);
return NodeFilter::FILTER_REJECT;
......
......@@ -71,7 +71,7 @@ void ScheduledAction::execute(JSDOMWindowShell* windowShell)
args.append(m_args[i]);
window->startTimeoutCheck();
static_cast<JSObject*>(func)->call(exec, windowShell, args);
static_cast<JSObject*>(func)->callAsFunction(exec, windowShell, args);
window->stopTimeoutCheck();
if (exec->hadException()) {
JSObject* exception = exec->exception()->toObject(exec);
......
......@@ -89,7 +89,7 @@ void JSAbstractEventListener::handleEvent(Event* ele, bool isWindowEvent)
JSValue* retval;
if (handleEventFunc) {
window->startTimeoutCheck();
retval = handleEventFunc->call(exec, listener, args);
retval = handleEventFunc->callAsFunction(exec, listener, args);
} else {
JSObject* thisObj;
if (isWindowEvent)
......@@ -97,7 +97,7 @@ void JSAbstractEventListener::handleEvent(Event* ele, bool isWindowEvent)
else
thisObj = static_cast<JSObject*>(toJS(exec, event->currentTarget()));
window->startTimeoutCheck();
retval = listener->call(exec, thisObj, args);
retval = listener->callAsFunction(exec, thisObj, args);
}
window->stopTimeoutCheck();
......
......@@ -114,7 +114,7 @@ JSValue* runtimeObjectCallAsFunction(ExecState* exec, JSObject* thisObj, const L
JSObject* runtimeObject = getRuntimeObject(exec, thisImp);
if (!runtimeObject)
return jsUndefined();
return runtimeObject->call(exec, thisObj, args);
return runtimeObject->callAsFunction(exec, thisObj, args);
}
} // namespace WebCore
......@@ -304,7 +304,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
return nil;
[self _rootObject]->globalObject()->startTimeoutCheck();
JSValue *result = funcImp->call(exec, [self _imp], argList);
JSValue *result = funcImp->callAsFunction(exec, [self _imp], argList);
[self _rootObject]->globalObject()->stopTimeoutCheck();
if (exec->hadException()) {
......
......@@ -113,7 +113,7 @@ bool _NPN_InvokeDefault(NPP, NPObject* o, const NPVariant* args, uint32_t argCou
List argList;
getListFromVariantArgs(exec, args, argCount, rootObject, argList);
rootObject->globalObject()->startTimeoutCheck();
JSValue *resultV = funcImp->call (exec, funcImp, argList);
JSValue *resultV = funcImp->callAsFunction(exec, funcImp, argList);
rootObject->globalObject()->stopTimeoutCheck();
// Convert and return the result of the function call.
......@@ -167,7 +167,7 @@ bool _NPN_Invoke(NPP npp, NPObject* o, NPIdentifier methodName, const NPVariant*
List argList;
getListFromVariantArgs(exec, args, argCount, rootObject, argList);
rootObject->globalObject()->startTimeoutCheck();
JSValue *resultV = funcImp->call (exec, thisObj, argList);
JSValue *resultV = funcImp->callAsFunction(exec, thisObj, argList);
rootObject->globalObject()->stopTimeoutCheck();
// Convert and return the result of the function call.
......
......@@ -300,7 +300,7 @@ jobject JavaJSObject::call(jstring methodName, jobjectArray args) const
List argList;
getListFromJArray(args, argList);
rootObject->globalObject()->startTimeoutCheck();
JSValue *result = funcImp->call(exec, thisObj, argList);
JSValue *result = funcImp->callAsFunction(exec, thisObj, argList);
rootObject->globalObject()->stopTimeoutCheck();
return convertValueToJObject(result);
......
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