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 namespace compiler { | 13 namespace compiler { |
14 | 14 |
15 class JSCallFunctionAccessor; | 15 class JSCallFunctionAccessor; |
16 struct Inlinee; | |
17 | 16 |
18 class JSInliner final : public AdvancedReducer { | 17 class JSInliner final : public AdvancedReducer { |
19 public: | 18 public: |
20 enum Mode { kRestrictedInlining, kGeneralInlining }; | 19 enum Mode { kRestrictedInlining, kGeneralInlining }; |
21 | 20 |
22 JSInliner(Editor* editor, Mode mode, Zone* local_zone, CompilationInfo* info, | 21 JSInliner(Editor* editor, Mode mode, Zone* local_zone, CompilationInfo* info, |
23 JSGraph* jsgraph) | 22 JSGraph* jsgraph) |
24 : AdvancedReducer(editor), | 23 : AdvancedReducer(editor), |
25 mode_(mode), | 24 mode_(mode), |
26 local_zone_(local_zone), | 25 local_zone_(local_zone), |
27 info_(info), | 26 info_(info), |
28 jsgraph_(jsgraph) {} | 27 jsgraph_(jsgraph) {} |
29 | 28 |
30 Reduction Reduce(Node* node) final; | 29 Reduction Reduce(Node* node) final; |
31 | 30 |
32 private: | 31 private: |
33 Mode const mode_; | 32 Mode const mode_; |
34 Zone* local_zone_; | 33 Zone* local_zone_; |
35 CompilationInfo* info_; | 34 CompilationInfo* info_; |
36 JSGraph* jsgraph_; | 35 JSGraph* jsgraph_; |
37 | 36 |
38 Node* CreateArgumentsAdaptorFrameState(JSCallFunctionAccessor* call, | 37 Node* CreateArgumentsAdaptorFrameState(JSCallFunctionAccessor* call, |
39 Zone* temp_zone); | 38 Zone* temp_zone); |
40 | 39 |
41 Reduction InlineCall(Node* call, Inlinee& inlinee); | 40 Reduction InlineCall(Node* call, Node* start, Node* end); |
42 }; | 41 }; |
43 | 42 |
44 } // namespace compiler | 43 } // namespace compiler |
45 } // namespace internal | 44 } // namespace internal |
46 } // namespace v8 | 45 } // namespace v8 |
47 | 46 |
48 #endif // V8_COMPILER_JS_INLINING_H_ | 47 #endif // V8_COMPILER_JS_INLINING_H_ |
OLD | NEW |