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

Unified Diff: src/hydrogen.cc

Issue 7857031: Add a function to compute loop nesting level to HBasicBlock. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 3 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/hydrogen.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc (revision 9206)
+++ src/hydrogen.cc (working copy)
@@ -220,6 +220,17 @@
}
+int HBasicBlock::LoopNestingDepth() const {
+ const HBasicBlock* current = this;
+ int result = (current->IsLoopHeader()) ? 1 : 0;
+ while (current->parent_loop_header() != NULL) {
+ current = current->parent_loop_header();
+ result++;
+ }
+ return result;
+}
+
+
void HBasicBlock::PostProcessLoopHeader(IterationStatement* stmt) {
ASSERT(IsLoopHeader());
@@ -6567,6 +6578,8 @@
PrintBlockProperty("dominator", current->dominator()->block_id());
}
+ PrintIntProperty("loop_depth", current->LoopNestingDepth());
+
if (chunk != NULL) {
int first_index = current->first_instruction_index();
int last_index = current->last_instruction_index();
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698