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

Unified Diff: src/compiler/graph-reducer.h

Issue 1135483004: [turbofan] Add AdvancedReducer::ReplaceWithValue() method and convert JSInlining to an AdvancedRedu… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « src/compiler/control-reducer.cc ('k') | src/compiler/graph-reducer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-reducer.h
diff --git a/src/compiler/graph-reducer.h b/src/compiler/graph-reducer.h
index 1c90b3018babceb2fe657307a9d3b341d35dd86f..aee2bca878f1b12b08ced8d2a4daf19898fe9f2b 100644
--- a/src/compiler/graph-reducer.h
+++ b/src/compiler/graph-reducer.h
@@ -74,6 +74,12 @@ class AdvancedReducer : public Reducer {
virtual void Replace(Node* node, Node* replacement) = 0;
// Revisit the {node} again later.
virtual void Revisit(Node* node) = 0;
+ // 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;
};
explicit AdvancedReducer(Editor* editor) : editor_(editor) {}
@@ -91,6 +97,11 @@ class AdvancedReducer : public Reducer {
DCHECK_NOT_NULL(editor_);
editor_->Revisit(node);
}
+ void ReplaceWithValue(Node* node, Node* value, Node* effect = nullptr,
+ Node* control = nullptr) {
+ DCHECK_NOT_NULL(editor_);
+ editor_->ReplaceWithValue(node, value, effect, control);
+ }
private:
Editor* const editor_;
@@ -126,6 +137,13 @@ class GraphReducer final : public AdvancedReducer::Editor {
// Replace {node} with {replacement}.
void Replace(Node* node, Node* replacement) final;
+
+ // 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;
+
// 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
// id is less than or equal to {max_id} with the {replacement}.
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/graph-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698