Steer macro naming in jsinterinlines.h using a macro. This allows us to prefix all primitives with some prefix (i.e. interp_) when we compile the tracer and replace them with new primitives that invoke the interpreter version first, and then do some tracer specific action.
authorAndreas Gal <gal@uci.edu>
Thu, 29 May 2008 17:14:42 -0700
changeset 17184 5eee494d5f061157f47c00d9c76605c00fb7b7d5
parent 17183 bd1d2405ea5ecf6592cbeb4ff9b5682b7cc5cdec
child 17185 0c74d1995a37ea4f9844bb86023994fffff6fb00
push id1452
push usershaver@mozilla.com
push dateFri, 22 Aug 2008 00:08:22 +0000
treeherdermozilla-central@d13bb0868596 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a1pre
Steer macro naming in jsinterinlines.h using a macro. This allows us to prefix all primitives with some prefix (i.e. interp_) when we compile the tracer and replace them with new primitives that invoke the interpreter version first, and then do some tracer specific action.
js/src/jsinterp.cpp
js/src/jsinterpinlines.h
js/src/jstracerinlines.h
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -2623,17 +2623,16 @@ JS_INTERPRET(JSContext *cx)
      */
 #define CHECK_BRANCH(len)                                                     \
     JS_BEGIN_MACRO                                                            \
         if (len <= 0) {                                                       \
             if ((cx->operationCount -= JSOW_SCRIPT_JUMP) <= 0) {              \
                 if (!js_ResetOperationCount(cx))                              \
                     goto error;                                               \
             }                                                                 \
-            monitor_branch(cx, regs, len);                                    \
         }                                                                     \
     JS_END_MACRO
 
     /*
      * Optimized Get and SetVersion for proper script language versioning.
      *
      * If any native method or JSClass/JSObjectOps hook calls js_SetVersion
      * and changes cx->version, the effect will "stick" and we will stop
--- a/js/src/jsinterpinlines.h
+++ b/js/src/jsinterpinlines.h
@@ -35,269 +35,273 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef jsinterpinlines_h___
 #define jsinterpinlines_h___
 
+#ifndef PRIMITIVE
+#define PRIMITIVE(x) x
+#endif
+
 static inline void
-prim_push_stack(JSFrameRegs& regs, jsval& v)
+PRIMITIVE(prim_push_stack)(JSFrameRegs& regs, jsval& v)
 {
     *regs.sp++ = v;
 }
 
 static inline void
-prim_pop_stack(JSFrameRegs& regs, jsval& v)
+PRIMITIVE(prim_pop_stack)(JSFrameRegs& regs, jsval& v)
 {
     v = *--regs.sp;
 }
 
 static inline void
-prim_store_stack(JSFrameRegs& regs, int n, jsval& v)
+PRIMITIVE(prim_store_stack)(JSFrameRegs& regs, int n, jsval& v)
 {
     regs.sp[n] = v;
 }
 
 static inline void
-prim_fetch_stack(JSFrameRegs& regs, int n, jsval& v)
+PRIMITIVE(prim_fetch_stack)(JSFrameRegs& regs, int n, jsval& v)
 {
     v = regs.sp[n];
 }
 
 static inline void
-prim_adjust_stack(JSFrameRegs& regs, int n)
+PRIMITIVE(prim_adjust_stack)(JSFrameRegs& regs, int n)
 {
     regs.sp += n;
 }
 
 static inline void
-prim_generate_constant(jsval c, jsval& v)
+PRIMITIVE(prim_generate_constant)(jsval c, jsval& v)
 {
     v = c;
 }
 
 static inline void
-prim_boolean_to_jsval(JSBool& b, jsval& v)
+PRIMITIVE(prim_boolean_to_jsval)(JSBool& b, jsval& v)
 {
     v = BOOLEAN_TO_JSVAL(b);
 }
 
 static inline void
-prim_string_to_jsval(JSString*& str, jsval& v)
+PRIMITIVE(prim_string_to_jsval)(JSString*& str, jsval& v)
 {
     v = STRING_TO_JSVAL(str);
 }
 
 static inline void
-prim_object_to_jsval(JSObject*& obj, jsval& v)
+PRIMITIVE(prim_object_to_jsval)(JSObject*& obj, jsval& v)
 {
     v = OBJECT_TO_JSVAL(obj);
 }
 
 static inline void
-prim_id_to_jsval(jsid& id, jsval& v)
+PRIMITIVE(prim_id_to_jsval)(jsid& id, jsval& v)
 {
     v = ID_TO_VALUE(id);
 }
 
 static inline void
-push_stack_constant(JSFrameRegs& regs, jsval c)
+PRIMITIVE(push_stack_constant)(JSFrameRegs& regs, jsval c)
 {
     jsval v;
     prim_generate_constant(c, v);
     prim_push_stack(regs, v);
 }
 
 static inline void
-push_stack_boolean(JSFrameRegs& regs, JSBool& b)
+PRIMITIVE(push_stack_boolean)(JSFrameRegs& regs, JSBool& b)
 {
     jsval v;
     prim_boolean_to_jsval(b, v);
     prim_push_stack(regs, v);
 }
 
 static inline void
-push_stack_object(JSFrameRegs& regs, JSObject*& obj)
+PRIMITIVE(push_stack_object)(JSFrameRegs& regs, JSObject*& obj)
 {
     jsval v;
     prim_object_to_jsval(obj, v);
     prim_push_stack(regs, v);
 }
 
 static inline void
-push_stack_id(JSFrameRegs& regs, jsid& id)
+PRIMITIVE(push_stack_id)(JSFrameRegs& regs, jsid& id)
 {
     jsval v;
     prim_id_to_jsval(id, v);
     prim_push_stack(regs, v);
 }
 
 static inline void
-store_stack_constant(JSFrameRegs& regs, int n, jsval c)
+PRIMITIVE(store_stack_constant)(JSFrameRegs& regs, int n, jsval c)
 {
     jsval v;
     prim_generate_constant(c, v);
     prim_store_stack(regs, n, v);
 }
 
 static inline void
-store_stack_boolean(JSFrameRegs& regs, int n, JSBool& b)
+PRIMITIVE(store_stack_boolean)(JSFrameRegs& regs, int n, JSBool& b)
 {
     jsval v;
     prim_boolean_to_jsval(b, v);
     prim_store_stack(regs, n, v);
 }
 
 static inline void
-store_stack_string(JSFrameRegs& regs, int n, JSString*& str)
+PRIMITIVE(store_stack_string)(JSFrameRegs& regs, int n, JSString*& str)
 {
     jsval v;
     prim_string_to_jsval(str, v);
     prim_store_stack(regs, n, v);
 }
 
 static inline void
-store_stack_object(JSFrameRegs& regs, int n, JSObject*& obj)
+PRIMITIVE(store_stack_object)(JSFrameRegs& regs, int n, JSObject*& obj)
 {
     jsval v;
     prim_object_to_jsval(obj, v);
     prim_store_stack(regs, n, v);
 }
 
 static inline bool
-guard_jsdouble_is_int_and_int_fits_in_jsval(jsdouble& d, jsint& i)
+PRIMITIVE(guard_jsdouble_is_int_and_int_fits_in_jsval)(jsdouble& d, jsint& i)
 {
     return JSDOUBLE_IS_INT(d, i) && INT_FITS_IN_JSVAL(i);
 }
 
 static inline void
-prim_int_to_jsval(jsint& i, jsval& v)
+PRIMITIVE(prim_int_to_jsval)(jsint& i, jsval& v)
 {
     v = INT_TO_JSVAL(i);
 }
 
 static inline bool
-call_NewDoubleInRootedValue(JSContext* cx, jsdouble& d, jsval* vp)
+PRIMITIVE(call_NewDoubleInRootedValue)(JSContext* cx, jsdouble& d, jsval* vp)
 {
     return js_NewDoubleInRootedValue(cx, d, vp);
 }
 
 static inline bool
-store_number(JSContext* cx, JSFrameRegs& regs, int n, jsdouble& d)
+PRIMITIVE(store_number)(JSContext* cx, JSFrameRegs& regs, int n, jsdouble& d)
 {
     jsint i;
     if (guard_jsdouble_is_int_and_int_fits_in_jsval(d, i))
         prim_int_to_jsval(i, regs.sp[n]);
     else if (!call_NewDoubleInRootedValue(cx, d, &regs.sp[n]))
         return JS_FALSE;
     return JS_TRUE;
 }
 
 static inline bool
-guard_int_fits_in_jsval(jsint& i)
+PRIMITIVE(guard_int_fits_in_jsval)(jsint& i)
 {
     return INT_FITS_IN_JSVAL(i);
 }
 
 static inline void
-prim_int_to_double(jsint& i, jsdouble& d)
+PRIMITIVE(prim_int_to_double)(jsint& i, jsdouble& d)
 {
     d = (jsdouble) i;
 }
 
 static inline bool
-store_int(JSContext* cx, JSFrameRegs& regs, int n, jsint& i)
+PRIMITIVE(store_int)(JSContext* cx, JSFrameRegs& regs, int n, jsint& i)
 {
     if (guard_int_fits_in_jsval(i)) {
         prim_int_to_jsval(i, regs.sp[n]);
     } else {
         jsdouble d;
         prim_int_to_double(i, d);
         if (!call_NewDoubleInRootedValue(cx, d, &regs.sp[n]))
             return JS_FALSE;
     }
     return JS_TRUE;
 }
 
 static inline bool
-guard_uint_fits_in_jsval(uint32& u)
+PRIMITIVE(guard_uint_fits_in_jsval)(uint32& u)
 {
     return u <= JSVAL_INT_MAX;
 }
 
 static inline void
-prim_uint_to_jsval(uint32& u, jsval& v)
+PRIMITIVE(prim_uint_to_jsval)(uint32& u, jsval& v)
 {
     v = INT_TO_JSVAL(u);
 }
 
 static inline void
-prim_uint_to_double(uint32& u, jsdouble& d)
+PRIMITIVE(prim_uint_to_double)(uint32& u, jsdouble& d)
 {
     d = (jsdouble) u;
 }
 
 static bool
-store_uint(JSContext* cx, JSFrameRegs& regs, int n, uint32& u)
+PRIMITIVE(store_uint)(JSContext* cx, JSFrameRegs& regs, int n, uint32& u)
 {
     if (guard_uint_fits_in_jsval(u)) {
         prim_uint_to_jsval(u, regs.sp[n]);
     } else {
         jsdouble d;
         prim_uint_to_double(u, d);
         if (!call_NewDoubleInRootedValue(cx, d, &regs.sp[n]))
             return JS_FALSE;
     }
     return JS_TRUE;
 }
 
 static inline bool
-guard_jsval_is_int(jsval& v)
+PRIMITIVE(guard_jsval_is_int)(jsval& v)
 {
     return JSVAL_IS_INT(v);
 }
 
 static inline void
-prim_jsval_to_int(jsval& v, jsint& i)
+PRIMITIVE(prim_jsval_to_int)(jsval& v, jsint& i)
 {
     i = JSVAL_TO_INT(v);
 }
 
 static inline bool
-guard_jsval_is_double(jsval& v)
+PRIMITIVE(guard_jsval_is_double)(jsval& v)
 {
     return JSVAL_IS_DOUBLE(v);
 }
 
 static inline void
-prim_jsval_to_double(jsval& v, jsdouble& d)
+PRIMITIVE(prim_jsval_to_double)(jsval& v, jsdouble& d)
 {
     d = *JSVAL_TO_DOUBLE(v);
 }
 
 static inline void
-call_ValueToNumber(JSContext* cx, jsval* vp, jsdouble& d)
+PRIMITIVE(call_ValueToNumber)(JSContext* cx, jsval* vp, jsdouble& d)
 {
     d = js_ValueToNumber(cx, vp);
 }
 
 static inline bool
-guard_jsval_is_null(jsval& v)
+PRIMITIVE(guard_jsval_is_null)(jsval& v)
 {
     return JSVAL_IS_NULL(v);
 }
 
 /*
  * Optimized conversion function that test for the desired type in v before
  * homing sp and calling a conversion function.
  */
 static inline bool
