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(); |