Bug 545274 - nanojit: start adding alias info to loads/stores/calls (TM-specific part). r=jseward.

This commit is contained in:
Nicholas Nethercote 2010-03-02 13:47:17 +11:00
parent 380c80bfcb
commit ecf1dcc241
16 changed files with 253 additions and 189 deletions

View File

@ -936,7 +936,7 @@ nsICanvasRenderingContextWebGL_Uniform1iv_tn(JSContext *cx, JSObject *obj, uint3
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_Uniform1iv,
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform1iv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, 0)))
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform1iv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, nanojit::ACC_STORE_ANY)))
static jsval FASTCALL
nsICanvasRenderingContextWebGL_Uniform2iv_tn(JSContext *cx, JSObject *obj, uint32 location, JSObject *arg)
@ -945,7 +945,7 @@ nsICanvasRenderingContextWebGL_Uniform2iv_tn(JSContext *cx, JSObject *obj, uint3
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_Uniform2iv,
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform2iv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, 0)))
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform2iv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, nanojit::ACC_STORE_ANY)))
static jsval FASTCALL
nsICanvasRenderingContextWebGL_Uniform3iv_tn(JSContext *cx, JSObject *obj, uint32 location, JSObject *arg)
@ -954,7 +954,7 @@ nsICanvasRenderingContextWebGL_Uniform3iv_tn(JSContext *cx, JSObject *obj, uint3
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_Uniform3iv,
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform3iv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, 0)))
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform3iv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, nanojit::ACC_STORE_ANY)))
static jsval FASTCALL
nsICanvasRenderingContextWebGL_Uniform4iv_tn(JSContext *cx, JSObject *obj, uint32 location, JSObject *arg)
@ -963,7 +963,7 @@ nsICanvasRenderingContextWebGL_Uniform4iv_tn(JSContext *cx, JSObject *obj, uint3
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_Uniform4iv,
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform4iv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, 0)))
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform4iv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, nanojit::ACC_STORE_ANY)))
static jsval FASTCALL
nsICanvasRenderingContextWebGL_Uniform1fv_tn(JSContext *cx, JSObject *obj, uint32 location, JSObject *arg)
@ -972,7 +972,7 @@ nsICanvasRenderingContextWebGL_Uniform1fv_tn(JSContext *cx, JSObject *obj, uint3
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_Uniform1fv,
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform1fv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, 0)))
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform1fv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, nanojit::ACC_STORE_ANY)))
static jsval FASTCALL
nsICanvasRenderingContextWebGL_Uniform2fv_tn(JSContext *cx, JSObject *obj, uint32 location, JSObject *arg)
@ -981,7 +981,7 @@ nsICanvasRenderingContextWebGL_Uniform2fv_tn(JSContext *cx, JSObject *obj, uint3
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_Uniform2fv,
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform2fv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, 0)))
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform2fv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, nanojit::ACC_STORE_ANY)))
static jsval FASTCALL
nsICanvasRenderingContextWebGL_Uniform3fv_tn(JSContext *cx, JSObject *obj, uint32 location, JSObject *arg)
@ -990,7 +990,7 @@ nsICanvasRenderingContextWebGL_Uniform3fv_tn(JSContext *cx, JSObject *obj, uint3
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_Uniform3fv,
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform3fv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, 0)))
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform3fv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, nanojit::ACC_STORE_ANY)))
static jsval FASTCALL
nsICanvasRenderingContextWebGL_Uniform4fv_tn(JSContext *cx, JSObject *obj, uint32 location, JSObject *arg)
@ -999,7 +999,7 @@ nsICanvasRenderingContextWebGL_Uniform4fv_tn(JSContext *cx, JSObject *obj, uint3
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_Uniform4fv,
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform4fv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, 0)))
(4, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_Uniform4fv_tn, CONTEXT, THIS, UINT32, OBJECT, 0, nanojit::ACC_STORE_ANY)))
static jsval FASTCALL
nsICanvasRenderingContextWebGL_UniformMatrix2fv_tn(JSContext *cx, JSObject *obj, uint32 loc, JSBool transpose, JSObject *arg)
@ -1008,7 +1008,7 @@ nsICanvasRenderingContextWebGL_UniformMatrix2fv_tn(JSContext *cx, JSObject *obj,
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_UniformMatrix2fv,
(5, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_UniformMatrix2fv_tn, CONTEXT, THIS, UINT32, BOOL, OBJECT, 0, 0)))
(5, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_UniformMatrix2fv_tn, CONTEXT, THIS, UINT32, BOOL, OBJECT, 0, nanojit::ACC_STORE_ANY)))
static jsval FASTCALL
nsICanvasRenderingContextWebGL_UniformMatrix3fv_tn(JSContext *cx, JSObject *obj, uint32 loc, JSBool transpose, JSObject *arg)
@ -1017,7 +1017,7 @@ nsICanvasRenderingContextWebGL_UniformMatrix3fv_tn(JSContext *cx, JSObject *obj,
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_UniformMatrix3fv,
(5, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_UniformMatrix3fv_tn, CONTEXT, THIS, UINT32, BOOL, OBJECT, 0, 0)))
(5, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_UniformMatrix3fv_tn, CONTEXT, THIS, UINT32, BOOL, OBJECT, 0, nanojit::ACC_STORE_ANY)))
static jsval FASTCALL
nsICanvasRenderingContextWebGL_UniformMatrix4fv_tn(JSContext *cx, JSObject *obj, uint32 loc, JSBool transpose, JSObject *arg)
@ -1026,6 +1026,6 @@ nsICanvasRenderingContextWebGL_UniformMatrix4fv_tn(JSContext *cx, JSObject *obj,
}
JS_DEFINE_TRCINFO_1(nsICanvasRenderingContextWebGL_UniformMatrix4fv,
(5, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_UniformMatrix4fv_tn, CONTEXT, THIS, UINT32, BOOL, OBJECT, 0, 0)))
(5, (static, JSVAL_FAIL, nsICanvasRenderingContextWebGL_UniformMatrix4fv_tn, CONTEXT, THIS, UINT32, BOOL, OBJECT, 0, nanojit::ACC_STORE_ANY)))
#endif /* JS_TRACER */

View File

@ -950,7 +950,8 @@ js_Array_dense_setelem(JSContext* cx, JSObject* obj, jsint i, jsval v)
JS_ASSERT(OBJ_IS_DENSE_ARRAY(cx, obj));
return dense_grow(cx, obj, i, v);
}
JS_DEFINE_CALLINFO_4(extern, BOOL, js_Array_dense_setelem, CONTEXT, OBJECT, INT32, JSVAL, 0, 0)
JS_DEFINE_CALLINFO_4(extern, BOOL, js_Array_dense_setelem, CONTEXT, OBJECT, INT32, JSVAL, 0,
nanojit::ACC_STORE_ANY)
JSBool FASTCALL
js_Array_dense_setelem_int(JSContext* cx, JSObject* obj, jsint i, int32 j)
@ -968,7 +969,8 @@ js_Array_dense_setelem_int(JSContext* cx, JSObject* obj, jsint i, int32 j)
return dense_grow(cx, obj, i, v);
}
JS_DEFINE_CALLINFO_4(extern, BOOL, js_Array_dense_setelem_int, CONTEXT, OBJECT, INT32, INT32, 0, 0)
JS_DEFINE_CALLINFO_4(extern, BOOL, js_Array_dense_setelem_int, CONTEXT, OBJECT, INT32, INT32, 0,
nanojit::ACC_STORE_ANY)
JSBool FASTCALL
js_Array_dense_setelem_double(JSContext* cx, JSObject* obj, jsint i, jsdouble d)
@ -987,7 +989,8 @@ js_Array_dense_setelem_double(JSContext* cx, JSObject* obj, jsint i, jsdouble d)
return dense_grow(cx, obj, i, v);
}
JS_DEFINE_CALLINFO_4(extern, BOOL, js_Array_dense_setelem_double, CONTEXT, OBJECT, INT32, DOUBLE, 0, 0)
JS_DEFINE_CALLINFO_4(extern, BOOL, js_Array_dense_setelem_double, CONTEXT, OBJECT, INT32, DOUBLE,
0, nanojit::ACC_STORE_ANY)
#endif
static JSBool
@ -2426,7 +2429,8 @@ js_ArrayCompPush(JSContext *cx, JSObject *obj, jsval v)
obj->dslots[length] = v;
return JS_TRUE;
}
JS_DEFINE_CALLINFO_3(extern, BOOL, js_ArrayCompPush, CONTEXT, OBJECT, JSVAL, 0, 0)
JS_DEFINE_CALLINFO_3(extern, BOOL, js_ArrayCompPush, CONTEXT, OBJECT, JSVAL, 0,
nanojit::ACC_STORE_ANY)
#ifdef JS_TRACER
static jsval FASTCALL
@ -3309,13 +3313,13 @@ static JSPropertySpec array_props[] = {
};
JS_DEFINE_TRCINFO_1(array_toString,
(2, (static, STRING_FAIL, Array_p_toString, CONTEXT, THIS, 0, 0)))
(2, (static, STRING_FAIL, Array_p_toString, CONTEXT, THIS, 0, nanojit::ACC_STORE_ANY)))
JS_DEFINE_TRCINFO_1(array_join,
(3, (static, STRING_FAIL, Array_p_join, CONTEXT, THIS, STRING, 0, 0)))
(3, (static, STRING_FAIL, Array_p_join, CONTEXT, THIS, STRING, 0, nanojit::ACC_STORE_ANY)))
JS_DEFINE_TRCINFO_1(array_push,
(3, (static, JSVAL_FAIL, Array_p_push1, CONTEXT, THIS, JSVAL, 0, 0)))
(3, (static, JSVAL_FAIL, Array_p_push1, CONTEXT, THIS, JSVAL, 0, nanojit::ACC_STORE_ANY)))
JS_DEFINE_TRCINFO_1(array_pop,
(2, (static, JSVAL_FAIL, Array_p_pop, CONTEXT, THIS, 0, 0)))
(2, (static, JSVAL_FAIL, Array_p_pop, CONTEXT, THIS, 0, nanojit::ACC_STORE_ANY)))
static JSFunctionSpec array_methods[] = {
#if JS_HAS_TOSOURCE
@ -3416,7 +3420,7 @@ js_NewEmptyArray(JSContext* cx, JSObject* proto)
return obj;
}
#ifdef JS_TRACER
JS_DEFINE_CALLINFO_2(extern, OBJECT, js_NewEmptyArray, CONTEXT, OBJECT, 0, 0)
JS_DEFINE_CALLINFO_2(extern, OBJECT, js_NewEmptyArray, CONTEXT, OBJECT, 0, nanojit::ACC_STORE_ANY)
#endif
JSObject* JS_FASTCALL
@ -3431,7 +3435,8 @@ js_NewEmptyArrayWithLength(JSContext* cx, JSObject* proto, int32 len)
return obj;
}
#ifdef JS_TRACER
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_NewEmptyArrayWithLength, CONTEXT, OBJECT, INT32, 0, 0)
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_NewEmptyArrayWithLength, CONTEXT, OBJECT, INT32, 0,
nanojit::ACC_STORE_ANY)
#endif
JSObject* JS_FASTCALL
@ -3446,7 +3451,8 @@ js_NewArrayWithSlots(JSContext* cx, JSObject* proto, uint32 len)
return obj;
}
#ifdef JS_TRACER
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_NewArrayWithSlots, CONTEXT, OBJECT, UINT32, 0, 0)
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_NewArrayWithSlots, CONTEXT, OBJECT, UINT32, 0,
nanojit::ACC_STORE_ANY)
#endif
JSObject *

