Commit 99ff3435 authored by barraclough@apple.com's avatar barraclough@apple.com

Bug 40094 - The return type of NativeFunction should be EncodedJSValue

On Windows & Linux, using JSVALUE32_64, EncodedJSValue is returned in registers, but JSValue is not.

Reviewed by Oliver Hunt.

JavaScriptCore: 

* API/JSCallbackFunction.cpp:
(JSC::JSCallbackFunction::call):
* API/JSCallbackFunction.h:
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::::call):
* JavaScriptCore.exp:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::executeCall):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* jit/JITStubs.h:
* jsc.cpp:
(functionPrint):
(functionDebug):
(functionGC):
(functionVersion):
(functionRun):
(functionLoad):
(functionCheckSyntax):
(functionSetSamplingFlags):
(functionClearSamplingFlags):
(functionReadline):
(functionQuit):
* runtime/ArrayConstructor.cpp:
(JSC::callArrayConstructor):
(JSC::arrayConstructorIsArray):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncToLocaleString):
(JSC::arrayProtoFuncJoin):
(JSC::arrayProtoFuncConcat):
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSort):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncFilter):
(JSC::arrayProtoFuncMap):
(JSC::arrayProtoFuncEvery):
(JSC::arrayProtoFuncForEach):
(JSC::arrayProtoFuncSome):
(JSC::arrayProtoFuncReduce):
(JSC::arrayProtoFuncReduceRight):
(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):
* runtime/BooleanConstructor.cpp:
(JSC::callBooleanConstructor):
* runtime/BooleanPrototype.cpp:
(JSC::booleanProtoFuncToString):
(JSC::booleanProtoFuncValueOf):
* runtime/CallData.h:
* runtime/DateConstructor.cpp:
(JSC::callDate):
(JSC::dateParse):
(JSC::dateNow):
(JSC::dateUTC):
* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToString):
(JSC::dateProtoFuncToUTCString):
(JSC::dateProtoFuncToISOString):
(JSC::dateProtoFuncToDateString):
(JSC::dateProtoFuncToTimeString):
(JSC::dateProtoFuncToLocaleString):
(JSC::dateProtoFuncToLocaleDateString):
(JSC::dateProtoFuncToLocaleTimeString):
(JSC::dateProtoFuncGetTime):
(JSC::dateProtoFuncGetFullYear):
(JSC::dateProtoFuncGetUTCFullYear):
(JSC::dateProtoFuncToGMTString):
(JSC::dateProtoFuncGetMonth):
(JSC::dateProtoFuncGetUTCMonth):
(JSC::dateProtoFuncGetDate):
(JSC::dateProtoFuncGetUTCDate):
(JSC::dateProtoFuncGetDay):
(JSC::dateProtoFuncGetUTCDay):
(JSC::dateProtoFuncGetHours):
(JSC::dateProtoFuncGetUTCHours):
(JSC::dateProtoFuncGetMinutes):
(JSC::dateProtoFuncGetUTCMinutes):
(JSC::dateProtoFuncGetSeconds):
(JSC::dateProtoFuncGetUTCSeconds):
(JSC::dateProtoFuncGetMilliSeconds):
(JSC::dateProtoFuncGetUTCMilliseconds):
(JSC::dateProtoFuncGetTimezoneOffset):
(JSC::dateProtoFuncSetTime):
(JSC::dateProtoFuncSetMilliSeconds):
(JSC::dateProtoFuncSetUTCMilliseconds):
(JSC::dateProtoFuncSetSeconds):
(JSC::dateProtoFuncSetUTCSeconds):
(JSC::dateProtoFuncSetMinutes):
(JSC::dateProtoFuncSetUTCMinutes):
(JSC::dateProtoFuncSetHours):
(JSC::dateProtoFuncSetUTCHours):
(JSC::dateProtoFuncSetDate):
(JSC::dateProtoFuncSetUTCDate):
(JSC::dateProtoFuncSetMonth):
(JSC::dateProtoFuncSetUTCMonth):
(JSC::dateProtoFuncSetFullYear):
(JSC::dateProtoFuncSetUTCFullYear):
(JSC::dateProtoFuncSetYear):
(JSC::dateProtoFuncGetYear):
(JSC::dateProtoFuncToJSON):
* runtime/ErrorConstructor.cpp:
(JSC::callErrorConstructor):
* runtime/ErrorPrototype.cpp:
(JSC::errorProtoFuncToString):
* runtime/FunctionConstructor.cpp:
(JSC::callFunctionConstructor):
* runtime/FunctionPrototype.cpp:
(JSC::callFunctionPrototype):
(JSC::functionProtoFuncToString):
(JSC::functionProtoFuncApply):
(JSC::functionProtoFuncCall):
* runtime/JSCell.h:
(JSC::getCallData):
(JSC::getConstructData):
* runtime/JSFunction.cpp:
(JSC::callHostFunctionAsConstructor):
* runtime/JSFunction.h:
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval):
(JSC::globalFuncParseInt):
(JSC::globalFuncParseFloat):
(JSC::globalFuncIsNaN):
(JSC::globalFuncIsFinite):
(JSC::globalFuncDecodeURI):
(JSC::globalFuncDecodeURIComponent):
(JSC::globalFuncEncodeURI):
(JSC::globalFuncEncodeURIComponent):
(JSC::globalFuncEscape):
(JSC::globalFuncUnescape):
(JSC::globalFuncJSCPrint):
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSONObject.cpp:
(JSC::JSONProtoFuncParse):
(JSC::JSONProtoFuncStringify):
* runtime/JSObject.cpp:
(JSC::callDefaultValueFunction):
* runtime/JSValue.h:
* runtime/MathObject.cpp:
(JSC::mathProtoFuncAbs):
(JSC::mathProtoFuncACos):
(JSC::mathProtoFuncASin):
(JSC::mathProtoFuncATan):
(JSC::mathProtoFuncATan2):
(JSC::mathProtoFuncCeil):
(JSC::mathProtoFuncCos):
(JSC::mathProtoFuncExp):
(JSC::mathProtoFuncFloor):
(JSC::mathProtoFuncLog):
(JSC::mathProtoFuncMax):
(JSC::mathProtoFuncMin):
(JSC::mathProtoFuncPow):
(JSC::mathProtoFuncRandom):
(JSC::mathProtoFuncRound):
(JSC::mathProtoFuncSin):
(JSC::mathProtoFuncSqrt):
(JSC::mathProtoFuncTan):
* runtime/NativeErrorConstructor.cpp:
(JSC::callNativeErrorConstructor):
* runtime/NumberConstructor.cpp:
(JSC::callNumberConstructor):
* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncToString):
(JSC::numberProtoFuncToLocaleString):
(JSC::numberProtoFuncValueOf):
(JSC::numberProtoFuncToFixed):
(JSC::numberProtoFuncToExponential):
(JSC::numberProtoFuncToPrecision):
* runtime/ObjectConstructor.cpp:
(JSC::callObjectConstructor):
(JSC::objectConstructorGetPrototypeOf):
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyNames):
(JSC::objectConstructorKeys):
(JSC::toPropertyDescriptor):
(JSC::objectConstructorDefineProperty):
(JSC::objectConstructorDefineProperties):
(JSC::objectConstructorCreate):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncValueOf):
(JSC::objectProtoFuncHasOwnProperty):
(JSC::objectProtoFuncIsPrototypeOf):
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
(JSC::objectProtoFuncLookupGetter):
(JSC::objectProtoFuncLookupSetter):
(JSC::objectProtoFuncPropertyIsEnumerable):
(JSC::objectProtoFuncToLocaleString):
(JSC::objectProtoFuncToString):
* runtime/ObjectPrototype.h:
* runtime/RegExpConstructor.cpp:
(JSC::callRegExpConstructor):
* runtime/RegExpObject.cpp:
(JSC::callRegExpObject):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncTest):
(JSC::regExpProtoFuncExec):
(JSC::regExpProtoFuncCompile):
(JSC::regExpProtoFuncToString):
* runtime/StringConstructor.cpp:
(JSC::stringFromCharCode):
(JSC::callStringConstructor):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncReplace):
(JSC::stringProtoFuncToString):
(JSC::stringProtoFuncCharAt):
(JSC::stringProtoFuncCharCodeAt):
(JSC::stringProtoFuncConcat):
(JSC::stringProtoFuncIndexOf):
(JSC::stringProtoFuncLastIndexOf):
(JSC::stringProtoFuncMatch):
(JSC::stringProtoFuncSearch):
(JSC::stringProtoFuncSlice):
(JSC::stringProtoFuncSplit):
(JSC::stringProtoFuncSubstr):
(JSC::stringProtoFuncSubstring):
(JSC::stringProtoFuncToLowerCase):
(JSC::stringProtoFuncToUpperCase):
(JSC::stringProtoFuncLocaleCompare):
(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):
(JSC::stringProtoFuncLink):
(JSC::stringProtoFuncTrim):
(JSC::stringProtoFuncTrimLeft):
(JSC::stringProtoFuncTrimRight):

