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

Unified Diff: src/hydrogen.h

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.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index 0837bf9634e33cc088a7a8dea90e479161c65902..236369ce64a11ae539113bcc2eb5c5a20b005867 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -161,6 +161,29 @@ class HBasicBlock: public ZoneObject {
inline Zone* zone() const;
+ void BuildSsiRecursively() {
+ BuildSsi();
+ for (int i = 0; i < dominated_blocks()->length(); ++i) {
+ dominated_blocks()->at(i)->BuildSsiRecursively();
+ }
+ }
+ void BuildSsi() {
+ for (int i = 0; i < phis()->length(); i++) {
+ HPhi* current = phis()->at(i);
+ current->SetFlag(HValue::kProcessedBySsi);
+ current->BuildSsi();
+ }
+
+ for (HInstruction* current = first();
+ current != NULL;
+ current = current->next()) {
+ // We set the flag before calling BuildSsi so that, while creating new
+ // SSI definitions, uses inside current will not be updated.
+ current->SetFlag(HValue::kProcessedBySsi);
+ current->BuildSsi();
+ }
+ }
+
#ifdef DEBUG
void Verify();
#endif
@@ -290,6 +313,7 @@ class HGraph: public ZoneObject {
undefined_constant_.set(constant);
}
HConstant* GetConstantUndefined() const { return undefined_constant_.get(); }
+ HConstant* GetConstant0();
HConstant* GetConstant1();
HConstant* GetConstantMinus1();
HConstant* GetConstantTrue();
@@ -370,6 +394,9 @@ class HGraph: public ZoneObject {
uint32_instructions_->Add(instr, zone());
}
+ void BuildSsi();
+ void CleanupSsi();
+
private:
HConstant* GetConstant(SetOncePointer<HConstant>* pointer,
Handle<Object> value);
@@ -399,6 +426,7 @@ class HGraph: public ZoneObject {
ZoneList<HPhi*>* phi_list_;
ZoneList<HInstruction*>* uint32_instructions_;
SetOncePointer<HConstant> undefined_constant_;
+ SetOncePointer<HConstant> constant_0_;
SetOncePointer<HConstant> constant_1_;
SetOncePointer<HConstant> constant_minus1_;
SetOncePointer<HConstant> constant_true_;
« no previous file with comments | « src/flag-definitions.h ('k') | src/hydrogen.cc » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698