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

Unified Diff: src/hydrogen.cc

Issue 11678007: SSI implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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 bf508dac28d7aeea2af3cfa3eb5281c7d0f83513..559dcd91109a808cef72f530e9c7a54dcab2d433 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -597,6 +597,11 @@ HConstant* HGraph::GetConstantInt32(SetOncePointer<HConstant>* pointer,
}
+HConstant* HGraph::GetConstant0() {
+ return GetConstantInt32(&constant_0_, 0);
+}
+
+
HConstant* HGraph::GetConstant1() {
return GetConstantInt32(&constant_1_, 1);
}
@@ -3499,6 +3504,11 @@ bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) {
HStackCheckEliminator sce(this);
sce.Process();
+ if (FLAG_use_ssi) {
+ BuildSsi();
+ CleanupSsi();
+ }
+
EliminateRedundantBoundsChecks();
DehoistSimpleArrayIndexComputations();
if (FLAG_dead_code_elimination) DeadCodeElimination();
@@ -3939,6 +3949,28 @@ void HGraph::DehoistSimpleArrayIndexComputations() {
}
+void HGraph::BuildSsi() {
+ HPhase phase("H_Build SSI", this);
+ entry_block()->BuildSsiRecursively();
+}
+
+
+void HGraph::CleanupSsi() {
+ HPhase phase("H_Cleanup SSI", this);
+ for (int b_index = 0; b_index < blocks()->length(); b_index++) {
+ HBasicBlock* block = blocks()->at(b_index);
+ HInstruction* current = block->first();
+ while (current != NULL) {
+ HInstruction* next = current->next();
+ if (current->IsSsiDefinition()) {
+ current->DeleteAndReplaceWith(current->ValueBeforeSsi());
+ }
+ current = next;
+ }
+ }
+}
+
+
void HGraph::DeadCodeElimination() {
HPhase phase("H_Dead code elimination", this);
ZoneList<HInstruction*> worklist(blocks_.length(), zone());
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698