Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index beaa1f1df96853c515d0c47c7a88ad3380edaacd..1813bbb7f1ab1a8f748a03c014cd977c1a2c424f 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -4072,6 +4072,18 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
} |
+void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { |
+ if (FLAG_debug_code && check->hydrogen()->skip_check()) { |
+ Label done; |
+ __ j(NegateCondition(cc), &done, Label::kNear); |
+ __ int3(); |
+ __ bind(&done); |
+ } else { |
+ DeoptimizeIf(cc, check->environment()); |
+ } |
+} |
+ |
+ |
void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
if (instr->hydrogen()->skip_check()) return; |
@@ -4109,7 +4121,9 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
__ cmpq(length, ToRegister(instr->index())); |
} |
} |
- DeoptimizeIf(below_equal, instr->environment()); |
+ Condition condition = |
+ instr->hydrogen()->allow_equality() ? below : below_equal; |
+ ApplyCheckIf(condition, instr); |
} |