Bug 1304638 - Don't return "(intermediate value)" while decompiling SETELEM/STRICTSETELEM. r?nbp draft
authorEmilio Cobos Álvarez <ecoal95@gmail.com>
Sun, 09 Oct 2016 15:39:15 +0200
changeset 422989 ebc452cc36cb7d12a20f6c09379fdb5b93740287
parent 421258 e8fa13708c070d1fadf488ed9d951464745b4e17
child 422990 411df89f2c484f0f7173e516e154f663cea453dc
child 422991 9621bfb2d6afebcc4980034b6cd3ca8a12ab364a
child 422992 d32a4fe04566f87cecfcccb4f763fa63b1e74546
child 422993 45d52770936f6dce415837c1b0046a2e781ef3fb
child 422994 10409beaa604513db385c8d1f408b5c3a67e746e
push id31789
push userbmo:ecoal95@gmail.com
push dateSun, 09 Oct 2016 14:02:03 +0000
reviewersnbp
bugs1304638
milestone52.0a1
Bug 1304638 - Don't return "(intermediate value)" while decompiling SETELEM/STRICTSETELEM. r?nbp This caused us to go to the fallback, and call `ValueToSource` to set the message exception[1]. The `ToSource` call happened also in the interpreter. This doesn't fix the underlying issue, which is that we call MoveHoles for frozen elements anyway. [1]: http://searchfox.org/mozilla-central/rev/c635b8c61d648bb8a0317c19f8905b3be8132a8a/js/src/jsopcode.cpp#1536 MozReview-Commit-ID: J7tfxoDnUUr
js/src/jsopcode.cpp
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -1260,16 +1260,22 @@ ExpressionDecompiler::decompilePC(jsbyte
                write("]");
       }
       case JSOP_GETPROP_SUPER:
       {
         RootedAtom prop(cx, loadAtom(pc));
         return write("super.") &&
                quote(prop, '\0');
       }
+      case JSOP_SETELEM:
+      case JSOP_STRICTSETELEM:
+        return decompilePCForStackOperand(pc, -3) &&
+               write("[") &&
+               decompilePCForStackOperand(pc, -2) &&
+               write("]");
       case JSOP_GETELEM:
       case JSOP_CALLELEM:
         return decompilePCForStackOperand(pc, -2) &&
                write("[") &&
                decompilePCForStackOperand(pc, -1) &&
                write("]");
       case JSOP_GETELEM_SUPER:
         return write("super[") &&