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

Unified Diff: src/compiler/js-context-specialization.h

Issue 1221103003: [turbofan] Move context specialization into JSContextSpecializer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix predicate. Created 5 years, 6 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
Index: src/compiler/js-context-specialization.h
diff --git a/src/compiler/js-context-specialization.h b/src/compiler/js-context-specialization.h
index 1f0c2b817ad3ebcbcf83df508fb6f31414db820c..5804938a53b5f294ac6c2d517ba42b771d7dd1af 100644
--- a/src/compiler/js-context-specialization.h
+++ b/src/compiler/js-context-specialization.h
@@ -18,23 +18,31 @@ class JSOperatorBuilder;
// Specializes a given JSGraph to a given context, potentially constant folding
// some {LoadContext} nodes or strength reducing some {StoreContext} nodes.
-class JSContextSpecializer : public AdvancedReducer {
+class JSContextSpecializer final : public AdvancedReducer {
public:
- JSContextSpecializer(Editor* editor, JSGraph* jsgraph)
- : AdvancedReducer(editor), jsgraph_(jsgraph) {}
+ JSContextSpecializer(Editor* editor, JSGraph* jsgraph, int context_index,
+ MaybeHandle<Context> context)
+ : AdvancedReducer(editor),
+ jsgraph_(jsgraph),
+ context_index_(context_index),
+ context_(context) {}
- Reduction Reduce(Node* node) override;
+ Reduction Reduce(Node* node) final;
- // Visible for unit testing.
+ private:
+ Reduction ReduceParameter(Node* node);
Reduction ReduceJSLoadContext(Node* node);
Reduction ReduceJSStoreContext(Node* node);
- private:
Isolate* isolate() const;
JSOperatorBuilder* javascript() const;
JSGraph* jsgraph() const { return jsgraph_; }
+ int context_index() const { return context_index_; }
+ MaybeHandle<Context> context() const { return context_; }
JSGraph* const jsgraph_;
+ int const context_index_;
+ MaybeHandle<Context> context_;
DISALLOW_COPY_AND_ASSIGN(JSContextSpecializer);
};

Powered by Google App Engine
This is Rietveld 408576698