View File

@ -90,7 +90,7 @@ js_dmod(jsdouble a, jsdouble b)
}
return js_fmod(a, b);
}
JS_DEFINE_CALLINFO_2(extern, DOUBLE, js_dmod, DOUBLE, DOUBLE, 1, 1)
JS_DEFINE_CALLINFO_2(extern, DOUBLE, js_dmod, DOUBLE, DOUBLE, 1, ACC_NONE)
int32 FASTCALL
js_imod(int32 a, int32 b)
@ -100,7 +100,7 @@ js_imod(int32 a, int32 b)
int r = a % b;
return r;
}
JS_DEFINE_CALLINFO_2(extern, INT32, js_imod, INT32, INT32, 1, 1)
JS_DEFINE_CALLINFO_2(extern, INT32, js_imod, INT32, INT32, 1, ACC_NONE)
/* The following boxing/unboxing primitives we can't emit inline because
they either interact with the GC and depend on Spidermonkey's 32-bit
@ -118,7 +118,7 @@ js_BoxDouble(JSContext* cx, jsdouble d)
return JSVAL_ERROR_COOKIE;
return v;
}
JS_DEFINE_CALLINFO_2(extern, JSVAL, js_BoxDouble, CONTEXT, DOUBLE, 1, 1)
JS_DEFINE_CALLINFO_2(extern, JSVAL, js_BoxDouble, CONTEXT, DOUBLE, 1, ACC_NONE)
jsval FASTCALL
js_BoxInt32(JSContext* cx, int32 i)
@ -132,7 +132,7 @@ js_BoxInt32(JSContext* cx, int32 i)
return JSVAL_ERROR_COOKIE;
return v;
}
JS_DEFINE_CALLINFO_2(extern, JSVAL, js_BoxInt32, CONTEXT, INT32, 1, 1)
JS_DEFINE_CALLINFO_2(extern, JSVAL, js_BoxInt32, CONTEXT, INT32, 1, ACC_NONE)
jsdouble FASTCALL
js_UnboxDouble(jsval v)
@ -141,7 +141,7 @@ js_UnboxDouble(jsval v)
return (jsdouble)JSVAL_TO_INT(v);
return *JSVAL_TO_DOUBLE(v);
}
JS_DEFINE_CALLINFO_1(extern, DOUBLE, js_UnboxDouble, JSVAL, 1, 1)
JS_DEFINE_CALLINFO_1(extern, DOUBLE, js_UnboxDouble, JSVAL, 1, ACC_NONE)
int32 FASTCALL
js_UnboxInt32(jsval v)
@ -150,7 +150,7 @@ js_UnboxInt32(jsval v)
return JSVAL_TO_INT(v);
return js_DoubleToECMAInt32(*JSVAL_TO_DOUBLE(v));
}
JS_DEFINE_CALLINFO_1(extern, INT32, js_UnboxInt32, JSVAL, 1, 1)
JS_DEFINE_CALLINFO_1(extern, INT32, js_UnboxInt32, JSVAL, 1, ACC_NONE)
JSBool FASTCALL
js_TryUnboxInt32(jsval v, int32* i32p)
@ -168,21 +168,21 @@ js_TryUnboxInt32(jsval v, int32* i32p)
*i32p = i;
return JS_TRUE;
}
JS_DEFINE_CALLINFO_2(extern, BOOL, js_TryUnboxInt32, JSVAL, INT32PTR, 1, 1)
JS_DEFINE_CALLINFO_2(extern, BOOL, js_TryUnboxInt32, JSVAL, INT32PTR, 1, ACC_NONE)
int32 FASTCALL
js_DoubleToInt32(jsdouble d)
{
return js_DoubleToECMAInt32(d);
}
JS_DEFINE_CALLINFO_1(extern, INT32, js_DoubleToInt32, DOUBLE, 1, 1)
JS_DEFINE_CALLINFO_1(extern, INT32, js_DoubleToInt32, DOUBLE, 1, ACC_NONE)
uint32 FASTCALL
js_DoubleToUint32(jsdouble d)
{
return js_DoubleToECMAUint32(d);
}
JS_DEFINE_CALLINFO_1(extern, UINT32, js_DoubleToUint32, DOUBLE, 1, 1)
JS_DEFINE_CALLINFO_1(extern, UINT32, js_DoubleToUint32, DOUBLE, 1, ACC_NONE)
jsdouble FASTCALL
js_StringToNumber(JSContext* cx, JSString* str)
@ -201,7 +201,7 @@ js_StringToNumber(JSContext* cx, JSString* str)
}
return d;
}
JS_DEFINE_CALLINFO_2(extern, DOUBLE, js_StringToNumber, CONTEXT, STRING, 1, 1)
JS_DEFINE_CALLINFO_2(extern, DOUBLE, js_StringToNumber, CONTEXT, STRING, 1, ACC_NONE)
int32 FASTCALL
js_StringToInt32(JSContext* cx, JSString* str)
@ -227,7 +227,7 @@ js_StringToInt32(JSContext* cx, JSString* str)
}
return js_DoubleToECMAInt32(d);
}
JS_DEFINE_CALLINFO_2(extern, INT32, js_StringToInt32, CONTEXT, STRING, 1, 1)
JS_DEFINE_CALLINFO_2(extern, INT32, js_StringToInt32, CONTEXT, STRING, 1, ACC_NONE)
JSBool FASTCALL
js_AddProperty(JSContext* cx, JSObject* obj, JSScopeProperty* sprop)
@ -282,7 +282,7 @@ js_AddProperty(JSContext* cx, JSObject* obj, JSScopeProperty* sprop)
JS_UNLOCK_SCOPE(cx, scope);
return JS_FALSE;
}
JS_DEFINE_CALLINFO_3(extern, BOOL, js_AddProperty, CONTEXT, OBJECT, SCOPEPROP, 0, 0)
JS_DEFINE_CALLINFO_3(extern, BOOL, js_AddProperty, CONTEXT, OBJECT, SCOPEPROP, 0, ACC_STORE_ANY)
static JSBool
HasProperty(JSContext* cx, JSObject* obj, jsid id)
@ -314,7 +314,7 @@ js_HasNamedProperty(JSContext* cx, JSObject* obj, JSString* idstr)
return HasProperty(cx, obj, id);
}
JS_DEFINE_CALLINFO_3(extern, BOOL, js_HasNamedProperty, CONTEXT, OBJECT, STRING, 0, 0)
JS_DEFINE_CALLINFO_3(extern, BOOL, js_HasNamedProperty, CONTEXT, OBJECT, STRING, 0, ACC_STORE_ANY)
JSBool FASTCALL
js_HasNamedPropertyInt32(JSContext* cx, JSObject* obj, int32 index)
@ -325,7 +325,8 @@ js_HasNamedPropertyInt32(JSContext* cx, JSObject* obj, int32 index)
return HasProperty(cx, obj, id);
}
JS_DEFINE_CALLINFO_3(extern, BOOL, js_HasNamedPropertyInt32, CONTEXT, OBJECT, INT32, 0, 0)
JS_DEFINE_CALLINFO_3(extern, BOOL, js_HasNamedPropertyInt32, CONTEXT, OBJECT, INT32, 0,
ACC_STORE_ANY)
JSString* FASTCALL
js_TypeOfObject(JSContext* cx, JSObject* obj)
@ -334,7 +335,7 @@ js_TypeOfObject(JSContext* cx, JSObject* obj)
return ATOM_TO_STRING(cx->runtime->atomState.typeAtoms[JSTYPE_OBJECT]);
return ATOM_TO_STRING(cx->runtime->atomState.typeAtoms[obj->typeOf(cx)]);
}
JS_DEFINE_CALLINFO_2(extern, STRING, js_TypeOfObject, CONTEXT, OBJECT, 1, 1)
JS_DEFINE_CALLINFO_2(extern, STRING, js_TypeOfObject, CONTEXT, OBJECT, 1, ACC_NONE)
JSString* FASTCALL
js_TypeOfBoolean(JSContext* cx, int32 unboxed)
@ -345,7 +346,7 @@ js_TypeOfBoolean(JSContext* cx, int32 unboxed)
JSType type = JS_TypeOfValue(cx, boxed);
return ATOM_TO_STRING(cx->runtime->atomState.typeAtoms[type]);
}
JS_DEFINE_CALLINFO_2(extern, STRING, js_TypeOfBoolean, CONTEXT, INT32, 1, 1)
JS_DEFINE_CALLINFO_2(extern, STRING, js_TypeOfBoolean, CONTEXT, INT32, 1, ACC_NONE)
jsdouble FASTCALL
js_BooleanOrUndefinedToNumber(JSContext* cx, int32 unboxed)
@ -355,7 +356,7 @@ js_BooleanOrUndefinedToNumber(JSContext* cx, int32 unboxed)
JS_ASSERT(unboxed == JS_TRUE || unboxed == JS_FALSE);
return unboxed;
}
JS_DEFINE_CALLINFO_2(extern, DOUBLE, js_BooleanOrUndefinedToNumber, CONTEXT, INT32, 1, 1)
JS_DEFINE_CALLINFO_2(extern, DOUBLE, js_BooleanOrUndefinedToNumber, CONTEXT, INT32, 1, ACC_NONE)
JSString* FASTCALL
js_BooleanOrUndefinedToString(JSContext *cx, int32 unboxed)
@ -363,7 +364,7 @@ js_BooleanOrUndefinedToString(JSContext *cx, int32 unboxed)
JS_ASSERT(uint32(unboxed) <= 2);
return ATOM_TO_STRING(cx->runtime->atomState.booleanAtoms[unboxed]);
}
JS_DEFINE_CALLINFO_2(extern, STRING, js_BooleanOrUndefinedToString, CONTEXT, INT32, 1, 1)
JS_DEFINE_CALLINFO_2(extern, STRING, js_BooleanOrUndefinedToString, CONTEXT, INT32, 1, ACC_NONE)
JSObject* FASTCALL
js_NewNullClosure(JSContext* cx, JSObject* funobj, JSObject* proto, JSObject* parent)
@ -383,7 +384,8 @@ js_NewNullClosure(JSContext* cx, JSObject* funobj, JSObject* proto, JSObject* pa
reinterpret_cast<jsval>(fun));
return closure;
}
JS_DEFINE_CALLINFO_4(extern, OBJECT, js_NewNullClosure, CONTEXT, OBJECT, OBJECT, OBJECT, 0, 0)
JS_DEFINE_CALLINFO_4(extern, OBJECT, js_NewNullClosure, CONTEXT, OBJECT, OBJECT, OBJECT, 0,
ACC_STORE_ANY)
JS_REQUIRES_STACK JSBool FASTCALL
js_PopInterpFrame(JSContext* cx, InterpState* state)
@ -424,7 +426,7 @@ js_PopInterpFrame(JSContext* cx, InterpState* state)
*state->inlineCallCountp = *state->inlineCallCountp - 1;
return JS_TRUE;
}
JS_DEFINE_CALLINFO_2(extern, BOOL, js_PopInterpFrame, CONTEXT, INTERPSTATE, 0, 0)
JS_DEFINE_CALLINFO_2(extern, BOOL, js_PopInterpFrame, CONTEXT, INTERPSTATE, 0, ACC_STORE_ANY)
JSString* FASTCALL
js_ConcatN(JSContext *cx, JSString **strArray, uint32 size)
@ -463,4 +465,4 @@ js_ConcatN(JSContext *cx, JSString **strArray, uint32 size)
cx->free(buf);
return str;
}
JS_DEFINE_CALLINFO_3(extern, STRING, js_ConcatN, CONTEXT, STRINGPTR, UINT32, 0, 0)
JS_DEFINE_CALLINFO_3(extern, STRING, js_ConcatN, CONTEXT, STRINGPTR, UINT32, 0, ACC_STORE_ANY)

View File

@ -256,15 +256,26 @@ struct ClosureVarInfo;
#define _JS_CALLINFO(name) name##_ci
#if defined(JS_NO_FASTCALL) && defined(NANOJIT_IA32)
#define _JS_DEFINE_CALLINFO(linkage, name, crtype, cargtypes, argtypes, cse, fold) \
#define _JS_DEFINE_CALLINFO(linkage, name, crtype, cargtypes, argtypes, isPure, storeAccSet) \
_JS_TN_LINKAGE(linkage, crtype) name cargtypes; \
_JS_CI_LINKAGE(linkage) const nanojit::CallInfo _JS_CALLINFO(name) = \
{ (intptr_t) &name, argtypes, cse, fold, nanojit::ABI_CDECL _JS_CI_NAME(name) };
{ (intptr_t) &name, argtypes, nanojit::ABI_CDECL, isPure, storeAccSet _JS_CI_NAME(name) };\
/* XXX: a temporary assertion to check all cse/fold pairs are correctly */ \
/* converted to isPure/storeAccSet pairs for bug 545274. Will be removed */ \
/* when bug 517910 starts doing more precise storeAccSet markings. */ \
JS_STATIC_ASSERT_IF(!isPure, storeAccSet == nanojit::ACC_STORE_ANY); /* temporary */ \
JS_STATIC_ASSERT_IF(isPure, storeAccSet == nanojit::ACC_NONE);
#else
#define _JS_DEFINE_CALLINFO(linkage, name, crtype, cargtypes, argtypes, cse, fold) \
#define _JS_DEFINE_CALLINFO(linkage, name, crtype, cargtypes, argtypes, isPure, storeAccSet) \
_JS_TN_LINKAGE(linkage, crtype) FASTCALL name cargtypes; \
_JS_CI_LINKAGE(linkage) const nanojit::CallInfo _JS_CALLINFO(name) = \
{ (intptr_t) &name, argtypes, cse, fold, nanojit::ABI_FASTCALL _JS_CI_NAME(name) };
{ (intptr_t) &name, argtypes, nanojit::ABI_FASTCALL, isPure, storeAccSet _JS_CI_NAME(name) }; \
/* XXX: a temporary assertion to check all cse/fold pairs are correctly */ \
/* converted to isPure/storeAccSet pairs for bug 545274. Will be removed */ \
/* when bug 517910 starts doing more precise storeAccSet markings. */ \
JS_STATIC_ASSERT_IF(!isPure, storeAccSet == nanojit::ACC_STORE_ANY); /* temporary */ \
JS_STATIC_ASSERT_IF(isPure, storeAccSet == nanojit::ACC_NONE);
#endif
/*
@ -289,33 +300,40 @@ struct ClosureVarInfo;
*
* - The parameter types.
*
* - The cse flag. 1 if the builtin call can be optimized away by common
* subexpression elimination; otherwise 0. This should be 1 only if the
* function is idempotent and the return value is determined solely by the
* arguments.
* - The isPure flag. Set to 1 if:
* (a) the function's return value is determined solely by its arguments
* (ie. no hidden state, no implicit inputs used such as global
* variables or the result of an I/O operation); and
* (b) the function causes no observable side-effects (ie. no writes to
* global variables, no I/O output).
* Multiple calls to a pure function can be merged during CSE.
*
* - The fold flag. Reserved. The same as cse for now.
* - The storeAccSet. This indicates which memory access regions the function
* accesses. It must be ACC_NONE if the function is pure; use
* ACC_STORE_ANY if you're not sure. Used to determine if each call site of
* the function aliases any loads.
*/
#define JS_DEFINE_CALLINFO_1(linkage, rt, op, at0, cse, fold) \
#define JS_DEFINE_CALLINFO_1(linkage, rt, op, at0, isPure, storeAccSet) \
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE_TYPE(rt), (_JS_CTYPE_TYPE(at0)), \
(_JS_CTYPE_ARGSIZE(at0) << (1*nanojit::ARGSIZE_SHIFT)) | \
_JS_CTYPE_RETSIZE(rt), cse, fold)
#define JS_DEFINE_CALLINFO_2(linkage, rt, op, at0, at1, cse, fold) \
_JS_CTYPE_RETSIZE(rt), \
isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_2(linkage, rt, op, at0, at1, isPure, storeAccSet) \
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE_TYPE(rt), \
(_JS_CTYPE_TYPE(at0), _JS_CTYPE_TYPE(at1)), \
(_JS_CTYPE_ARGSIZE(at0) << (2*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at1) << (1*nanojit::ARGSIZE_SHIFT)) | \
_JS_CTYPE_RETSIZE(rt), \
cse, fold)
#define JS_DEFINE_CALLINFO_3(linkage, rt, op, at0, at1, at2, cse, fold) \
isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_3(linkage, rt, op, at0, at1, at2, isPure, storeAccSet) \
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE_TYPE(rt), \
(_JS_CTYPE_TYPE(at0), _JS_CTYPE_TYPE(at1), _JS_CTYPE_TYPE(at2)), \
(_JS_CTYPE_ARGSIZE(at0) << (3*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at1) << (2*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at2) << (1*nanojit::ARGSIZE_SHIFT)) | \
_JS_CTYPE_RETSIZE(rt), \
cse, fold)
#define JS_DEFINE_CALLINFO_4(linkage, rt, op, at0, at1, at2, at3, cse, fold) \
isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_4(linkage, rt, op, at0, at1, at2, at3, isPure, storeAccSet) \
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE_TYPE(rt), \
(_JS_CTYPE_TYPE(at0), _JS_CTYPE_TYPE(at1), _JS_CTYPE_TYPE(at2), \
_JS_CTYPE_TYPE(at3)), \
@ -324,8 +342,8 @@ struct ClosureVarInfo;
(_JS_CTYPE_ARGSIZE(at2) << (2*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at3) << (1*nanojit::ARGSIZE_SHIFT)) | \
_JS_CTYPE_RETSIZE(rt), \
cse, fold)
#define JS_DEFINE_CALLINFO_5(linkage, rt, op, at0, at1, at2, at3, at4, cse, fold) \
isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_5(linkage, rt, op, at0, at1, at2, at3, at4, isPure, storeAccSet) \
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE_TYPE(rt), \
(_JS_CTYPE_TYPE(at0), _JS_CTYPE_TYPE(at1), _JS_CTYPE_TYPE(at2), \
_JS_CTYPE_TYPE(at3), _JS_CTYPE_TYPE(at4)), \
@ -335,8 +353,8 @@ struct ClosureVarInfo;
(_JS_CTYPE_ARGSIZE(at3) << (2*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at4) << (1*nanojit::ARGSIZE_SHIFT)) | \
_JS_CTYPE_RETSIZE(rt), \
cse, fold)
#define JS_DEFINE_CALLINFO_6(linkage, rt, op, at0, at1, at2, at3, at4, at5, cse, fold) \
isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_6(linkage, rt, op, at0, at1, at2, at3, at4, at5, isPure, storeAccSet) \
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE_TYPE(rt), \
(_JS_CTYPE_TYPE(at0), _JS_CTYPE_TYPE(at1), _JS_CTYPE_TYPE(at2), \
_JS_CTYPE_TYPE(at3), _JS_CTYPE_TYPE(at4), _JS_CTYPE_TYPE(at5)), \
@ -346,8 +364,10 @@ struct ClosureVarInfo;
(_JS_CTYPE_ARGSIZE(at3) << (3*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at4) << (2*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at5) << (1*nanojit::ARGSIZE_SHIFT)) | \
_JS_CTYPE_RETSIZE(rt), cse, fold)
#define JS_DEFINE_CALLINFO_7(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, cse, fold) \
_JS_CTYPE_RETSIZE(rt), \
isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_7(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, isPure, \
storeAccSet) \
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE_TYPE(rt), \
(_JS_CTYPE_TYPE(at0), _JS_CTYPE_TYPE(at1), _JS_CTYPE_TYPE(at2), \
_JS_CTYPE_TYPE(at3), _JS_CTYPE_TYPE(at4), _JS_CTYPE_TYPE(at5), \
@ -359,8 +379,10 @@ struct ClosureVarInfo;
(_JS_CTYPE_ARGSIZE(at4) << (3*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at5) << (2*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at6) << (1*nanojit::ARGSIZE_SHIFT)) | \
_JS_CTYPE_RETSIZE(rt), cse, fold)
#define JS_DEFINE_CALLINFO_8(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, at7, cse, fold) \
_JS_CTYPE_RETSIZE(rt), \
isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_8(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, at7, isPure, \
storeAccSet) \
_JS_DEFINE_CALLINFO(linkage, op, _JS_CTYPE_TYPE(rt), \
(_JS_CTYPE_TYPE(at0), _JS_CTYPE_TYPE(at1), _JS_CTYPE_TYPE(at2), \
_JS_CTYPE_TYPE(at3), _JS_CTYPE_TYPE(at4), _JS_CTYPE_TYPE(at5), \
@ -373,37 +395,38 @@ struct ClosureVarInfo;
(_JS_CTYPE_ARGSIZE(at5) << (3*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at6) << (2*nanojit::ARGSIZE_SHIFT)) | \
(_JS_CTYPE_ARGSIZE(at7) << (1*nanojit::ARGSIZE_SHIFT)) | \
_JS_CTYPE_RETSIZE(rt), cse, fold)
_JS_CTYPE_RETSIZE(rt), \
isPure, storeAccSet)
#define JS_DECLARE_CALLINFO(name) extern const nanojit::CallInfo _JS_CALLINFO(name);
#define _JS_TN_INIT_HELPER_n(n, args) _JS_TN_INIT_HELPER_##n args
#define _JS_TN_INIT_HELPER_1(linkage, rt, op, at0, cse, fold) \
#define _JS_TN_INIT_HELPER_1(linkage, rt, op, at0, isPure, storeAccSet) \
&_JS_CALLINFO(op), \
_JS_CTYPE_PCH(at0), \
_JS_CTYPE_ACH(at0), \
_JS_CTYPE_FLAGS(rt)
#define _JS_TN_INIT_HELPER_2(linkage, rt, op, at0, at1, cse, fold) \
#define _JS_TN_INIT_HELPER_2(linkage, rt, op, at0, at1, isPure, storeAccSet) \
&_JS_CALLINFO(op), \
_JS_CTYPE_PCH(at1) _JS_CTYPE_PCH(at0), \
_JS_CTYPE_ACH(at1) _JS_CTYPE_ACH(at0), \
_JS_CTYPE_FLAGS(rt)
#define _JS_TN_INIT_HELPER_3(linkage, rt, op, at0, at1, at2, cse, fold) \
#define _JS_TN_INIT_HELPER_3(linkage, rt, op, at0, at1, at2, isPure, storeAccSet) \
&_JS_CALLINFO(op), \
_JS_CTYPE_PCH(at2) _JS_CTYPE_PCH(at1) _JS_CTYPE_PCH(at0), \
_JS_CTYPE_ACH(at2) _JS_CTYPE_ACH(at1) _JS_CTYPE_ACH(at0), \
_JS_CTYPE_FLAGS(rt)
#define _JS_TN_INIT_HELPER_4(linkage, rt, op, at0, at1, at2, at3, cse, fold) \
#define _JS_TN_INIT_HELPER_4(linkage, rt, op, at0, at1, at2, at3, isPure, storeAccSet) \
&_JS_CALLINFO(op), \
_JS_CTYPE_PCH(at3) _JS_CTYPE_PCH(at2) _JS_CTYPE_PCH(at1) _JS_CTYPE_PCH(at0), \
_JS_CTYPE_ACH(at3) _JS_CTYPE_ACH(at2) _JS_CTYPE_ACH(at1) _JS_CTYPE_ACH(at0), \
_JS_CTYPE_FLAGS(rt)
#define _JS_TN_INIT_HELPER_5(linkage, rt, op, at0, at1, at2, at3, at4, cse, fold) \
#define _JS_TN_INIT_HELPER_5(linkage, rt, op, at0, at1, at2, at3, at4, isPure, storeAccSet) \
&_JS_CALLINFO(op), \
_JS_CTYPE_PCH(at4) _JS_CTYPE_PCH(at3) _JS_CTYPE_PCH(at2) _JS_CTYPE_PCH(at1) \
_JS_CTYPE_PCH(at0), \
@ -411,7 +434,7 @@ struct ClosureVarInfo;
_JS_CTYPE_ACH(at0), \
_JS_CTYPE_FLAGS(rt)
#define _JS_TN_INIT_HELPER_6(linkage, rt, op, at0, at1, at2, at3, at4, at5, cse, fold) \
#define _JS_TN_INIT_HELPER_6(linkage, rt, op, at0, at1, at2, at3, at4, at5, isPure, storeAccSet) \
&_JS_CALLINFO(op), \
_JS_CTYPE_PCH(at5) _JS_CTYPE_PCH(at4) _JS_CTYPE_PCH(at3) _JS_CTYPE_PCH(at2) \
_JS_CTYPE_PCH(at1) _JS_CTYPE_PCH(at0), \
@ -419,7 +442,7 @@ struct ClosureVarInfo;
_JS_CTYPE_ACH(at1) _JS_CTYPE_ACH(at0), \
_JS_CTYPE_FLAGS(rt)
#define _JS_TN_INIT_HELPER_7(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, cse, fold) \
#define _JS_TN_INIT_HELPER_7(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, isPure, storeAccSet) \
&_JS_CALLINFO(op), \
_JS_CTYPE_PCH(at6) _JS_CTYPE_PCH(at5) _JS_CTYPE_PCH(at4) _JS_CTYPE_PCH(at3) \
_JS_CTYPE_PCH(at2) _JS_CTYPE_PCH(at1) _JS_CTYPE_PCH(at0), \
@ -427,7 +450,7 @@ struct ClosureVarInfo;
_JS_CTYPE_ACH(at2) _JS_CTYPE_ACH(at1) _JS_CTYPE_ACH(at0), \
_JS_CTYPE_FLAGS(rt)
#define _JS_TN_INIT_HELPER_8(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, at7, cse, fold) \
#define _JS_TN_INIT_HELPER_8(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, at7, isPure, storeAccSet) \
&_JS_CALLINFO(op), \
_JS_CTYPE_PCH(at7) _JS_CTYPE_PCH(at6) _JS_CTYPE_PCH(at5) _JS_CTYPE_PCH(at4) \
_JS_CTYPE_PCH(at3) _JS_CTYPE_PCH(at2) _JS_CTYPE_PCH(at1) _JS_CTYPE_PCH(at0), \
@ -492,14 +515,14 @@ js_dmod(jsdouble a, jsdouble b);
#else
#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_DEFINE_CALLINFO_6(linkage, rt, op, at0, at1, at2, at3, at4, at5, cse, fold)
#define JS_DEFINE_CALLINFO_7(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, cse, fold)
#define JS_DEFINE_CALLINFO_8(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, at7, cse, fold)
#define JS_DEFINE_CALLINFO_1(linkage, rt, op, at0, isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_2(linkage, rt, op, at0, at1, isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_3(linkage, rt, op, at0, at1, at2, isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_4(linkage, rt, op, at0, at1, at2, at3, isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_5(linkage, rt, op, at0, at1, at2, at3, at4, isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_6(linkage, rt, op, at0, at1, at2, at3, at4, at5, isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_7(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, isPure, storeAccSet)
#define JS_DEFINE_CALLINFO_8(linkage, rt, op, at0, at1, at2, at3, at4, at5, at6, at7, isPure, storeAccSet)
#define JS_DECLARE_CALLINFO(name)
#define JS_DEFINE_TRCINFO_1(name, tn0)
#define JS_DEFINE_TRCINFO_2(name, tn0, tn1)

