use FASTCALL for builtins
authorshaver@mozilla.org
Sat, 05 Jul 2008 17:37:15 -0400
changeset 17432 9edc74143be669124e0589c0636e026bd9d7519b
parent 17431 ac9c1fa73e6f3abb9bd736025dfbdaaf3652c400
child 17433 8c6d36837b228e0b633f5e0dbc9cfaa01ad7f798
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a1pre
use FASTCALL for builtins
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -131,17 +131,17 @@ Tracker::set(const void* v, LIns* ins)
 #define Q  ARGSIZE_Q
 
 #ifdef DEBUG
 #define NAME(op) ,#op
 #else
 #define NAME(op)
 #endif
 
-jsdouble builtin_dmod(jsdouble a, jsdouble b)
+FASTCALL jsdouble builtin_dmod(jsdouble a, jsdouble b)
 {
     if (b == 0.0) {
         jsdpun u;
         u.s.hi = JSDOUBLE_HI32_EXPMASK | JSDOUBLE_HI32_MANTMASK;
         u.s.lo = 0xffffffff;
         return u.d;
     }
     jsdouble r;
@@ -154,39 +154,39 @@ jsdouble builtin_dmod(jsdouble a, jsdoub
         r = fmod(a, b);
     return r;
 }
 
 /* The following boxing/unboxing primitives we can't emit inline because
    they either interact with the GC and depend on Spidermonkey's 32-bit
    integer representation. */
 
-inline uint64 builtin_BoxDouble(JSContext* cx, jsdouble d)
+inline FASTCALL uint64 builtin_BoxDouble(JSContext* cx, jsdouble d)
 {
     if (!cx->doubleFreeList) /* we must be certain the GC won't kick in */
         return 1LL << 32;
     jsval v; /* not rooted but ok here because we know GC won't run */
 #ifdef DEBUG        
     bool ok = 
 #endif            
         js_NewDoubleInRootedValue(cx, d, &v);
 #ifdef DEBUG
     JS_ASSERT(ok);
 #endif        
     return v & 0xffffffffLL;
 }
 
-inline uint64 builtin_BoxInt32(JSContext* cx, jsint i)
+inline FASTCALL uint64 builtin_BoxInt32(JSContext* cx, jsint i)
 {
     if (INT_FITS_IN_JSVAL(i)) 
         return INT_TO_JSVAL(i) & 0xffffffffLL;
     return builtin_BoxDouble(cx, (jsdouble)i);
 }
 
-inline uint64 builtin_UnboxInt32(JSContext* cx, jsval v)
+inline FASTCALL uint64 builtin_UnboxInt32(JSContext* cx, jsval v)
 {
     if (JSVAL_IS_INT(v))
         return JSVAL_TO_INT(v);
     jsint i;
     if (JSVAL_IS_DOUBLE(v) && JSDOUBLE_IS_INT(*JSVAL_TO_DOUBLE(v), i))
         return i;
     return 1LL << 32;
 }
@@ -1244,17 +1244,17 @@ bool TraceRecorder::JSOP_SETELEM()
     /* check that the index is within bounds */
     jsint idx = asInt(r);
     LIns* idx_ins = get(&r);
     if (!guardDenseArrayIndexWithinBounds(obj, idx, obj_ins, dslots_ins, idx_ins))
         return false;
     /* get us the address of the array slot */
     LIns* addr = lir->ins2(LIR_add, dslots_ins, 
             lir->ins2i(LIR_lsh, idx_ins, sizeof(jsval) == 4 ? 2 : 3));
-    /* if the current value is a hole, abrt */
+    /* if the current value is a hole, abort */
     if (obj->dslots[idx] == JSVAL_HOLE)
         return false;
     LIns* oldval = lir->insLoad(LIR_ld, addr, 0);
     guard(false, lir->ins2(LIR_eq, oldval, lir->insImmPtr((void*)JSVAL_HOLE)));
     /* ok, box the value we are storing, store it and we are done */
     LIns* v_ins = get(&v);
     if (isInt(v))
         lir->insStorei(int32_to_jsval(v_ins), addr, 0);