Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: src/arm/codegen-arm.cc

Issue 1645008: Add tracking of loop nesting to ARM code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/codegen-arm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/arm/codegen-arm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698