Don't try to record recursion until we support it properly (454277).
authorAndreas Gal <gal@mozilla.com>
Mon, 08 Sep 2008 22:49:17 +0200
changeset 19078 73a0e8ebcbee014d2c49daaedad76e3769c9a362
parent 19077 c5c39b3affe27f17cd190d3b459ec2c8aab5d13b
child 19079 728cf8bf1648f4ea344e34c71751df9768e63a54
child 19084 6a8762adc8e6fe3b22bf60c2ba301d6af9344f39
push id1930
push usermrbkap@mozilla.com
push dateWed, 10 Sep 2008 06:40:47 +0000
treeherderautoland@ee61af1469cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs454277
milestone1.9.1b1pre
Don't try to record recursion until we support it properly (454277).
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -3692,22 +3692,26 @@ TraceRecorder::clearFrameSlotsFromCache(
     vpstop = &fp->slots[fp->script->nslots];
     while (vp < vpstop)
         nativeFrameTracker.set(vp++, (LIns*)0);
 }
 
 bool
 TraceRecorder::record_EnterFrame()
 {
+    JSStackFrame* fp = cx->fp;
+
     if (++callDepth >= MAX_CALLDEPTH)
         ABORT_TRACE("exceeded maximum call depth");
+    if (fp->script == fp->down->script)
+        ABORT_TRACE("recursive call");
+    
     debug_only_v(printf("EnterFrame %s, callDepth=%d\n",
                         js_AtomToPrintableString(cx, cx->fp->fun->atom),
                         callDepth););
-    JSStackFrame* fp = cx->fp;
     LIns* void_ins = INS_CONST(JSVAL_TO_BOOLEAN(JSVAL_VOID));
 
     jsval* vp = &fp->argv[fp->argc];
     jsval* vpstop = vp + (fp->fun->nargs - fp->argc);
     if (applyingArguments) {
         applyingArguments = false;
         while (vp < vpstop) {
             JS_ASSERT(vp >= fp->down->regs->sp);