Bug 623297 - Fix profiler regression (r=dvander)
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 01 Feb 2011 12:57:24 -0800
changeset 62040 92a6b1ebfb9e56a8cc555ce95b2d9bfdf1103834
parent 62039 e510e0303de5870e875815f68835f6f67072d3f0
child 62042 a4b132fe80298d2a2312762c8f93784517f5413d
push idunknown
push userunknown
push dateunknown
reviewersdvander
bugs623297
milestone2.0b11pre
Bug 623297 - Fix profiler regression (r=dvander)
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -12091,17 +12091,19 @@ TraceRecorder::lookupForSetPropertyOp(JS
         }
     }
     return RECORD_CONTINUE;
 }
 
 static JSBool FASTCALL
 MethodWriteBarrier(JSContext* cx, JSObject* obj, uint32 slot, const Value* v)
 {
+#ifdef DEBUG
     TraceMonitor *tm = JS_TRACE_MONITOR_ON_TRACE(cx);
+#endif
 
     bool ok = obj->methodWriteBarrier(cx, slot, *v);
     JS_ASSERT(WasBuiltinSuccessful(tm));
     return ok;
 }
 JS_DEFINE_CALLINFO_4(static, BOOL_FAIL, MethodWriteBarrier, CONTEXT, OBJECT, UINT32, CVALUEPTR,
                      0, ACCSET_STORE_ANY)
 
@@ -12684,17 +12686,19 @@ JS_REQUIRES_STACK RecordingStatus
 TraceRecorder::primitiveToStringInPlace(Value* vp)
 {
     Value v = *vp;
     JS_ASSERT(v.isPrimitive());
 
     if (!v.isString()) {
         // v is not a string. Turn it into one. js_ValueToString is safe
         // because v is not an object.
+#ifdef DEBUG
         TraceMonitor *localtm = traceMonitor;
+#endif
         JSString *str = js_ValueToString(cx, v);
         JS_ASSERT(localtm->recorder == this);
         if (!str)
             RETURN_ERROR("failed to stringify element id");
         v.setString(str);
         set(vp, stringify(*vp));
 
         // Write the string back to the stack to save the interpreter some work
@@ -16861,17 +16865,16 @@ LoopProfile::reset()
 }
 
 MonitorResult
 LoopProfile::profileLoopEdge(JSContext* cx, uintN& inlineCallCount)
 {
     if (cx->regs->pc == top) {
         debug_only_print0(LC_TMProfiler, "Profiling complete (edge)\n");
         decide(cx);
-        stopProfiling(cx);
     } else {
         /* Record an inner loop invocation. */
         JSStackFrame *fp = cx->fp();
         jsbytecode *pc = cx->regs->pc;
         bool found = false;
 
         /* We started with the most deeply nested one first, since it gets hit most often.*/
         for (int i = int(numInnerLoops)-1; i >= 0; i--) {