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); |
}; |