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

MIPS: New array bounds check elimination pass (focused on induction variables...

MIPS: New array bounds check elimination pass (focused on induction variables and bitwise operations).

Port r15866 (52e8581c)

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3c9efdee
......@@ -4163,6 +4163,21 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
}
void LCodeGen::ApplyCheckIf(Condition cc,
LBoundsCheck* check,
Register src1,
const Operand& src2) {
if (FLAG_debug_code && check->hydrogen()->skip_check()) {
Label done;
__ Branch(&done, NegateCondition(cc), src1, src2);
__ stop("eliminated bounds check failed");
__ bind(&done);
} else {
DeoptimizeIf(cc, check->environment(), src1, src2);
}
}
void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
if (instr->hydrogen()->skip_check()) return;
......@@ -4175,13 +4190,13 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
} else {
__ li(at, Operand(constant_index));
}
DeoptimizeIf(condition,
instr->environment(),
ApplyCheckIf(condition,
instr,
at,
Operand(ToRegister(instr->length())));
} else {
DeoptimizeIf(condition,
instr->environment(),
ApplyCheckIf(condition,
instr,
ToRegister(instr->index()),
Operand(ToRegister(instr->length())));
}
......
......@@ -284,6 +284,10 @@ class LCodeGen BASE_EMBEDDED {
LEnvironment* environment,
Register src1 = zero_reg,
const Operand& src2 = Operand(zero_reg));
void ApplyCheckIf(Condition cc,
LBoundsCheck* check,
Register src1 = zero_reg,
const Operand& src2 = Operand(zero_reg));
void AddToTranslation(Translation* translation,
LOperand* op,
......
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