mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 459266 - TM: Allow CALLINFO macros to specify linkage. r=brendan.
This commit is contained in:
parent
b99d012978
commit
e0b7bce037
@ -43,6 +43,9 @@
|
||||
*
|
||||
* The macro arguments are:
|
||||
*
|
||||
* - 'extern' to indicate extern linkage for these functions and the associated
|
||||
* CallInfo.
|
||||
*
|
||||
* - The return type. This identifier must name one of the _JS_TYPEINFO_*
|
||||
* macros defined in jsbuiltins.h.
|
||||
*
|
||||
@ -63,31 +66,31 @@
|
||||
* Do not use bool FASTCALL, use JSBool only!
|
||||
*/
|
||||
|
||||
BUILTIN2(JSVAL, BoxDouble, CONTEXT, DOUBLE, 1, 1)
|
||||
BUILTIN2(JSVAL, BoxInt32, CONTEXT, INT32, 1, 1)
|
||||
BUILTIN1(DOUBLE, UnboxDouble, JSVAL, 1, 1)
|
||||
BUILTIN1(INT32, UnboxInt32, JSVAL, 1, 1)
|
||||
BUILTIN2(DOUBLE, dmod, DOUBLE, DOUBLE, 1, 1)
|
||||
BUILTIN2(INT32, imod, INT32, INT32, 1, 1)
|
||||
BUILTIN1(INT32, DoubleToInt32, DOUBLE, 1, 1)
|
||||
BUILTIN1(UINT32, DoubleToUint32, DOUBLE, 1, 1)
|
||||
BUILTIN2(extern, JSVAL, js_BoxDouble, CONTEXT, DOUBLE, 1, 1)
|
||||
BUILTIN2(extern, JSVAL, js_BoxInt32, CONTEXT, INT32, 1, 1)
|
||||
BUILTIN1(extern, DOUBLE, js_UnboxDouble, JSVAL, 1, 1)
|
||||
BUILTIN1(extern, INT32, js_UnboxInt32, JSVAL, 1, 1)
|
||||
BUILTIN2(extern, DOUBLE, js_dmod, DOUBLE, DOUBLE, 1, 1)
|
||||
BUILTIN2(extern, INT32, js_imod, INT32, INT32, 1, 1)
|
||||
BUILTIN1(extern, INT32, js_DoubleToInt32, DOUBLE, 1, 1)
|
||||
BUILTIN1(extern, UINT32, js_DoubleToUint32, DOUBLE, 1, 1)
|
||||
|
||||
BUILTIN2(DOUBLE, StringToNumber, CONTEXT, STRING, 1, 1)
|
||||
BUILTIN2(INT32, StringToInt32, CONTEXT, STRING, 1, 1)
|
||||
BUILTIN3(JSVAL, Any_getprop, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
BUILTIN4(BOOL, Any_setprop, CONTEXT, OBJECT, STRING, JSVAL, 0, 0)
|
||||
BUILTIN3(JSVAL, Any_getelem, CONTEXT, OBJECT, UINT32, 0, 0)
|
||||
BUILTIN4(BOOL, Any_setelem, CONTEXT, OBJECT, UINT32, JSVAL, 0, 0)
|
||||
BUILTIN3(OBJECT, FastValueToIterator, CONTEXT, UINT32, JSVAL, 0, 0)
|
||||
BUILTIN2(JSVAL, FastCallIteratorNext, CONTEXT, OBJECT, 0, 0)
|
||||
BUILTIN2(BOOL, CloseIterator, CONTEXT, JSVAL, 0, 0)
|
||||
BUILTIN2(GUARDRECORD, CallTree, INTERPSTATE, FRAGMENT, 0, 0)
|
||||
BUILTIN2(OBJECT, FastNewObject, CONTEXT, OBJECT, 0, 0)
|
||||
BUILTIN3(BOOL, AddProperty, CONTEXT, OBJECT, SCOPEPROP, 0, 0)
|
||||
BUILTIN3(BOOL, HasNamedProperty, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
BUILTIN3(JSVAL, CallGetter, CONTEXT, OBJECT, SCOPEPROP, 0, 0)
|
||||
BUILTIN2(STRING, TypeOfObject, CONTEXT, OBJECT, 1, 1)
|
||||
BUILTIN2(STRING, TypeOfBoolean, CONTEXT, INT32, 1, 1)
|
||||
BUILTIN2(DOUBLE, BooleanToNumber, CONTEXT, INT32, 1, 1)
|
||||
BUILTIN2(STRING, ObjectToString, CONTEXT, OBJECT, 0, 0)
|
||||
BUILTIN1(OBJECT, Arguments, CONTEXT, 0, 0)
|
||||
BUILTIN2(extern, DOUBLE, js_StringToNumber, CONTEXT, STRING, 1, 1)
|
||||
BUILTIN2(extern, INT32, js_StringToInt32, CONTEXT, STRING, 1, 1)
|
||||
BUILTIN3(extern, JSVAL, js_Any_getprop, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
BUILTIN4(extern, BOOL, js_Any_setprop, CONTEXT, OBJECT, STRING, JSVAL, 0, 0)
|
||||
BUILTIN3(extern, JSVAL, js_Any_getelem, CONTEXT, OBJECT, UINT32, 0, 0)
|
||||
BUILTIN4(extern, BOOL, js_Any_setelem, CONTEXT, OBJECT, UINT32, JSVAL, 0, 0)
|
||||
BUILTIN3(extern, OBJECT, js_FastValueToIterator, CONTEXT, UINT32, JSVAL, 0, 0)
|
||||
BUILTIN2(extern, JSVAL, js_FastCallIteratorNext, CONTEXT, OBJECT, 0, 0)
|
||||
BUILTIN2(extern, BOOL, js_CloseIterator, CONTEXT, JSVAL, 0, 0)
|
||||
BUILTIN2(extern, GUARDRECORD, js_CallTree, INTERPSTATE, FRAGMENT, 0, 0)
|
||||
BUILTIN2(extern, OBJECT, js_FastNewObject, CONTEXT, OBJECT, 0, 0)
|
||||
BUILTIN3(extern, BOOL, js_AddProperty, CONTEXT, OBJECT, SCOPEPROP, 0, 0)
|
||||
BUILTIN3(extern, BOOL, js_HasNamedProperty, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
BUILTIN3(extern, JSVAL, js_CallGetter, CONTEXT, OBJECT, SCOPEPROP, 0, 0)
|
||||
BUILTIN2(extern, STRING, js_TypeOfObject, CONTEXT, OBJECT, 1, 1)
|
||||
BUILTIN2(extern, STRING, js_TypeOfBoolean, CONTEXT, INT32, 1, 1)
|
||||
BUILTIN2(extern, DOUBLE, js_BooleanToNumber, CONTEXT, INT32, 1, 1)
|
||||
BUILTIN2(extern, STRING, js_ObjectToString, CONTEXT, OBJECT, 0, 0)
|
||||
BUILTIN1(extern, OBJECT, js_Arguments, CONTEXT, 0, 0)
|
||||
|
@ -1538,8 +1538,8 @@ InitArrayObject(JSContext *cx, JSObject *obj, jsuint length, jsval *vector,
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
JSString* FASTCALL
|
||||
js_Array_p_join(JSContext* cx, JSObject* obj, JSString *str)
|
||||
static JSString* FASTCALL
|
||||
Array_p_join(JSContext* cx, JSObject* obj, JSString *str)
|
||||
{
|
||||
jsval v;
|
||||
if (!array_join_sub(cx, obj, TO_STRING, str, &v))
|
||||
@ -2126,8 +2126,8 @@ array_push1_dense(JSContext* cx, JSObject* obj, jsval v, jsval *rval)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
jsval FASTCALL
|
||||
js_Array_p_push1(JSContext* cx, JSObject* obj, jsval v)
|
||||
static jsval FASTCALL
|
||||
Array_p_push1(JSContext* cx, JSObject* obj, jsval v)
|
||||
{
|
||||
if (OBJ_IS_DENSE_ARRAY(cx, obj)
|
||||
? array_push1_dense(cx, obj, v, &v)
|
||||
@ -2197,8 +2197,8 @@ array_pop_dense(JSContext *cx, JSObject* obj, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
jsval FASTCALL
|
||||
js_Array_p_pop(JSContext* cx, JSObject* obj)
|
||||
static jsval FASTCALL
|
||||
Array_p_pop(JSContext* cx, JSObject* obj)
|
||||
{
|
||||
jsval v;
|
||||
if (OBJ_IS_DENSE_ARRAY(cx, obj)
|
||||
@ -2969,18 +2969,18 @@ static JSPropertySpec array_props[] = {
|
||||
|
||||
#ifdef JS_TRACER
|
||||
|
||||
JS_DEFINE_CALLINFO_3(STRING, Array_p_join, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
JS_DEFINE_CALLINFO_3(JSVAL, Array_p_push1, CONTEXT, OBJECT, JSVAL, 0, 0)
|
||||
JS_DEFINE_CALLINFO_2(JSVAL, Array_p_pop, CONTEXT, OBJECT, 0, 0)
|
||||
JS_DEFINE_CALLINFO_3(static, STRING, Array_p_join, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
JS_DEFINE_CALLINFO_3(static, JSVAL, Array_p_push1, CONTEXT, OBJECT, JSVAL, 0, 0)
|
||||
JS_DEFINE_CALLINFO_2(static, JSVAL, Array_p_pop, CONTEXT, OBJECT, 0, 0)
|
||||
|
||||
static JSTraceableNative array_join_trcinfo[] = {
|
||||
{ array_join, &ci_Array_p_join, "TC", "s", FAIL_NULL }
|
||||
{ array_join, &_JS_CALLINFO(Array_p_join), "TC", "s", FAIL_NULL }
|
||||
};
|
||||
static JSTraceableNative array_push_trcinfo[] = {
|
||||
{ array_push, &ci_Array_p_push1, "TC", "v", FAIL_JSVAL }
|
||||
{ array_push, &_JS_CALLINFO(Array_p_push1), "TC", "v", FAIL_JSVAL }
|
||||
};
|
||||
static JSTraceableNative array_pop_trcinfo[] = {
|
||||
{ array_pop, &ci_Array_p_pop, "TC", "", FAIL_JSVAL }
|
||||
{ array_pop, &_JS_CALLINFO(Array_p_pop), "TC", "", FAIL_JSVAL }
|
||||
};
|
||||
|
||||
#endif /* JS_TRACER */
|
||||
@ -3417,9 +3417,9 @@ js_ArrayToJSDoubleBuffer(JSContext *cx, JSObject *obj, jsuint offset, jsuint cou
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JS_DEFINE_CALLINFO_4(BOOL, Array_dense_setelem, CONTEXT, OBJECT, INT32, JSVAL, 0, 0)
|
||||
JS_DEFINE_CALLINFO_2(OBJECT, FastNewArray, CONTEXT, OBJECT, 0, 0)
|
||||
JS_DEFINE_CALLINFO_3(OBJECT, Array_1int, CONTEXT, OBJECT, INT32, 0, 0)
|
||||
JS_DEFINE_CALLINFO_3(OBJECT, Array_1str, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
JS_DEFINE_CALLINFO_4(OBJECT, Array_2obj, CONTEXT, OBJECT, OBJECT, OBJECT, 0, 0)
|
||||
JS_DEFINE_CALLINFO_5(OBJECT, Array_3num, CONTEXT, OBJECT, DOUBLE, DOUBLE, DOUBLE, 0, 0)
|
||||
JS_DEFINE_CALLINFO_4(extern, BOOL, js_Array_dense_setelem, CONTEXT, OBJECT, INT32, JSVAL, 0, 0)
|
||||
JS_DEFINE_CALLINFO_2(extern, OBJECT, js_FastNewArray, CONTEXT, OBJECT, 0, 0)
|
||||
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_Array_1int, CONTEXT, OBJECT, INT32, 0, 0)
|
||||
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_Array_1str, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
JS_DEFINE_CALLINFO_4(extern, OBJECT, js_Array_2obj, CONTEXT, OBJECT, OBJECT, OBJECT, 0, 0)
|
||||
JS_DEFINE_CALLINFO_5(extern, OBJECT, js_Array_3num, CONTEXT, OBJECT, DOUBLE, DOUBLE, DOUBLE, 0, 0)
|
||||
|
@ -142,81 +142,96 @@ struct JSTraceableNative {
|
||||
#define _JS_ARGSIZE2(ctype, size) size##_RETSIZE
|
||||
#define _JS_ARGSIZE(tyname) _JS_EXPAND(_JS_ARGSIZE2 _JS_TYPEINFO_##tyname)
|
||||
|
||||
#define _JS_DEFINE_CALLINFO(name, crtype, cargtypes, argtypes, cse, fold) \
|
||||
crtype FASTCALL js_##name cargtypes; \
|
||||
const nanojit::CallInfo ci_##name = \
|
||||
{ (intptr_t) &js_##name, argtypes, cse, fold, nanojit::ABI_FASTCALL _JS_CI_NAME(name) };
|
||||
#define _JS_static_TN(t) static t
|
||||
#define _JS_static_CI static
|
||||
#define _JS_extern_TN(t) extern t
|
||||
#define _JS_extern_CI
|
||||
#define _JS_FRIEND_TN(t) extern JS_FRIEND_API(t)
|
||||
#define _JS_FRIEND_CI
|
||||
#define _JS_EXPAND_TN_LINKAGE(linkage, t) _JS_##linkage##_TN(t)
|
||||
#define _JS_EXPAND_CI_LINKAGE(linkage) _JS_##linkage##_CI
|
||||
|
||||
#define _JS_CALLINFO(name) name##_ci
|
||||
|
||||
#define _JS_DEFINE_CALLINFO(linkage, name, crtype, cargtypes, argtypes, cse, fold) \
|
||||
_JS_EXPAND_TN_LINKAGE(linkage, crtype) FASTCALL name cargtypes; \
|
||||
_JS_EXPAND_CI_LINKAGE(linkage) const nanojit::CallInfo _JS_CALLINFO(name) = \
|
||||
{ (intptr_t) &name, argtypes, cse, fold, nanojit::ABI_FASTCALL _JS_CI_NAME(name) };
|
||||
|
||||
/*
|
||||
* Declare a C function named js_<op> and a CallInfo struct named ci_<op> so
|
||||
* the tracer can call it.
|
||||
* Declare a C function named <op> and a CallInfo struct named <op>_callinfo so the
|
||||
* tracer can call it. |linkage| controls the visibility of both the function
|
||||
* and the CallInfo global. It can be extern, static, or FRIEND, which
|
||||
* specifies JS_FRIEND_API linkage for the function.
|
||||
*/
|
||||
#define JS_DEFINE_CALLINFO_1(rt, op, at0, cse, fold) \
|
||||
_JS_DEFINE_CALLINFO(op, _JS_CTYPE(rt), (_JS_CTYPE(at0)), \
|
||||
#define JS_DEFINE_CALLINFO_1(linkage, rt, op, at0, cse, fold) \
|
||||
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE(rt), (_JS_CTYPE(at0)), \
|
||||
(_JS_ARGSIZE(at0) << 2) | _JS_RETSIZE(rt), cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_2(rt, op, at0, at1, cse, fold) \
|
||||
_JS_DEFINE_CALLINFO(op, _JS_CTYPE(rt), (_JS_CTYPE(at0), _JS_CTYPE(at1)), \
|
||||
#define JS_DEFINE_CALLINFO_2(linkage, rt, op, at0, at1, cse, fold) \
|
||||
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE(rt), (_JS_CTYPE(at0), _JS_CTYPE(at1)), \
|
||||
(_JS_ARGSIZE(at0) << 4) | (_JS_ARGSIZE(at1) << 2) | _JS_RETSIZE(rt), \
|
||||
cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_3(rt, op, at0, at1, at2, cse, fold) \
|
||||
_JS_DEFINE_CALLINFO(op, _JS_CTYPE(rt), (_JS_CTYPE(at0), _JS_CTYPE(at1), _JS_CTYPE(at2)), \
|
||||
#define JS_DEFINE_CALLINFO_3(linkage, rt, op, at0, at1, at2, cse, fold) \
|
||||
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE(rt), \
|
||||
(_JS_CTYPE(at0), _JS_CTYPE(at1), _JS_CTYPE(at2)), \
|
||||
(_JS_ARGSIZE(at0) << 6) | (_JS_ARGSIZE(at1) << 4) | \
|
||||
(_JS_ARGSIZE(at2) << 2) | _JS_RETSIZE(rt), \
|
||||
cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_4(rt, op, at0, at1, at2, at3, cse, fold) \
|
||||
_JS_DEFINE_CALLINFO(op, _JS_CTYPE(rt), (_JS_CTYPE(at0), _JS_CTYPE(at1), _JS_CTYPE(at2), \
|
||||
_JS_CTYPE(at3)), \
|
||||
#define JS_DEFINE_CALLINFO_4(linkage, rt, op, at0, at1, at2, at3, cse, fold) \
|
||||
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE(rt), \
|
||||
(_JS_CTYPE(at0), _JS_CTYPE(at1), _JS_CTYPE(at2), _JS_CTYPE(at3)), \
|
||||
(_JS_ARGSIZE(at0) << 8) | (_JS_ARGSIZE(at1) << 6) | \
|
||||
(_JS_ARGSIZE(at2) << 4) | (_JS_ARGSIZE(at3) << 2) | _JS_RETSIZE(rt), \
|
||||
cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_5(rt, op, at0, at1, at2, at3, at4, cse, fold) \
|
||||
_JS_DEFINE_CALLINFO(op, _JS_CTYPE(rt), (_JS_CTYPE(at0), _JS_CTYPE(at1), _JS_CTYPE(at2), \
|
||||
_JS_CTYPE(at3), _JS_CTYPE(at4)), \
|
||||
#define JS_DEFINE_CALLINFO_5(linkage, rt, op, at0, at1, at2, at3, at4, cse, fold) \
|
||||
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE(rt), \
|
||||
(_JS_CTYPE(at0), _JS_CTYPE(at1), _JS_CTYPE(at2), _JS_CTYPE(at3), \
|
||||
_JS_CTYPE(at4)), \
|
||||
(_JS_ARGSIZE(at0) << 10) | (_JS_ARGSIZE(at1) << 8) | \
|
||||
(_JS_ARGSIZE(at2) << 6) | (_JS_ARGSIZE(at3) << 4) | \
|
||||
(_JS_ARGSIZE(at4) << 2) | _JS_RETSIZE(rt), \
|
||||
cse, fold)
|
||||
|
||||
#define JS_DECLARE_CALLINFO(name) extern const nanojit::CallInfo ci_##name;
|
||||
#define JS_DECLARE_CALLINFO(name) extern const nanojit::CallInfo _JS_CALLINFO(name);
|
||||
|
||||
#else
|
||||
|
||||
#define JS_DEFINE_CALLINFO_1(rt, op, at0, cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_2(rt, op, at0, at1, cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_3(rt, op, at0, at1, at2, cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_4(rt, op, at0, at1, at2, at3, cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_5(rt, op, at0, at1, at2, at3, at4, cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_1(linkage, rt, op, at0, cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_2(linkage, rt, op, at0, at1, cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_3(linkage, rt, op, at0, at1, at2, cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_4(linkage, rt, op, at0, at1, at2, at3, cse, fold)
|
||||
#define JS_DEFINE_CALLINFO_5(linkage, rt, op, at0, at1, at2, at3, at4, cse, fold)
|
||||
#define JS_DECLARE_CALLINFO(name)
|
||||
|
||||
#endif /* !JS_TRACER */
|
||||
|
||||
/* Defined in jsarray.cpp */
|
||||
JS_DECLARE_CALLINFO(Array_dense_setelem)
|
||||
JS_DECLARE_CALLINFO(FastNewArray)
|
||||
JS_DECLARE_CALLINFO(Array_1int)
|
||||
JS_DECLARE_CALLINFO(Array_1str)
|
||||
JS_DECLARE_CALLINFO(Array_2obj)
|
||||
JS_DECLARE_CALLINFO(Array_3num)
|
||||
JS_DECLARE_CALLINFO(js_Array_dense_setelem)
|
||||
JS_DECLARE_CALLINFO(js_FastNewArray)
|
||||
JS_DECLARE_CALLINFO(js_Array_1int)
|
||||
JS_DECLARE_CALLINFO(js_Array_1str)
|
||||
JS_DECLARE_CALLINFO(js_Array_2obj)
|
||||
JS_DECLARE_CALLINFO(js_Array_3num)
|
||||
|
||||
/* Defined in jsdate.cpp */
|
||||
JS_DECLARE_CALLINFO(FastNewDate)
|
||||
JS_DECLARE_CALLINFO(js_FastNewDate)
|
||||
|
||||
/* Defined in jsnum.cpp */
|
||||
JS_DECLARE_CALLINFO(NumberToString)
|
||||
JS_DECLARE_CALLINFO(js_NumberToString)
|
||||
|
||||
/* Defined in jsstr.cpp */
|
||||
JS_DECLARE_CALLINFO(ConcatStrings)
|
||||
JS_DECLARE_CALLINFO(String_getelem)
|
||||
JS_DECLARE_CALLINFO(String_p_charCodeAt)
|
||||
JS_DECLARE_CALLINFO(EqualStrings)
|
||||
JS_DECLARE_CALLINFO(CompareStrings)
|
||||
JS_DECLARE_CALLINFO(js_ConcatStrings)
|
||||
JS_DECLARE_CALLINFO(js_String_getelem)
|
||||
JS_DECLARE_CALLINFO(js_String_p_charCodeAt)
|
||||
JS_DECLARE_CALLINFO(js_EqualStrings)
|
||||
JS_DECLARE_CALLINFO(js_CompareStrings)
|
||||
|
||||
/* Defined in jsbuiltins.cpp */
|
||||
#define BUILTIN1(rt, op, at0, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN2(rt, op, at0, at1, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN3(rt, op, at0, at1, at2, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN4(rt, op, at0, at1, at2, at3, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN5(rt, op, at0, at1, at2, at3, at4, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN1(linkage, rt, op, at0, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN2(linkage, rt, op, at0, at1, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN3(linkage, rt, op, at0, at1, at2, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN4(linkage, rt, op, at0, at1, at2, at3, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN5(linkage, rt, op, at0, at1, at2, at3, at4, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#include "builtins.tbl"
|
||||
#undef BUILTIN
|
||||
#undef BUILTIN1
|
||||
|
@ -920,8 +920,8 @@ date_now(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
jsdouble FASTCALL
|
||||
js_Date_now(JSContext*)
|
||||
static jsdouble FASTCALL
|
||||
date_now_tn(JSContext*)
|
||||
{
|
||||
return PRMJ_Now() / PRMJ_USEC_PER_MSEC;
|
||||
}
|
||||
@ -1967,12 +1967,12 @@ date_valueOf(JSContext *cx, uintN argc, jsval *vp)
|
||||
#ifdef JS_TRACER
|
||||
|
||||
// Don't really need an argument here, but we don't support arg-less builtins
|
||||
JS_DEFINE_CALLINFO_1(DOUBLE, Date_now, CONTEXT, 0, 0)
|
||||
JS_DEFINE_CALLINFO_1(static, DOUBLE, date_now_tn, CONTEXT, 0, 0)
|
||||
|
||||
JS_DEFINE_CALLINFO_2(OBJECT, FastNewDate, CONTEXT, OBJECT, 0, 0)
|
||||
JS_DEFINE_CALLINFO_2(extern, OBJECT, js_FastNewDate, CONTEXT, OBJECT, 0, 0)
|
||||
|
||||
static JSTraceableNative date_now_trcinfo[] = {
|
||||
{ date_now, &ci_Date_now, "C", "", INFALLIBLE }
|
||||
{ date_now, &_JS_CALLINFO(date_now_tn), "C", "", INFALLIBLE }
|
||||
};
|
||||
|
||||
#endif /* JS_TRACER */
|
||||
@ -2134,7 +2134,7 @@ js_FastNewDate(JSContext* cx, JSObject* proto)
|
||||
jsdouble* date = js_NewWeaklyRootedDouble(cx, 0.0);
|
||||
if (!date)
|
||||
return NULL;
|
||||
*date = js_Date_now(cx);
|
||||
*date = date_now_tn(cx);
|
||||
obj->fslots[JSSLOT_UTC_TIME] = DOUBLE_TO_JSVAL(date);
|
||||
obj->fslots[JSSLOT_LOCAL_TIME] = DOUBLE_TO_JSVAL(cx->runtime->jsNaN);;
|
||||
|
||||
|
@ -593,10 +593,10 @@ math_toSource(JSContext *cx, uintN argc, jsval *vp)
|
||||
#ifdef JS_TRACER
|
||||
|
||||
#define MATH_BUILTIN_1(name) \
|
||||
jsdouble FASTCALL js_Math_##name(jsdouble d) { return name(d); } \
|
||||
JS_DEFINE_CALLINFO_1(DOUBLE, Math_##name, DOUBLE, 1, 1) \
|
||||
static jsdouble FASTCALL math_##name##_tn(jsdouble d) { return name(d); } \
|
||||
JS_DEFINE_CALLINFO_1(static, DOUBLE, math_##name##_tn, DOUBLE, 1, 1) \
|
||||
static const JSTraceableNative math_##name##_trcinfo = \
|
||||
{ math_##name, &ci_Math_##name, "", "d", INFALLIBLE };
|
||||
{ math_##name, &_JS_CALLINFO(math_##name##_tn), "", "d", INFALLIBLE };
|
||||
|
||||
MATH_BUILTIN_1(sin)
|
||||
MATH_BUILTIN_1(cos)
|
||||
@ -604,8 +604,8 @@ MATH_BUILTIN_1(sqrt)
|
||||
MATH_BUILTIN_1(floor)
|
||||
MATH_BUILTIN_1(ceil)
|
||||
|
||||
jsdouble FASTCALL
|
||||
js_Math_log(jsdouble d)
|
||||
static jsdouble FASTCALL
|
||||
math_log_tn(jsdouble d)
|
||||
{
|
||||
#if !JS_USE_FDLIBM_MATH && defined(SOLARIS) && defined(__GNUC__)
|
||||
if (d < 0)
|
||||
@ -614,8 +614,8 @@ js_Math_log(jsdouble d)
|
||||
return log(d);
|
||||
}
|
||||
|
||||
jsdouble FASTCALL
|
||||
js_Math_max(jsdouble d, jsdouble p)
|
||||
static jsdouble FASTCALL
|
||||
math_max_tn(jsdouble d, jsdouble p)
|
||||
{
|
||||
if (JSDOUBLE_IS_NaN(d) || JSDOUBLE_IS_NaN(p))
|
||||
return js_NaN;
|
||||
@ -629,8 +629,8 @@ js_Math_max(jsdouble d, jsdouble p)
|
||||
return (p > d) ? p : d;
|
||||
}
|
||||
|
||||
jsdouble FASTCALL
|
||||
js_Math_pow(jsdouble d, jsdouble p)
|
||||
static jsdouble FASTCALL
|
||||
math_pow_tn(jsdouble d, jsdouble p)
|
||||
{
|
||||
if (!JSDOUBLE_IS_FINITE(p) && (d == 1.0 || d == -1.0))
|
||||
return js_NaN;
|
||||
@ -639,8 +639,8 @@ js_Math_pow(jsdouble d, jsdouble p)
|
||||
return pow(d, p);
|
||||
}
|
||||
|
||||
jsdouble FASTCALL
|
||||
js_Math_random(JSRuntime* rt)
|
||||
static jsdouble FASTCALL
|
||||
math_random_tn(JSRuntime* rt)
|
||||
{
|
||||
JS_LOCK_RUNTIME(rt);
|
||||
js_random_init(rt);
|
||||
@ -649,19 +649,19 @@ js_Math_random(JSRuntime* rt)
|
||||
return z;
|
||||
}
|
||||
|
||||
JS_DEFINE_CALLINFO_1(DOUBLE, Math_log, DOUBLE, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(DOUBLE, Math_max, DOUBLE, DOUBLE, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(DOUBLE, Math_pow, DOUBLE, DOUBLE, 1, 1)
|
||||
JS_DEFINE_CALLINFO_1(DOUBLE, Math_random, RUNTIME, 0, 0)
|
||||
JS_DEFINE_CALLINFO_1(static, DOUBLE, math_log_tn, DOUBLE, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(static, DOUBLE, math_max_tn, DOUBLE, DOUBLE, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(static, DOUBLE, math_pow_tn, DOUBLE, DOUBLE, 1, 1)
|
||||
JS_DEFINE_CALLINFO_1(static, DOUBLE, math_random_tn, RUNTIME, 0, 0)
|
||||
|
||||
static const JSTraceableNative math_log_trcinfo =
|
||||
{ math_log, &ci_Math_log, "", "d", INFALLIBLE };
|
||||
{ math_log, &_JS_CALLINFO(math_log_tn), "", "d", INFALLIBLE };
|
||||
static const JSTraceableNative math_max_trcinfo =
|
||||
{ math_max, &ci_Math_max, "", "dd", INFALLIBLE };
|
||||
{ math_max, &_JS_CALLINFO(math_max_tn), "", "dd", INFALLIBLE };
|
||||
static const JSTraceableNative math_pow_trcinfo =
|
||||
{ math_pow, &ci_Math_pow, "", "dd", INFALLIBLE };
|
||||
{ math_pow, &_JS_CALLINFO(math_pow_tn), "", "dd", INFALLIBLE };
|
||||
static const JSTraceableNative math_random_trcinfo =
|
||||
{ math_random, &ci_Math_random, "R", "", INFALLIBLE };
|
||||
{ math_random, &_JS_CALLINFO(math_random_tn), "R", "", INFALLIBLE };
|
||||
|
||||
#endif /* JS_TRACER */
|
||||
|
||||
|
@ -124,8 +124,8 @@ num_parseFloat(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
jsdouble FASTCALL
|
||||
js_ParseFloat(JSContext* cx, JSString* str)
|
||||
static jsdouble FASTCALL
|
||||
ParseFloat(JSContext* cx, JSString* str)
|
||||
{
|
||||
const jschar* bp;
|
||||
const jschar* end;
|
||||
@ -183,8 +183,8 @@ num_parseInt(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
jsdouble FASTCALL
|
||||
js_ParseInt(JSContext* cx, JSString* str)
|
||||
static jsdouble FASTCALL
|
||||
ParseInt(JSContext* cx, JSString* str)
|
||||
{
|
||||
const jschar* bp;
|
||||
const jschar* end;
|
||||
@ -197,8 +197,8 @@ js_ParseInt(JSContext* cx, JSString* str)
|
||||
return d;
|
||||
}
|
||||
|
||||
jsdouble FASTCALL
|
||||
js_ParseIntDouble(jsdouble d)
|
||||
static jsdouble FASTCALL
|
||||
ParseIntDouble(jsdouble d)
|
||||
{
|
||||
if (!JSDOUBLE_IS_FINITE(d))
|
||||
return js_NaN;
|
||||
@ -215,16 +215,16 @@ const char js_parseInt_str[] = "parseInt";
|
||||
|
||||
#ifdef JS_TRACER
|
||||
|
||||
JS_DEFINE_CALLINFO_2(DOUBLE, ParseInt, CONTEXT, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_1(DOUBLE, ParseIntDouble, DOUBLE, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(DOUBLE, ParseFloat, CONTEXT, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(static, DOUBLE, ParseInt, CONTEXT, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_1(static, DOUBLE, ParseIntDouble, DOUBLE, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(static, DOUBLE, ParseFloat, CONTEXT, STRING, 1, 1)
|
||||
|
||||
static const JSTraceableNative num_parseInt_trcinfo[] = {
|
||||
{ num_parseInt, &ci_ParseInt, "C", "s", INFALLIBLE | JSTN_MORE },
|
||||
{ num_parseInt, &ci_ParseIntDouble, "", "d", INFALLIBLE }
|
||||
{ num_parseInt, &_JS_CALLINFO(ParseInt), "C", "s", INFALLIBLE | JSTN_MORE },
|
||||
{ num_parseInt, &_JS_CALLINFO(ParseIntDouble), "", "d", INFALLIBLE }
|
||||
};
|
||||
static const JSTraceableNative num_parseFloat_trcinfo[] = {
|
||||
{ num_parseFloat, &ci_ParseFloat, "C", "s", INFALLIBLE }
|
||||
{ num_parseFloat, &_JS_CALLINFO(ParseFloat), "C", "s", INFALLIBLE }
|
||||
};
|
||||
|
||||
#endif /* JS_TRACER */
|
||||
@ -597,12 +597,12 @@ num_toPrecision(JSContext *cx, uintN argc, jsval *vp)
|
||||
|
||||
#ifdef JS_TRACER
|
||||
|
||||
JS_DEFINE_CALLINFO_3(STRING, NumberToStringWithBase, CONTEXT, DOUBLE, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(STRING, NumberToString, CONTEXT, DOUBLE, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(static, STRING, NumberToStringWithBase, CONTEXT, DOUBLE, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(extern, STRING, js_NumberToString, CONTEXT, DOUBLE, 1, 1)
|
||||
|
||||
static const JSTraceableNative num_toString_trcinfo[] = {
|
||||
{ num_toString, &ci_NumberToStringWithBase, "DC", "i", FAIL_NULL | JSTN_MORE},
|
||||
{ num_toString, &ci_NumberToString, "DC", "", FAIL_NULL }
|
||||
{ num_toString, &NumberToStringWithBase_ci, "DC", "i", FAIL_NULL | JSTN_MORE},
|
||||
{ num_toString, &js_NumberToString_ci, "DC", "", FAIL_NULL }
|
||||
};
|
||||
|
||||
#endif /* JS_TRACER */
|
||||
@ -817,8 +817,8 @@ js_NumberToCString(JSContext *cx, jsdouble d, jsint base, char *buf, size_t bufS
|
||||
return numStr;
|
||||
}
|
||||
|
||||
JSString * JS_FASTCALL
|
||||
js_NumberToStringWithBase(JSContext *cx, jsdouble d, jsint base)
|
||||
static JSString * JS_FASTCALL
|
||||
NumberToStringWithBase(JSContext *cx, jsdouble d, jsint base)
|
||||
{
|
||||
char buf[DTOSTR_STANDARD_BUFFER_SIZE];
|
||||
char *numStr;
|
||||
@ -834,7 +834,7 @@ js_NumberToStringWithBase(JSContext *cx, jsdouble d, jsint base)
|
||||
JSString * JS_FASTCALL
|
||||
js_NumberToString(JSContext *cx, jsdouble d)
|
||||
{
|
||||
return js_NumberToStringWithBase(cx, d, 10);
|
||||
return NumberToStringWithBase(cx, d, 10);
|
||||
}
|
||||
|
||||
jsdouble
|
||||
|
@ -182,9 +182,6 @@ js_NewNumberInRootedValue(JSContext *cx, jsdouble d, jsval *vp);
|
||||
extern JSString * JS_FASTCALL
|
||||
js_NumberToString(JSContext *cx, jsdouble d);
|
||||
|
||||
extern JSString * JS_FASTCALL
|
||||
js_NumberToStringWithBase(JSContext *cx, jsdouble d, jsint base);
|
||||
|
||||
/*
|
||||
* Convert int to C string. The buf must be big enough for MIN_INT to fit
|
||||
* including '-' and '\0'.
|
||||
|
@ -1557,8 +1557,8 @@ js_HasOwnProperty(JSContext *cx, JSLookupPropOp lookup, JSObject *obj, jsid id,
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
int32 FASTCALL
|
||||
js_Object_p_hasOwnProperty(JSContext* cx, JSObject* obj, JSString *str)
|
||||
static int32 FASTCALL
|
||||
Object_p_hasOwnProperty(JSContext* cx, JSObject* obj, JSString *str)
|
||||
{
|
||||
jsid id = ATOM_TO_JSID(STRING_TO_JSVAL(str));
|
||||
jsval v;
|
||||
@ -1598,8 +1598,8 @@ obj_propertyIsEnumerable(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
int32 FASTCALL
|
||||
js_Object_p_propertyIsEnumerable(JSContext* cx, JSObject* obj, JSString *str)
|
||||
static int32 FASTCALL
|
||||
Object_p_propertyIsEnumerable(JSContext* cx, JSObject* obj, JSString *str)
|
||||
{
|
||||
jsid id = ATOM_TO_JSID(STRING_TO_JSVAL(str));
|
||||
jsval v;
|
||||
@ -1811,14 +1811,14 @@ const char js_lookupSetter_str[] = "__lookupSetter__";
|
||||
|
||||
#ifdef JS_TRACER
|
||||
|
||||
JS_DEFINE_CALLINFO_3(INT32, Object_p_hasOwnProperty, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
JS_DEFINE_CALLINFO_3(INT32, Object_p_propertyIsEnumerable, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
JS_DEFINE_CALLINFO_3(static, INT32, Object_p_hasOwnProperty, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
JS_DEFINE_CALLINFO_3(static, INT32, Object_p_propertyIsEnumerable, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
|
||||
static const JSTraceableNative obj_hasOwnProperty_trcinfo[] = {
|
||||
{ obj_hasOwnProperty, &ci_Object_p_hasOwnProperty, "TC", "s", FAIL_VOID }
|
||||
{ obj_hasOwnProperty, &_JS_CALLINFO(Object_p_hasOwnProperty), "TC", "s", FAIL_VOID }
|
||||
};
|
||||
static const JSTraceableNative obj_propertyIsEnumerable_trcinfo[] = {
|
||||
{ obj_propertyIsEnumerable, &ci_Object_p_propertyIsEnumerable, "TC", "s", FAIL_VOID }
|
||||
{ obj_propertyIsEnumerable, &_JS_CALLINFO(Object_p_propertyIsEnumerable), "TC", "s", FAIL_VOID }
|
||||
};
|
||||
|
||||
#endif /* JS_TRACER */
|
||||
|
@ -4275,8 +4275,8 @@ regexp_test(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
jsint FASTCALL
|
||||
js_Regexp_p_test(JSContext* cx, JSObject* regexp, JSString* str)
|
||||
static jsint FASTCALL
|
||||
Regexp_p_test(JSContext* cx, JSObject* regexp, JSString* str)
|
||||
{
|
||||
jsval vp[3] = { JSVAL_NULL, OBJECT_TO_JSVAL(regexp), STRING_TO_JSVAL(str) };
|
||||
if (!regexp_exec_sub(cx, regexp, 1, vp + 2, JS_TRUE, vp))
|
||||
@ -4291,10 +4291,10 @@ js_Regexp_p_test(JSContext* cx, JSObject* regexp, JSString* str)
|
||||
* because the function returns a boolean during recording, and "with possible
|
||||
* error" from FAIL_VOID below.
|
||||
*/
|
||||
JS_DEFINE_CALLINFO_3(INT32, Regexp_p_test, CONTEXT, OBJECT, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(static, INT32, Regexp_p_test, CONTEXT, OBJECT, STRING, 1, 1)
|
||||
|
||||
static const JSTraceableNative regexp_test_trcinfo[] = {
|
||||
{ regexp_test, &ci_Regexp_p_test, "TC", "s", FAIL_VOID }
|
||||
{ regexp_test, &Regexp_p_test_ci, "TC", "s", FAIL_VOID }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
122
js/src/jsstr.cpp
122
js/src/jsstr.cpp
@ -781,16 +781,16 @@ str_substring(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
JSString* FASTCALL
|
||||
js_String_p_substring(JSContext* cx, JSString* str, int32 begin, int32 end)
|
||||
static JSString* FASTCALL
|
||||
String_p_substring(JSContext* cx, JSString* str, int32 begin, int32 end)
|
||||
{
|
||||
JS_ASSERT(end >= begin);
|
||||
JS_ASSERT(JS_ON_TRACE(cx));
|
||||
return js_NewDependentString(cx, str, (size_t)begin, (size_t)(end - begin));
|
||||
}
|
||||
|
||||
JSString* FASTCALL
|
||||
js_String_p_substring_1(JSContext* cx, JSString* str, int32 begin)
|
||||
static JSString* FASTCALL
|
||||
String_p_substring_1(JSContext* cx, JSString* str, int32 begin)
|
||||
{
|
||||
int32 end = JSSTRING_LENGTH(str);
|
||||
JS_ASSERT(end >= begin);
|
||||
@ -1430,8 +1430,8 @@ str_match(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
JSObject* FASTCALL
|
||||
js_String_p_match(JSContext* cx, JSString* str, jsbytecode *pc, JSObject* regexp)
|
||||
static JSObject* FASTCALL
|
||||
String_p_match(JSContext* cx, JSString* str, jsbytecode *pc, JSObject* regexp)
|
||||
{
|
||||
jsval vp[3] = { JSVAL_NULL, STRING_TO_JSVAL(str), OBJECT_TO_JSVAL(regexp) };
|
||||
if (!js_StringMatchHelper(cx, 1, vp, pc))
|
||||
@ -1441,8 +1441,8 @@ js_String_p_match(JSContext* cx, JSString* str, jsbytecode *pc, JSObject* regexp
|
||||
return JSVAL_TO_OBJECT(vp[0]);
|
||||
}
|
||||
|
||||
JSObject* FASTCALL
|
||||
js_String_p_match_obj(JSContext* cx, JSObject* str, jsbytecode *pc, JSObject* regexp)
|
||||
static JSObject* FASTCALL
|
||||
String_p_match_obj(JSContext* cx, JSObject* str, jsbytecode *pc, JSObject* regexp)
|
||||
{
|
||||
jsval vp[3] = { JSVAL_NULL, OBJECT_TO_JSVAL(str), OBJECT_TO_JSVAL(regexp) };
|
||||
if (!js_StringMatchHelper(cx, 1, vp, pc))
|
||||
@ -1754,8 +1754,8 @@ str_replace(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
JSString* FASTCALL
|
||||
js_String_p_replace_str(JSContext* cx, JSString* str, JSObject* regexp, JSString* repstr)
|
||||
static JSString* FASTCALL
|
||||
String_p_replace_str(JSContext* cx, JSString* str, JSObject* regexp, JSString* repstr)
|
||||
{
|
||||
jsval vp[4] = {
|
||||
JSVAL_NULL, STRING_TO_JSVAL(str), OBJECT_TO_JSVAL(regexp), STRING_TO_JSVAL(repstr)
|
||||
@ -1766,8 +1766,8 @@ js_String_p_replace_str(JSContext* cx, JSString* str, JSObject* regexp, JSString
|
||||
return JSVAL_TO_STRING(vp[0]);
|
||||
}
|
||||
|
||||
JSString* FASTCALL
|
||||
js_String_p_replace_str2(JSContext* cx, JSString* str, JSString* patstr, JSString* repstr)
|
||||
static JSString* FASTCALL
|
||||
String_p_replace_str2(JSContext* cx, JSString* str, JSString* patstr, JSString* repstr)
|
||||
{
|
||||
jsval vp[4] = {
|
||||
JSVAL_NULL, STRING_TO_JSVAL(str), STRING_TO_JSVAL(patstr), STRING_TO_JSVAL(repstr)
|
||||
@ -1778,9 +1778,9 @@ js_String_p_replace_str2(JSContext* cx, JSString* str, JSString* patstr, JSStrin
|
||||
return JSVAL_TO_STRING(vp[0]);
|
||||
}
|
||||
|
||||
JSString* FASTCALL
|
||||
js_String_p_replace_str3(JSContext* cx, JSString* str, JSString* patstr, JSString* repstr,
|
||||
JSString* flagstr)
|
||||
static JSString* FASTCALL
|
||||
String_p_replace_str3(JSContext* cx, JSString* str, JSString* patstr, JSString* repstr,
|
||||
JSString* flagstr)
|
||||
{
|
||||
jsval vp[5] = {
|
||||
JSVAL_NULL, STRING_TO_JSVAL(str), STRING_TO_JSVAL(patstr), STRING_TO_JSVAL(repstr),
|
||||
@ -2095,8 +2095,8 @@ str_split(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
JSObject* FASTCALL
|
||||
js_String_p_split(JSContext* cx, JSString* str, JSString* sepstr)
|
||||
static JSObject* FASTCALL
|
||||
String_p_split(JSContext* cx, JSString* str, JSString* sepstr)
|
||||
{
|
||||
// FIXME: Avoid building and then parsing this array.
|
||||
jsval vp[4] = { JSVAL_NULL, STRING_TO_JSVAL(str), STRING_TO_JSVAL(sepstr), JSVAL_VOID };
|
||||
@ -2183,8 +2183,8 @@ str_concat(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
JSString* FASTCALL
|
||||
js_String_p_concat_1int(JSContext* cx, JSString* str, int32 i)
|
||||
static JSString* FASTCALL
|
||||
String_p_concat_1int(JSContext* cx, JSString* str, int32 i)
|
||||
{
|
||||
// FIXME: should be able to use stack buffer and avoid istr...
|
||||
JSString* istr = js_NumberToString(cx, i);
|
||||
@ -2193,8 +2193,8 @@ js_String_p_concat_1int(JSContext* cx, JSString* str, int32 i)
|
||||
return js_ConcatStrings(cx, str, istr);
|
||||
}
|
||||
|
||||
JSString* FASTCALL
|
||||
js_String_p_concat_2str(JSContext* cx, JSString* str, JSString* a, JSString* b)
|
||||
static JSString* FASTCALL
|
||||
String_p_concat_2str(JSContext* cx, JSString* str, JSString* a, JSString* b)
|
||||
{
|
||||
str = js_ConcatStrings(cx, str, a);
|
||||
if (str)
|
||||
@ -2202,8 +2202,8 @@ js_String_p_concat_2str(JSContext* cx, JSString* str, JSString* a, JSString* b)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JSString* FASTCALL
|
||||
js_String_p_concat_3str(JSContext* cx, JSString* str, JSString* a, JSString* b, JSString* c)
|
||||
static JSString* FASTCALL
|
||||
String_p_concat_3str(JSContext* cx, JSString* str, JSString* a, JSString* b, JSString* c)
|
||||
{
|
||||
str = js_ConcatStrings(cx, str, a);
|
||||
if (str) {
|
||||
@ -2460,59 +2460,59 @@ js_String_getelem(JSContext* cx, JSString* str, int32 i)
|
||||
return js_GetUnitString(cx, str, (size_t)i);
|
||||
}
|
||||
|
||||
JS_DEFINE_CALLINFO_2(BOOL, EqualStrings, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(INT32, CompareStrings, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(extern, BOOL, js_EqualStrings, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(extern, INT32, js_CompareStrings, STRING, STRING, 1, 1)
|
||||
|
||||
JS_DEFINE_CALLINFO_4(STRING, String_p_substring, CONTEXT, STRING, INT32, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(STRING, String_p_substring_1, CONTEXT, STRING, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(STRING, String_getelem, CONTEXT, STRING, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(INT32, String_p_charCodeAt, STRING, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(STRING, ConcatStrings, CONTEXT, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(STRING, String_p_concat_1int, CONTEXT, STRING, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(STRING, String_p_concat_2str, CONTEXT, STRING, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_5(STRING, String_p_concat_3str, CONTEXT, STRING, STRING, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(OBJECT, String_p_match, CONTEXT, STRING, PC, OBJECT, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(OBJECT, String_p_match_obj, CONTEXT, OBJECT, PC, OBJECT, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(STRING, String_p_replace_str, CONTEXT, STRING, OBJECT, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(STRING, String_p_replace_str2, CONTEXT, STRING, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_5(STRING, String_p_replace_str3, CONTEXT, STRING, STRING, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(OBJECT, String_p_split, CONTEXT, STRING, STRING, 0, 0)
|
||||
JS_DEFINE_CALLINFO_2(STRING, toLowerCase, CONTEXT, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(STRING, toUpperCase, CONTEXT, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(static, STRING, String_p_substring, CONTEXT, STRING, INT32, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(static, STRING, String_p_substring_1, CONTEXT, STRING, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(extern, STRING, js_String_getelem, CONTEXT, STRING, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(extern, INT32, js_String_p_charCodeAt, STRING, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(extern, STRING, js_ConcatStrings, CONTEXT, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(static, STRING, String_p_concat_1int, CONTEXT, STRING, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(static, STRING, String_p_concat_2str, CONTEXT, STRING, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_5(static, STRING, String_p_concat_3str, CONTEXT, STRING, STRING, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(static, OBJECT, String_p_match, CONTEXT, STRING, PC, OBJECT, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(static, OBJECT, String_p_match_obj, CONTEXT, OBJECT, PC, OBJECT, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(static, STRING, String_p_replace_str, CONTEXT, STRING, OBJECT, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_4(static, STRING, String_p_replace_str2, CONTEXT, STRING, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_5(static, STRING, String_p_replace_str3, CONTEXT, STRING, STRING, STRING, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_3(static, OBJECT, String_p_split, CONTEXT, STRING, STRING, 0, 0)
|
||||
JS_DEFINE_CALLINFO_2(extern, STRING, js_toLowerCase, CONTEXT, STRING, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(extern, STRING, js_toUpperCase, CONTEXT, STRING, 1, 1)
|
||||
|
||||
static const JSTraceableNative str_substring_trcinfo[] = {
|
||||
{ str_substring, &ci_String_p_substring, "SC", "ii", FAIL_NULL | JSTN_MORE},
|
||||
{ str_substring, &ci_String_p_substring_1, "SC", "i", FAIL_NULL }
|
||||
{ str_substring, &_JS_CALLINFO(String_p_substring), "SC", "ii", FAIL_NULL | JSTN_MORE},
|
||||
{ str_substring, &_JS_CALLINFO(String_p_substring_1), "SC", "i", FAIL_NULL }
|
||||
};
|
||||
static const JSTraceableNative str_charAt_trcinfo[] = {
|
||||
{ str_charAt, &ci_String_getelem, "SC", "i", FAIL_NULL }
|
||||
{ str_charAt, &_JS_CALLINFO(js_String_getelem), "SC", "i", FAIL_NULL }
|
||||
};
|
||||
static const JSTraceableNative str_charCodeAt_trcinfo[] = {
|
||||
{ str_charCodeAt, &ci_String_p_charCodeAt, "S", "i", FAIL_NEG }
|
||||
{ str_charCodeAt, &_JS_CALLINFO(js_String_p_charCodeAt), "S", "i", FAIL_NEG }
|
||||
};
|
||||
static const JSTraceableNative str_concat_trcinfo[] = {
|
||||
{ str_concat, &ci_String_p_concat_1int, "SC", "i", FAIL_NULL | JSTN_MORE },
|
||||
{ str_concat, &ci_ConcatStrings, "SC", "s", FAIL_NULL | JSTN_MORE },
|
||||
{ str_concat, &ci_String_p_concat_2str, "SC", "ss", FAIL_NULL | JSTN_MORE },
|
||||
{ str_concat, &ci_String_p_concat_3str, "SC", "sss", FAIL_NULL }
|
||||
{ str_concat, &_JS_CALLINFO(String_p_concat_1int), "SC", "i", FAIL_NULL | JSTN_MORE },
|
||||
{ str_concat, &_JS_CALLINFO(js_ConcatStrings), "SC", "s", FAIL_NULL | JSTN_MORE },
|
||||
{ str_concat, &_JS_CALLINFO(String_p_concat_2str), "SC", "ss", FAIL_NULL | JSTN_MORE },
|
||||
{ str_concat, &_JS_CALLINFO(String_p_concat_3str), "SC", "sss", FAIL_NULL }
|
||||
};
|
||||
static const JSTraceableNative str_match_trcinfo[] = {
|
||||
{ str_match, &ci_String_p_match, "PSC", "r", FAIL_VOID | JSTN_MORE },
|
||||
{ str_match, &ci_String_p_match_obj, "PTC", "r", FAIL_VOID }
|
||||
{ str_match, &_JS_CALLINFO(String_p_match), "PSC", "r", FAIL_VOID | JSTN_MORE },
|
||||
{ str_match, &_JS_CALLINFO(String_p_match_obj), "PTC", "r", FAIL_VOID }
|
||||
};
|
||||
static const JSTraceableNative str_replace_trcinfo[] = {
|
||||
{ str_replace, &ci_String_p_replace_str, "SC", "sr", FAIL_NULL | JSTN_MORE },
|
||||
{ str_replace, &ci_String_p_replace_str2,"SC", "ss", FAIL_NULL | JSTN_MORE },
|
||||
{ str_replace, &ci_String_p_replace_str3,"SC", "sss", FAIL_NULL }
|
||||
{ str_replace, &_JS_CALLINFO(String_p_replace_str), "SC", "sr", FAIL_NULL | JSTN_MORE },
|
||||
{ str_replace, &_JS_CALLINFO(String_p_replace_str2),"SC", "ss", FAIL_NULL | JSTN_MORE },
|
||||
{ str_replace, &_JS_CALLINFO(String_p_replace_str3),"SC", "sss", FAIL_NULL }
|
||||
};
|
||||
static const JSTraceableNative str_split_trcinfo[] = {
|
||||
{ str_split, &ci_String_p_split, "SC", "s", FAIL_NULL }
|
||||
{ str_split, &_JS_CALLINFO(String_p_split), "SC", "s", FAIL_NULL }
|
||||
};
|
||||
static const JSTraceableNative str_toLowerCase_trcinfo[] = {
|
||||
{ str_toLowerCase, &ci_toLowerCase, "SC", "", FAIL_NULL }
|
||||
{ str_toLowerCase, &_JS_CALLINFO(js_toLowerCase), "SC", "", FAIL_NULL }
|
||||
};
|
||||
static const JSTraceableNative str_toUpperCase_trcinfo[] = {
|
||||
{ str_toUpperCase, &ci_toUpperCase, "SC", "", FAIL_NULL }
|
||||
{ str_toUpperCase, &_JS_CALLINFO(js_toUpperCase), "SC", "", FAIL_NULL }
|
||||
};
|
||||
|
||||
#endif /* JS_TRACER */
|
||||
@ -2640,8 +2640,8 @@ str_fromCharCode(JSContext *cx, uintN argc, jsval *vp)
|
||||
|
||||
#ifdef JS_TRACER
|
||||
|
||||
JSString* FASTCALL
|
||||
js_String_fromCharCode(JSContext* cx, int32 i)
|
||||
static JSString* FASTCALL
|
||||
String_fromCharCode(JSContext* cx, int32 i)
|
||||
{
|
||||
JS_ASSERT(JS_ON_TRACE(cx));
|
||||
jschar c = (jschar)i;
|
||||
@ -2650,10 +2650,10 @@ js_String_fromCharCode(JSContext* cx, int32 i)
|
||||
return js_NewStringCopyN(cx, &c, 1);
|
||||
}
|
||||
|
||||
JS_DEFINE_CALLINFO_2(STRING, String_fromCharCode, CONTEXT, INT32, 1, 1)
|
||||
JS_DEFINE_CALLINFO_2(static, STRING, String_fromCharCode, CONTEXT, INT32, 1, 1)
|
||||
|
||||
static const JSTraceableNative str_fromCharCode_trcinfo[] = {
|
||||
{ str_fromCharCode, &ci_String_fromCharCode, "C", "i", FAIL_NULL }};
|
||||
{ str_fromCharCode, &_JS_CALLINFO(String_fromCharCode), "C", "i", FAIL_NULL }};
|
||||
|
||||
#endif /* JS_TRACER */
|
||||
|
||||
|
@ -388,7 +388,7 @@ static bool isi2f(LInsp i)
|
||||
i->oprnd1()->isop(LIR_call) &&
|
||||
i->oprnd2()->isop(LIR_callh))
|
||||
{
|
||||
if (i->oprnd1()->callInfo() == &ci_i2f)
|
||||
if (i->oprnd1()->callInfo() == &i2f_ci)
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@ -406,7 +406,7 @@ static bool isu2f(LInsp i)
|
||||
i->oprnd1()->isop(LIR_call) &&
|
||||
i->oprnd2()->isop(LIR_callh))
|
||||
{
|
||||
if (i->oprnd1()->callInfo() == &ci_u2f)
|
||||
if (i->oprnd1()->callInfo() == &u2f_ci)
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@ -579,13 +579,13 @@ public:
|
||||
LInsp ins1(LOpcode v, LInsp s0)
|
||||
{
|
||||
if (v == LIR_fneg)
|
||||
return quadCall(&ci_fneg, &s0);
|
||||
return quadCall(&fneg_ci, &s0);
|
||||
|
||||
if (v == LIR_i2f)
|
||||
return quadCall(&ci_i2f, &s0);
|
||||
return quadCall(&i2f_ci, &s0);
|
||||
|
||||
if (v == LIR_u2f)
|
||||
return quadCall(&ci_u2f, &s0);
|
||||
return quadCall(&u2f_ci, &s0);
|
||||
|
||||
return out->ins1(v, s0);
|
||||
}
|
||||
@ -597,7 +597,7 @@ public:
|
||||
|
||||
// change the numeric value and order of these LIR opcodes and die
|
||||
if (LIR_fadd <= v && v <= LIR_fdiv) {
|
||||
static const CallInfo *fmap[] = { &ci_fadd, &ci_fsub, &ci_fmul, &ci_fdiv };
|
||||
static const CallInfo *fmap[] = { &fadd_ci, &fsub_ci, &fmul_ci, &fdiv_ci };
|
||||
|
||||
args[0] = s1;
|
||||
args[1] = s0;
|
||||
@ -606,7 +606,7 @@ public:
|
||||
}
|
||||
|
||||
if (LIR_feq <= v && v <= LIR_fge) {
|
||||
static const CallInfo *fmap[] = { &ci_fcmpeq, &ci_fcmplt, &ci_fcmpgt, &ci_fcmple, &ci_fcmpge };
|
||||
static const CallInfo *fmap[] = { &fcmpeq_ci, &fcmplt_ci, &fcmpgt_ci, &fcmple_ci, &fcmpge_ci };
|
||||
|
||||
args[0] = s1;
|
||||
args[1] = s0;
|
||||
@ -728,12 +728,12 @@ public:
|
||||
LInsp insCall(const CallInfo *ci, LInsp args[])
|
||||
{
|
||||
LInsp s0 = args[0];
|
||||
if (ci == &ci_DoubleToUint32) {
|
||||
if (ci == &js_DoubleToUint32_ci) {
|
||||
if (s0->isconstq())
|
||||
return out->insImm(js_DoubleToECMAUint32(s0->constvalf()));
|
||||
if (isi2f(s0) || isu2f(s0))
|
||||
return iu2fArg(s0);
|
||||
} else if (ci == &ci_DoubleToInt32) {
|
||||
} else if (ci == &js_DoubleToInt32_ci) {
|
||||
if (s0->isconstq())
|
||||
return out->insImm(js_DoubleToECMAInt32(s0->constvalf()));
|
||||
if (s0->isop(LIR_fadd) || s0->isop(LIR_fsub) || s0->isop(LIR_fmul)) {
|
||||
@ -747,23 +747,23 @@ public:
|
||||
if (isi2f(s0) || isu2f(s0))
|
||||
return iu2fArg(s0);
|
||||
// XXX ARM -- check for qjoin(call(UnboxDouble),call(UnboxDouble))
|
||||
if (s0->isCall() && s0->callInfo() == &ci_UnboxDouble) {
|
||||
if (s0->isCall() && s0->callInfo() == &js_UnboxDouble_ci) {
|
||||
LIns* args2[] = { callArgN(s0, 0) };
|
||||
return out->insCall(&ci_UnboxInt32, args2);
|
||||
return out->insCall(&js_UnboxInt32_ci, args2);
|
||||
}
|
||||
if (s0->isCall() && s0->callInfo() == &ci_StringToNumber) {
|
||||
if (s0->isCall() && s0->callInfo() == &js_StringToNumber_ci) {
|
||||
// callArgN's ordering is that as seen by the builtin, not as stored in args here.
|
||||
// True story!
|
||||
LIns* args2[] = { callArgN(s0, 1), callArgN(s0, 0) };
|
||||
return out->insCall(&ci_StringToInt32, args2);
|
||||
return out->insCall(&js_StringToInt32_ci, args2);
|
||||
}
|
||||
} else if (ci == &ci_BoxDouble) {
|
||||
} else if (ci == &js_BoxDouble_ci) {
|
||||
JS_ASSERT(s0->isQuad());
|
||||
if (s0->isop(LIR_i2f)) {
|
||||
LIns* args2[] = { s0->oprnd1(), args[1] };
|
||||
return out->insCall(&ci_BoxInt32, args2);
|
||||
return out->insCall(&js_BoxInt32_ci, args2);
|
||||
}
|
||||
if (s0->isCall() && s0->callInfo() == &ci_UnboxDouble)
|
||||
if (s0->isCall() && s0->callInfo() == &js_UnboxDouble_ci)
|
||||
return callArgN(s0, 0);
|
||||
}
|
||||
return out->insCall(ci, args);
|
||||
@ -2027,7 +2027,7 @@ TraceRecorder::emitTreeCall(Fragment* inner, GuardRecord* lr)
|
||||
TreeInfo* ti = (TreeInfo*)inner->vmprivate;
|
||||
/* Invoke the inner tree. */
|
||||
LIns* args[] = { INS_CONSTPTR(inner), lirbuf->state }; /* reverse order */
|
||||
LIns* ret = lir->insCall(&ci_CallTree, args);
|
||||
LIns* ret = lir->insCall(&js_CallTree_ci, args);
|
||||
/* Read back all registers, in case the called tree changed any of them. */
|
||||
SideExit* exit = lr->exit;
|
||||
import(ti, inner_sp_ins, exit->numGlobalSlots, exit->calldepth,
|
||||
@ -3218,7 +3218,7 @@ TraceRecorder::stack(int n, LIns* i)
|
||||
|
||||
LIns* TraceRecorder::f2i(LIns* f)
|
||||
{
|
||||
return lir->insCall(&ci_DoubleToInt32, &f);
|
||||
return lir->insCall(&js_DoubleToInt32_ci, &f);
|
||||
}
|
||||
|
||||
LIns* TraceRecorder::makeNumberInt32(LIns* f)
|
||||
@ -3299,7 +3299,7 @@ TraceRecorder::switchop()
|
||||
} else if (JSVAL_IS_STRING(v)) {
|
||||
LIns* args[] = { v_ins, INS_CONSTPTR(JSVAL_TO_STRING(v)) };
|
||||
guard(true,
|
||||
addName(lir->ins_eq0(lir->ins_eq0(lir->insCall(&ci_EqualStrings, args))),
|
||||
addName(lir->ins_eq0(lir->ins_eq0(lir->insCall(&js_EqualStrings_ci, args))),
|
||||
"guard(switch on string)"),
|
||||
BRANCH_EXIT);
|
||||
} else if (JSVAL_TAG(v) == JSVAL_BOOLEAN) {
|
||||
@ -3467,9 +3467,9 @@ TraceRecorder::cmp(LOpcode op, int flags)
|
||||
} else {
|
||||
LIns* args[] = { r_ins, l_ins };
|
||||
if (op == LIR_feq)
|
||||
l_ins = lir->ins_eq0(lir->insCall(&ci_EqualStrings, args));
|
||||
l_ins = lir->ins_eq0(lir->insCall(&js_EqualStrings_ci, args));
|
||||
else
|
||||
l_ins = lir->insCall(&ci_CompareStrings, args);
|
||||
l_ins = lir->insCall(&js_CompareStrings_ci, args);
|
||||
r_ins = lir->insImm(0);
|
||||
cond = evalCmp(op, JSVAL_TO_STRING(l), JSVAL_TO_STRING(r));
|
||||
}
|
||||
@ -3488,7 +3488,7 @@ TraceRecorder::cmp(LOpcode op, int flags)
|
||||
u.d = js_NaN;
|
||||
l_ins = lir->insImmq(u.u64);
|
||||
} else if (JSVAL_IS_STRING(l)) {
|
||||
l_ins = lir->insCall(&ci_StringToNumber, args);
|
||||
l_ins = lir->insCall(&js_StringToNumber_ci, args);
|
||||
} else if (JSVAL_TAG(l) == JSVAL_BOOLEAN) {
|
||||
/*
|
||||
* What I really want here is for undefined to be type-specialized
|
||||
@ -3497,7 +3497,7 @@ TraceRecorder::cmp(LOpcode op, int flags)
|
||||
* branched. Failing that, I want to be able to ins_choose on quads
|
||||
* without cmov. Failing that, eat flaming builtin!
|
||||
*/
|
||||
l_ins = lir->insCall(&ci_BooleanToNumber, args);
|
||||
l_ins = lir->insCall(&js_BooleanToNumber_ci, args);
|
||||
} else if (!isNumber(l)) {
|
||||
ABORT_TRACE("unsupported LHS type for cmp vs number");
|
||||
}
|
||||
@ -3510,10 +3510,10 @@ TraceRecorder::cmp(LOpcode op, int flags)
|
||||
u.d = js_NaN;
|
||||
r_ins = lir->insImmq(u.u64);
|
||||
} else if (JSVAL_IS_STRING(r)) {
|
||||
r_ins = lir->insCall(&ci_StringToNumber, args);
|
||||
r_ins = lir->insCall(&js_StringToNumber_ci, args);
|
||||
} else if (JSVAL_TAG(r) == JSVAL_BOOLEAN) {
|
||||
// See above for the sob story.
|
||||
r_ins = lir->insCall(&ci_BooleanToNumber, args);
|
||||
r_ins = lir->insCall(&js_BooleanToNumber_ci, args);
|
||||
} else if (!isNumber(r)) {
|
||||
ABORT_TRACE("unsupported RHS type for cmp vs number");
|
||||
}
|
||||
@ -3624,20 +3624,20 @@ TraceRecorder::binary(LOpcode op)
|
||||
if (JSVAL_IS_STRING(l)) {
|
||||
args[0] = a;
|
||||
args[1] = cx_ins;
|
||||
a = lir->insCall(&ci_StringToNumber, args);
|
||||
a = lir->insCall(&js_StringToNumber_ci, args);
|
||||
leftNumber = true;
|
||||
}
|
||||
if (JSVAL_IS_STRING(r)) {
|
||||
args[0] = b;
|
||||
args[1] = cx_ins;
|
||||
b = lir->insCall(&ci_StringToNumber, args);
|
||||
b = lir->insCall(&js_StringToNumber_ci, args);
|
||||
rightNumber = true;
|
||||
}
|
||||
}
|
||||
if (leftNumber && rightNumber) {
|
||||
if (intop) {
|
||||
LIns *args[] = { a };
|
||||
a = lir->insCall(op == LIR_ush ? &ci_DoubleToUint32 : &ci_DoubleToInt32, args);
|
||||
a = lir->insCall(op == LIR_ush ? &js_DoubleToUint32_ci : &js_DoubleToInt32_ci, args);
|
||||
b = f2i(b);
|
||||
}
|
||||
a = lir->ins2(op, a, b);
|
||||
@ -3922,7 +3922,7 @@ TraceRecorder::box_jsval(jsval v, LIns*& v_ins)
|
||||
{
|
||||
if (isNumber(v)) {
|
||||
LIns* args[] = { v_ins, cx_ins };
|
||||
v_ins = lir->insCall(&ci_BoxDouble, args);
|
||||
v_ins = lir->insCall(&js_BoxDouble_ci, args);
|
||||
guard(false, lir->ins2(LIR_eq, v_ins, INS_CONST(JSVAL_ERROR_COOKIE)),
|
||||
OOM_EXIT);
|
||||
return true;
|
||||
@ -3954,7 +3954,7 @@ TraceRecorder::unbox_jsval(jsval v, LIns*& v_ins)
|
||||
JSVAL_DOUBLE))),
|
||||
MISMATCH_EXIT);
|
||||
LIns* args[] = { v_ins };
|
||||
v_ins = lir->insCall(&ci_UnboxDouble, args);
|
||||
v_ins = lir->insCall(&js_UnboxDouble_ci, args);
|
||||
return true;
|
||||
}
|
||||
switch (JSVAL_TAG(v)) {
|
||||
@ -4265,7 +4265,7 @@ TraceRecorder::record_JSOP_ARGUMENTS()
|
||||
ABORT_TRACE("can't trace arguments yet");
|
||||
#else
|
||||
LIns* args[] = { cx_ins };
|
||||
LIns* a_ins = lir->insCall(&ci_Arguments, args);
|
||||
LIns* a_ins = lir->insCall(&js_Arguments_ci, args);
|
||||
guard(false, lir->ins_eq0(a_ins), OOM_EXIT);
|
||||
stack(0, a_ins);
|
||||
return true;
|
||||
@ -4377,15 +4377,15 @@ TraceRecorder::record_JSOP_ADD()
|
||||
} else {
|
||||
LIns* args2[] = { get(&r), cx_ins };
|
||||
if (JSVAL_IS_NUMBER(r)) {
|
||||
args[0] = lir->insCall(&ci_NumberToString, args2);
|
||||
args[0] = lir->insCall(&js_NumberToString_ci, args2);
|
||||
} else if (JSVAL_IS_OBJECT(r)) {
|
||||
args[0] = lir->insCall(&ci_ObjectToString, args2);
|
||||
args[0] = lir->insCall(&js_ObjectToString_ci, args2);
|
||||
} else {
|
||||
ABORT_TRACE("untraceable right operand to string-JSOP_ADD");
|
||||
}
|
||||
guard(false, lir->ins_eq0(args[0]), OOM_EXIT);
|
||||
}
|
||||
LIns* concat = lir->insCall(&ci_ConcatStrings, args);
|
||||
LIns* concat = lir->insCall(&js_ConcatStrings_ci, args);
|
||||
guard(false, lir->ins_eq0(concat), OOM_EXIT);
|
||||
set(&l, concat);
|
||||
return true;
|
||||
@ -4423,12 +4423,12 @@ TraceRecorder::record_JSOP_MOD()
|
||||
/* We can't demote this in a filter since we need the actual values of l and r. */
|
||||
if (isPromote(l_ins) && isPromote(r_ins) && asNumber(l) >= 0 && asNumber(r) > 0) {
|
||||
LIns* args[] = { ::demote(lir, r_ins), ::demote(lir, l_ins) };
|
||||
x = lir->insCall(&ci_imod, args);
|
||||
x = lir->insCall(&js_imod_ci, args);
|
||||
guard(false, lir->ins2(LIR_eq, x, lir->insImm(-1)), BRANCH_EXIT);
|
||||
x = lir->ins1(LIR_i2f, x);
|
||||
} else {
|
||||
LIns* args[] = { r_ins, l_ins };
|
||||
x = lir->insCall(&ci_dmod, args);
|
||||
x = lir->insCall(&js_dmod_ci, args);
|
||||
}
|
||||
set(&l, x);
|
||||
return true;
|
||||
@ -4537,7 +4537,7 @@ TraceRecorder::functionCall(bool constructing)
|
||||
if (FUN_INTERPRETED(fun)) {
|
||||
if (constructing) {
|
||||
LIns* args[] = { get(&fval), cx_ins };
|
||||
LIns* tv_ins = lir->insCall(&ci_FastNewObject, args);
|
||||
LIns* tv_ins = lir->insCall(&js_FastNewObject_ci, args);
|
||||
guard(false, lir->ins_eq0(tv_ins), OOM_EXIT);
|
||||
set(&tval, tv_ins);
|
||||
}
|
||||
@ -4569,7 +4569,7 @@ TraceRecorder::functionCall(bool constructing)
|
||||
if (!aval_ins->isCall())
|
||||
ABORT_TRACE("can't trace Function.prototype.apply on non-builtin-call 2nd arg");
|
||||
|
||||
if (aval_ins->callInfo() == &ci_Arguments) {
|
||||
if (aval_ins->callInfo() == &js_Arguments_ci) {
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, aobj) == &js_ArgumentsClass);
|
||||
JS_ASSERT(OBJ_GET_PRIVATE(cx, aobj) == fp);
|
||||
if (!FUN_INTERPRETED(tfun))
|
||||
@ -4604,7 +4604,7 @@ TraceRecorder::functionCall(bool constructing)
|
||||
return interpretedFunctionCall(tval, tfun, argc, false);
|
||||
}
|
||||
|
||||
if (aval_ins->callInfo() != &ci_Array_1str)
|
||||
if (aval_ins->callInfo() != &js_Array_1str_ci)
|
||||
ABORT_TRACE("can't trace Function.prototype.apply on other than [str] 2nd arg");
|
||||
|
||||
JS_ASSERT(OBJ_IS_ARRAY(cx, aobj));
|
||||
@ -4629,12 +4629,12 @@ TraceRecorder::functionCall(bool constructing)
|
||||
ABORT_TRACE("untraceable native");
|
||||
|
||||
static JSTraceableNative knownNatives[] = {
|
||||
{ (JSFastNative)js_Array, &ci_FastNewArray, "pC", "", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Array, &ci_Array_1int, "pC", "i", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Array, &ci_Array_2obj, "pC", "oo", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Array, &ci_Array_3num, "pC", "ddd", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Object, &ci_FastNewObject, "fC", "", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Date, &ci_FastNewDate, "pC", "", FAIL_NULL },
|
||||
{ (JSFastNative)js_Array, &js_FastNewArray_ci, "pC", "", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Array, &js_Array_1int_ci, "pC", "i", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Array, &js_Array_2obj_ci, "pC", "oo", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Array, &js_Array_3num_ci, "pC", "ddd", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Object, &js_FastNewObject_ci, "fC", "", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Date, &js_FastNewDate_ci, "pC", "", FAIL_NULL },
|
||||
};
|
||||
|
||||
LIns* args[5];
|
||||
@ -4732,7 +4732,7 @@ TraceRecorder::functionCall(bool constructing)
|
||||
* If we got this far, and we have a charCodeAt, check that charCodeAt
|
||||
* isn't going to return a NaN.
|
||||
*/
|
||||
if (!constructing && known->builtin == &ci_String_p_charCodeAt) {
|
||||
if (!constructing && known->builtin == &js_String_p_charCodeAt_ci) {
|
||||
JSString* str = JSVAL_TO_STRING(thisval);
|
||||
jsval& arg = arg1_ins ? arg1 : stackval(-1);
|
||||
|
||||
@ -4837,10 +4837,10 @@ TraceRecorder::record_JSOP_TYPEOF()
|
||||
// We specialize identically for boolean and undefined. We must not have a hole here.
|
||||
// Pass the unboxed type here, since TypeOfBoolean knows how to handle it.
|
||||
JS_ASSERT(JSVAL_TO_BOOLEAN(r) <= 2);
|
||||
type = lir->insCall(&ci_TypeOfBoolean, args);
|
||||
type = lir->insCall(&js_TypeOfBoolean_ci, args);
|
||||
} else {
|
||||
JS_ASSERT(JSVAL_IS_OBJECT(r));
|
||||
type = lir->insCall(&ci_TypeOfObject, args);
|
||||
type = lir->insCall(&js_TypeOfObject_ci, args);
|
||||
}
|
||||
}
|
||||
set(&r, type);
|
||||
@ -5000,7 +5000,7 @@ TraceRecorder::record_SetPropHit(JSPropCacheEntry* entry, JSScopeProperty* sprop
|
||||
|
||||
if (entry->kshape != PCVCAP_SHAPE(entry->vcap)) {
|
||||
LIns* args[] = { INS_CONSTPTR(sprop), obj_ins, cx_ins };
|
||||
LIns* ok_ins = lir->insCall(&ci_AddProperty, args);
|
||||
LIns* ok_ins = lir->insCall(&js_AddProperty_ci, args);
|
||||
guard(false, lir->ins_eq0(ok_ins), OOM_EXIT);
|
||||
}
|
||||
|
||||
@ -5052,7 +5052,7 @@ TraceRecorder::record_JSOP_GETELEM()
|
||||
ABORT_TRACE("Invalid string index in JSOP_GETELEM");
|
||||
idx_ins = makeNumberInt32(idx_ins);
|
||||
LIns* args[] = { idx_ins, obj_ins, cx_ins };
|
||||
LIns* unitstr_ins = lir->insCall(&ci_String_getelem, args);
|
||||
LIns* unitstr_ins = lir->insCall(&js_String_getelem_ci, args);
|
||||
guard(false, lir->ins_eq0(unitstr_ins), MISMATCH_EXIT);
|
||||
set(&lval, unitstr_ins);
|
||||
return true;
|
||||
@ -5082,7 +5082,7 @@ TraceRecorder::record_JSOP_GETELEM()
|
||||
return false;
|
||||
}
|
||||
LIns* args[] = { idx_ins, obj_ins, cx_ins };
|
||||
v_ins = lir->insCall(&ci_Any_getprop, args);
|
||||
v_ins = lir->insCall(&js_Any_getprop_ci, args);
|
||||
guard(false, lir->ins2(LIR_eq, v_ins, INS_CONST(JSVAL_ERROR_COOKIE)), MISMATCH_EXIT);
|
||||
if (!unbox_jsval(v, v_ins))
|
||||
ABORT_TRACE("JSOP_GETELEM");
|
||||
@ -5105,7 +5105,7 @@ TraceRecorder::record_JSOP_GETELEM()
|
||||
idx = ID_TO_VALUE(id);
|
||||
if (!guardElemOp(obj, obj_ins, id, offsetof(JSObjectOps, getProperty), &v))
|
||||
return false;
|
||||
LIns* v_ins = lir->insCall(&ci_Any_getelem, args);
|
||||
LIns* v_ins = lir->insCall(&js_Any_getelem_ci, args);
|
||||
guard(false, lir->ins2(LIR_eq, v_ins, INS_CONST(JSVAL_ERROR_COOKIE)), MISMATCH_EXIT);
|
||||
if (!unbox_jsval(v, v_ins))
|
||||
ABORT_TRACE("JSOP_GETELEM");
|
||||
@ -5150,7 +5150,7 @@ TraceRecorder::record_JSOP_SETELEM()
|
||||
if (!guardElemOp(obj, obj_ins, id, offsetof(JSObjectOps, setProperty), NULL))
|
||||
return false;
|
||||
LIns* args[] = { boxed_v_ins, idx_ins, obj_ins, cx_ins };
|
||||
LIns* ok_ins = lir->insCall(&ci_Any_setprop, args);
|
||||
LIns* ok_ins = lir->insCall(&js_Any_setprop_ci, args);
|
||||
guard(false, lir->ins_eq0(ok_ins), MISMATCH_EXIT);
|
||||
} else if (JSVAL_IS_INT(idx)) {
|
||||
if (JSVAL_TO_INT(idx) < 0)
|
||||
@ -5159,14 +5159,14 @@ TraceRecorder::record_JSOP_SETELEM()
|
||||
LIns* args[] = { boxed_v_ins, idx_ins, obj_ins, cx_ins };
|
||||
LIns* res_ins;
|
||||
if (guardDenseArray(obj, obj_ins)) {
|
||||
res_ins = lir->insCall(&ci_Array_dense_setelem, args);
|
||||
res_ins = lir->insCall(&js_Array_dense_setelem_ci, args);
|
||||
} else {
|
||||
if (!js_IndexToId(cx, JSVAL_TO_INT(idx), &id))
|
||||
return false;
|
||||
idx = ID_TO_VALUE(id);
|
||||
if (!guardElemOp(obj, obj_ins, id, offsetof(JSObjectOps, setProperty), NULL))
|
||||
return false;
|
||||
res_ins = lir->insCall(&ci_Any_setelem, args);
|
||||
res_ins = lir->insCall(&js_Any_setelem_ci, args);
|
||||
}
|
||||
guard(false, lir->ins_eq0(res_ins), MISMATCH_EXIT);
|
||||
} else {
|
||||
@ -5417,7 +5417,7 @@ TraceRecorder::prop(JSObject* obj, LIns* obj_ins, uint32& slot, LIns*& v_ins)
|
||||
if (sprop->shortid == REGEXP_LAST_INDEX)
|
||||
ABORT_TRACE("can't trace regexp.lastIndex yet");
|
||||
LIns* args[] = { INS_CONSTPTR(sprop), obj_ins, cx_ins };
|
||||
v_ins = lir->insCall(&ci_CallGetter, args);
|
||||
v_ins = lir->insCall(&js_CallGetter_ci, args);
|
||||
guard(false, lir->ins2(LIR_eq, v_ins, INS_CONST(JSVAL_ERROR_COOKIE)), OOM_EXIT);
|
||||
if (!unbox_jsval((sprop->shortid == REGEXP_SOURCE) ? JSVAL_STRING : JSVAL_BOOLEAN,
|
||||
v_ins)) {
|
||||
@ -5704,7 +5704,7 @@ TraceRecorder::record_JSOP_NEWINIT()
|
||||
if (key == JSProto_Array) {
|
||||
if (!js_GetClassPrototype(cx, globalObj, INT_TO_JSID(key), &obj))
|
||||
return false;
|
||||
ci = &ci_FastNewArray;
|
||||
ci = &js_FastNewArray_ci;
|
||||
} else {
|
||||
jsval v_obj;
|
||||
if (!js_FindClassObject(cx, globalObj, INT_TO_JSID(key), &v_obj))
|
||||
@ -5712,7 +5712,7 @@ TraceRecorder::record_JSOP_NEWINIT()
|
||||
if (JSVAL_IS_PRIMITIVE(v_obj))
|
||||
ABORT_TRACE("primitive Object value");
|
||||
obj = JSVAL_TO_OBJECT(v_obj);
|
||||
ci = &ci_FastNewObject;
|
||||
ci = &js_FastNewObject_ci;
|
||||
}
|
||||
LIns* args[] = { INS_CONSTPTR(obj), cx_ins };
|
||||
LIns* v_ins = lir->insCall(ci, args);
|
||||
@ -5732,9 +5732,9 @@ TraceRecorder::record_JSOP_ENDINIT()
|
||||
if (obj->fslots[JSSLOT_ARRAY_LENGTH] == 1 &&
|
||||
obj->dslots && JSVAL_IS_STRING(obj->dslots[0])) {
|
||||
LIns* v_ins = get(&v);
|
||||
JS_ASSERT(v_ins->isCall() && v_ins->callInfo() == &ci_FastNewArray);
|
||||
JS_ASSERT(v_ins->isCall() && v_ins->callInfo() == &js_FastNewArray_ci);
|
||||
LIns* args[] = { stack(1), callArgN(v_ins, 1), cx_ins };
|
||||
v_ins = lir->insCall(&ci_Array_1str, args);
|
||||
v_ins = lir->insCall(&js_Array_1str_ci, args);
|
||||
set(&v, v_ins);
|
||||
}
|
||||
}
|
||||
@ -5821,7 +5821,7 @@ TraceRecorder::record_JSOP_ITER()
|
||||
if (!JSVAL_IS_PRIMITIVE(v)) {
|
||||
jsuint flags = cx->fp->regs->pc[1];
|
||||
LIns* args[] = { get(&v), INS_CONST(flags), cx_ins };
|
||||
LIns* v_ins = lir->insCall(&ci_FastValueToIterator, args);
|
||||
LIns* v_ins = lir->insCall(&js_FastValueToIterator_ci, args);
|
||||
guard(false, lir->ins_eq0(v_ins), MISMATCH_EXIT);
|
||||
set(&v, v_ins);
|
||||
return true;
|
||||
@ -5836,7 +5836,7 @@ TraceRecorder::forInLoop(jsval* vp)
|
||||
jsval& iterobj_val = stackval(-1);
|
||||
if (!JSVAL_IS_PRIMITIVE(iterobj_val)) {
|
||||
LIns* args[] = { get(&iterobj_val), cx_ins };
|
||||
LIns* v_ins = lir->insCall(&ci_FastCallIteratorNext, args);
|
||||
LIns* v_ins = lir->insCall(&js_FastCallIteratorNext_ci, args);
|
||||
guard(false, lir->ins2(LIR_eq, v_ins, INS_CONST(JSVAL_ERROR_COOKIE)), OOM_EXIT);
|
||||
|
||||
LIns* flag_ins = lir->ins_eq0(lir->ins2(LIR_eq, v_ins, INS_CONST(JSVAL_HOLE)));
|
||||
@ -5859,7 +5859,7 @@ bool
|
||||
TraceRecorder::record_JSOP_ENDITER()
|
||||
{
|
||||
LIns* args[] = { stack(-1), cx_ins };
|
||||
LIns* ok_ins = lir->insCall(&ci_CloseIterator, args);
|
||||
LIns* ok_ins = lir->insCall(&js_CloseIterator_ci, args);
|
||||
guard(false, lir->ins_eq0(ok_ins), MISMATCH_EXIT);
|
||||
return true;
|
||||
}
|
||||
@ -6023,7 +6023,7 @@ TraceRecorder::record_JSOP_IN()
|
||||
OBJ_DROP_PROPERTY(cx, obj2, prop);
|
||||
|
||||
LIns* args[] = { get(&lval), obj_ins, cx_ins };
|
||||
x = lir->insCall(&ci_HasNamedProperty, args);
|
||||
x = lir->insCall(&js_HasNamedProperty_ci, args);
|
||||
guard(false, lir->ins2i(LIR_eq, x, JSVAL_TO_BOOLEAN(JSVAL_VOID)), OOM_EXIT);
|
||||
x = lir->ins2i(LIR_eq, x, 1);
|
||||
} while (0);
|
||||
|
Loading…
Reference in New Issue
Block a user