-value_to_number(JSContext* cx, JSFrameRegs& regs, int n, jsval& v, jsdouble& d)
+PRIMITIVE(value_to_number)(JSContext* cx, JSFrameRegs& regs, int n, jsval& v, jsdouble& d)
 {
     JS_ASSERT(v == regs.sp[n]);
     if (guard_jsval_is_int(v)) {
         int i;
         prim_jsval_to_int(v, i);
         prim_int_to_double(i, d);
     } else if (guard_jsval_is_double(v)) {
         prim_jsval_to_double(v, d);
@@ -306,60 +310,60 @@ value_to_number(JSContext* cx, JSFrameRe
         if (guard_jsval_is_null(regs.sp[n]))
             return JS_FALSE;
         JS_ASSERT(JSVAL_IS_NUMBER(regs.sp[n]) || (regs.sp[n] == JSVAL_TRUE));
     }
     return JS_TRUE;
 }
 
 static inline bool
-fetch_number(JSContext* cx, JSFrameRegs& regs, int n, jsdouble& d)
+PRIMITIVE(fetch_number)(JSContext* cx, JSFrameRegs& regs, int n, jsdouble& d)
 {
     jsval v;
 
     prim_fetch_stack(regs, n, v);
     return value_to_number(cx, regs, n, v, d);
 }
 
 static inline void
-call_ValueToECMAInt32(JSContext* cx, jsval* vp, jsint& i)
+PRIMITIVE(call_ValueToECMAInt32)(JSContext* cx, jsval* vp, jsint& i)
 {
     i = js_ValueToECMAInt32(cx, vp);
 }
 
 static inline bool
-fetch_int(JSContext* cx, JSFrameRegs& regs, int n, jsint& i)
+PRIMITIVE(fetch_int)(JSContext* cx, JSFrameRegs& regs, int n, jsint& i)
 {
     jsval v;
     
     prim_fetch_stack(regs, n, v);
     if (guard_jsval_is_int(v)) {
         prim_jsval_to_int(v, i);
     } else {
         call_ValueToECMAInt32(cx, &regs.sp[n], i);
         if (!guard_jsval_is_null(regs.sp[n]))
             return JS_FALSE;
     }
     return JS_TRUE;
 }
 
 static inline void
-prim_int_to_uint(jsint& i, uint32& u)
+PRIMITIVE(prim_int_to_uint)(jsint& i, uint32& u)
 {
     u = (uint32) i;
 }
 
 static inline void
-call_ValueToECMAUint32(JSContext* cx, jsval* vp, uint32& u)
+PRIMITIVE(call_ValueToECMAUint32)(JSContext* cx, jsval* vp, uint32& u)
 {
     u = js_ValueToECMAUint32(cx, vp);
 }
 
 static inline bool
-fetch_uint(JSContext* cx, JSFrameRegs& regs, int n, uint32& u)
+PRIMITIVE(fetch_uint)(JSContext* cx, JSFrameRegs& regs, int n, uint32& u)
 {
     jsval v;
     
     prim_fetch_stack(regs, n, v);
     if (guard_jsval_is_int(v)) {
         int i;
         prim_jsval_to_int(v, i);
         prim_int_to_uint(i, u);
@@ -367,140 +371,140 @@ fetch_uint(JSContext* cx, JSFrameRegs& r
         call_ValueToECMAUint32(cx, &regs.sp[n], u);
         if (guard_jsval_is_null(regs.sp[n]))
             return JS_FALSE;
     }
     return JS_TRUE;
 }
 
 static inline void
-prim_generate_boolean_constant(JSBool c, JSBool& b)
+PRIMITIVE(prim_generate_boolean_constant)(JSBool c, JSBool& b)
 {
     b = c;
 }
 
 static inline bool
-guard_jsval_is_boolean(jsval& v)
+PRIMITIVE(guard_jsval_is_boolean)(jsval& v)
 {
     return JSVAL_IS_BOOLEAN(v);
 }
 
 static inline void
-prim_jsval_to_boolean(jsval& v, JSBool& b)
+PRIMITIVE(prim_jsval_to_boolean)(jsval& v, JSBool& b)
 {
     b = JSVAL_TO_BOOLEAN(v);
 }
 
 static inline void
-call_ValueToBoolean(jsval& v, JSBool& b)
+PRIMITIVE(call_ValueToBoolean)(jsval& v, JSBool& b)
 {
     b = js_ValueToBoolean(v);
 }
 
 static inline void
-pop_boolean(JSContext* cx, JSFrameRegs& regs, jsval& v, JSBool& b)
+PRIMITIVE(pop_boolean)(JSContext* cx, JSFrameRegs& regs, jsval& v, JSBool& b)
 {
     prim_fetch_stack(regs, -1, v);
     if (guard_jsval_is_null(v)) {
         prim_generate_boolean_constant(JS_FALSE, b);
     } else if (guard_jsval_is_boolean(v)) {
         prim_jsval_to_boolean(v, b);
     } else {
         call_ValueToBoolean(v, b);
     }
     prim_adjust_stack(regs, -1);
 }
 
 static inline bool
-guard_jsval_is_primitive(jsval& v)
+PRIMITIVE(guard_jsval_is_primitive)(jsval& v)
 {
     return JSVAL_IS_PRIMITIVE(v);
 }
 
 static inline void
-prim_jsval_to_object(jsval& v, JSObject*& obj)
+PRIMITIVE(prim_jsval_to_object)(jsval& v, JSObject*& obj)
 {
     obj = JSVAL_TO_OBJECT(v);
 }
 
 static inline bool
-guard_obj_is_null(JSObject*& obj)
+PRIMITIVE(guard_obj_is_null)(JSObject*& obj)
 {
     return !obj;
 }
 
 static inline void
-call_ValueToNonNullObject(JSContext* cx, jsval& v, JSObject*& obj)
+PRIMITIVE(call_ValueToNonNullObject)(JSContext* cx, jsval& v, JSObject*& obj)
 {
     obj = js_ValueToNonNullObject(cx, v);
 }
 
 static inline bool
-value_to_object(JSContext* cx, JSFrameRegs& regs, int n, jsval& v,
+PRIMITIVE(value_to_object)(JSContext* cx, JSFrameRegs& regs, int n, jsval& v,
                 JSObject*& obj)
 {
     if (!guard_jsval_is_primitive(v)) {
         prim_jsval_to_object(v, obj);
     } else {
         call_ValueToNonNullObject(cx, v, obj);
         if (guard_obj_is_null(obj))
             return JS_FALSE;
         jsval x;
         prim_object_to_jsval(obj, x);
         prim_store_stack(regs, n, x);
     }
     return JS_TRUE;
 }
 
 static inline bool
-fetch_object(JSContext* cx, JSFrameRegs& regs, int n, jsval& v, JSObject*& obj)
+PRIMITIVE(fetch_object)(JSContext* cx, JSFrameRegs& regs, int n, jsval& v, JSObject*& obj)
 {
     prim_fetch_stack(regs, n, v);
     return value_to_object(cx, regs, n, v, obj);
 }
 
 static inline bool
-call_obj_default_value(JSContext* cx, JSObject*& obj, JSType hint, jsval* vp)
+PRIMITIVE(call_obj_default_value)(JSContext* cx, JSObject*& obj, JSType hint, jsval* vp)
 {
     return OBJ_DEFAULT_VALUE(cx, obj, hint, vp);
 }
 
 static inline bool
-default_value(JSContext* cx, JSFrameRegs& regs, int n, JSType hint, jsval& v)
+PRIMITIVE(default_value)(JSContext* cx, JSFrameRegs& regs, int n, JSType hint, jsval& v)
 {
     JS_ASSERT(!JSVAL_IS_PRIMITIVE(v));
     JS_ASSERT(v == regs.sp[n]);
     JSObject* obj;
     prim_jsval_to_object(v, obj);
     if (!call_obj_default_value(cx, obj, hint, &regs.sp[n])) 
         return JS_FALSE;
     prim_fetch_stack(regs, n, v);
     return JS_TRUE;
 }
 
 static inline void
-prim_dadd(jsdouble& a, jsdouble& b, jsdouble& r)
+PRIMITIVE(prim_dadd)(jsdouble& a, jsdouble& b, jsdouble& r)
 {
     r = a + b;
 }
 
 static inline void
-prim_dsub(jsdouble& a, jsdouble& b, jsdouble& r)
+PRIMITIVE(prim_dsub)(jsdouble& a, jsdouble& b, jsdouble& r)
 {
     r = a - b;
 }
 
 static inline void
-prim_dmul(jsdouble& a, jsdouble& b, jsdouble& r)
+PRIMITIVE(prim_dmul)(jsdouble& a, jsdouble& b, jsdouble& r)
 {
     r = a * b;
 }
 
 static inline void
-prim_ddiv(JSContext* cx, JSRuntime* rt, JSFrameRegs& regs, int n, jsdouble& a,
+PRIMITIVE(prim_ddiv)(JSContext* cx, JSRuntime* rt, JSFrameRegs& regs, int n, jsdouble& a,
           jsdouble& b)
 {
     if (b == 0) {
         jsval* vp = &regs.sp[n];
 #ifdef XP_WIN
         /* XXX MSVC miscompiles such that (NaN == 0) */
         if (JSDOUBLE_IS_NaN(b))
             *vp = DOUBLE_TO_JSVAL(rt->jsNaN);
@@ -514,17 +518,17 @@ prim_ddiv(JSContext* cx, JSRuntime* rt, 
             *vp = DOUBLE_TO_JSVAL(rt->jsPositiveInfinity);
     } else {
         jsdouble r = a / b;
         store_number(cx, regs, n, r);
     }
 }
 
 static inline void
-prim_dmod(JSContext* cx, JSRuntime* rt, JSFrameRegs& regs, int n, jsdouble& a,
+PRIMITIVE(prim_dmod)(JSContext* cx, JSRuntime* rt, JSFrameRegs& regs, int n, jsdouble& a,
           jsdouble& b)
 {
     if (b == 0) {
         store_stack_constant(regs, -1, DOUBLE_TO_JSVAL(rt->jsNaN));
     } else {
         jsdouble r;
 #ifdef XP_WIN
         /* Workaround MS fmod bug where 42 % (1/0) => NaN, not 42. */
@@ -533,147 +537,138 @@ prim_dmod(JSContext* cx, JSRuntime* rt, 
         else 
 #endif
             r = fmod(a, b);
         store_number(cx, regs, n, r);
     }
 }
 
 static inline void
-prim_ior(jsint& a, jsint& b, jsint& r)
+PRIMITIVE(prim_ior)(jsint& a, jsint& b, jsint& r)
 {
     r = a | b;
 }
 
 static inline void
-prim_ixor(jsint& a, jsint& b, jsint& r)
+PRIMITIVE(prim_ixor)(jsint& a, jsint& b, jsint& r)
 {
     r = a ^ b;
 }
 
 static inline void
-prim_iand(jsint& a, jsint& b, jsint& r)
+PRIMITIVE(prim_iand)(jsint& a, jsint& b, jsint& r)
 {
     r = a & b;
 }
 
 static inline void
-prim_ilsh(jsint& a, jsint& b, jsint& r)
+PRIMITIVE(prim_ilsh)(jsint& a, jsint& b, jsint& r)
 {
     r = a << (b & 31);
 }
 
 static inline void
-prim_irsh(jsint& a, jsint& b, jsint& r)
+PRIMITIVE(prim_irsh)(jsint& a, jsint& b, jsint& r)
 {
     r = a >> (b & 31);
 }
 
 static inline void
-prim_ursh(uint32& a, jsint& b, uint32& r)
+PRIMITIVE(prim_ursh)(uint32& a, jsint& b, uint32& r)
 {
     r = a >> (b & 31);
 }
 
 static inline bool
-guard_boolean_is_true(JSBool& cond)
+PRIMITIVE(guard_boolean_is_true)(JSBool& cond)
 {
     return cond;
 }
 
 static inline void
-prim_icmp_lt(jsint& a, jsint& b, JSBool& r)
+PRIMITIVE(prim_icmp_lt)(jsint& a, jsint& b, JSBool& r)
 {
     r = a < b;
 }
 
 static inline void
-prim_icmp_le(jsint& a, jsint& b, JSBool& r)
+PRIMITIVE(prim_icmp_le)(jsint& a, jsint& b, JSBool& r)
 {
     r = a <= b;
 }
 
 static inline void
-prim_icmp_gt(jsint& a, jsint& b, JSBool& r)
+PRIMITIVE(prim_icmp_gt)(jsint& a, jsint& b, JSBool& r)
 {
     r = a > b;
 }
 
 static inline void
-prim_icmp_ge(jsint& a, jsint& b, JSBool& r)
+PRIMITIVE(prim_icmp_ge)(jsint& a, jsint& b, JSBool& r)
 {
     r = a >= b;
 }
 
 static inline void
-prim_dcmp_lt(bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
+PRIMITIVE(prim_dcmp_lt)(bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
 {
     r = JSDOUBLE_COMPARE(a, <, b, ifnan);
 }
 
 static inline void
-prim_dcmp_le(bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
+PRIMITIVE(prim_dcmp_le)(bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
 {
     r = JSDOUBLE_COMPARE(a, <=, b, ifnan);
 }
 
 static inline void
-prim_dcmp_gt(bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
+PRIMITIVE(prim_dcmp_gt)(bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
 {
     r = JSDOUBLE_COMPARE(a, >, b, ifnan);
 }
 
 static inline void
-prim_dcmp_ge(bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
+PRIMITIVE(prim_dcmp_ge)(bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
 {
     r = JSDOUBLE_COMPARE(a, >=, b, ifnan);
 }
 
 static inline void
-prim_generate_int_constant(jsint c, jsint& v)
+PRIMITIVE(prim_generate_int_constant)(jsint c, jsint& v)
 {
     v = c;
 }
 
 static inline void
-prim_jsval_to_string(jsval& v, JSString*& s)
+PRIMITIVE(prim_jsval_to_string)(jsval& v, JSString*& s)
 {
     s = JSVAL_TO_STRING(v);
 }
 
 static inline void
-call_CompareStrings(JSString*& a, JSString*& b, jsint& r)
+PRIMITIVE(call_CompareStrings)(JSString*& a, JSString*& b, jsint& r)
 {
     r = js_CompareStrings(a, b);
 }
 
 static inline bool
-guard_both_jsvals_are_int(jsval& a, jsval& b)
+PRIMITIVE(guard_both_jsvals_are_int)(jsval& a, jsval& b)
 {
     return (a & b) & JSVAL_INT;
 }
 
 static inline bool
-guard_both_jsvals_are_string(jsval& a, jsval& b)
+PRIMITIVE(guard_both_jsvals_are_string)(jsval& a, jsval& b)
 {
     return JSVAL_IS_STRING(a) && JSVAL_IS_STRING(b);
 }
 
 /*
- * The monitor observers backward branches and triggers the trace recorder. This
- * is the only part of the tracing system that is always enabled and thus incurs 
- * a mild runtime overhead even when not tracing.
- */
-static inline void
-monitor_branch(JSContext* cx, JSFrameRegs& regs, int offset)
-{
-}
-
-/*
  * Unsupported opcodes trigger a trace stop condition and cause the trace
  * recorder to abandon the current trace.
  */
 static inline void
-trace_stop(const char* op)
+PRIMITIVE(trace_stop)(const char* op)
 {
+    /* If we are not tracing, this is a no-op. */
 }
 
 #endif /* jsinterpinlines_h___ */
--- a/js/src/jstracerinlines.h
+++ b/js/src/jstracerinlines.h
@@ -34,11 +34,14 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef jstracer_h___
 #define jstracer_h___
 
-#include "jsinterpinlines.h"	// XXXbe fork me
+//#define PRIMITIVE(x) interp_##x
+#define PRIMITIVE(x) x
+
+#include "jsinterpinlines.h"	
 
 #endif /* jstracer_h___ */