Chromium Code Reviews| Index: src/codegen-arm.cc |
| =================================================================== |
| --- src/codegen-arm.cc (revision 282) |
| +++ src/codegen-arm.cc (working copy) |
| @@ -948,6 +948,7 @@ |
| ASSERT(var()->mode() != Variable::DYNAMIC); |
| Label exit; |
| + bool skipped_write = false; |
| if (init_state == CONST_INIT) { |
| ASSERT(var()->mode() == Variable::CONST); |
| // Only the first const initialization must be executed (the slot |
| @@ -957,6 +958,7 @@ |
| masm->ldr(r2, ArmCodeGenerator::SlotOperand(masm, scope, this, r2)); |
| masm->cmp(r2, Operand(Factory::the_hole_value())); |
| masm->b(ne, &exit); |
| + skipped_write = true; |
| } |
| // We must execute the store. |
| @@ -981,7 +983,9 @@ |
| masm->mov(r3, Operand(offset)); |
| masm->RecordWrite(r2, r3, r1); |
| } |
| - masm->bind(&exit); |
| + // If we did not jump over the assignment, we do not need to bind the |
| + // exit label. Doing so can defeat peephole optimization. |
| + if (skipped_write) masm->bind(&exit); |
|
iposva
2008/09/11 18:25:11
Why do you introduce a separate variable for testi
|
| } |
| } |