Commit 9523d952 authored by Jan de Mooij's avatar Jan de Mooij
Browse files

Bug 1598548 part 12 - Don't treat JSOP_IFEQ as a backedge. r=arai

Now all loops use either JSOP_IFNE (do-while) or JSOP_GOTO (other loops).

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

--HG--
extra : moz-landing-system : lando
parent 3ef732aa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ class LoopControl : public BreakableControl {
  //     {loop update if present}
  //
  //     # Loop end, backward jump
  //     JSOP_GOTO/JSOP_IFEQ/JSOP_IFNE head
  //     JSOP_GOTO/JSOP_IFNE head
  //
  //   breakTarget:

+3 −10
Original line number Diff line number Diff line
@@ -3112,7 +3112,7 @@ AbortReasonOr<Ok> IonBuilder::jsop_dup2() {
}

AbortReasonOr<Ok> IonBuilder::visitTestBackedge(JSOp op, bool* restarted) {
  MOZ_ASSERT(op == JSOP_IFNE || op == JSOP_IFEQ);
  MOZ_ASSERT(op == JSOP_IFNE);
  MOZ_ASSERT(loopDepth_ > 0);

  MDefinition* ins = current->pop();
@@ -3128,15 +3128,8 @@ AbortReasonOr<Ok> IonBuilder::visitTestBackedge(JSOp op, bool* restarted) {
  MBasicBlock* backedge;
  MOZ_TRY_VAR(backedge, newBlock(current, loopHead));

  if (op == JSOP_IFNE) {
  current->end(newTest(ins, backedge, nullptr));
    MOZ_TRY(
        addPendingEdge(PendingEdge::NewTestFalse(current, op), successorPC));
  } else {
    MOZ_ASSERT(op == JSOP_IFEQ);
    current->end(newTest(ins, nullptr, backedge));
    MOZ_TRY(addPendingEdge(PendingEdge::NewTestTrue(current, op), successorPC));
  }
  MOZ_TRY(addPendingEdge(PendingEdge::NewTestFalse(current, op), successorPC));

  MOZ_TRY(startTraversingBlock(backedge));
  return visitBackEdge(restarted);
+0 −1
Original line number Diff line number Diff line
@@ -274,7 +274,6 @@ static inline bool IsBackedgePC(jsbytecode* pc) {
  switch (JSOp(*pc)) {
    case JSOP_GOTO:
    case JSOP_IFNE:
    case JSOP_IFEQ:
      return GET_JUMP_OFFSET(pc) < 0;
    default:
      return false;