Bug 1543592 part 1 - Rename JSOP_DEBUGAFTERYIELD to JSOP_AFTERYIELD. r=tcampbell
authorJan de Mooij <jdemooij@mozilla.com>
Fri, 12 Apr 2019 10:20:12 +0000
changeset 469254 4584d95fcaeaad9e6808bc34906807fd7ed6c1d2
parent 469253 4e987641febce56ca92c086093965f2192531387
child 469255 c35e1a0a6cfb68df8bb1a5370faf6c918aa86fcb
push id112776
push usershindli@mozilla.com
push dateFri, 12 Apr 2019 16:20:17 +0000
treeherdermozilla-inbound@b4501ced5619 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1543592
milestone68.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 1543592 part 1 - Rename JSOP_DEBUGAFTERYIELD to JSOP_AFTERYIELD. r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D27032
js/src/frontend/BytecodeEmitter.cpp
js/src/jit-test/tests/debug/bug1368736.js
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineCompiler.h
js/src/jit/BaselineDebugModeOSR.cpp
js/src/jit/IonBuilder.cpp
js/src/jit/VMFunctions.cpp
js/src/vm/Debugger.cpp
js/src/vm/Debugger.h
js/src/vm/GeneratorObject.cpp
js/src/vm/Interpreter.cpp
js/src/vm/Opcodes.h
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -2302,17 +2302,17 @@ bool BytecodeEmitter::emitYieldOp(JSOp o
 
   uint32_t resumeIndex;
   if (!allocateResumeIndex(bytecodeSection().offset(), &resumeIndex)) {
     return false;
   }
 
   SET_RESUMEINDEX(bytecodeSection().code(off), resumeIndex);
 
-  return emit1(JSOP_DEBUGAFTERYIELD);
+  return emit1(JSOP_AFTERYIELD);
 }
 
 bool BytecodeEmitter::emitSetThis(BinaryNode* setThisNode) {
   // ParseNodeKind::SetThis is used to update |this| after a super() call
   // in a derived class constructor.
 
   MOZ_ASSERT(setThisNode->isKind(ParseNodeKind::SetThis));
   MOZ_ASSERT(setThisNode->left()->isKind(ParseNodeKind::Name));
--- a/js/src/jit-test/tests/debug/bug1368736.js
+++ b/js/src/jit-test/tests/debug/bug1368736.js
@@ -1,12 +1,12 @@
 g = newGlobal({newCompartment: true});
 hits = 0;
 Debugger(g).onDebuggerStatement = function(frame) {
-    // Set a breakpoint at the JSOP_DEBUGAFTERYIELD op.
+    // Set a breakpoint at the JSOP_AFTERYIELD op.
     frame.script.setBreakpoint(75, {hit: function() { hits++; }});
 }
 g.eval(`
 function* range() {
     debugger;
     for (var i = 0; i < 3; i++) {
         yield i;
     }
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -5437,17 +5437,17 @@ bool BaselineCodeGen<Handler>::emit_JSOP
 }
 
 template <typename Handler>
 bool BaselineCodeGen<Handler>::emit_JSOP_AWAIT() {
   return emit_JSOP_YIELD();
 }
 
 template <typename Handler>
-bool BaselineCodeGen<Handler>::emit_JSOP_DEBUGAFTERYIELD() {
+bool BaselineCodeGen<Handler>::emit_JSOP_AFTERYIELD() {
   auto ifDebuggee = [this]() {
     frame.assertSyncedStack();
     masm.loadBaselineFramePtr(BaselineFrameReg, R0.scratchReg());
     prepareVMCall();
     pushBytecodePCArg();
     pushArg(R0.scratchReg());
 
     using Fn = bool (*)(JSContext*, BaselineFrame*, jsbytecode*, bool*);
--- a/js/src/jit/BaselineCompiler.h
+++ b/js/src/jit/BaselineCompiler.h
@@ -200,17 +200,17 @@ namespace jit {
   _(JSOP_ISNOITER)              \
   _(JSOP_ENDITER)               \
   _(JSOP_ISGENCLOSING)          \
   _(JSOP_GENERATOR)             \
   _(JSOP_INITIALYIELD)          \
   _(JSOP_YIELD)                 \
   _(JSOP_AWAIT)                 \
   _(JSOP_TRYSKIPAWAIT)          \
-  _(JSOP_DEBUGAFTERYIELD)       \
+  _(JSOP_AFTERYIELD)            \
   _(JSOP_FINALYIELDRVAL)        \
   _(JSOP_RESUME)                \
   _(JSOP_ASYNCAWAIT)            \
   _(JSOP_ASYNCRESOLVE)          \
   _(JSOP_CALLEE)                \
   _(JSOP_ENVCALLEE)             \
   _(JSOP_SUPERBASE)             \
   _(JSOP_SUPERFUN)              \
--- a/js/src/jit/BaselineDebugModeOSR.cpp
+++ b/js/src/jit/BaselineDebugModeOSR.cpp
@@ -329,17 +329,17 @@ static void PatchBaselineFramesForDebugM
   //  J. From the warmup counter in the prologue.
   //
   // On to Off:
   //  - All the ways above.
   //  C. From the debug trap handler.
   //  D. From the debug prologue.
   //  E. From the debug epilogue.
   //  G. From GeneratorThrowOrReturn
-  //  K. From a JSOP_DEBUGAFTERYIELD instruction.
+  //  K. From a JSOP_AFTERYIELD instruction.
   //
   // Cycles (On to Off to On)+ or (Off to On to Off)+:
   //  F. Undo cases B, C, D, E, I or J above on previously patched yet unpopped
   //     frames.
   //
   // In general, we patch the return address from the VM call to return to a
   // "continuation fixer" to fix up machine state (registers and stack
   // state). Specifics on what needs to be done are documented below.
@@ -505,20 +505,19 @@ static void PatchBaselineFramesForDebugM
             recompInfo->resumeAddr = bl->debugOsrPrologueEntryAddr();
             popFrameReg = true;
             break;
 
           case RetAddrEntry::Kind::DebugAfterYield:
             // Case K above.
             //
             // Resume at the next instruction.
-            MOZ_ASSERT(*pc == JSOP_DEBUGAFTERYIELD);
-            recompInfo->resumeAddr =
-                bl->nativeCodeForPC(script, pc + JSOP_DEBUGAFTERYIELD_LENGTH,
-                                    &recompInfo->slotInfo);
+            MOZ_ASSERT(*pc == JSOP_AFTERYIELD);
+            recompInfo->resumeAddr = bl->nativeCodeForPC(
+                script, pc + JSOP_AFTERYIELD_LENGTH, &recompInfo->slotInfo);
             popFrameReg = true;
             break;
 
           default:
             // Case E above.
             //
             // We patch a jump directly to the epilogue after popping the
             // frame reg and checking for forced return.
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -2517,17 +2517,17 @@ AbortReasonOr<Ok> IonBuilder::inspectOpc
 
     // Generators / Async (bug 1317690)
     case JSOP_EXCEPTION:
     case JSOP_ISGENCLOSING:
     case JSOP_INITIALYIELD:
     case JSOP_YIELD:
     case JSOP_FINALYIELDRVAL:
     case JSOP_RESUME:
-    case JSOP_DEBUGAFTERYIELD:
+    case JSOP_AFTERYIELD:
     case JSOP_AWAIT:
     case JSOP_TRYSKIPAWAIT:
     case JSOP_GENERATOR:
     case JSOP_ASYNCAWAIT:
     case JSOP_ASYNCRESOLVE:
 
     // Misc
     case JSOP_DELNAME:
--- a/js/src/jit/VMFunctions.cpp
+++ b/js/src/jit/VMFunctions.cpp
@@ -1004,17 +1004,17 @@ bool InterpretResume(JSContext* cx, Hand
                                 UndefinedHandleValue, args, rval);
 }
 
 bool DebugAfterYield(JSContext* cx, BaselineFrame* frame, jsbytecode* pc,
                      bool* mustReturn) {
   // The BaselineFrame has just been constructed by JSOP_RESUME in the
   // caller. We need to set its debuggee flag as necessary.
   //
-  // If a breakpoint is set on JSOP_DEBUGAFTERYIELD, or stepping is enabled,
+  // If a breakpoint is set on JSOP_AFTERYIELD, or stepping is enabled,
   // we may already have done this work. Don't fire onEnterFrame again.
   if (frame->script()->isDebuggee() && !frame->isDebuggee()) {
     frame->setIsDebuggee();
     ResumeMode resumeMode = Debugger::onResumeFrame(cx, frame);
     return HandlePrologueResumeMode(cx, frame, pc, mustReturn, resumeMode);
   }
 
   *mustReturn = false;
@@ -1119,18 +1119,18 @@ bool HandleDebugTrap(JSContext* cx, Base
                      bool* mustReturn) {
   *mustReturn = false;
 
   RootedScript script(cx, frame->script());
   jsbytecode* pc =
       script->baselineScript()->retAddrEntryFromReturnAddress(retAddr).pc(
           script);
 
-  if (*pc == JSOP_DEBUGAFTERYIELD) {
-    // JSOP_DEBUGAFTERYIELD will set the frame's debuggee flag and call the
+  if (*pc == JSOP_AFTERYIELD) {
+    // JSOP_AFTERYIELD will set the frame's debuggee flag and call the
     // onEnterFrame handler, but if we set a breakpoint there we have to do
     // it now.
     MOZ_ASSERT(!frame->isDebuggee());
 
     if (!DebugAfterYield(cx, frame, pc, mustReturn)) {
       return false;
     }
     if (*mustReturn) {
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -2054,17 +2054,17 @@ ResumeMode Debugger::fireEnterFrame(JSCo
   MOZ_ASSERT(hook->isCallable());
 
   RootedValue scriptFrame(cx);
 
   FrameIter iter(cx);
 
 #if DEBUG
   // Assert that the hook won't be able to re-enter the generator.
-  if (iter.hasScript() && *iter.pc() == JSOP_DEBUGAFTERYIELD) {
+  if (iter.hasScript() && *iter.pc() == JSOP_AFTERYIELD) {
     auto* genObj = GetGeneratorObjectForFrame(cx, iter.abstractFramePtr());
     MOZ_ASSERT(genObj->isRunning() || genObj->isClosing());
   }
 #endif
 
   Maybe<AutoRealm> ar;
   ar.emplace(cx, object);
 
--- a/js/src/vm/Debugger.h
+++ b/js/src/vm/Debugger.h
@@ -1015,17 +1015,17 @@ class Debugger : private mozilla::Linked
    * suspended earlier.
    *
    * There is no separate user-visible Debugger.onResumeFrame hook; this
    * fires .onEnterFrame (again, since we're re-entering the frame).
    *
    * Unfortunately, the interpreter and the baseline JIT arrange for this to
    * be called in different ways. The interpreter calls it from JSOP_RESUME,
    * immediately after pushing the resumed frame; the JIT calls it from
-   * JSOP_DEBUGAFTERYIELD, just after the generator resumes. The difference
+   * JSOP_AFTERYIELD, just after the generator resumes. The difference
    * should not be user-visible.
    */
   static inline ResumeMode onResumeFrame(JSContext* cx, AbstractFramePtr frame);
 
   /*
    * Announce to the debugger a |debugger;| statement on has been
    * encountered on the youngest JS frame on |cx|. Call whatever hooks have
    * been registered to observe this.
--- a/js/src/vm/GeneratorObject.cpp
+++ b/js/src/vm/GeneratorObject.cpp
@@ -310,17 +310,17 @@ bool AbstractGeneratorObject::isAfterAwa
 bool AbstractGeneratorObject::isAfterYieldOrAwait(JSOp op) {
   if (isClosed() || isClosing() || isRunning()) {
     return false;
   }
 
   JSScript* script = callee().nonLazyScript();
   jsbytecode* code = script->code();
   uint32_t nextOffset = script->resumeOffsets()[resumeIndex()];
-  if (code[nextOffset] != JSOP_DEBUGAFTERYIELD) {
+  if (code[nextOffset] != JSOP_AFTERYIELD) {
     return false;
   }
 
   static_assert(JSOP_YIELD_LENGTH == JSOP_INITIALYIELD_LENGTH,
                 "JSOP_YIELD and JSOP_INITIALYIELD must have the same length");
   static_assert(JSOP_YIELD_LENGTH == JSOP_AWAIT_LENGTH,
                 "JSOP_YIELD and JSOP_AWAIT must have the same length");
 
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -4117,22 +4117,22 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
             goto error;
           default:
             MOZ_CRASH("bad resumeKind");
         }
       }
       ADVANCE_AND_DISPATCH(0);
     }
 
-    CASE(JSOP_DEBUGAFTERYIELD) {
+    CASE(JSOP_AFTERYIELD) {
       // No-op in the interpreter, as AbstractGeneratorObject::resume takes care
       // of fixing up InterpreterFrames.
       MOZ_ASSERT_IF(REGS.fp()->script()->isDebuggee(), REGS.fp()->isDebuggee());
     }
-    END_CASE(JSOP_DEBUGAFTERYIELD)
+    END_CASE(JSOP_AFTERYIELD)
 
     CASE(JSOP_FINALYIELDRVAL) {
       ReservedRooted<JSObject*> gen(&rootObject0, &REGS.sp[-1].toObject());
       REGS.sp--;
       AbstractGeneratorObject::finalSuspend(gen);
       goto successful_return_continuation;
     }
 
--- a/js/src/vm/Opcodes.h
+++ b/js/src/vm/Opcodes.h
@@ -2248,17 +2248,17 @@
      * Bytecode emitted after 'yield' expressions to help the Debugger fix up
      * the frame in the JITs. No-op in the interpreter.
      *
      *   Category: Operators
      *   Type: Debugger
      *   Operands:
      *   Stack: =>
      */ \
-    MACRO(JSOP_DEBUGAFTERYIELD, 208, "debugafteryield", NULL, 1, 0, 0, JOF_BYTE) \
+    MACRO(JSOP_AFTERYIELD, 208, "afteryield", NULL, 1, 0, 0, JOF_BYTE) \
     /*
      * Pops the generator and the return value 'promise', stops interpretation
      * and returns 'promise'. Pushes resolved value onto the stack.
      *
      *   Category: Statements
      *   Type: Generator
      *   Operands: uint24_t resumeIndex
      *   Stack: promise, gen => resolved