View File

@ -2253,7 +2253,7 @@ date_valueOf(JSContext *cx, uintN argc, jsval *vp)
// Don't really need an argument here, but we don't support arg-less builtins
JS_DEFINE_TRCINFO_1(date_now,
(1, (static, DOUBLE, date_now_tn, CONTEXT, 0, 0)))
(1, (static, DOUBLE, date_now_tn, CONTEXT, 0, nanojit::ACC_STORE_ANY)))
static JSFunctionSpec date_static_methods[] = {
JS_FN("UTC", date_UTC, MAXARGS,0),
@ -2263,7 +2263,7 @@ static JSFunctionSpec date_static_methods[] = {
};
JS_DEFINE_TRCINFO_1(date_valueOf,
(3, (static, JSVAL_RETRY, date_valueOf_tn, CONTEXT, THIS, STRING, 0, 0)))
(3, (static, JSVAL_RETRY, date_valueOf_tn, CONTEXT, THIS, STRING, 0, nanojit::ACC_STORE_ANY)))
static JSFunctionSpec date_methods[] = {
JS_FN("getTime", date_getTime, 0,0),

View File

@ -297,7 +297,7 @@ js_Arguments(JSContext *cx, JSObject *parent, uint32 argc, JSObject *callee,
#endif
JS_DEFINE_CALLINFO_6(extern, OBJECT, js_Arguments, CONTEXT, OBJECT, UINT32, OBJECT,
DOUBLEPTR, APNPTR, 0, 0)
DOUBLEPTR, APNPTR, 0, nanojit::ACC_STORE_ANY)
/* FIXME change the return type to void. */
JSBool JS_FASTCALL
@ -309,7 +309,8 @@ js_PutArguments(JSContext *cx, JSObject *argsobj, jsval *args)
return true;
}
JS_DEFINE_CALLINFO_3(extern, BOOL, js_PutArguments, CONTEXT, OBJECT, JSVALPTR, 0, 0)
JS_DEFINE_CALLINFO_3(extern, BOOL, js_PutArguments, CONTEXT, OBJECT, JSVALPTR, 0,
nanojit::ACC_STORE_ANY)
static JSBool
args_delProperty(JSContext *cx, JSObject *obj, jsval idval, jsval *vp)
@ -867,7 +868,8 @@ js_CreateCallObjectOnTrace(JSContext *cx, JSFunction *fun, JSObject *callee, JSO
return callobj;
}
JS_DEFINE_CALLINFO_4(extern, OBJECT, js_CreateCallObjectOnTrace, CONTEXT, FUNCTION, OBJECT, OBJECT, 0, 0)
JS_DEFINE_CALLINFO_4(extern, OBJECT, js_CreateCallObjectOnTrace, CONTEXT, FUNCTION, OBJECT, OBJECT,
0, nanojit::ACC_STORE_ANY)
JSFunction *
js_GetCallObjectFunction(JSObject *obj)
@ -947,7 +949,8 @@ js_PutCallObjectOnTrace(JSContext *cx, JSObject *scopeChain, uint32 nargs, jsval
return true;
}
JS_DEFINE_CALLINFO_6(extern, BOOL, js_PutCallObjectOnTrace, CONTEXT, OBJECT, UINT32, JSVALPTR, UINT32, JSVALPTR, 0, 0)
JS_DEFINE_CALLINFO_6(extern, BOOL, js_PutCallObjectOnTrace, CONTEXT, OBJECT, UINT32, JSVALPTR,
UINT32, JSVALPTR, 0, nanojit::ACC_STORE_ANY)
static JSBool
call_enumerate(JSContext *cx, JSObject *obj)
@ -1133,8 +1136,10 @@ js_SetCallVar(JSContext *cx, JSObject *obj, jsid id, jsval v)
return CallPropertyOp(cx, obj, id, &v, JSCPK_VAR, JS_TRUE);
}
JS_DEFINE_CALLINFO_4(extern, BOOL, js_SetCallArg, CONTEXT, OBJECT, JSID, JSVAL, 0, 0)
JS_DEFINE_CALLINFO_4(extern, BOOL, js_SetCallVar, CONTEXT, OBJECT, JSID, JSVAL, 0, 0)
JS_DEFINE_CALLINFO_4(extern, BOOL, js_SetCallArg, CONTEXT, OBJECT, JSID, JSVAL, 0,
nanojit::ACC_STORE_ANY)
JS_DEFINE_CALLINFO_4(extern, BOOL, js_SetCallVar, CONTEXT, OBJECT, JSID, JSVAL, 0,
nanojit::ACC_STORE_ANY)
static JSBool
call_resolve(JSContext *cx, JSObject *obj, jsval idval, uintN flags,
@ -2467,8 +2472,8 @@ js_CloneFunctionObject(JSContext *cx, JSFunction *fun, JSObject *parent,
}
#ifdef JS_TRACER
JS_DEFINE_CALLINFO_4(extern, OBJECT, js_CloneFunctionObject,
CONTEXT, FUNCTION, OBJECT, OBJECT, 0, 0)
JS_DEFINE_CALLINFO_4(extern, OBJECT, js_CloneFunctionObject, CONTEXT, FUNCTION, OBJECT, OBJECT, 0,
nanojit::ACC_STORE_ANY)
#endif
/*
@ -2498,7 +2503,7 @@ js_AllocFlatClosure(JSContext *cx, JSFunction *fun, JSObject *scopeChain)
}
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_AllocFlatClosure,
CONTEXT, FUNCTION, OBJECT, 0, 0)
CONTEXT, FUNCTION, OBJECT, 0, nanojit::ACC_STORE_ANY)
JS_REQUIRES_STACK JSObject *
js_NewFlatClosure(JSContext *cx, JSFunction *fun)

View File

@ -464,7 +464,7 @@ js_CloseIterator(JSContext *cx, jsval v)
#endif
return JS_TRUE;
}
JS_DEFINE_CALLINFO_2(FRIEND, BOOL, js_CloseIterator, CONTEXT, JSVAL, 0, 0)
JS_DEFINE_CALLINFO_2(FRIEND, BOOL, js_CloseIterator, CONTEXT, JSVAL, 0, nanojit::ACC_STORE_ANY)
static JSBool
CallEnumeratorNext(JSContext *cx, JSObject *iterobj, uintN flags, jsval *rval)

View File

@ -563,7 +563,7 @@ math_toSource(JSContext *cx, uintN argc, jsval *vp)
#define MATH_BUILTIN_CFUN_1(name, cfun) \
static jsdouble FASTCALL math_##name##_tn(jsdouble d) { return cfun(d); } \
JS_DEFINE_TRCINFO_1(math_##name, \
(1, (static, DOUBLE, math_##name##_tn, DOUBLE, 1, 1)))
(1, (static, DOUBLE, math_##name##_tn, DOUBLE, 1, nanojit::ACC_NONE)))
MATH_BUILTIN_CFUN_1(abs, fabs)
MATH_BUILTIN_1(atan)
@ -609,7 +609,7 @@ math_exp_tn(JSContext *cx, jsdouble d)
}
JS_DEFINE_TRCINFO_1(math_exp,
(2, (static, DOUBLE, math_exp_tn, CONTEXT, DOUBLE, 1, 1)))
(2, (static, DOUBLE, math_exp_tn, CONTEXT, DOUBLE, 1, nanojit::ACC_NONE)))
#else
@ -692,27 +692,27 @@ math_floor_tn(jsdouble x)
}
JS_DEFINE_TRCINFO_1(math_acos,
(1, (static, DOUBLE, math_acos_tn, DOUBLE, 1, 1)))
(1, (static, DOUBLE, math_acos_tn, DOUBLE, 1, nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(math_asin,
(1, (static, DOUBLE, math_asin_tn, DOUBLE, 1, 1)))
(1, (static, DOUBLE, math_asin_tn, DOUBLE, 1, nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(math_atan2,
(2, (static, DOUBLE, math_atan2_kernel, DOUBLE, DOUBLE, 1, 1)))
(2, (static, DOUBLE, math_atan2_kernel, DOUBLE, DOUBLE, 1, nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(js_math_floor,
(1, (static, DOUBLE, math_floor_tn, DOUBLE, 1, 1)))
(1, (static, DOUBLE, math_floor_tn, DOUBLE, 1, nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(math_log,
(1, (static, DOUBLE, math_log_tn, DOUBLE, 1, 1)))
(1, (static, DOUBLE, math_log_tn, DOUBLE, 1, nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(js_math_max,
(2, (static, DOUBLE, math_max_tn, DOUBLE, DOUBLE, 1, 1)))
(2, (static, DOUBLE, math_max_tn, DOUBLE, DOUBLE, 1, nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(js_math_min,
(2, (static, DOUBLE, math_min_tn, DOUBLE, DOUBLE, 1, 1)))
(2, (static, DOUBLE, math_min_tn, DOUBLE, DOUBLE, 1, nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(math_pow,
(2, (static, DOUBLE, math_pow_tn, DOUBLE, DOUBLE, 1, 1)))
(2, (static, DOUBLE, math_pow_tn, DOUBLE, DOUBLE, 1, nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(math_random,
(1, (static, DOUBLE, math_random_tn, CONTEXT, 0, 0)))
(1, (static, DOUBLE, math_random_tn, CONTEXT, 0, nanojit::ACC_STORE_ANY)))
JS_DEFINE_TRCINFO_1(js_math_round,
(1, (static, DOUBLE, math_round_tn, DOUBLE, 1, 1)))
(1, (static, DOUBLE, math_round_tn, DOUBLE, 1, nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(js_math_ceil,
(1, (static, DOUBLE, math_ceil_tn, DOUBLE, 1, 1)))
(1, (static, DOUBLE, math_ceil_tn, DOUBLE, 1, nanojit::ACC_NONE)))
#endif /* JS_TRACER */

View File

@ -254,11 +254,11 @@ const char js_parseInt_str[] = "parseInt";
#ifdef JS_TRACER
JS_DEFINE_TRCINFO_2(num_parseInt,
(2, (static, DOUBLE, ParseInt, CONTEXT, STRING, 1, 1)),
(1, (static, DOUBLE, ParseIntDouble, DOUBLE, 1, 1)))
(2, (static, DOUBLE, ParseInt, CONTEXT, STRING, 1, nanojit::ACC_NONE)),
(1, (static, DOUBLE, ParseIntDouble, DOUBLE, 1, nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(num_parseFloat,
(2, (static, DOUBLE, ParseFloat, CONTEXT, STRING, 1, 1)))
(2, (static, DOUBLE, ParseFloat, CONTEXT, STRING, 1, nanojit::ACC_NONE)))
#endif /* JS_TRACER */
@ -625,8 +625,10 @@ num_toPrecision(JSContext *cx, uintN argc, jsval *vp)
#ifdef JS_TRACER
JS_DEFINE_TRCINFO_2(num_toString,
(2, (extern, STRING_RETRY, js_NumberToString, CONTEXT, THIS_DOUBLE, 1, 1)),
(3, (static, STRING_RETRY, js_NumberToStringWithBase, CONTEXT, THIS_DOUBLE, INT32, 1, 1)))
(2, (extern, STRING_RETRY, js_NumberToString, CONTEXT, THIS_DOUBLE, 1,
nanojit::ACC_NONE)),
(3, (static, STRING_RETRY, js_NumberToStringWithBase, CONTEXT, THIS_DOUBLE, INT32, 1,
nanojit::ACC_NONE)))
#endif /* JS_TRACER */

View File

@ -2782,11 +2782,14 @@ const char js_lookupSetter_str[] = "__lookupSetter__";
#endif
JS_DEFINE_TRCINFO_1(obj_valueOf,
(3, (static, JSVAL, Object_p_valueOf, CONTEXT, THIS, STRING, 0, 0)))
(3, (static, JSVAL, Object_p_valueOf, CONTEXT, THIS, STRING, 0,
nanojit::ACC_STORE_ANY)))
JS_DEFINE_TRCINFO_1(obj_hasOwnProperty,
(3, (static, BOOL_FAIL, Object_p_hasOwnProperty, CONTEXT, THIS, STRING, 0, 0)))
(3, (static, BOOL_FAIL, Object_p_hasOwnProperty, CONTEXT, THIS, STRING, 0,
nanojit::ACC_STORE_ANY)))
JS_DEFINE_TRCINFO_1(obj_propertyIsEnumerable,
(3, (static, BOOL_FAIL, Object_p_propertyIsEnumerable, CONTEXT, THIS, STRING, 0, 0)))
(3, (static, BOOL_FAIL, Object_p_propertyIsEnumerable, CONTEXT, THIS, STRING, 0,
nanojit::ACC_STORE_ANY)))
static JSFunctionSpec object_methods[] = {
#if JS_HAS_TOSOURCE
@ -3028,7 +3031,8 @@ js_Object_tn(JSContext* cx, JSObject* proto)
}
JS_DEFINE_TRCINFO_1(js_Object,
(2, (extern, CONSTRUCTOR_RETRY, js_Object_tn, CONTEXT, CALLEE_PROTOTYPE, 0, 0)))
(2, (extern, CONSTRUCTOR_RETRY, js_Object_tn, CONTEXT, CALLEE_PROTOTYPE, 0,
nanojit::ACC_STORE_ANY)))
JSObject* FASTCALL
js_NonEmptyObject(JSContext* cx, JSObject* proto)
@ -3052,7 +3056,8 @@ js_NonEmptyObject(JSContext* cx, JSObject* proto)
return obj;
}
JS_DEFINE_CALLINFO_2(extern, CONSTRUCTOR_RETRY, js_NonEmptyObject, CONTEXT, CALLEE_PROTOTYPE, 0, 0)
JS_DEFINE_CALLINFO_2(extern, CONSTRUCTOR_RETRY, js_NonEmptyObject, CONTEXT, CALLEE_PROTOTYPE, 0,
nanojit::ACC_STORE_ANY)
static inline JSObject*
NewNativeObject(JSContext* cx, JSClass* clasp, JSObject* proto,
@ -3111,7 +3116,8 @@ js_NewInstance(JSContext *cx, JSClass *clasp, JSObject *ctor)
JSObject::defaultPrivate(clasp));
}
JS_DEFINE_CALLINFO_3(extern, CONSTRUCTOR_RETRY, js_NewInstance, CONTEXT, CLASS, OBJECT, 0, 0)
JS_DEFINE_CALLINFO_3(extern, CONSTRUCTOR_RETRY, js_NewInstance, CONTEXT, CLASS, OBJECT, 0,
nanojit::ACC_STORE_ANY)
#else /* !JS_TRACER */

