Bug 469237: Avoid warnings in jstracer.cpp. r=igor
authorJim Blandy <jimb@mozilla.org>
Thu, 09 Apr 2009 13:10:22 -0700
changeset 24899 07f24650db8f1d84b448704fbc73ebefb264915f
parent 24898 b3b5e2a64382bb6c2ff24d363a6ab1177d0d826f
child 24900 145b1c8acb86dd3d18741639851b0634a070de4a
push id1267
push userrsayre@mozilla.com
push dateSun, 19 Apr 2009 02:47:24 +0000
reviewersigor
bugs469237
milestone1.9.1b4pre
Bug 469237: Avoid warnings in jstracer.cpp. r=igor ../jstracer.cpp: In member function ‘void TraceRecorder::guard(bool, nanojit::LIns*, nanojit::LIns*)’: ../jstracer.cpp:2301: warning: format ‘%p’ expects type ‘void*’, but argument 2 has type ‘nanojit::SideExit*’ ../jstracer.cpp: In function ‘bool js_AttemptToExtendTree(JSContext*, VMSideExit*, VMSideExit*, jsbytecode*)’: ../jstracer.cpp:3624: warning: suggest parentheses around ‘&&’ within ‘||’
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -2289,17 +2289,17 @@ TraceRecorder::guard(bool expected, LIns
 #ifdef DEBUG
     LIns* guard =
 #endif
     lir->insGuard(expected ? LIR_xf : LIR_xt, cond, exit);
 #ifdef DEBUG
     if (guard) {
         GuardRecord* lr = guard->record();
         VMSideExit* e = (VMSideExit*)lr->exit;
-        debug_only_v(printf("    lr=%p exitType=%d\n", (SideExit*)e, e->exitType);)
+        debug_only_v(printf("    lr=%p exitType=%d\n", (void*)e, e->exitType);)
     } else {
         debug_only_v(printf("    redundant guard, eliminated\n");)
     }
 #endif
 }
 
 /* Emit a guard for condition (cond), expecting to evaluate to boolean result (expected)
    and generate a side exit with type exitType to jump to if the condition does not hold. */
@@ -3612,17 +3612,17 @@ js_AttemptToExtendTree(JSContext* cx, VM
         c->parent = f;
         anchor->target = c;
         c->root = f;
     }
 
     debug_only_v(printf("trying to attach another branch to the tree (hits = %d)\n", c->hits());)
 
     int32_t& hits = c->hits();
-    if (outer || hits++ >= HOTEXIT && hits <= HOTEXIT+MAXEXIT) {
+    if (outer || (hits++ >= HOTEXIT && hits <= HOTEXIT+MAXEXIT)) {
         /* start tracing secondary trace from this point */
         c->lirbuf = f->lirbuf;
         unsigned stackSlots;
         unsigned ngslots;
         uint8* typeMap;
         TypeMap fullMap;
         if (exitedFrom == NULL) {
             /* If we are coming straight from a simple side exit, just use that exit's type map