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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10946027: Revert "Initial implementation of sparse conditional constant propagation." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 8370cd63caaf0615bc1b4551a0438ad811de110c..fd02f8cd6bed6c863adcf7201f6ffad4d7acc2d7 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -607,6 +607,7 @@ class BlockEntryInstr : public Instruction {
virtual intptr_t PredecessorCount() const = 0;
virtual BlockEntryInstr* PredecessorAt(intptr_t index) const = 0;
+ virtual void AddPredecessor(BlockEntryInstr* predecessor) = 0;
virtual void PrepareEntry(FlowGraphCompiler* compiler) = 0;
intptr_t preorder_number() const { return preorder_number_; }
@@ -633,7 +634,6 @@ class BlockEntryInstr : public Instruction {
void AddDominatedBlock(BlockEntryInstr* block) {
dominated_blocks_.Add(block);
}
- void ClearDominatedBlocks() { dominated_blocks_.Clear(); }
bool Dominates(BlockEntryInstr* other) const;
@@ -697,9 +697,6 @@ class BlockEntryInstr : public Instruction {
loop_info_(NULL) { }
private:
- virtual void ClearPredecessors() = 0;
- virtual void AddPredecessor(BlockEntryInstr* predecessor) = 0;
-
const intptr_t try_index_;
intptr_t preorder_number_;
intptr_t postorder_number_;
@@ -788,6 +785,8 @@ class GraphEntryInstr : public BlockEntryInstr {
UNREACHABLE();
return NULL;
}
+ virtual void AddPredecessor(BlockEntryInstr* predecessor) { UNREACHABLE(); }
+
virtual intptr_t SuccessorCount() const;
virtual BlockEntryInstr* SuccessorAt(intptr_t index) const;
@@ -822,9 +821,6 @@ class GraphEntryInstr : public BlockEntryInstr {
virtual void PrintToVisualizer(BufferFormatter* f) const;
private:
- virtual void ClearPredecessors() { UNREACHABLE(); }
- virtual void AddPredecessor(BlockEntryInstr* predecessor) { UNREACHABLE(); }
-
TargetEntryInstr* normal_entry_;
GrowableArray<TargetEntryInstr*> catch_entries_;
Environment* start_env_;
@@ -849,6 +845,9 @@ class JoinEntryInstr : public BlockEntryInstr {
virtual BlockEntryInstr* PredecessorAt(intptr_t index) const {
return predecessors_[index];
}
+ virtual void AddPredecessor(BlockEntryInstr* predecessor) {
+ predecessors_.Add(predecessor);
+ }
// Returns -1 if pred is not in the list.
intptr_t IndexOfPredecessor(BlockEntryInstr* pred) const;
@@ -865,28 +864,10 @@ class JoinEntryInstr : public BlockEntryInstr {
virtual void PrintTo(BufferFormatter* f) const;
virtual void PrintToVisualizer(BufferFormatter* f) const;
- // After recomputing predecessors to eliminate unreachable ones,
- // reorganize phi inputs to match the predecessor order and to eliminate
- // unreachable inputs.
- void EliminateUnreachablePhiInputs();
-
private:
- virtual void ClearPredecessors() {
- // Keep a 'backup' of any existing predecessors to enable garbage
- // collection of phis after eliminating unreachable code and recomputing
- // predecessors.
- stale_predecessors_.Clear();
- stale_predecessors_.AddArray(predecessors_);
- predecessors_.Clear();
- }
- virtual void AddPredecessor(BlockEntryInstr* predecessor) {
- predecessors_.Add(predecessor);
- }
-
GrowableArray<BlockEntryInstr*> predecessors_;
ZoneGrowableArray<PhiInstr*>* phis_;
intptr_t phi_count_;
- GrowableArray<BlockEntryInstr*> stale_predecessors_;
DISALLOW_COPY_AND_ASSIGN(JoinEntryInstr);
};
@@ -914,6 +895,10 @@ class TargetEntryInstr : public BlockEntryInstr {
ASSERT((index == 0) && (predecessor_ != NULL));
return predecessor_;
}
+ virtual void AddPredecessor(BlockEntryInstr* predecessor) {
+ ASSERT(predecessor_ == NULL);
+ predecessor_ = predecessor;
+ }
// Returns true if this Block is an entry of a catch handler.
bool IsCatchEntry() const {
@@ -933,12 +918,6 @@ class TargetEntryInstr : public BlockEntryInstr {
virtual void PrintToVisualizer(BufferFormatter* f) const;
private:
- virtual void ClearPredecessors() { predecessor_ = NULL; }
- virtual void AddPredecessor(BlockEntryInstr* predecessor) {
- ASSERT(predecessor_ == NULL);
- predecessor_ = predecessor;
- }
-
BlockEntryInstr* predecessor_;
const intptr_t catch_try_index_;
@@ -951,7 +930,15 @@ class Definition : public Instruction {
public:
enum UseKind { kEffect, kValue };
- Definition();
+ Definition()
+ : temp_index_(-1),
+ ssa_temp_index_(-1),
+ propagated_type_(AbstractType::Handle()),
+ propagated_cid_(kIllegalCid),
+ input_use_list_(NULL),
+ env_use_list_(NULL),
+ use_kind_(kValue) { // Phis and parameters rely on this default.
+ }
virtual Definition* AsDefinition() { return this; }
@@ -1073,12 +1060,6 @@ class Definition : public Instruction {
virtual void PrintOperandsTo(BufferFormatter* f) const;
virtual void PrintToVisualizer(BufferFormatter* f) const;
- // A value in the constant propagation lattice.
- // - non-constant sentinel
- // - a constant (any non-sentinel value)
- // - unknown sentinel
- Object& constant_value() const { return constant_value_; }
-
private:
intptr_t temp_index_;
intptr_t ssa_temp_index_;
@@ -1090,8 +1071,6 @@ class Definition : public Instruction {
Value* env_use_list_;
UseKind use_kind_;
- Object& constant_value_;
-
DISALLOW_COPY_AND_ASSIGN(Definition);
};
@@ -1162,8 +1141,6 @@ class PhiInstr : public Definition {
virtual void PrintToVisualizer(BufferFormatter* f) const;
private:
- friend class JoinEntryInstr; // Direct access to inputs_ array.
-
JoinEntryInstr* block_;
GrowableArray<Value*> inputs_;
bool is_alive_;
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698