View File

@ -2352,7 +2352,7 @@ class RegExpNativeCompiler {
LIns* to_fail = lir->insBranch(LIR_jf, lir->ins2(LIR_plt, pos, cpend), 0);
if (!fails.append(to_fail))
return NULL;
LIns* text_ch = lir->insLoad(LIR_ldcs, pos, 0);
LIns* text_ch = lir->insLoad(LIR_ldzs, pos, 0, ACC_READONLY);
// Extra characters that need to be compared against when doing folding.
struct extra {
@ -2573,7 +2573,7 @@ class RegExpNativeCompiler {
LIns* to_fail = lir->insBranch(LIR_jf, lir->ins2(LIR_plt, pos, cpend), 0);
if (!fails.append(to_fail))
return NULL;
LIns* text_ch = lir->insLoad(LIR_ldcs, pos, 0);
LIns* text_ch = lir->insLoad(LIR_ldzs, pos, 0, ACC_READONLY);
if (!fails.append(lir->insBranch(LIR_jf,
lir->ins2(LIR_le, text_ch, lir->insImm(charSet->length)),
0))) {
@ -2581,7 +2581,8 @@ class RegExpNativeCompiler {
}
LIns* byteIndex = lir->ins_i2p(lir->ins2(LIR_rsh, text_ch, lir->insImm(3)));
LIns* bitmap = lir->insImmPtr(bitmapData);
LIns* byte = lir->insLoad(LIR_ldcb, lir->ins2(LIR_piadd, bitmap, byteIndex), (int) 0);
LIns* byte = lir->insLoad(LIR_ldzb, lir->ins2(LIR_piadd, bitmap, byteIndex), (int) 0,
ACC_READONLY);
LIns* bitMask = lir->ins2(LIR_lsh, lir->insImm(1),
lir->ins2(LIR_and, text_ch, lir->insImm(0x7)));
LIns* test = lir->ins2(LIR_eq, lir->ins2(LIR_and, byte, bitMask), lir->insImm(0));
@ -2600,7 +2601,7 @@ class RegExpNativeCompiler {
chr = lir->ins2(LIR_lsh, chr, sizeLog2);
}
LIns *addr = lir->ins2(LIR_piadd, lir->insImmPtr(tbl), lir->ins_u2p(chr));
return lir->insLoad(LIR_ldcb, addr, 0);
return lir->insLoad(LIR_ldzb, addr, 0, ACC_READONLY);
}
/* Compile a builtin character class. */
@ -2609,7 +2610,7 @@ class RegExpNativeCompiler {
/* All the builtins checked below consume one character. */
if (!fails.append(lir->insBranch(LIR_jf, lir->ins2(LIR_plt, pos, cpend), 0)))
return NULL;
LIns *chr = lir->insLoad(LIR_ldcs, pos, 0);
LIns *chr = lir->insLoad(LIR_ldzs, pos, 0, ACC_READONLY);
switch (node->op) {
case REOP_DOT:
@ -5875,7 +5876,8 @@ js_CloneRegExpObject(JSContext *cx, JSObject *obj, JSObject *proto)
}
#ifdef JS_TRACER
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_CloneRegExpObject, CONTEXT, OBJECT, OBJECT, 0, 0)
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_CloneRegExpObject, CONTEXT, OBJECT, OBJECT, 0,
ACC_STORE_ANY)
#endif
bool

View File

@ -1029,7 +1029,8 @@ js_String_p_charCodeAt_int_int(JSString* str, jsint i)
return 0;
return str->chars()[i];
}
JS_DEFINE_CALLINFO_2(extern, INT32, js_String_p_charCodeAt_int_int, STRING, INT32, 1, 1)
JS_DEFINE_CALLINFO_2(extern, INT32, js_String_p_charCodeAt_int_int, STRING, INT32, 1,
nanojit::ACC_NONE)
int32 FASTCALL
js_String_p_charCodeAt_double_int(JSString* str, double d)
@ -1039,7 +1040,8 @@ js_String_p_charCodeAt_double_int(JSString* str, double d)
return 0;
return str->chars()[jsuint(d)];
}
JS_DEFINE_CALLINFO_2(extern, INT32, js_String_p_charCodeAt_double_int, STRING, DOUBLE, 1, 1)
JS_DEFINE_CALLINFO_2(extern, INT32, js_String_p_charCodeAt_double_int, STRING, DOUBLE, 1,
nanojit::ACC_NONE)
jsdouble FASTCALL
js_String_p_charCodeAt0(JSString* str)
@ -1060,7 +1062,7 @@ js_String_p_charCodeAt0_int(JSString* str)
return 0;
return str->chars()[0];
}
JS_DEFINE_CALLINFO_1(extern, INT32, js_String_p_charCodeAt0_int, STRING, 1, 1)
JS_DEFINE_CALLINFO_1(extern, INT32, js_String_p_charCodeAt0_int, STRING, 1, nanojit::ACC_NONE)
#endif
jsint
@ -2543,14 +2545,19 @@ js_String_getelem(JSContext* cx, JSString* str, int32 i)
#endif
JS_DEFINE_TRCINFO_1(js_str_toString,
(2, (extern, STRING_RETRY, String_p_toString, CONTEXT, THIS, 1, 1)))
(2, (extern, STRING_RETRY, String_p_toString, CONTEXT, THIS, 1,
nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(str_charAt,
(3, (extern, STRING_RETRY, js_String_getelem, CONTEXT, THIS_STRING, INT32, 1, 1)))
(3, (extern, STRING_RETRY, js_String_getelem, CONTEXT, THIS_STRING, INT32, 1,
nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_2(str_charCodeAt,
(1, (extern, DOUBLE, js_String_p_charCodeAt0, THIS_STRING, 1, 1)),
(2, (extern, DOUBLE, js_String_p_charCodeAt, THIS_STRING, DOUBLE, 1, 1)))
(1, (extern, DOUBLE, js_String_p_charCodeAt0, THIS_STRING, 1,
nanojit::ACC_NONE)),
(2, (extern, DOUBLE, js_String_p_charCodeAt, THIS_STRING, DOUBLE, 1,
nanojit::ACC_NONE)))
JS_DEFINE_TRCINFO_1(str_concat,
(3, (extern, STRING_RETRY, js_ConcatStrings, CONTEXT, THIS_STRING, STRING, 1, 1)))
(3, (extern, STRING_RETRY, js_ConcatStrings, CONTEXT, THIS_STRING, STRING, 1,
nanojit::ACC_NONE)))
#define GENERIC JSFUN_GENERIC_NATIVE
#define PRIMITIVE JSFUN_THISP_PRIMITIVE
@ -2952,7 +2959,8 @@ js_String_tn(JSContext* cx, JSObject* proto, JSString* str)
JS_ASSERT(JS_ON_TRACE(cx));
return js_NewObjectWithClassProto(cx, &js_StringClass, proto, STRING_TO_JSVAL(str));
}
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_String_tn, CONTEXT, CALLEE_PROTOTYPE, STRING, 0, 0)
JS_DEFINE_CALLINFO_3(extern, OBJECT, js_String_tn, CONTEXT, CALLEE_PROTOTYPE, STRING, 0,
nanojit::ACC_STORE_ANY)
#endif /* !JS_TRACER */
@ -3009,7 +3017,7 @@ String_fromCharCode(JSContext* cx, int32 i)
#endif
JS_DEFINE_TRCINFO_1(str_fromCharCode,
(2, (static, STRING_RETRY, String_fromCharCode, CONTEXT, INT32, 1, 1)))
(2, (static, STRING_RETRY, String_fromCharCode, CONTEXT, INT32, 1, nanojit::ACC_NONE)))
static JSFunctionSpec string_static_methods[] = {
JS_TN("fromCharCode", str_fromCharCode, 1, 0, &str_fromCharCode_trcinfo),
@ -3430,7 +3438,7 @@ js_EqualStrings(JSString *str1, JSString *str2)
return JS_TRUE;
}
JS_DEFINE_CALLINFO_2(extern, BOOL, js_EqualStrings, STRING, STRING, 1, 1)
JS_DEFINE_CALLINFO_2(extern, BOOL, js_EqualStrings, STRING, STRING, 1, nanojit::ACC_NONE)
int32 JS_FASTCALL
js_CompareStrings(JSString *str1, JSString *str2)
@ -3456,7 +3464,7 @@ js_CompareStrings(JSString *str1, JSString *str2)
}
return (intN)(l1 - l2);
}
JS_DEFINE_CALLINFO_2(extern, INT32, js_CompareStrings, STRING, STRING, 1, 1)
JS_DEFINE_CALLINFO_2(extern, INT32, js_CompareStrings, STRING, STRING, 1, nanojit::ACC_NONE)
size_t
js_strlen(const jschar *s)

