Chromium Code Reviews| Index: src/arm/codegen-arm.cc |
| =================================================================== |
| --- src/arm/codegen-arm.cc (revision 4427) |
| +++ src/arm/codegen-arm.cc (working copy) |
| @@ -133,6 +133,7 @@ |
| allocator_(NULL), |
| cc_reg_(al), |
| state_(NULL), |
| + loop_nesting_(0), |
| function_return_is_shadowed_(false) { |
| } |
| @@ -156,6 +157,10 @@ |
| ASSERT(frame_ == NULL); |
| frame_ = new VirtualFrame(); |
| cc_reg_ = al; |
| + |
| + // Adjust for function-level loop nesting. |
| + loop_nesting_ += info->loop_nesting(); |
| + |
| { |
| CodeGenState state(this); |
| @@ -380,9 +385,13 @@ |
| masm_->InstructionsGeneratedSince(&check_exit_codesize)); |
| } |
| + // Adjust for function-level loop nesting. |
| + loop_nesting_ -= info->loop_nesting(); |
|
Erik Corry
2010/04/15 12:46:18
Seems simpler to ASSERT that loop_nesting() == inf
|
| + |
| // Code generation state must be reset. |
| ASSERT(!has_cc()); |
| ASSERT(state_ == NULL); |
| + ASSERT(loop_nesting() == 0); |
| ASSERT(!function_return_is_shadowed_); |
| function_return_.Unuse(); |
| DeleteFrame(); |
| @@ -1885,6 +1894,7 @@ |
| CodeForStatementPosition(node); |
| node->break_target()->set_direction(JumpTarget::FORWARD_ONLY); |
| JumpTarget body(JumpTarget::BIDIRECTIONAL); |
| + IncrementLoopNesting(); |
| // Label the top of the loop for the backward CFG edge. If the test |
| // is always true we can use the continue target, and if the test is |
| @@ -1945,6 +1955,7 @@ |
| if (node->break_target()->is_linked()) { |
| node->break_target()->Bind(); |
| } |
| + DecrementLoopNesting(); |
| ASSERT(!has_valid_frame() || frame_->height() == original_height); |
| } |
| @@ -1963,6 +1974,7 @@ |
| if (info == ALWAYS_FALSE) return; |
| node->break_target()->set_direction(JumpTarget::FORWARD_ONLY); |
| + IncrementLoopNesting(); |
| // Label the top of the loop with the continue target for the backward |
| // CFG edge. |
| @@ -1994,6 +2006,7 @@ |
| if (node->break_target()->is_linked()) { |
| node->break_target()->Bind(); |
| } |
| + DecrementLoopNesting(); |
| ASSERT(!has_valid_frame() || frame_->height() == original_height); |
| } |
| @@ -2015,6 +2028,7 @@ |
| if (info == ALWAYS_FALSE) return; |
| node->break_target()->set_direction(JumpTarget::FORWARD_ONLY); |
| + IncrementLoopNesting(); |
| // If there is no update statement, label the top of the loop with the |
| // continue target, otherwise with the loop target. |
| @@ -2069,6 +2083,7 @@ |
| if (node->break_target()->is_linked()) { |
| node->break_target()->Bind(); |
| } |
| + DecrementLoopNesting(); |
| ASSERT(!has_valid_frame() || frame_->height() == original_height); |
| } |