Bug 1506972 - Remove unused JSOP_THROWING opcode. r=jandem
authorTed Campbell <tcampbell@mozilla.com>
Wed, 14 Nov 2018 10:01:46 +0000
changeset 446185 b8fba4d3bec32495e45e8e9c850d300d4bd9d842
parent 446184 ff9ba87562638d9f91b5b9f185342af8321562f3
child 446186 76b88f20b0824ae7e24b4de15c2bec404faa30e2
push id35038
push userrmaries@mozilla.com
push dateWed, 14 Nov 2018 22:12:17 +0000
treeherdermozilla-central@4e1b2b7e0c37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1506972
milestone65.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 1506972 - Remove unused JSOP_THROWING opcode. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D11814
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineCompiler.h
js/src/jit/IonBuilder.cpp
js/src/vm/Interpreter.cpp
js/src/vm/Interpreter.h
js/src/vm/Opcodes.h
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -1215,16 +1215,17 @@ BaselineCompiler::emitBody()
         }
 
         switch (op) {
           // ===== NOT Yet Implemented =====
           case JSOP_FORCEINTERPRETER:
             // Intentionally not implemented.
           case JSOP_SETINTRINSIC:
             // Run-once opcode during self-hosting initialization.
+          case JSOP_UNUSED151:
           case JSOP_UNUSED206:
           case JSOP_LIMIT:
             // === !! WARNING WARNING WARNING !! ===
             // Do you really want to sacrifice performance by not implementing
             // this operation in the BaselineCompiler?
             JitSpew(JitSpew_BaselineAbort, "Unhandled op: %s", CodeName[op]);
             return Method_CantCompile;
 
@@ -3894,32 +3895,16 @@ BaselineCompiler::emit_JSOP_THROW()
     frame.popRegsAndSync(1);
 
     prepareVMCall();
     pushArg(R0);
 
     return callVM(ThrowInfo);
 }
 
-typedef bool (*ThrowingFn)(JSContext*, HandleValue);
-static const VMFunction ThrowingInfo =
-    FunctionInfo<ThrowingFn>(js::ThrowingOperation, "ThrowingOperation");
-
-bool
-BaselineCompiler::emit_JSOP_THROWING()
-{
-    // Keep value to throw in R0.
-    frame.popRegsAndSync(1);
-
-    prepareVMCall();
-    pushArg(R0);
-
-    return callVM(ThrowingInfo);
-}
-
 bool
 BaselineCompiler::emit_JSOP_TRY()
 {
     if (!emit_JSOP_JUMPTARGET()) {
         return false;
     }
 
     // Ionmonkey can't inline function with JSOP_TRY.
--- a/js/src/jit/BaselineCompiler.h
+++ b/js/src/jit/BaselineCompiler.h
@@ -168,17 +168,16 @@ namespace jit {
     _(JSOP_OPTIMIZE_SPREADCALL)\
     _(JSOP_IMPLICITTHIS)       \
     _(JSOP_GIMPLICITTHIS)      \
     _(JSOP_INSTANCEOF)         \
     _(JSOP_TYPEOF)             \
     _(JSOP_TYPEOFEXPR)         \
     _(JSOP_THROWMSG)           \
     _(JSOP_THROW)              \
-    _(JSOP_THROWING)           \
     _(JSOP_TRY)                \
     _(JSOP_FINALLY)            \
     _(JSOP_GOSUB)              \
     _(JSOP_RETSUB)             \
     _(JSOP_PUSHLEXICALENV)     \
     _(JSOP_POPLEXICALENV)      \
     _(JSOP_FRESHENLEXICALENV)  \
     _(JSOP_RECREATELEXICALENV) \
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -2555,17 +2555,16 @@ IonBuilder::inspectOpcode(JSOp op)
       case JSOP_PUSHVARENV:
       case JSOP_POPVARENV:
 
       // Compound assignment
       case JSOP_GETBOUNDNAME:
 
       // Generators / Async (bug 1317690)
       case JSOP_EXCEPTION:
-      case JSOP_THROWING:
       case JSOP_ISGENCLOSING:
       case JSOP_INITIALYIELD:
       case JSOP_YIELD:
       case JSOP_FINALYIELDRVAL:
       case JSOP_RESUME:
       case JSOP_DEBUGAFTERYIELD:
       case JSOP_AWAIT:
       case JSOP_TRYSKIPAWAIT:
@@ -2583,16 +2582,17 @@ IonBuilder::inspectOpcode(JSOp op)
         // Do you really want to sacrifice performance by not implementing this
         // operation in the optimizing compiler?
         break;
 
       case JSOP_FORCEINTERPRETER:
         // Intentionally not implemented.
         break;
 
+      case JSOP_UNUSED151:
       case JSOP_UNUSED206:
       case JSOP_LIMIT:
         break;
     }
 
     // Track a simpler message, since the actionable abort message is a
     // static string, and the internal opcode name isn't an actionable
     // thing anyways.
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -2293,16 +2293,17 @@ CASE(EnableInterruptsPseudoOpcode)
     SANITY_CHECKS();
     DISPATCH_TO(op);
 }
 
 /* Various 1-byte no-ops. */
 CASE(JSOP_NOP)
 CASE(JSOP_NOP_DESTRUCTURING)
 CASE(JSOP_TRY_DESTRUCTURING_ITERCLOSE)
