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

Unified Diff: runtime/vm/intermediate_language.h

Issue 11505002: Improve redundant load elimination (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix for real 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: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index ccfa8299d4dfbfc6b71678241813d101f25064cf..dfe08ee185f248c8d61f23396314faa1b6750282 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -942,6 +942,8 @@ class JoinEntryInstr : public BlockEntryInstr {
void InsertPhi(intptr_t var_index, intptr_t var_count);
void RemoveDeadPhis();
+ void InsertPhi(PhiInstr* phi);
+
intptr_t phi_count() const { return phi_count_; }
virtual void PrintTo(BufferFormatter* f) const;
@@ -1139,6 +1141,22 @@ class Definition : public Instruction {
// returning Definition (return type is covariant).
virtual Definition* Canonicalize(FlowGraphOptimizer* optimizer);
+ static const intptr_t kReplacementMarker = -2;
+
+ Definition* Replacement() {
+ if (ssa_temp_index_ == kReplacementMarker) {
+ return reinterpret_cast<Definition*>(temp_index_);
+ }
+ return this;
+ }
+
+ void SetReplacement(Definition* other) {
+ ASSERT(ssa_temp_index_ >= 0);
+ ASSERT(WasEliminated());
+ ssa_temp_index_ = kReplacementMarker;
+ temp_index_ = reinterpret_cast<intptr_t>(other);
+ }
+
protected:
friend class RangeAnalysis;

Powered by Google App Engine
This is Rietveld 408576698