Commit dc8eb9a0 authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: Proper support for deopt_every_n_times option on the x64 and ARM architectures.

Port r17564 (b928ddeb)

BUG=
R=plind44@gmail.com

Review URL: https://codereview.chromium.org/65903002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17575 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 56ca0091
......@@ -738,13 +738,23 @@ void LCodeGen::DeoptimizeIf(Condition condition,
return;
}
ASSERT(FLAG_deopt_every_n_times < 2); // Other values not supported on MIPS.
if (FLAG_deopt_every_n_times == 1 &&
!info()->IsStub() &&
info()->opt_count() == id) {
ASSERT(frame_is_built_);
if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) {
Register scratch = scratch0();
ExternalReference count = ExternalReference::stress_deopt_count(isolate());
Label no_deopt;
__ Push(a1, scratch);
__ li(scratch, Operand(count));
__ lw(a1, MemOperand(scratch));
__ Subu(a1, a1, Operand(1));
__ Branch(&no_deopt, ne, a1, Operand(zero_reg));
__ li(a1, Operand(FLAG_deopt_every_n_times));
__ sw(a1, MemOperand(scratch));
__ Pop(a1, scratch);
__ Call(entry, RelocInfo::RUNTIME_ENTRY);
return;
__ bind(&no_deopt);
__ sw(a1, MemOperand(scratch));
__ Pop(a1, scratch);
}
if (info()->ShouldTrapOnDeopt()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment