Bug 610582. Fix TMFLAGS=tracer for anonymous functions. r=gal
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 16 Nov 2010 08:19:27 -0500
changeset 57822 c1c10304f99189e148dc86815bd579a6ffd5a92a
parent 57821 bc000c1509acf6d0aa4496235e7eee89dfab7f14
child 57823 c47a52df435d316008f36e985c1f5e28682c4623
child 57824 98e10bbc80d3373d82b42871d5d8076a94164dc2
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersgal
bugs610582
milestone2.0b8pre
Bug 610582. Fix TMFLAGS=tracer for anonymous functions. r=gal
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -10101,17 +10101,19 @@ TraceRecorder::record_EnterFrame()
 {
     JSStackFrame* const fp = cx->fp();
 
     if (++callDepth >= MAX_CALLDEPTH)
         RETURN_STOP_A("exceeded maximum call depth");
 
     debug_only_stmt(JSAutoByteString funBytes);
     debug_only_printf(LC_TMTracer, "EnterFrame %s, callDepth=%d\n",
-                      js_AtomToPrintableString(cx, cx->fp()->fun()->atom, &funBytes),
+                      cx->fp()->fun()->atom ?
+                        js_AtomToPrintableString(cx, cx->fp()->fun()->atom, &funBytes) :
+                        "<anonymous>",
                       callDepth);
     debug_only_stmt(
         if (LogController.lcbits & LC_TMRecorder) {
             js_Disassemble(cx, cx->fp()->script(), JS_TRUE, stdout);
             debug_only_print0(LC_TMTracer, "----\n");
         }
     )
     LIns* void_ins = w.immiUndefined();
@@ -10305,17 +10307,19 @@ TraceRecorder::record_JSOP_RETURN()
     if (fp->isConstructing() && rval.isPrimitive()) {
         rval_ins = get(&fp->thisValue());
     } else {
         rval_ins = get(&rval);
     }
     debug_only_stmt(JSAutoByteString funBytes);
     debug_only_printf(LC_TMTracer,
                       "returning from %s\n",
-                      js_AtomToPrintableString(cx, fp->fun()->atom, &funBytes));
+                      fp->fun()->atom ?
+                        js_AtomToPrintableString(cx, fp->fun()->atom, &funBytes) :
+                        "<anonymous>");
     clearCurrentFrameSlotsFromTracker(nativeFrameTracker);
 
     return ARECORD_CONTINUE;
 }
 
 JS_REQUIRES_STACK AbortableRecordingStatus
 TraceRecorder::record_JSOP_GOTO()
 {