View File

@ -834,7 +834,7 @@ PrintOnTrace(char* format, uint32 argc, double *argv)
return JS_TRUE;
}
JS_DEFINE_CALLINFO_3(extern, BOOL, PrintOnTrace, CHARPTR, UINT32, DOUBLEPTR, 0, 0)
JS_DEFINE_CALLINFO_3(extern, BOOL, PrintOnTrace, CHARPTR, UINT32, DOUBLEPTR, 0, ACC_STORE_ANY)
// This version is not intended to be called directly: usually it is easier to
// use one of the other overloads.
@ -5005,7 +5005,8 @@ TraceRecorder::emitTreeCall(TreeFragment* inner, VMSideExit* exit, LIns* inner_s
ci->_address = uintptr_t(inner->code());
JS_ASSERT(ci->_address);
ci->_argtypes = ARGSIZE_P | ARGSIZE_P << ARGSIZE_SHIFT;
ci->_cse = ci->_fold = 0;
ci->_isPure = 0;
ci->_storeAccSet = ACC_STORE_ANY;
ci->_abi = ABI_FASTCALL;
#ifdef DEBUG
ci->_name = "fragment";
@ -7775,8 +7776,10 @@ TraceRecorder::frameIfInRange(JSObject* obj, unsigned* depthp) const
return NULL;
}
JS_DEFINE_CALLINFO_4(extern, UINT32, GetClosureVar, CONTEXT, OBJECT, CVIPTR, DOUBLEPTR, 0, 0)
JS_DEFINE_CALLINFO_4(extern, UINT32, GetClosureArg, CONTEXT, OBJECT, CVIPTR, DOUBLEPTR, 0, 0)
JS_DEFINE_CALLINFO_4(extern, UINT32, GetClosureVar, CONTEXT, OBJECT, CVIPTR, DOUBLEPTR, 0,
ACC_STORE_ANY)
JS_DEFINE_CALLINFO_4(extern, UINT32, GetClosureArg, CONTEXT, OBJECT, CVIPTR, DOUBLEPTR, 0,
ACC_STORE_ANY)
/*
* Search the scope chain for a property lookup operation at the current PC and
@ -9073,8 +9076,9 @@ TraceRecorder::map_is_native(JSObjectMap* map, LIns* map_ins, LIns*& ops_ins, si
return false;
#undef OP
ops_ins = addName(lir->insLoad(LIR_ldcp, map_ins, int(offsetof(JSObjectMap, ops))), "ops");
LIns* n = lir->insLoad(LIR_ldcp, ops_ins, op_offset);
ops_ins = addName(lir->insLoad(LIR_ldp, map_ins, int(offsetof(JSObjectMap, ops)), ACC_READONLY),
"ops");
LIns* n = lir->insLoad(LIR_ldp, ops_ins, op_offset, ACC_READONLY);
guard(true,
addName(lir->ins2(LIR_peq, n, INS_CONSTPTR(ptr)), "guard(native-map)"),
BRANCH_EXIT);
@ -9253,7 +9257,8 @@ TraceRecorder::guardPropertyCacheHit(LIns* obj_ins,
if (entry->adding()) {
LIns *vshape_ins = addName(
lir->insLoad(LIR_ld,
addName(lir->insLoad(LIR_ldcp, cx_ins, offsetof(JSContext, runtime)),
addName(lir->insLoad(LIR_ldp, cx_ins,
offsetof(JSContext, runtime), ACC_READONLY),
"runtime"),
offsetof(JSRuntime, protoHazardShape)),
"protoHazardShape");
@ -9341,7 +9346,8 @@ LIns*
TraceRecorder::stobj_get_const_fslot(LIns* obj_ins, unsigned slot)
{
JS_ASSERT(slot < JS_INITIAL_NSLOTS);
return lir->insLoad(LIR_ldcp, obj_ins, offsetof(JSObject, fslots) + slot * sizeof(jsval));
return lir->insLoad(LIR_ldp, obj_ins, offsetof(JSObject, fslots) + slot * sizeof(jsval),
ACC_READONLY);
}
LIns*
@ -9426,15 +9432,10 @@ TraceRecorder::unbox_jsval(jsval v, LIns* v_ins, VMSideExit* exit)
INS_CONSTWORD(JSVAL_OBJECT)),
exit);
/*
* LIR_ldcp is ok to use here even though Array classword can
* change, because no object's classword can ever change from
* &js_ArrayClass to &js_FunctionClass.
*/
guard(HAS_FUNCTION_CLASS(JSVAL_TO_OBJECT(v)),
lir->ins2(LIR_peq,
lir->ins2(LIR_piand,
lir->insLoad(LIR_ldcp, v_ins, offsetof(JSObject, classword)),
lir->insLoad(LIR_ldp, v_ins, offsetof(JSObject, classword)),
INS_CONSTWORD(~JSSLOT_CLASS_MASK_BITS)),
INS_CONSTPTR(&js_FunctionClass)),
exit);
@ -9528,11 +9529,11 @@ TraceRecorder::getThis(LIns*& this_ins)
JS_REQUIRES_STACK bool
TraceRecorder::guardClass(JSObject* obj, LIns* obj_ins, JSClass* clasp, VMSideExit* exit,
LOpcode loadOp)
AccSet accSet)
{
bool cond = obj->getClass() == clasp;
LIns* class_ins = lir->insLoad(loadOp, obj_ins, offsetof(JSObject, classword));
LIns* class_ins = lir->insLoad(LIR_ldp, obj_ins, offsetof(JSObject, classword), accSet);
class_ins = lir->ins2(LIR_piand, class_ins, INS_CONSTWORD(~JSSLOT_CLASS_MASK_BITS));
#ifdef JS_JIT_SPEW
@ -10516,7 +10517,8 @@ TraceRecorder::emitNativePropertyOp(JSScope* scope, JSScopeProperty* sprop, LIns
ARGSIZE_P << (2*ARGSIZE_SHIFT) |
ARGSIZE_P << (3*ARGSIZE_SHIFT) |
ARGSIZE_P << (4*ARGSIZE_SHIFT);
ci->_cse = ci->_fold = 0;
ci->_isPure = 0;
ci->_storeAccSet = ACC_STORE_ANY;
ci->_abi = ABI_CDECL;
#ifdef DEBUG
ci->_name = "JSPropertyOp";
@ -10899,7 +10901,8 @@ TraceRecorder::callNative(uintN argc, JSOp mode)
CallInfo* ci = new (traceAlloc()) CallInfo();
ci->_address = uintptr_t(fun->u.n.native);
ci->_cse = ci->_fold = 0;
ci->_isPure = 0;
ci->_storeAccSet = ACC_STORE_ANY;
ci->_abi = ABI_CDECL;
ci->_argtypes = types;
#ifdef DEBUG
@ -11229,7 +11232,7 @@ MethodWriteBarrier(JSContext* cx, JSObject* obj, JSScopeProperty* sprop, JSObjec
return OBJ_SCOPE(obj)->methodWriteBarrier(cx, sprop, tvr.value());
}
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, MethodWriteBarrier, CONTEXT, OBJECT, SCOPEPROP, OBJECT,
0, 0)
0, ACC_STORE_ANY)
JS_REQUIRES_STACK RecordingStatus
TraceRecorder::setProp(jsval &l, JSPropCacheEntry* entry, JSScopeProperty* sprop,
@ -11399,8 +11402,9 @@ TraceRecorder::setCallProp(JSObject *callobj, LIns *callobj_ins, JSScopeProperty
offsetof(InterpState, callstackBase));
LIns *frameInfo_ins = lir->insLoad(LIR_ldp, callstackBase_ins, 0);
LIns *typemap_ins = lir->ins2(LIR_addp, frameInfo_ins, INS_CONSTWORD(sizeof(FrameInfo)));
LIns *type_ins = lir->insLoad(LIR_ldcb,
lir->ins2(LIR_addp, typemap_ins, lir->ins_u2p(slot_ins)), 0);
LIns *type_ins = lir->insLoad(LIR_ldzb,
lir->ins2(LIR_addp, typemap_ins, lir->ins_u2p(slot_ins)), 0,
ACC_READONLY);
TraceType type = getCoercedType(v);
if (type == TT_INT32 && !isPromoteInt(v_ins))
type = TT_DOUBLE;
@ -11532,7 +11536,7 @@ GetPropertyByName(JSContext* cx, JSObject* obj, JSString** namep, jsval* vp)
return cx->interpState->builtinStatus == 0;
}
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, GetPropertyByName, CONTEXT, OBJECT, STRINGPTR, JSVALPTR,
0, 0)
0, ACC_STORE_ANY)
// Convert the value in a slot to a string and store the resulting string back
// in the slot (typically in order to root it).
@ -11594,7 +11598,8 @@ GetPropertyByIndex(JSContext* cx, JSObject* obj, int32 index, jsval* vp)
}
return cx->interpState->builtinStatus == 0;
}
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, GetPropertyByIndex, CONTEXT, OBJECT, INT32, JSVALPTR, 0, 0)
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, GetPropertyByIndex, CONTEXT, OBJECT, INT32, JSVALPTR, 0,
ACC_STORE_ANY)
JS_REQUIRES_STACK RecordingStatus
TraceRecorder::getPropertyByIndex(LIns* obj_ins, LIns* index_ins, jsval* outp)
@ -11621,8 +11626,8 @@ GetPropertyById(JSContext* cx, JSObject* obj, jsid id, jsval* vp)
}
return cx->interpState->builtinStatus == 0;
}
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, GetPropertyById,
CONTEXT, OBJECT, JSVAL, JSVALPTR, 0, 0)
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, GetPropertyById, CONTEXT, OBJECT, JSVAL, JSVALPTR,
0, ACC_STORE_ANY)
JS_REQUIRES_STACK RecordingStatus
TraceRecorder::getPropertyById(LIns* obj_ins, jsval* outp)
@ -11678,7 +11683,7 @@ GetPropertyWithNativeGetter(JSContext* cx, JSObject* obj, JSScopeProperty* sprop
return cx->interpState->builtinStatus == 0;
}
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, GetPropertyWithNativeGetter,
CONTEXT, OBJECT, SCOPEPROP, JSVALPTR, 0, 0)
CONTEXT, OBJECT, SCOPEPROP, JSVALPTR, 0, ACC_STORE_ANY)
JS_REQUIRES_STACK RecordingStatus
TraceRecorder::getPropertyWithNativeGetter(LIns* obj_ins, JSScopeProperty* sprop, jsval* outp)
@ -11804,7 +11809,7 @@ TraceRecorder::record_JSOP_GETELEM()
lir->ins_u2p(lir->ins2(LIR_mul,
idx_ins,
INS_CONST(sizeof(TraceType)))));
LIns* type_ins = lir->insLoad(LIR_ldcb, typep_ins, 0);
LIns* type_ins = lir->insLoad(LIR_ldzb, typep_ins, 0, ACC_READONLY);
guard(true,
addName(lir->ins2(LIR_eq, type_ins, lir->insImm(type)),
"guard(type-stable upvar)"),
@ -11875,7 +11880,7 @@ SetPropertyByName(JSContext* cx, JSObject* obj, JSString** namep, jsval* vp)
return cx->interpState->builtinStatus == 0;
}
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, SetPropertyByName, CONTEXT, OBJECT, STRINGPTR, JSVALPTR,
0, 0)
0, ACC_STORE_ANY)
static JSBool FASTCALL
InitPropertyByName(JSContext* cx, JSObject* obj, JSString** namep, jsval val)
@ -11891,7 +11896,7 @@ InitPropertyByName(JSContext* cx, JSObject* obj, JSString** namep, jsval val)
return cx->interpState->builtinStatus == 0;
}
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, InitPropertyByName, CONTEXT, OBJECT, STRINGPTR, JSVAL,
0, 0)
0, ACC_STORE_ANY)
JS_REQUIRES_STACK RecordingStatus
TraceRecorder::initOrSetPropertyByName(LIns* obj_ins, jsval* idvalp, jsval* rvalp, bool init)
@ -11932,7 +11937,8 @@ SetPropertyByIndex(JSContext* cx, JSObject* obj, int32 index, jsval* vp)
}
return cx->interpState->builtinStatus == 0;
}
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, SetPropertyByIndex, CONTEXT, OBJECT, INT32, JSVALPTR, 0, 0)
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, SetPropertyByIndex, CONTEXT, OBJECT, INT32, JSVALPTR, 0,
ACC_STORE_ANY)
static JSBool FASTCALL
InitPropertyByIndex(JSContext* cx, JSObject* obj, int32 index, jsval val)
@ -11947,7 +11953,8 @@ InitPropertyByIndex(JSContext* cx, JSObject* obj, int32 index, jsval val)
}
return cx->interpState->builtinStatus == 0;
}
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, InitPropertyByIndex, CONTEXT, OBJECT, INT32, JSVAL, 0, 0)
JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, InitPropertyByIndex, CONTEXT, OBJECT, INT32, JSVAL, 0,
ACC_STORE_ANY)
JS_REQUIRES_STACK RecordingStatus
TraceRecorder::initOrSetPropertyByIndex(LIns* obj_ins, LIns* index_ins, jsval* rvalp, bool init)
@ -12017,11 +12024,13 @@ TraceRecorder::setElem(int lval_spindex, int idx_spindex, int v_spindex)
lir->insGuard(LIR_xf,
lir->ins2(LIR_ult,
idx_ins,
lir->insLoad(LIR_ldc, priv_ins, js::TypedArray::lengthOffset())),
lir->insLoad(LIR_ld, priv_ins, js::TypedArray::lengthOffset(),
ACC_READONLY)),
createGuardRecord(snapshot(OVERFLOW_EXIT)));
// We're now ready to store
LIns* data_ins = lir->insLoad(LIR_ldcp, priv_ins, js::TypedArray::dataOffset());
LIns* data_ins = lir->insLoad(LIR_ldp, priv_ins, js::TypedArray::dataOffset(),
ACC_READONLY);
LIns* pidx_ins = lir->ins_u2p(idx_ins);
LIns* addr_ins = 0;
@ -12177,11 +12186,11 @@ TraceRecorder::record_JSOP_CALLNAME()
}
JS_DEFINE_CALLINFO_5(extern, UINT32, GetUpvarArgOnTrace, CONTEXT, UINT32, INT32, UINT32,
DOUBLEPTR, 0, 0)
DOUBLEPTR, 0, ACC_STORE_ANY)
JS_DEFINE_CALLINFO_5(extern, UINT32, GetUpvarVarOnTrace, CONTEXT, UINT32, INT32, UINT32,
DOUBLEPTR, 0, 0)
DOUBLEPTR, 0, ACC_STORE_ANY)
JS_DEFINE_CALLINFO_5(extern, UINT32, GetUpvarStackOnTrace, CONTEXT, UINT32, INT32, UINT32,
DOUBLEPTR, 0, 0)
DOUBLEPTR, 0, ACC_STORE_ANY)
/*
* Record LIR to get the given upvar. Return the LIR instruction for the upvar
@ -12310,7 +12319,7 @@ TraceRecorder::record_JSOP_GETDSLOT()
unsigned index = GET_UINT16(cx->fp->regs->pc);
LIns* dslots_ins = lir->insLoad(LIR_ldp, callee_ins, offsetof(JSObject, dslots));
LIns* v_ins = lir->insLoad(LIR_ldcp, dslots_ins, index * sizeof(jsval));
LIns* v_ins = lir->insLoad(LIR_ldp, dslots_ins, index * sizeof(jsval), ACC_READONLY);
stack(0, unbox_jsval(callee->dslots[index], v_ins, snapshot(BRANCH_EXIT)));
return ARECORD_CONTINUE;
@ -12613,7 +12622,7 @@ CatchStopIteration_tn(JSContext* cx, JSBool ok, jsval* vp)
}
JS_DEFINE_TRCINFO_1(CatchStopIteration_tn,
(3, (static, BOOL, CatchStopIteration_tn, CONTEXT, BOOL, JSVALPTR, 0, 0)))
(3, (static, BOOL, CatchStopIteration_tn, CONTEXT, BOOL, JSVALPTR, 0, ACC_STORE_ANY)))
JS_REQUIRES_STACK AbortableRecordingStatus
TraceRecorder::record_NativeCallComplete()
@ -12763,7 +12772,7 @@ MethodReadBarrier(JSContext* cx, JSObject* obj, JSScopeProperty* sprop, JSObject
return JSVAL_TO_OBJECT(tvr.value());
}
JS_DEFINE_CALLINFO_4(static, OBJECT_FAIL, MethodReadBarrier, CONTEXT, OBJECT, SCOPEPROP, OBJECT,
0, 0)
0, ACC_STORE_ANY)
/*
* Get a property. The current opcode has JOF_ATOM.
@ -13075,12 +13084,12 @@ TraceRecorder::typedArrayElement(jsval& oval, jsval& ival, jsval*& vp, LIns*& v_
guard(true,
lir->ins2(LIR_ult,
idx_ins,
lir->insLoad(LIR_ldc, priv_ins, js::TypedArray::lengthOffset())),
lir->insLoad(LIR_ld, priv_ins, js::TypedArray::lengthOffset(), ACC_READONLY)),
OVERFLOW_EXIT);
/* We are now ready to load. Do a different type of load
* depending on what type of thing we're loading. */
LIns* data_ins = lir->insLoad(LIR_ldcp, priv_ins, js::TypedArray::dataOffset());
LIns* data_ins = lir->insLoad(LIR_ldp, priv_ins, js::TypedArray::dataOffset(), ACC_READONLY);
switch (tarray->type) {
case js::TypedArray::TYPE_INT8:
@ -13786,7 +13795,7 @@ HasInstance(JSContext* cx, JSObject* ctor, jsval val)
SetBuiltinError(cx);
return result;
}
JS_DEFINE_CALLINFO_3(static, BOOL_FAIL, HasInstance, CONTEXT, OBJECT, JSVAL, 0, 0)
JS_DEFINE_CALLINFO_3(static, BOOL_FAIL, HasInstance, CONTEXT, OBJECT, JSVAL, 0, ACC_STORE_ANY)
JS_REQUIRES_STACK AbortableRecordingStatus
TraceRecorder::record_JSOP_INSTANCEOF()
@ -14882,9 +14891,9 @@ CallIteratorNext_tn(JSContext* cx, jsbytecode* pc, JSObject* iterobj)
}
JS_DEFINE_TRCINFO_1(ObjectToIterator,
(4, (static, OBJECT_FAIL, ObjectToIterator_tn, CONTEXT, PC, THIS, INT32, 0, 0)))
(4, (static, OBJECT_FAIL, ObjectToIterator_tn, CONTEXT, PC, THIS, INT32, 0, ACC_STORE_ANY)))
JS_DEFINE_TRCINFO_1(CallIteratorNext,
(3, (static, JSVAL_FAIL, CallIteratorNext_tn, CONTEXT, PC, THIS, 0, 0)))
(3, (static, JSVAL_FAIL, CallIteratorNext_tn, CONTEXT, PC, THIS, 0, ACC_STORE_ANY)))
static const struct BuiltinFunctionInfo {
JSNativeTraceInfo *ti;
@ -15003,9 +15012,9 @@ TraceRecorder::record_JSOP_LENGTH()
} else if (OkToTraceTypedArrays && js_IsTypedArray(obj)) {
// Ensure array is a typed array and is the same type as what was written
guardConstClass(obj, obj_ins, obj->getClass(), snapshot(BRANCH_EXIT));
v_ins = lir->ins1(LIR_i2f, lir->insLoad(LIR_ldc,
v_ins = lir->ins1(LIR_i2f, lir->insLoad(LIR_ld,
stobj_get_const_fslot(obj_ins, JSSLOT_PRIVATE),
js::TypedArray::lengthOffset()));
js::TypedArray::lengthOffset(), ACC_READONLY));
} else {
if (!OBJ_IS_NATIVE(obj))
RETURN_STOP_A("can't trace length property access on non-array, non-native object");
@ -15120,7 +15129,7 @@ js_Unbrand(JSContext *cx, JSObject *obj)
return obj->unbrand(cx);
}
JS_DEFINE_CALLINFO_2(extern, BOOL, js_Unbrand, CONTEXT, OBJECT, 0, 0)
JS_DEFINE_CALLINFO_2(extern, BOOL, js_Unbrand, CONTEXT, OBJECT, 0, ACC_STORE_ANY)
JS_REQUIRES_STACK AbortableRecordingStatus
TraceRecorder::record_JSOP_UNBRAND()

