Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index fab5a1b7a07d3ddb9a3bcefba6be68813644def5..0fed3a972e6c274c308213fdd0e6a3ac1a64913a 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -4260,6 +4260,18 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
} |
+void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { |
+ if (FLAG_debug_code && check->hydrogen()->skip_check()) { |
+ Label done; |
+ __ b(NegateCondition(cc), &done); |
+ __ stop("eliminated bounds check failed"); |
+ __ bind(&done); |
+ } else { |
+ DeoptimizeIf(cc, check->environment()); |
+ } |
+} |
+ |
+ |
void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
if (instr->hydrogen()->skip_check()) return; |
@@ -4275,7 +4287,8 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
} else { |
__ cmp(ToRegister(instr->index()), ToRegister(instr->length())); |
} |
- DeoptimizeIf(hs, instr->environment()); |
+ Condition condition = instr->hydrogen()->allow_equality() ? hi : hs; |
+ ApplyCheckIf(condition, instr); |
} |