Bug 648438 - Don't assert about js_ReconstructStackDepth for imacros since apparently this only works for imacros in the top stack frame (r=jwalden)
authorLuke Wagner <luke@mozilla.com>
Thu, 16 Jun 2011 08:14:19 -0700
changeset 71362 b65724d6c32633b356471a31f7ff01ff74a14312
parent 71361 b35005673847d8f3deb28418c2b9c4a80bc12ced
child 71363 81c343a150a4bc7be1bfa665b41f877a4074bfbd
push id20538
push usercleary@mozilla.com
push dateMon, 20 Jun 2011 23:59:42 +0000
treeherdermozilla-central@a285146675dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs648438
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 648438 - Don't assert about js_ReconstructStackDepth for imacros since apparently this only works for imacros in the top stack frame (r=jwalden)
js/src/jit-test/tests/basic/testBug648438.js
js/src/vm/Stack.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testBug648438.js
@@ -0,0 +1,7 @@
+for (var i = 0; i < 20; i++) {
+    (function () {
+        try {
+            JSON.parse();
+        } catch (e) {}
+    }).call();
+}
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -933,25 +933,27 @@ StackIter::settleOnNewState()
              *
              * Function.prototype.call will however appear, hence the debugger
              * can, by inspecting 'args.thisv', give some useful information.
              */
             JSOp op = js_GetOpcode(cx_, fp_->script(), pc_);
             if (op == JSOP_CALL || op == JSOP_FUNCALL) {
                 uintN argc = GET_ARGC(pc_);
                 DebugOnly<uintN> spoff = sp_ - fp_->base();
-                JS_ASSERT(spoff == js_ReconstructStackDepth(cx_, fp_->script(), pc_));
+                JS_ASSERT_IF(!fp_->hasImacropc(),
+                             spoff == js_ReconstructStackDepth(cx_, fp_->script(), pc_));
                 Value *vp = sp_ - (2 + argc);
 
                 if (IsNativeFunction(*vp)) {
                     state_ = IMPLICIT_NATIVE;
                     args_ = CallArgsFromVp(argc, vp);
                     return;
                 }
             } else if (op == JSOP_FUNAPPLY) {
+                JS_ASSERT(!fp_->hasImacropc());
                 uintN argc = GET_ARGC(pc_);
                 uintN spoff = js_ReconstructStackDepth(cx_, fp_->script(), pc_);
                 Value *sp = fp_->base() + spoff;
                 Value *vp = sp - (2 + argc);
 
                 if (IsNativeFunction(*vp)) {
                     if (sp_ != sp) {
                         JS_ASSERT(argc == 2);