View File

@ -1294,9 +1294,10 @@ class TraceRecorder
JS_REQUIRES_STACK nanojit::LIns* box_jsval(jsval v, nanojit::LIns* v_ins);
JS_REQUIRES_STACK nanojit::LIns* unbox_jsval(jsval v, nanojit::LIns* v_ins, VMSideExit* exit);
JS_REQUIRES_STACK bool guardClass(JSObject* obj, nanojit::LIns* obj_ins, JSClass* clasp,
VMSideExit* exit, nanojit::LOpcode loadOp = nanojit::LIR_ldp);
VMSideExit* exit,
nanojit::AccSet accSet = nanojit::ACC_LOAD_ANY);
bool guardConstClass(JSObject* obj, nanojit::LIns* obj_ins, JSClass* clasp, VMSideExit* exit) {
return guardClass(obj, obj_ins, clasp, exit, nanojit::LIR_ldcp);
return guardClass(obj, obj_ins, clasp, exit, nanojit::ACC_READONLY);
}
JS_REQUIRES_STACK bool guardDenseArray(JSObject* obj, nanojit::LIns* obj_ins,
ExitType exitType = MISMATCH_EXIT);

View File

@ -339,7 +339,7 @@ js_TypedArray_uint8_clamp_double(const double x)
return y;
}
JS_DEFINE_CALLINFO_1(extern, INT32, js_TypedArray_uint8_clamp_double, DOUBLE, 1, 1)
JS_DEFINE_CALLINFO_1(extern, INT32, js_TypedArray_uint8_clamp_double, DOUBLE, 1, nanojit::ACC_NONE)
struct uint8_clamped {

View File

@ -1303,7 +1303,7 @@ def writeTraceableQuickStub(f, customMethodCalls, member, stubName):
# Write the JS_DEFINE_TRCINFO block
f.write("JS_DEFINE_TRCINFO_1(%s,\n" % stubName)
f.write(" (%d, (static, %s, %s, %s, 0, 0)))\n\n"
f.write(" (%d, (static, %s, %s, %s, 0, nanojit::ACC_STORE_ANY)))\n\n"
% (len(traceInfo["params"]), traceInfo["type"], stubName + "_tn",
", ".join(traceInfo["params"])))