+CASE(JSOP_UNUSED151)
 CASE(JSOP_UNUSED206)
 CASE(JSOP_CONDSWITCH)
 {
     MOZ_ASSERT(CodeSpec[*REGS.pc].length == 1);
     ADVANCE_AND_DISPATCH(1);
 }
 
 CASE(JSOP_TRY)
@@ -4347,24 +4348,16 @@ CASE(JSOP_EXCEPTION)
     }
 }
 END_CASE(JSOP_EXCEPTION)
 
 CASE(JSOP_FINALLY)
     CHECK_BRANCH();
 END_CASE(JSOP_FINALLY)
 
-CASE(JSOP_THROWING)
-{
-    ReservedRooted<Value> v(&rootValue0);
-    POP_COPY_TO(v);
-    MOZ_ALWAYS_TRUE(ThrowingOperation(cx, v));
-}
-END_CASE(JSOP_THROWING)
-
 CASE(JSOP_THROW)
 {
     CHECK_BRANCH();
     ReservedRooted<Value> v(&rootValue0);
     POP_COPY_TO(v);
     MOZ_ALWAYS_FALSE(Throw(cx, v));
     /* let the code at error try to catch the exception. */
     goto error;
@@ -4874,27 +4867,16 @@ bool
 js::Throw(JSContext* cx, HandleValue v)
 {
     MOZ_ASSERT(!cx->isExceptionPending());
     cx->setPendingException(v);
     return false;
 }
 
 bool
-js::ThrowingOperation(JSContext* cx, HandleValue v)
-{
-    // Like js::Throw, but returns |true| instead of |false| to continue
-    // execution instead of calling the (JIT) exception handler.
-
-    MOZ_ASSERT(!cx->isExceptionPending());
-    cx->setPendingException(v);
-    return true;
-}
-
-bool
 js::GetProperty(JSContext* cx, HandleValue v, HandlePropertyName name, MutableHandleValue vp)
 {
     if (name == cx->names().length) {
         // Fast path for strings, arrays and arguments.
         if (GetLengthProperty(v, vp)) {
             return true;
         }
     }
--- a/js/src/vm/Interpreter.h
+++ b/js/src/vm/Interpreter.h
@@ -421,19 +421,16 @@ bool
 HandleClosingGeneratorReturn(JSContext* cx, AbstractFramePtr frame, bool ok);
 
 /************************************************************************/
 
 bool
 Throw(JSContext* cx, HandleValue v);
 
 bool
-ThrowingOperation(JSContext* cx, HandleValue v);
-
-bool
 GetProperty(JSContext* cx, HandleValue value, HandlePropertyName name, MutableHandleValue vp);
 
 JSObject*
 Lambda(JSContext* cx, HandleFunction fun, HandleObject parent);
 
 JSObject*
 LambdaArrow(JSContext* cx, HandleFunction fun, HandleObject parent, HandleValue newTargetv);
 
--- a/js/src/vm/Opcodes.h
+++ b/js/src/vm/Opcodes.h
@@ -1622,27 +1622,18 @@
      *
      *   Category: Operators
      *   Type: Arithmetic Operators
      *   Operands:
      *   Stack: lval, rval => (lval ** rval)
      */ \
     macro(JSOP_POW, 150, "pow", "**", 1, 2, 1, JOF_BYTE|JOF_IC) \
     /*
-     * Pops the top of stack value as 'v', sets pending exception as 'v', to
-     * trigger rethrow.
-     *
-     * This opcode is used in conditional catch clauses.
-     *
-     *   Category: Statements
-     *   Type: Exception Handling
-     *   Operands:
-     *   Stack: v =>
      */ \
-    macro(JSOP_THROWING, 151, "throwing", NULL, 1, 1, 0, JOF_BYTE) \
+    macro(JSOP_UNUSED151, 151, "unused151", NULL, 1, 0, 0, JOF_BYTE) \
     /*
      * Pops the top of stack value as 'rval', sets the return value in stack
      * frame as 'rval'.
      *
      *   Category: Statements
      *   Type: Function
      *   Operands:
      *   Stack: rval =>