Nit patrol.
authorBrendan Eich <brendan@mozilla.org>
Sun, 20 Jul 2008 16:09:08 -0700
changeset 17778 90467ec4fc8b95d51bca051db330cd95501ab491
parent 17777 85e5e3504108d7947e4d959c70fcf54e8e99f3de
child 17779 c315c24d0b90ca071d3325c4a0a4266bbaf3b4a8
push id1452
push usershaver@mozilla.com
push dateFri, 22 Aug 2008 00:08:22 +0000
treeherderautoland@d13bb0868596 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a1pre
Nit patrol.
js/src/jsinterp.cpp
js/src/jstracer.cpp
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -2746,17 +2746,17 @@ js_Interpret(JSContext *cx)
 #define MONITOR_BRANCH(oldpc)                                                 \
     JS_BEGIN_MACRO                                                            \
         if (TRACING_ENABLED(cx))                                              \
             ENABLE_TRACER(js_LoopEdge(cx, oldpc));                            \
     JS_END_MACRO
 
 #else /* !JS_TRACER */
 
-#define MONITOR_BRANCH(oldpc) do { } while(0)
+#define MONITOR_BRANCH(oldpc) ((void) 0)
 
 #endif /* !JS_TRACER */
 
     /*
      * Prepare to call a user-supplied branch handler, and abort the script
      * if it returns false.
      */
 #define CHECK_BRANCH()                                                        \
@@ -4976,17 +4976,17 @@ js_Interpret(JSContext *cx)
                     fp->regs = &newifp->callerRegs;
                     regs.sp = newifp->frame.spbase = newsp;
                     regs.pc = script->code;
                     newifp->frame.regs = &regs;
                     cx->fp = fp = &newifp->frame;
 
                     if (JS_TRACE_MONITOR(cx).recorder)
                         RECORD(EnterFrame);
-                    
+
                     inlineCallCount++;
                     JS_RUNTIME_METER(rt, inlineCalls);
 
 #ifdef INCLUDE_MOZILLA_DTRACE
                     /* DTrace function entry, inlines */
                     if (JAVASCRIPT_FUNCTION_ENTRY_ENABLED())
                         jsdtrace_function_entry(cx, fp, fun);
                     if (JAVASCRIPT_FUNCTION_INFO_ENABLED())
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -137,29 +137,26 @@ Tracker::clear()
 }
 
 bool
 Tracker::has(const void *v) const
 {
     struct Tracker::Page* p = findPage(v);
     if (!p)
         return false;
-    LIns* i = p->map[(jsuword(v) & 0xfff) >> 2];
-    if (i == 0)
-        return false;
-    return true;
+    return p->map[(jsuword(v) & 0xfff) >> 2] != NULL;
 }
 
 LIns*
 Tracker::get(const void* v) const
 {
     struct Tracker::Page* p = findPage(v);
-    JS_ASSERT(p != 0); /* we must have a page for the slot we are looking for */
+    JS_ASSERT(p); /* we must have a page for the slot we are looking for */
     LIns* i = p->map[(jsuword(v) & 0xfff) >> 2];
-    JS_ASSERT(i != 0);
+    JS_ASSERT(i);
     return i;
 }
 
 void
 Tracker::set(const void* v, LIns* i)
 {
     struct Tracker::Page* p = findPage(v);
     if (!p)
@@ -447,17 +444,17 @@ TraceRecorder::TraceRecorder(JSContext* 
         Fragment* _fragment, uint8* typeMap)
 {
     this->cx = cx;
     this->globalObj = JS_GetGlobalForObject(cx, cx->fp->scopeChain);
     this->anchor = _anchor;
     this->fragment = _fragment;
     this->lirbuf = _fragment->lirbuf;
     this->fragmentInfo = (VMFragmentInfo*)_fragment->root->vmprivate;
-    JS_ASSERT(fragmentInfo != NULL);
+    JS_ASSERT(fragmentInfo);
     this->entryFrame = fragmentInfo->entryFrame;
     this->entryRegs = &fragmentInfo->entryRegs;
     this->atoms = cx->fp->script->atomMap.vector;
 
 #ifdef DEBUG
     printf("recording starting from %s:%u@%u\n", cx->fp->script->filename,
            js_PCToLineNumber(cx, cx->fp->script, entryRegs->pc),
            entryRegs->pc - cx->fp->script->code);
@@ -1272,17 +1269,17 @@ js_LoopEdge(JSContext* cx, jsbytecode* o
            cx->fp->regs->pc - cx->fp->script->code,
            state.sp, lr->jmp,
            (rdtsc() - start));
 #endif
     box(cx, fi->ngslots, fi->gslots, cx->fp, cx->fp, lr->exit->typeMap, native);
     JS_ASSERT(*(uint64*)&native[fi->maxNativeFrameSlots] == 0xdeadbeefdeadbeefLL);
 
     AUDIT(sideExitIntoInterpreter);
-    
+
     /* if the side exit terminates the loop, don't try to attach a trace here */
     if (js_IsLoopExit(cx, cx->fp->script, cx->fp->regs->pc))
         return false;
 
     debug_only(printf("trying to attach another branch to the tree\n");)
 
     Fragment* c;
     if (!(c = lr->target)) {