Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_COMPILER_JS_CALL_REDUCER_H_ | 5 #ifndef V8_COMPILER_JS_CALL_REDUCER_H_ |
| 6 #define V8_COMPILER_JS_CALL_REDUCER_H_ | 6 #define V8_COMPILER_JS_CALL_REDUCER_H_ |
| 7 | 7 |
| 8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
| 9 #include "src/compiler/graph-reducer.h" | 9 #include "src/compiler/graph-reducer.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 // Forward declarations. | 14 // Forward declarations. |
| 15 class CompilationDependencies; | 15 class CompilationDependencies; |
| 16 class Factory; | 16 class Factory; |
| 17 | 17 |
| 18 namespace compiler { | 18 namespace compiler { |
| 19 | 19 |
| 20 // Forward declarations. | 20 // Forward declarations. |
| 21 class CommonOperatorBuilder; | 21 class CommonOperatorBuilder; |
| 22 class JSGraph; | 22 class JSGraph; |
| 23 class JSOperatorBuilder; | 23 class JSOperatorBuilder; |
| 24 class MachineOperatorBuilder; | |
|
Michael Starzinger
2017/06/06 14:32:54
nit: Looks like a left-over, shouldn't be needed.
danno
2017/06/07 09:00:56
Done.
| |
| 24 class SimplifiedOperatorBuilder; | 25 class SimplifiedOperatorBuilder; |
| 25 | 26 |
| 26 // Performs strength reduction on {JSConstruct} and {JSCall} nodes, | 27 // Performs strength reduction on {JSConstruct} and {JSCall} nodes, |
| 27 // which might allow inlining or other optimizations to be performed afterwards. | 28 // which might allow inlining or other optimizations to be performed afterwards. |
| 28 class JSCallReducer final : public AdvancedReducer { | 29 class JSCallReducer final : public AdvancedReducer { |
| 29 public: | 30 public: |
| 30 JSCallReducer(Editor* editor, JSGraph* jsgraph, | 31 JSCallReducer(Editor* editor, JSGraph* jsgraph, |
| 31 Handle<Context> native_context, | 32 Handle<Context> native_context, |
| 32 CompilationDependencies* dependencies) | 33 CompilationDependencies* dependencies) |
| 33 : AdvancedReducer(editor), | 34 : AdvancedReducer(editor), |
| 34 jsgraph_(jsgraph), | 35 jsgraph_(jsgraph), |
| 35 native_context_(native_context), | 36 native_context_(native_context), |
| 36 dependencies_(dependencies) {} | 37 dependencies_(dependencies) {} |
| 37 | 38 |
| 38 Reduction Reduce(Node* node) final; | 39 Reduction Reduce(Node* node) final; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 Reduction ReduceArrayConstructor(Node* node); | 42 Reduction ReduceArrayConstructor(Node* node); |
| 42 Reduction ReduceBooleanConstructor(Node* node); | 43 Reduction ReduceBooleanConstructor(Node* node); |
| 43 Reduction ReduceCallApiFunction( | 44 Reduction ReduceCallApiFunction( |
| 44 Node* node, Handle<FunctionTemplateInfo> function_template_info); | 45 Node* node, Handle<FunctionTemplateInfo> function_template_info); |
| 45 Reduction ReduceNumberConstructor(Node* node); | 46 Reduction ReduceNumberConstructor(Node* node); |
| 46 Reduction ReduceFunctionPrototypeApply(Node* node); | 47 Reduction ReduceFunctionPrototypeApply(Node* node); |
| 47 Reduction ReduceFunctionPrototypeCall(Node* node); | 48 Reduction ReduceFunctionPrototypeCall(Node* node); |
| 48 Reduction ReduceFunctionPrototypeHasInstance(Node* node); | 49 Reduction ReduceFunctionPrototypeHasInstance(Node* node); |
| 49 Reduction ReduceObjectGetPrototype(Node* node, Node* object); | 50 Reduction ReduceObjectGetPrototype(Node* node, Node* object); |
| 50 Reduction ReduceObjectGetPrototypeOf(Node* node); | 51 Reduction ReduceObjectGetPrototypeOf(Node* node); |
| 51 Reduction ReduceObjectPrototypeGetProto(Node* node); | 52 Reduction ReduceObjectPrototypeGetProto(Node* node); |
| 52 Reduction ReduceReflectGetPrototypeOf(Node* node); | 53 Reduction ReduceReflectGetPrototypeOf(Node* node); |
| 54 Reduction ReduceArrayForEach(Handle<JSFunction> function, Node* node); | |
| 53 Reduction ReduceSpreadCall(Node* node, int arity); | 55 Reduction ReduceSpreadCall(Node* node, int arity); |
| 54 Reduction ReduceJSConstruct(Node* node); | 56 Reduction ReduceJSConstruct(Node* node); |
| 55 Reduction ReduceJSConstructWithSpread(Node* node); | 57 Reduction ReduceJSConstructWithSpread(Node* node); |
| 56 Reduction ReduceJSCall(Node* node); | 58 Reduction ReduceJSCall(Node* node); |
| 57 Reduction ReduceJSCallWithSpread(Node* node); | 59 Reduction ReduceJSCallWithSpread(Node* node); |
| 58 | 60 |
| 59 Graph* graph() const; | 61 Graph* graph() const; |
| 60 JSGraph* jsgraph() const { return jsgraph_; } | 62 JSGraph* jsgraph() const { return jsgraph_; } |
| 61 Isolate* isolate() const; | 63 Isolate* isolate() const; |
| 62 Factory* factory() const; | 64 Factory* factory() const; |
| 63 Handle<Context> native_context() const { return native_context_; } | 65 Handle<Context> native_context() const { return native_context_; } |
| 64 Handle<JSGlobalProxy> global_proxy() const; | 66 Handle<JSGlobalProxy> global_proxy() const; |
| 65 CommonOperatorBuilder* common() const; | 67 CommonOperatorBuilder* common() const; |
| 66 JSOperatorBuilder* javascript() const; | 68 JSOperatorBuilder* javascript() const; |
| 67 SimplifiedOperatorBuilder* simplified() const; | 69 SimplifiedOperatorBuilder* simplified() const; |
| 68 CompilationDependencies* dependencies() const { return dependencies_; } | 70 CompilationDependencies* dependencies() const { return dependencies_; } |
| 69 | 71 |
| 70 JSGraph* const jsgraph_; | 72 JSGraph* const jsgraph_; |
| 71 Handle<Context> const native_context_; | 73 Handle<Context> const native_context_; |
| 72 CompilationDependencies* const dependencies_; | 74 CompilationDependencies* const dependencies_; |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 } // namespace compiler | 77 } // namespace compiler |
| 76 } // namespace internal | 78 } // namespace internal |
| 77 } // namespace v8 | 79 } // namespace v8 |
| 78 | 80 |
| 79 #endif // V8_COMPILER_JS_CALL_REDUCER_H_ | 81 #endif // V8_COMPILER_JS_CALL_REDUCER_H_ |
| OLD | NEW |