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

Unified Diff: src/hydrogen.cc

Issue 14046017: Abcd for performance check. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index a2ddc04b9174f2ec7b95f68acd3acd199ee0a848..3cc8ade284e4a029d399529198fdf9f2b38c8f87 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -437,6 +437,28 @@ void HLoopInformation::RegisterBackEdge(HBasicBlock* block) {
}
+void HLoopInformation::ProcessEdge(HBasicBlock* destination) {
+ HLoopInformation* target_loop = destination->current_loop();
+ if (IsInThisLoop(target_loop)) return;
+
+ HLoopInformation* current_loop = this;
+ while (current_loop != NULL) {
+ if (target_loop == current_loop) return;
+ current_loop->exits_count_++;
+ current_loop = current_loop->parent_loop();
+ }
+}
+
+
+void HLoopInformation::ProcessThrow() {
+ HLoopInformation* current_loop = this;
+ while (current_loop != NULL) {
Jakob Kummerow 2013/04/17 11:34:15 Please add a comment saying that when we support t
Massi 2013/05/07 11:32:03 Done.
+ current_loop->exits_count_++;
+ current_loop = current_loop->parent_loop();
+ }
+}
+
+
HBasicBlock* HLoopInformation::GetLastBackEdge() const {
int max_id = -1;
HBasicBlock* result = NULL;
@@ -2017,6 +2039,14 @@ void HGraph::OrderBlocks() {
HBasicBlock* b = reverse_result[i];
blocks_.Add(b, zone());
b->set_block_id(index++);
+
+ HLoopInformation* loop = b->current_loop();
+ if (loop != NULL) {
+ for (int i = 0; i < b->end()->SuccessorCount(); i++) {
+ HBasicBlock* successor = b->end()->SuccessorAt(i);
+ loop->ProcessEdge(successor);
+ }
+ }
}
}
@@ -3413,6 +3443,12 @@ void HInferRepresentation::Analyze() {
current->CheckFlag(HInstruction::kFlexibleRepresentation)) {
current->ChangeRepresentation(Representation::Tagged());
}
+
+ if (current->IsThrow()) {
Jakob Kummerow 2013/04/17 11:34:15 Let's move this into the block ordering phase wher
Massi 2013/05/07 11:32:03 Done.
+ if (block->current_loop() != NULL) {
+ block->current_loop()->ProcessThrow();
+ }
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698