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

Side by Side Diff: runtime/vm/flow_graph_inliner.h

Issue 1472363002: VM: Inlining of small constructors/factories, optimizations on inlined function bodies (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_FLOW_GRAPH_INLINER_H_ 5 #ifndef VM_FLOW_GRAPH_INLINER_H_
6 #define VM_FLOW_GRAPH_INLINER_H_ 6 #define VM_FLOW_GRAPH_INLINER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 class Field; 13 class Field;
14 class FlowGraph; 14 class FlowGraph;
15 class Function; 15 class Function;
16 16
17 class FlowGraphInliner : ValueObject { 17 class FlowGraphInliner : ValueObject {
18 public: 18 public:
19 FlowGraphInliner(FlowGraph* flow_graph, 19 FlowGraphInliner(FlowGraph* flow_graph,
20 GrowableArray<const Function*>* inline_id_to_function, 20 GrowableArray<const Function*>* inline_id_to_function,
21 GrowableArray<intptr_t>* caller_inline_id); 21 GrowableArray<intptr_t>* caller_inline_id,
22 bool use_speculative_inlining,
23 GrowableArray<intptr_t>* inlining_black_list);
22 24
23 // The flow graph is destructively updated upon inlining. 25 // The flow graph is destructively updated upon inlining.
24 void Inline(); 26 void Inline();
25 27
26 // Compute graph info if it was not already computed or if 'force' is true. 28 // Compute graph info if it was not already computed or if 'force' is true.
27 static void CollectGraphInfo(FlowGraph* flow_graph, bool force = false); 29 static void CollectGraphInfo(FlowGraph* flow_graph, bool force = false);
28 static void SetInliningId(FlowGraph* flow_graph, intptr_t inlining_id); 30 static void SetInliningId(FlowGraph* flow_graph, intptr_t inlining_id);
29 31
30 bool AlwaysInline(const Function& function); 32 bool AlwaysInline(const Function& function);
31 33
32 FlowGraph* flow_graph() const { return flow_graph_; } 34 FlowGraph* flow_graph() const { return flow_graph_; }
33 intptr_t NextInlineId(const Function& function, intptr_t caller_id); 35 intptr_t NextInlineId(const Function& function, intptr_t caller_id);
34 36
35 bool trace_inlining() const { return trace_inlining_; } 37 bool trace_inlining() const { return trace_inlining_; }
36 38
37 private: 39 private:
38 friend class CallSiteInliner; 40 friend class CallSiteInliner;
39 41
40 FlowGraph* flow_graph_; 42 FlowGraph* flow_graph_;
41 GrowableArray<const Function*>* inline_id_to_function_; 43 GrowableArray<const Function*>* inline_id_to_function_;
42 GrowableArray<intptr_t>* caller_inline_id_; 44 GrowableArray<intptr_t>* caller_inline_id_;
43 const bool trace_inlining_; 45 const bool trace_inlining_;
46 const bool use_speculative_inlining_;
47 GrowableArray<intptr_t>* inlining_black_list_;
44 48
45 DISALLOW_COPY_AND_ASSIGN(FlowGraphInliner); 49 DISALLOW_COPY_AND_ASSIGN(FlowGraphInliner);
46 }; 50 };
47 51
48 } // namespace dart 52 } // namespace dart
49 53
50 #endif // VM_FLOW_GRAPH_INLINER_H_ 54 #endif // VM_FLOW_GRAPH_INLINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698