Chromium Code Reviews| Index: src/ia32/lithium-codegen-ia32.cc |
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
| index 2240d1072445d7a7d71ef1c27274691be8adacfc..d28425e590406c4e2c51735eb8e951807f9f72ea 100644 |
| --- a/src/ia32/lithium-codegen-ia32.cc |
| +++ b/src/ia32/lithium-codegen-ia32.cc |
| @@ -4379,8 +4379,20 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| } |
| +void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { |
|
titzer
2013/07/18 12:22:58
If the debug code is valuable enough to have on ia
Massi
2013/07/23 07:57:50
Done.
|
| + 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; |
| + if (instr->hydrogen()->skip_check() && !FLAG_debug_code) return; |
| if (instr->index()->IsConstantOperand()) { |
| int constant_index = |
| @@ -4391,10 +4403,14 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| } else { |
| __ cmp(ToOperand(instr->length()), Immediate(constant_index)); |
| } |
| - DeoptimizeIf(below_equal, instr->environment()); |
| + Condition condition = |
| + instr->hydrogen()->allow_equality() ? below : below_equal; |
| + ApplyCheckIf(condition, instr); |
| } else { |
| __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); |
| - DeoptimizeIf(above_equal, instr->environment()); |
| + Condition condition = |
| + instr->hydrogen()->allow_equality() ? above : above_equal; |
| + ApplyCheckIf(condition, instr); |
| } |
| } |