Index: src/compiler/graph-reducer.h |
diff --git a/src/compiler/graph-reducer.h b/src/compiler/graph-reducer.h |
index bd732d5808938b4cc0c3bcd0589615b867ea6a89..1ab9878728ef523c1502a2b6e50f143a17562c79 100644 |
--- a/src/compiler/graph-reducer.h |
+++ b/src/compiler/graph-reducer.h |
@@ -77,9 +77,8 @@ class AdvancedReducer : public Reducer { |
// Replace value uses of {node} with {value} and effect uses of {node} with |
// {effect}. If {effect == NULL}, then use the effect input to {node}. All |
// control uses will be relaxed assuming {node} cannot throw. |
- virtual void ReplaceWithValue(Node* node, Node* value, |
- Node* effect = nullptr, |
- Node* control = nullptr) = 0; |
+ virtual void ReplaceWithValue(Node* node, Node* value, Node* effect, |
+ Node* control) = 0; |
}; |
explicit AdvancedReducer(Editor* editor) : editor_(editor) {} |
@@ -107,15 +106,13 @@ class AdvancedReducer : public Reducer { |
// uses of {node} with the effect and control input to {node}. |
// TODO(turbofan): replace the effect input to {node} with {graph->start()}. |
void RelaxEffectsAndControls(Node* node) { |
- DCHECK_NOT_NULL(editor_); |
- editor_->ReplaceWithValue(node, node, nullptr, nullptr); |
+ ReplaceWithValue(node, node, nullptr, nullptr); |
} |
// Relax the control uses of {node} by immediately replacing them with the |
// control input to {node}. |
void RelaxControls(Node* node) { |
- DCHECK_NOT_NULL(editor_); |
- editor_->ReplaceWithValue(node, node, node, nullptr); |
+ ReplaceWithValue(node, node, node, nullptr); |
} |
private: |
@@ -124,10 +121,10 @@ class AdvancedReducer : public Reducer { |
// Performs an iterative reduction of a node graph. |
-class GraphReducer final : public AdvancedReducer::Editor { |
+class GraphReducer : public AdvancedReducer::Editor { |
public: |
- GraphReducer(Graph* graph, Zone* zone); |
- ~GraphReducer() final; |
+ GraphReducer(Graph* graph, Node* dead_value, Node* dead_control, Zone* zone); |
titzer
2015/06/05 09:42:26
Can we move the zone first and then have default v
Michael Starzinger
2015/06/05 11:06:54
Done.
|
+ ~GraphReducer(); |
Graph* graph() const { return graph_; } |
@@ -156,8 +153,8 @@ class GraphReducer final : public AdvancedReducer::Editor { |
// Replace value uses of {node} with {value} and effect uses of {node} with |
// {effect}. If {effect == NULL}, then use the effect input to {node}. All |
// control uses will be relaxed assuming {node} cannot throw. |
- void ReplaceWithValue(Node* node, Node* value, Node* effect = nullptr, |
- Node* control = nullptr) final; |
+ void ReplaceWithValue(Node* node, Node* value, Node* effect, |
+ Node* control) final; |
// Replace all uses of {node} with {replacement} if the id of {replacement} is |
// less than or equal to {max_id}. Otherwise, replace all uses of {node} whose |
@@ -173,6 +170,8 @@ class GraphReducer final : public AdvancedReducer::Editor { |
void Revisit(Node* node) final; |
Graph* const graph_; |
+ Node* const dead_value_; |
+ Node* const dead_control_; |
NodeMarker<State> state_; |
ZoneVector<Reducer*> reducers_; |
ZoneStack<Node*> revisit_; |