Bug 1543592 part 1 - Rename JSOP_DEBUGAFTERYIELD to JSOP_AFTERYIELD. r=tcampbell

Differential Revision: https://phabricator.services.mozilla.com/D27032

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jan de Mooij 2019-04-12 10:20:12 +00:00
parent da3aba33df
commit f0e1533406
12 changed files with 18 additions and 19 deletions

View File

@ -2307,7 +2307,7 @@ bool BytecodeEmitter::emitYieldOp(JSOp op) {
SET_RESUMEINDEX(bytecodeSection().code(off), resumeIndex);
return emit1(JSOP_DEBUGAFTERYIELD);
return emit1(JSOP_AFTERYIELD);
}
bool BytecodeEmitter::emitSetThis(BinaryNode* setThisNode) {

View File

@ -1,7 +1,7 @@
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(`

View File

@ -5442,7 +5442,7 @@ bool BaselineCodeGen<Handler>::emit_JSOP_AWAIT() {
}
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());

View File

@ -205,7 +205,7 @@ namespace jit {
_(JSOP_YIELD) \
_(JSOP_AWAIT) \
_(JSOP_TRYSKIPAWAIT) \
_(JSOP_DEBUGAFTERYIELD) \
_(JSOP_AFTERYIELD) \
_(JSOP_FINALYIELDRVAL) \
_(JSOP_RESUME) \
_(JSOP_ASYNCAWAIT) \

View File

@ -334,7 +334,7 @@ static void PatchBaselineFramesForDebugMode(
// 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
@ -510,10 +510,9 @@ static void PatchBaselineFramesForDebugMode(
// 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;

View File

@ -2522,7 +2522,7 @@ AbortReasonOr<Ok> IonBuilder::inspectOpcode(JSOp op) {
case JSOP_YIELD:
case JSOP_FINALYIELDRVAL:
case JSOP_RESUME:
case JSOP_DEBUGAFTERYIELD:
case JSOP_AFTERYIELD:
case JSOP_AWAIT:
case JSOP_TRYSKIPAWAIT:
case JSOP_GENERATOR:

View File

@ -1009,7 +1009,7 @@ bool DebugAfterYield(JSContext* cx, BaselineFrame* frame, jsbytecode* pc,
// 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();
@ -1124,8 +1124,8 @@ bool HandleDebugTrap(JSContext* cx, BaselineFrame* frame, uint8_t* retAddr,
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());

View File

@ -2059,7 +2059,7 @@ ResumeMode Debugger::fireEnterFrame(JSContext* cx, MutableHandleValue vp) {
#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());
}

View File

@ -1020,7 +1020,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger> {
* 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);

View File

@ -315,7 +315,7 @@ bool AbstractGeneratorObject::isAfterYieldOrAwait(JSOp op) {
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;
}

View File

@ -4122,12 +4122,12 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
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());

View File

@ -2253,7 +2253,7 @@
* 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.