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

Side by Side Diff: src/compiler/js-inlining.h

Issue 1391903002: [turbofan] Separate JSInliningHeuristic into own class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | src/compiler/js-inlining.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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. 19 // Forward declarations.
20 class JSCallFunctionAccessor; 20 class JSCallFunctionAccessor;
21 21
22 // 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,
24 // heuristics that decide what and how much to inline are beyond its scope.
22 class JSInliner final : public AdvancedReducer { 25 class JSInliner final : public AdvancedReducer {
23 public: 26 public:
24 enum Mode { kRestrictedInlining, kGeneralInlining }; 27 JSInliner(Editor* editor, Zone* local_zone, CompilationInfo* info,
25
26 JSInliner(Editor* editor, Mode mode, Zone* local_zone, CompilationInfo* info,
27 JSGraph* jsgraph) 28 JSGraph* jsgraph)
28 : AdvancedReducer(editor), 29 : AdvancedReducer(editor),
29 mode_(mode),
30 local_zone_(local_zone), 30 local_zone_(local_zone),
31 info_(info), 31 info_(info),
32 jsgraph_(jsgraph) {} 32 jsgraph_(jsgraph) {}
33 33
34 // Reducer interface, eagerly inlines everything.
34 Reduction Reduce(Node* node) final; 35 Reduction Reduce(Node* node) final;
35 36
37 // Can be used by inlining heuristics or by testing code directly, without
38 // using the above generic reducer interface of the inlining machinery.
39 Reduction ReduceJSCallFunction(Node* node, Handle<JSFunction> function);
40
36 private: 41 private:
37 Mode const mode_;
38 Zone* local_zone_; 42 Zone* local_zone_;
39 CompilationInfo* info_; 43 CompilationInfo* info_;
40 JSGraph* jsgraph_; 44 JSGraph* jsgraph_;
41 45
42 Node* CreateArgumentsAdaptorFrameState(JSCallFunctionAccessor* call, 46 Node* CreateArgumentsAdaptorFrameState(JSCallFunctionAccessor* call,
43 Handle<SharedFunctionInfo> shared_info, 47 Handle<SharedFunctionInfo> shared_info,
44 Zone* temp_zone); 48 Zone* temp_zone);
45 49
46 Reduction InlineCall(Node* call, Node* context, Node* frame_state, 50 Reduction InlineCall(Node* call, Node* context, Node* frame_state,
47 Node* start, Node* end); 51 Node* start, Node* end);
48 }; 52 };
49 53
50 } // namespace compiler 54 } // namespace compiler
51 } // namespace internal 55 } // namespace internal
52 } // namespace v8 56 } // namespace v8
53 57
54 #endif // V8_COMPILER_JS_INLINING_H_ 58 #endif // V8_COMPILER_JS_INLINING_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/compiler/js-inlining.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698