mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1601599 part 5 - Remove JSOP_LOOPHEAD source notes. r=tcampbell
IonBuilder no longer has to know the loop type. Depends on D56701 Differential Revision: https://phabricator.services.mozilla.com/D56702 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2b6ea9d26a
commit
8e7270c424
@ -66,8 +66,7 @@ bool LoopControl::emitSpecialBreakForDone(BytecodeEmitter* bce) {
|
||||
}
|
||||
|
||||
bool LoopControl::emitLoopHead(BytecodeEmitter* bce,
|
||||
const Maybe<uint32_t>& nextPos,
|
||||
SrcNoteType type) {
|
||||
const Maybe<uint32_t>& nextPos) {
|
||||
// Insert a NOP if needed to ensure the script does not start with a
|
||||
// JSOP_LOOPHEAD. This avoids JIT issues with prologue code + try notes
|
||||
// or OSR. See bug 1602390 and bug 1602681.
|
||||
@ -88,9 +87,6 @@ bool LoopControl::emitLoopHead(BytecodeEmitter* bce,
|
||||
head_ = {bce->bytecodeSection().offset()};
|
||||
|
||||
BytecodeOffset off;
|
||||
if (!bce->newSrcNote(type)) {
|
||||
return false;
|
||||
}
|
||||
if (!bce->emitJumpTargetOp(JSOP_LOOPHEAD, &off)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -136,8 +136,7 @@ class LoopControl : public BreakableControl {
|
||||
// corresponds to the next instruction after JSOP_LOOPHEAD.
|
||||
// Can be Nothing() if not available.
|
||||
MOZ_MUST_USE bool emitLoopHead(BytecodeEmitter* bce,
|
||||
const mozilla::Maybe<uint32_t>& nextPos,
|
||||
SrcNoteType type);
|
||||
const mozilla::Maybe<uint32_t>& nextPos);
|
||||
|
||||
MOZ_MUST_USE bool emitLoopEnd(BytecodeEmitter* bce, JSOp op,
|
||||
JSTryNoteKind tryNoteKind);
|
||||
|
@ -5175,7 +5175,7 @@ bool BytecodeEmitter::emitAsyncIterator() {
|
||||
bool BytecodeEmitter::emitSpread(bool allowSelfHosted) {
|
||||
LoopControl loopInfo(this, StatementKind::Spread);
|
||||
|
||||
if (!loopInfo.emitLoopHead(this, Nothing(), SRC_FOR_OF)) {
|
||||
if (!loopInfo.emitLoopHead(this, Nothing())) {
|
||||
// [stack] NEXT ITER ARR I
|
||||
return false;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ bool CForEmitter::emitCond(const Maybe<uint32_t>& condPos) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!loopInfo_->emitLoopHead(bce_, condPos, SRC_FOR)) {
|
||||
if (!loopInfo_->emitLoopHead(bce_, condPos)) {
|
||||
// [stack]
|
||||
return false;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ bool DoWhileEmitter::emitBody(const Maybe<uint32_t>& doPos,
|
||||
|
||||
loopInfo_.emplace(bce_, StatementKind::DoLoop);
|
||||
|
||||
if (!loopInfo_->emitLoopHead(bce_, bodyPos, SRC_DO_WHILE)) {
|
||||
if (!loopInfo_->emitLoopHead(bce_, bodyPos)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ bool ForInEmitter::emitInitialize() {
|
||||
|
||||
loopInfo_.emplace(bce_, StatementKind::ForInLoop);
|
||||
|
||||
if (!loopInfo_->emitLoopHead(bce_, Nothing(), SRC_FOR_IN)) {
|
||||
if (!loopInfo_->emitLoopHead(bce_, Nothing())) {
|
||||
// [stack] ITER
|
||||
return false;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ bool ForOfEmitter::emitInitialize(const Maybe<uint32_t>& forPos) {
|
||||
|
||||
loopInfo_.emplace(bce_, iterDepth, allowSelfHostedIter_, iterKind_);
|
||||
|
||||
if (!loopInfo_->emitLoopHead(bce_, Nothing(), SRC_FOR_OF)) {
|
||||
if (!loopInfo_->emitLoopHead(bce_, Nothing())) {
|
||||
// [stack] NEXT ITER UNDEF
|
||||
return false;
|
||||
}
|
||||
|
@ -72,11 +72,6 @@ class SrcNote {
|
||||
// clang-format off
|
||||
#define FOR_EACH_SRC_NOTE_TYPE(M) \
|
||||
M(SRC_NULL, "null", 0) /* Terminates a note vector. */ \
|
||||
M(SRC_FOR, "for", 0) /* JSOP_LOOPHEAD is for C-style for-loop. */ \
|
||||
M(SRC_WHILE, "while", 0) /* JSOP_LOOPHEAD is for while loop. */ \
|
||||
M(SRC_DO_WHILE, "do-while", 0) /* JSOP_LOOPHEAD is for do-while loop. */ \
|
||||
M(SRC_FOR_IN, "for-in", 0) /* JSOP_LOOPHEAD is for for-in loop. */ \
|
||||
M(SRC_FOR_OF, "for-of", 0) /* JSOP_LOOPHEAD is for for-of loop. */ \
|
||||
M(SRC_ASSIGNOP, "assignop", 0) /* += or another assign-op follows. */ \
|
||||
M(SRC_CLASS_SPAN, "class", 2) /* The starting and ending offsets for the class, used \
|
||||
for toString correctness for default ctors. */ \
|
||||
@ -87,6 +82,11 @@ class SrcNote {
|
||||
M(SRC_SETLINE, "setline", SrcNote::SetLine::Count) \
|
||||
M(SRC_BREAKPOINT, "breakpoint", 0) /* Bytecode is a recommended breakpoint. */ \
|
||||
M(SRC_STEP_SEP, "step-sep", 0) /* Bytecode is the first in a new steppable area. */ \
|
||||
M(SRC_UNUSED9, "unused", 0) \
|
||||
M(SRC_UNUSED10, "unused", 0) \
|
||||
M(SRC_UNUSED11, "unused", 0) \
|
||||
M(SRC_UNUSED12, "unused", 0) \
|
||||
M(SRC_UNUSED13, "unused", 0) \
|
||||
M(SRC_UNUSED14, "unused", 0) \
|
||||
M(SRC_UNUSED15, "unused", 0) \
|
||||
M(SRC_UNUSED16, "unused", 0) \
|
||||
|
@ -42,7 +42,7 @@ bool WhileEmitter::emitCond(const Maybe<uint32_t>& whilePos,
|
||||
|
||||
loopInfo_.emplace(bce_, StatementKind::WhileLoop);
|
||||
|
||||
if (!loopInfo_->emitLoopHead(bce_, condPos, SRC_WHILE)) {
|
||||
if (!loopInfo_->emitLoopHead(bce_, condPos)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3052,11 +3052,6 @@ static MOZ_MUST_USE bool SrcNotes(JSContext* cx, HandleScript script,
|
||||
case SRC_BREAKPOINT:
|
||||
case SRC_STEP_SEP:
|
||||
case SRC_XDELTA:
|
||||
case SRC_FOR:
|
||||
case SRC_DO_WHILE:
|
||||
case SRC_WHILE:
|
||||
case SRC_FOR_IN:
|
||||
case SRC_FOR_OF:
|
||||
break;
|
||||
|
||||
case SRC_COLSPAN:
|
||||
|
Loading…
Reference in New Issue
Block a user