| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_INLINING_H_ | 5 #ifndef V8_COMPILER_JS_INLINING_H_ |
| 6 #define V8_COMPILER_JS_INLINING_H_ | 6 #define V8_COMPILER_JS_INLINING_H_ |
| 7 | 7 |
| 8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.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 CompilationInfo; | 15 class CompilationInfo; |
| 16 | 16 |
| 17 namespace compiler { | 17 namespace compiler { |
| 18 | 18 |
| 19 // Forward declarations. | |
| 20 class JSCallFunctionAccessor; | |
| 21 | |
| 22 // The JSInliner provides the core graph inlining machinery. Note that this | 19 // The JSInliner provides the core graph inlining machinery. Note that this |
| 23 // class only deals with the mechanics of how to inline one graph into another, | 20 // class only deals with the mechanics of how to inline one graph into another, |
| 24 // heuristics that decide what and how much to inline are beyond its scope. | 21 // heuristics that decide what and how much to inline are beyond its scope. |
| 25 class JSInliner final : public AdvancedReducer { | 22 class JSInliner final : public AdvancedReducer { |
| 26 public: | 23 public: |
| 27 JSInliner(Editor* editor, Zone* local_zone, CompilationInfo* info, | 24 JSInliner(Editor* editor, Zone* local_zone, CompilationInfo* info, |
| 28 JSGraph* jsgraph) | 25 JSGraph* jsgraph) |
| 29 : AdvancedReducer(editor), | 26 : AdvancedReducer(editor), |
| 30 local_zone_(local_zone), | 27 local_zone_(local_zone), |
| 31 info_(info), | 28 info_(info), |
| 32 jsgraph_(jsgraph) {} | 29 jsgraph_(jsgraph) {} |
| 33 | 30 |
| 34 // Reducer interface, eagerly inlines everything. | 31 // Reducer interface, eagerly inlines everything. |
| 35 Reduction Reduce(Node* node) final; | 32 Reduction Reduce(Node* node) final; |
| 36 | 33 |
| 37 // Can be used by inlining heuristics or by testing code directly, without | 34 // Can be used by inlining heuristics or by testing code directly, without |
| 38 // using the above generic reducer interface of the inlining machinery. | 35 // using the above generic reducer interface of the inlining machinery. |
| 39 Reduction ReduceJSCallFunction(Node* node, Handle<JSFunction> function); | 36 Reduction ReduceJSCall(Node* node, Handle<JSFunction> function); |
| 40 | 37 |
| 41 private: | 38 private: |
| 42 Zone* local_zone_; | 39 Zone* local_zone_; |
| 43 CompilationInfo* info_; | 40 CompilationInfo* info_; |
| 44 JSGraph* jsgraph_; | 41 JSGraph* jsgraph_; |
| 45 | 42 |
| 46 Node* CreateArgumentsAdaptorFrameState( | 43 Node* CreateArtificialFrameState(Node* node, Node* outer_frame_state, |
| 47 JSCallFunctionAccessor* call, Handle<SharedFunctionInfo> shared_info); | 44 int parameter_count, |
| 45 FrameStateType frame_state_type, |
| 46 Handle<SharedFunctionInfo> shared); |
| 48 | 47 |
| 49 Reduction InlineCall(Node* call, Node* context, Node* frame_state, | 48 Reduction InlineCall(Node* call, Node* context, Node* frame_state, |
| 50 Node* start, Node* end); | 49 Node* start, Node* end); |
| 51 }; | 50 }; |
| 52 | 51 |
| 53 } // namespace compiler | 52 } // namespace compiler |
| 54 } // namespace internal | 53 } // namespace internal |
| 55 } // namespace v8 | 54 } // namespace v8 |
| 56 | 55 |
| 57 #endif // V8_COMPILER_JS_INLINING_H_ | 56 #endif // V8_COMPILER_JS_INLINING_H_ |
| OLD | NEW |