Index: src/compiler/graph-reducer.h |
diff --git a/src/compiler/graph-reducer.h b/src/compiler/graph-reducer.h |
index bd732d5808938b4cc0c3bcd0589615b867ea6a89..21e0a84b99c86021556848e316a66f7c0e6d15c9 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,11 @@ 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(Zone* zone, Graph* graph, Node* dead_value = nullptr, |
+ Node* dead_control = nullptr); |
+ ~GraphReducer(); |
Graph* graph() const { return graph_; } |
@@ -156,8 +154,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 +171,8 @@ class GraphReducer final : public AdvancedReducer::Editor { |
void Revisit(Node* node) final; |
Graph* const graph_; |
+ Node* dead_value_; |
+ Node* dead_control_; |
NodeMarker<State> state_; |
ZoneVector<Reducer*> reducers_; |
ZoneStack<Node*> revisit_; |