ASSERT(var()->mode() != Variable::DYNAMIC);
Label exit;
+ bool may_skip_write = false;
if (init_state == CONST_INIT) {
ASSERT(var()->mode() == Variable::CONST);
// Only the first const initialization must be executed (the slot
masm->ldr(r2, ArmCodeGenerator::SlotOperand(masm, scope, this, r2));
masm->cmp(r2, Operand(Factory::the_hole_value()));
masm->b(ne, &exit);
+ may_skip_write = true;
}
// We must execute the store.
masm->mov(r3, Operand(offset));
masm->RecordWrite(r2, r3, r1);
}
- masm->bind(&exit);
+ // If we definitely did not jump over the assignment, we do not need to
+ // bind the exit label. Doing so can defeat peephole optimization.
+ if (may_skip_write) masm->bind(&exit);
}
}
ASSERT(var()->mode() != Variable::DYNAMIC);
Label exit;
+ bool may_skip_write = false;
if (init_state == CONST_INIT) {
ASSERT(var()->mode() == Variable::CONST);
// Only the first const initialization must be executed (the slot
masm->mov(eax, Ia32CodeGenerator::SlotOperand(masm, scope, this, ecx));
masm->cmp(eax, Factory::the_hole_value());
masm->j(not_equal, &exit);
+ may_skip_write = true;
}
// We must execute the store.
int offset = FixedArray::kHeaderSize + index() * kPointerSize;
masm->RecordWrite(ecx, offset, eax, ebx);
}
- masm->bind(&exit);
+ // If we definitely did not jump over the assignment, we do not need to
+ // bind the exit label. Doing so can defeat peephole optimization.
+ if (may_skip_write) masm->bind(&exit);
}
}