JavaScriptGlue: 

* JSObject.cpp:
(nativeCallFunction):

WebCore: 

* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::callHTMLCollection):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::open):
* bindings/js/JSInjectedScriptHostCustom.cpp:
(WebCore::InjectedScriptHost::createInjectedScript):
* bindings/js/JSNodeFilterCondition.cpp:
(WebCore::JSNodeFilterCondition::acceptNode):
* bindings/js/JSNodeListCustom.cpp:
(WebCore::callNodeList):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::callPlugin):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScriptFunctionCall.cpp:
(WebCore::ScriptFunctionCall::call):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializingTreeWalker::convertIfTerminal):
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject callWebScriptMethod:withArguments:]):
* bindings/scripts/CodeGeneratorJS.pm:
* bridge/NP_jsobject.cpp:
(_NPN_InvokeDefault):
(_NPN_Invoke):
(_NPN_Construct):
* bridge/jni/jni_jsobject.mm:
(JavaJSObject::call):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::callObjCFallbackObject):
* bridge/runtime_method.cpp:
(JSC::callRuntimeMethod):
* bridge/runtime_object.cpp:
(JSC::Bindings::callRuntimeObject):

WebKit/mac: 

* Plugins/Hosted/NetscapePluginInstanceProxy.h:
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::invoke):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5ec1d33a
......@@ -47,7 +47,7 @@ JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSGlobalObject* globalOb
{
}
JSValue JSCallbackFunction::call(ExecState* exec)
EncodedJSValue JSCallbackFunction::call(ExecState* exec)
{
JSContextRef execRef = toRef(exec);
JSObjectRef functionRef = toRef(exec->callee());
......@@ -67,7 +67,7 @@ JSValue JSCallbackFunction::call(ExecState* exec)
if (exception)
exec->setException(toJS(exec, exception));
return toJS(exec, result);
return JSValue::encode(toJS(exec, result));
}
CallType JSCallbackFunction::getCallData(CallData& callData)
......
......@@ -48,7 +48,7 @@ private:
virtual CallType getCallData(CallData&);
virtual const ClassInfo* classInfo() const { return &info; }
static JSValue JSC_HOST_CALL call(ExecState*);
static EncodedJSValue JSC_HOST_CALL call(ExecState*);
JSObjectCallAsFunctionCallback m_callback;
};
......
......@@ -182,7 +182,7 @@ private:
static JSCallbackObject* asCallbackObject(JSValue);
static JSValue JSC_HOST_CALL call(ExecState*);
static EncodedJSValue JSC_HOST_CALL call(ExecState*);
static JSObject* construct(ExecState*, JSObject* constructor, const ArgList&);
static JSValue staticValueGetter(ExecState*, JSValue, const Identifier&);
......
......@@ -371,7 +371,7 @@ CallType JSCallbackObject<Base>::getCallData(CallData& callData)
}
template <class Base>
JSValue JSCallbackObject<Base>::call(ExecState* exec)
EncodedJSValue JSCallbackObject<Base>::call(ExecState* exec)
{
JSContextRef execRef = toRef(exec);
JSObjectRef functionRef = toRef(exec->callee());
......@@ -391,12 +391,12 @@ JSValue JSCallbackObject<Base>::call(ExecState* exec)
}
if (exception)
exec->setException(toJS(exec, exception));
return result;
return JSValue::encode(result);
}
}
ASSERT_NOT_REACHED(); // getCallData should prevent us from reaching here
return JSValue();
return JSValue::encode(JSValue());
}
template <class Base>
......
2010-06-02 Gavin Barraclough <barraclough@apple.com>
Reviewed by Oliver Hunt.
Bug 40094 - The return type of NativeFunction should be EncodedJSValue
On Windows & Linux, using JSVALUE32_64, EncodedJSValue is returned in registers, but JSValue is not.
* API/JSCallbackFunction.cpp:
(JSC::JSCallbackFunction::call):
* API/JSCallbackFunction.h:
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::::call):
* JavaScriptCore.exp:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::executeCall):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* jit/JITStubs.h:
* jsc.cpp:
(functionPrint):
(functionDebug):
(functionGC):
(functionVersion):
(functionRun):
(functionLoad):
(functionCheckSyntax):
(functionSetSamplingFlags):
(functionClearSamplingFlags):
(functionReadline):
(functionQuit):
* runtime/ArrayConstructor.cpp:
(JSC::callArrayConstructor):
(JSC::arrayConstructorIsArray):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncToLocaleString):
(JSC::arrayProtoFuncJoin):
(JSC::arrayProtoFuncConcat):
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSort):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncFilter):
(JSC::arrayProtoFuncMap):
(JSC::arrayProtoFuncEvery):
(JSC::arrayProtoFuncForEach):
(JSC::arrayProtoFuncSome):
(JSC::arrayProtoFuncReduce):
(JSC::arrayProtoFuncReduceRight):
(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):
* runtime/BooleanConstructor.cpp:
(JSC::callBooleanConstructor):
* runtime/BooleanPrototype.cpp:
(JSC::booleanProtoFuncToString):
(JSC::booleanProtoFuncValueOf):
* runtime/CallData.h:
* runtime/DateConstructor.cpp:
(JSC::callDate):
(JSC::dateParse):
(JSC::dateNow):
(JSC::dateUTC):
* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToString):
(JSC::dateProtoFuncToUTCString):
(JSC::dateProtoFuncToISOString):
(JSC::dateProtoFuncToDateString):
(JSC::dateProtoFuncToTimeString):
(JSC::dateProtoFuncToLocaleString):
(JSC::dateProtoFuncToLocaleDateString):
(JSC::dateProtoFuncToLocaleTimeString):
(JSC::dateProtoFuncGetTime):
(JSC::dateProtoFuncGetFullYear):
(JSC::dateProtoFuncGetUTCFullYear):
(JSC::dateProtoFuncToGMTString):
(JSC::dateProtoFuncGetMonth):
(JSC::dateProtoFuncGetUTCMonth):
(JSC::dateProtoFuncGetDate):
(JSC::dateProtoFuncGetUTCDate):
(JSC::dateProtoFuncGetDay):
(JSC::dateProtoFuncGetUTCDay):
(JSC::dateProtoFuncGetHours):
(JSC::dateProtoFuncGetUTCHours):
(JSC::dateProtoFuncGetMinutes):
(JSC::dateProtoFuncGetUTCMinutes):
(JSC::dateProtoFuncGetSeconds):
(JSC::dateProtoFuncGetUTCSeconds):
(JSC::dateProtoFuncGetMilliSeconds):
(JSC::dateProtoFuncGetUTCMilliseconds):
(JSC::dateProtoFuncGetTimezoneOffset):
(JSC::dateProtoFuncSetTime):
(JSC::dateProtoFuncSetMilliSeconds):
(JSC::dateProtoFuncSetUTCMilliseconds):
(JSC::dateProtoFuncSetSeconds):
(JSC::dateProtoFuncSetUTCSeconds):
(JSC::dateProtoFuncSetMinutes):
(JSC::dateProtoFuncSetUTCMinutes):
(JSC::dateProtoFuncSetHours):
(JSC::dateProtoFuncSetUTCHours):
(JSC::dateProtoFuncSetDate):
(JSC::dateProtoFuncSetUTCDate):
(JSC::dateProtoFuncSetMonth):
(JSC::dateProtoFuncSetUTCMonth):
(JSC::dateProtoFuncSetFullYear):
(JSC::dateProtoFuncSetUTCFullYear):
(JSC::dateProtoFuncSetYear):
(JSC::dateProtoFuncGetYear):
(JSC::dateProtoFuncToJSON):
* runtime/ErrorConstructor.cpp:
(JSC::callErrorConstructor):
* runtime/ErrorPrototype.cpp:
(JSC::errorProtoFuncToString):
* runtime/FunctionConstructor.cpp:
(JSC::callFunctionConstructor):
* runtime/FunctionPrototype.cpp:
(JSC::callFunctionPrototype):
(JSC::functionProtoFuncToString):
(JSC::functionProtoFuncApply):
(JSC::functionProtoFuncCall):
* runtime/JSCell.h:
(JSC::getCallData):
(JSC::getConstructData):
* runtime/JSFunction.cpp:
(JSC::callHostFunctionAsConstructor):
* runtime/JSFunction.h:
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval):
(JSC::globalFuncParseInt):
(JSC::globalFuncParseFloat):
(JSC::globalFuncIsNaN):
(JSC::globalFuncIsFinite):
(JSC::globalFuncDecodeURI):
(JSC::globalFuncDecodeURIComponent):
(JSC::globalFuncEncodeURI):
(JSC::globalFuncEncodeURIComponent):
(JSC::globalFuncEscape):
(JSC::globalFuncUnescape):
(JSC::globalFuncJSCPrint):
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSONObject.cpp:
(JSC::JSONProtoFuncParse):
(JSC::JSONProtoFuncStringify):
* runtime/JSObject.cpp:
(JSC::callDefaultValueFunction):
* runtime/JSValue.h:
* runtime/MathObject.cpp:
(JSC::mathProtoFuncAbs):
(JSC::mathProtoFuncACos):
(JSC::mathProtoFuncASin):
(JSC::mathProtoFuncATan):
(JSC::mathProtoFuncATan2):
(JSC::mathProtoFuncCeil):
(JSC::mathProtoFuncCos):
(JSC::mathProtoFuncExp):
(JSC::mathProtoFuncFloor):
(JSC::mathProtoFuncLog):
(JSC::mathProtoFuncMax):
(JSC::mathProtoFuncMin):
(JSC::mathProtoFuncPow):
(JSC::mathProtoFuncRandom):
(JSC::mathProtoFuncRound):
(JSC::mathProtoFuncSin):
(JSC::mathProtoFuncSqrt):
(JSC::mathProtoFuncTan):
* runtime/NativeErrorConstructor.cpp:
(JSC::callNativeErrorConstructor):
* runtime/NumberConstructor.cpp:
(JSC::callNumberConstructor):
* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncToString):
(JSC::numberProtoFuncToLocaleString):
(JSC::numberProtoFuncValueOf):
(JSC::numberProtoFuncToFixed):
(JSC::numberProtoFuncToExponential):
(JSC::numberProtoFuncToPrecision):
* runtime/ObjectConstructor.cpp:
(JSC::callObjectConstructor):
(JSC::objectConstructorGetPrototypeOf):
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyNames):
(JSC::objectConstructorKeys):
(JSC::toPropertyDescriptor):
(JSC::objectConstructorDefineProperty):
(JSC::objectConstructorDefineProperties):
(JSC::objectConstructorCreate):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncValueOf):
(JSC::objectProtoFuncHasOwnProperty):
(JSC::objectProtoFuncIsPrototypeOf):
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
(JSC::objectProtoFuncLookupGetter):
(JSC::objectProtoFuncLookupSetter):
(JSC::objectProtoFuncPropertyIsEnumerable):
(JSC::objectProtoFuncToLocaleString):
(JSC::objectProtoFuncToString):
* runtime/ObjectPrototype.h:
* runtime/RegExpConstructor.cpp:
(JSC::callRegExpConstructor):
* runtime/RegExpObject.cpp:
(JSC::callRegExpObject):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncTest):
(JSC::regExpProtoFuncExec):
(JSC::regExpProtoFuncCompile):
(JSC::regExpProtoFuncToString):
* runtime/StringConstructor.cpp:
(JSC::stringFromCharCode):
(JSC::callStringConstructor):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncReplace):
(JSC::stringProtoFuncToString):
(JSC::stringProtoFuncCharAt):
(JSC::stringProtoFuncCharCodeAt):
(JSC::stringProtoFuncConcat):
(JSC::stringProtoFuncIndexOf):
(JSC::stringProtoFuncLastIndexOf):
(JSC::stringProtoFuncMatch):
(JSC::stringProtoFuncSearch):
(JSC::stringProtoFuncSlice):
(JSC::stringProtoFuncSplit):
(JSC::stringProtoFuncSubstr):
(JSC::stringProtoFuncSubstring):
(JSC::stringProtoFuncToLowerCase):
(JSC::stringProtoFuncToUpperCase):
(JSC::stringProtoFuncLocaleCompare):
(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):
(JSC::stringProtoFuncLink):
(JSC::stringProtoFuncTrim):
(JSC::stringProtoFuncTrimLeft):
(JSC::stringProtoFuncTrimRight):
2010-06-02 Mark Rowe <mrowe@apple.com>
Reviewed by Gavin Barraclough.
......
__ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFxS2_E
__ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFPvS2_E
__ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFPvS2_E
......@@ -109,7 +109,6 @@ __ZN3JSC10Identifier4fromEPNS_9ExecStateEj
__ZN3JSC10Identifier5equalEPKN7WebCore10StringImplEPKc
__ZN3JSC10JSFunction4infoE
__ZN3JSC10JSFunction4nameEPNS_9ExecStateE
__ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFNS_7JSValueES2_E
__ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeE
__ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeEPKc
__ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeERKNS_7UStringE
......@@ -174,7 +173,6 @@ __ZN3JSC16JSVariableObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNam
__ZN3JSC16toUInt32SlowCaseEdRb
__ZN3JSC17BytecodeGenerator21setDumpsGeneratedCodeEb
__ZN3JSC17PropertyNameArray3addEPN7WebCore10StringImplE
__ZN3JSC17PrototypeFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFNS_7JSValueES2_E
__ZN3JSC17constructFunctionEPNS_9ExecStateERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
__ZN3JSC18DebuggerActivationC1EPNS_8JSObjectE
__ZN3JSC18PropertyDescriptor11setWritableEb
......
......@@ -203,6 +203,9 @@
86565742115BE3DA00291F40 /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86565740115BE3DA00291F40 /* CString.cpp */; };
86565743115BE3DA00291F40 /* CString.h in Headers */ = {isa = PBXBuildFile; fileRef = 86565741115BE3DA00291F40 /* CString.h */; settings = {ATTRIBUTES = (Private, ); }; };
865F408810E7D56300947361 /* APIShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 865F408710E7D56300947361 /* APIShims.h */; };
867FC36211B763950025105E /* JavaScriptCore.JSVALUE32_64only.exp in Sources */ = {isa = PBXBuildFile; fileRef = 867FC35F11B763950025105E /* JavaScriptCore.JSVALUE32_64only.exp */; };
867FC36311B763950025105E /* JavaScriptCore.JSVALUE32only.exp in Sources */ = {isa = PBXBuildFile; fileRef = 867FC36011B763950025105E /* JavaScriptCore.JSVALUE32only.exp */; };
867FC36411B763950025105E /* JavaScriptCore.JSVALUE64only.exp in Sources */ = {isa = PBXBuildFile; fileRef = 867FC36111B763950025105E /* JavaScriptCore.JSVALUE64only.exp */; };
868BFA08117CEFD100B908B1 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA00117CEFD100B908B1 /* AtomicString.cpp */; };
868BFA09117CEFD100B908B1 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA01117CEFD100B908B1 /* AtomicString.h */; settings = {ATTRIBUTES = (Private, ); }; };
868BFA0A117CEFD100B908B1 /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -766,6 +769,9 @@
86565740115BE3DA00291F40 /* CString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CString.cpp; path = text/CString.cpp; sourceTree = "<group>"; };
86565741115BE3DA00291F40 /* CString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CString.h; path = text/CString.h; sourceTree = "<group>"; };
865F408710E7D56300947361 /* APIShims.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIShims.h; sourceTree = "<group>"; };
867FC35F11B763950025105E /* JavaScriptCore.JSVALUE32_64only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE32_64only.exp; sourceTree = "<group>"; };
867FC36011B763950025105E /* JavaScriptCore.JSVALUE32only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE32only.exp; sourceTree = "<group>"; };
867FC36111B763950025105E /* JavaScriptCore.JSVALUE64only.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = JavaScriptCore.JSVALUE64only.exp; sourceTree = "<group>"; };
868BFA00117CEFD100B908B1 /* AtomicString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtomicString.cpp; path = text/AtomicString.cpp; sourceTree = "<group>"; };
868BFA01117CEFD100B908B1 /* AtomicString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicString.h; path = text/AtomicString.h; sourceTree = "<group>"; };
868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicStringImpl.h; path = text/AtomicStringImpl.h; sourceTree = "<group>"; };
......@@ -1162,6 +1168,9 @@
937B63CC09E766D200A671DD /* DerivedSources.make */,
F692A8540255597D01FF60F7 /* create_hash_table */,
14B8ECA60A5653980062BE54 /* JavaScriptCore.exp */,
867FC36011B763950025105E /* JavaScriptCore.JSVALUE32only.exp */,
867FC35F11B763950025105E /* JavaScriptCore.JSVALUE32_64only.exp */,
867FC36111B763950025105E /* JavaScriptCore.JSVALUE64only.exp */,
F5C290E60284F98E018635CA /* JavaScriptCorePrefix.h */,
45E12D8806A49B0F00E9DF84 /* jsc.cpp */,
F68EBB8C0255D4C601FF60F7 /* config.h */,
......@@ -2599,6 +2608,9 @@
146FE51211A710430087AE66 /* JITCall32_64.cpp in Sources */,
A783A2AB11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp in Sources */,
BC01D4F111A8F1FF00A54B2A /* JSZombie.cpp in Sources */,
867FC36211B763950025105E /* JavaScriptCore.JSVALUE32_64only.exp in Sources */,
867FC36311B763950025105E /* JavaScriptCore.JSVALUE32only.exp in Sources */,
867FC36411B763950025105E /* JavaScriptCore.JSVALUE64only.exp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -785,7 +785,7 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT
JSValue result;
{
SamplingTool::HostCallRecord callRecord(m_sampler.get());
result = callData.native.function(newCallFrame);
result = JSValue::decode(callData.native.function(newCallFrame));
}
if (*profiler)
......
......@@ -2031,7 +2031,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_call_NotJSFunction)
JSValue funcVal = stackFrame.args[0].jsValue();
CallData callData;
CallType callType = funcVal.getCallData(callData);
CallType callType = getCallData(funcVal, callData);
ASSERT(callType != CallTypeJS);
......@@ -2044,7 +2044,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_call_NotJSFunction)
callFrame->init(0, static_cast<Instruction*>((STUB_RETURN_ADDRESS).value()), previousCallFrame->scopeChain(), previousCallFrame, argCount, asObject(funcVal));
stackFrame.callFrame = callFrame;
JSValue returnValue;
EncodedJSValue returnValue;
{
SamplingTool::HostCallRecord callRecord(CTI_SAMPLER);
returnValue = callData.native.function(callFrame);
......@@ -2052,7 +2052,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_call_NotJSFunction)
stackFrame.callFrame = previousCallFrame;
CHECK_FOR_EXCEPTION();
return JSValue::encode(returnValue);
return returnValue;
}
ASSERT(callType == CallTypeNone);
......@@ -2169,7 +2169,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_construct_NotJSConstruct)
int argCount = stackFrame.args[2].int32();
ConstructData constructData;
ConstructType constructType = constrVal.getConstructData(constructData);
ConstructType constructType = getConstructData(constrVal, constructData);
if (constructType == ConstructTypeHost) {
int registerOffset = stackFrame.args[1].int32();
......
......@@ -29,6 +29,7 @@
#ifndef JITStubs_h
#define JITStubs_h
#include "CallData.h"
#include "MacroAssemblerCodeRef.h"
#include "Register.h"
#include "ThunkGenerators.h"
......
......@@ -71,19 +71,19 @@ using namespace WTF;
static void cleanupGlobalData(JSGlobalData*);
static bool fillBufferWithContentsOfFile(const UString& fileName, Vector<char>& buffer);
static JSValue JSC_HOST_CALL functionPrint(ExecState*);
static JSValue JSC_HOST_CALL functionDebug(ExecState*);
static JSValue JSC_HOST_CALL functionGC(ExecState*);
static JSValue JSC_HOST_CALL functionVersion(ExecState*);
static JSValue JSC_HOST_CALL functionRun(ExecState*);
static JSValue JSC_HOST_CALL functionLoad(ExecState*);
static JSValue JSC_HOST_CALL functionCheckSyntax(ExecState*);
static JSValue JSC_HOST_CALL functionReadline(ExecState*);
static NO_RETURN_WITH_VALUE JSValue JSC_HOST_CALL functionQuit(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionPrint(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionDebug(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionGC(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionVersion(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionRun(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionLoad(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionCheckSyntax(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionReadline(ExecState*);
static NO_RETURN_WITH_VALUE EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*);
#if ENABLE(SAMPLING_FLAGS)
static JSValue JSC_HOST_CALL functionSetSamplingFlags(ExecState*);
static JSValue JSC_HOST_CALL functionClearSamplingFlags(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionSetSamplingFlags(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionClearSamplingFlags(ExecState*);
#endif
struct Script {
......@@ -171,7 +171,7 @@ GlobalObject::GlobalObject(const Vector<UString>& arguments)
putDirect(Identifier(globalExec(), "arguments"), array);
}
JSValue JSC_HOST_CALL functionPrint(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionPrint(ExecState* exec)
{
for (unsigned i = 0; i < exec->argumentCount(); ++i) {
if (i)
......@@ -182,36 +182,36 @@ JSValue JSC_HOST_CALL functionPrint(ExecState* exec)
putchar('\n');
fflush(stdout);
return jsUndefined();
return JSValue::encode(jsUndefined());
}
JSValue JSC_HOST_CALL functionDebug(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionDebug(ExecState* exec)
{
fprintf(stderr, "--> %s\n", exec->argument(0).toString(exec).UTF8String().data());
return jsUndefined();
return JSValue::encode(jsUndefined());
}
JSValue JSC_HOST_CALL functionGC(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionGC(ExecState* exec)
{
JSLock lock(SilenceAssertionsOnly);
exec->heap()->collectAllGarbage();
return jsUndefined();
return JSValue::encode(jsUndefined());
}
JSValue JSC_HOST_CALL functionVersion(ExecState*)
EncodedJSValue JSC_HOST_CALL functionVersion(ExecState*)
{
// We need this function for compatibility with the Mozilla JS tests but for now
// we don't actually do any version-specific handling
return jsUndefined();
return JSValue::encode(jsUndefined());
}
JSValue JSC_HOST_CALL functionRun(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionRun(ExecState* exec)
{
StopWatch stopWatch;
UString fileName = exec->argument(0).toString(exec);
Vector<char> script;
if (!fillBufferWithContentsOfFile(fileName, script))
return throwError(exec, GeneralError, "Could not open file.");
return JSValue::encode(throwError(exec, GeneralError, "Could not open file."));
JSGlobalObject* globalObject = exec->lexicalGlobalObject();
......@@ -219,60 +219,60 @@ JSValue JSC_HOST_CALL functionRun(ExecState* exec)
evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script.data(), fileName));
stopWatch.stop();
return jsNumber(globalObject->globalExec(), stopWatch.getElapsedMS());
return JSValue::encode(jsNumber(globalObject->globalExec(), stopWatch.getElapsedMS()));
}
JSValue JSC_HOST_CALL functionLoad(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionLoad(ExecState* exec)
{
UString fileName = exec->argument(0).toString(exec);
Vector<char> script;
if (!fillBufferWithContentsOfFile(fileName, script))
return throwError(exec, GeneralError, "Could not open file.");
return JSValue::encode(throwError(exec, GeneralError, "Could not open file."));
JSGlobalObject* globalObject = exec->lexicalGlobalObject();
Completion result = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script.data(), fileName));
if (result.complType() == Throw)
exec->setException(result.value());
return result.value();
return JSValue::encode(result.value());
}
JSValue JSC_HOST_CALL functionCheckSyntax(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionCheckSyntax(ExecState* exec)
{
UString fileName = exec->argument(0).toString(exec);
Vector<char> script;
if (!fillBufferWithContentsOfFile(fileName, script))
return throwError(exec, GeneralError, "Could not open file.");
return JSValue::encode(throwError(exec, GeneralError, "Could not open file."));
JSGlobalObject* globalObject = exec->lexicalGlobalObject();
Completion result = checkSyntax(globalObject->globalExec(), makeSource(script.data(), fileName));
if (result.complType() == Throw)
exec->setException(result.value());
return result.value();
return JSValue::encode(result.value());
}
#if ENABLE(SAMPLING_FLAGS)
JSValue JSC_HOST_CALL functionSetSamplingFlags(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionSetSamplingFlags(ExecState* exec)
{
for (unsigned i = 0; i < exec->argumentCount(); ++i) {
unsigned flag = static_cast<unsigned>(exec->argument(i).toNumber(exec));
if ((flag >= 1) && (flag <= 32))
SamplingFlags::setFlag(flag);
}
return jsNull();
return JSValue::encode(jsNull());
}
JSValue JSC_HOST_CALL functionClearSamplingFlags(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionClearSamplingFlags(ExecState* exec)
{
for (unsigned i = 0; i < exec->argumentCount(); ++i) {
unsigned flag = static_cast<unsigned>(exec->argument(i).toNumber(exec));
if ((flag >= 1) && (flag <= 32))
SamplingFlags::clearFlag(flag);
}
return jsNull();
return JSValue::encode(jsNull());
}
#endif
JSValue JSC_HOST_CALL functionReadline(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionReadline(ExecState* exec)
{
Vector<char, 256> line;
int c;
......@@ -283,10 +283,10 @@ JSValue JSC_HOST_CALL functionReadline(ExecState* exec)
line.append(c);
}
line.append('\0');
return jsString(exec, line.data());
return JSValue::encode(jsString(exec, line.data()));
}
JSValue JSC_HOST_CALL functionQuit(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionQuit(ExecState* exec)
{
// Technically, destroying the heap in the middle of JS execution is a no-no,
// but we want to maintain compatibility with the Mozilla test suite, so
......@@ -298,7 +298,7 @@ JSValue JSC_HOST_CALL functionQuit(ExecState* exec)
#if COMPILER(MSVC) && OS(WINCE)
// Without this, Visual Studio will complain that this method does not return a value.
return jsUndefined();
return JSValue::encode(jsUndefined());
#endif
}
......
......@@ -35,7 +35,7 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor);
static JSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*);
static EncodedJSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*);
ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, ArrayPrototype* arrayPrototype, Structure* prototypeFunctionStructure)
: InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, arrayPrototype->classInfo()->className))
......@@ -76,10 +76,10 @@ ConstructType ArrayConstructor::getConstructData(ConstructData& constructData)
return ConstructTypeHost;
}
static JSValue JSC_HOST_CALL callArrayConstructor(ExecState* exec)
static EncodedJSValue JSC_HOST_CALL callArrayConstructor(ExecState* exec)
{
ArgList args(exec);
return constructArrayWithSizeQuirk(exec, args);
return JSValue::encode(constructArrayWithSizeQuirk(exec, args));
}
// ECMA 15.6.1
......@@ -90,9 +90,9 @@ CallType ArrayConstructor::getCallData(CallData& callData)
return CallTypeHost;
}
JSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState* exec)
EncodedJSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState* exec)
{
return jsBoolean(exec->argument(0).inherits(