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

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

Issue 2379733002: Recognize and optimize a.runtimeType == b.runtimeType pattern. (Closed)
Patch Set: fix lint Created 4 years, 1 month 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 | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_inliner.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 (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 Definition; 13 class Definition;
14 class Field; 14 class Field;
15 class FlowGraph; 15 class FlowGraph;
16 class ForwardInstructionIterator; 16 class ForwardInstructionIterator;
17 class Function; 17 class Function;
18 class InstanceCallInstr; 18 class InstanceCallInstr;
19 class Instruction; 19 class Instruction;
20 class StaticCallInstr; 20 class StaticCallInstr;
21 class TargetEntryInstr; 21 class TargetEntryInstr;
22 class Precompiler;
22 23
23 class FlowGraphInliner : ValueObject { 24 class FlowGraphInliner : ValueObject {
24 public: 25 public:
25 FlowGraphInliner(FlowGraph* flow_graph, 26 FlowGraphInliner(FlowGraph* flow_graph,
26 GrowableArray<const Function*>* inline_id_to_function, 27 GrowableArray<const Function*>* inline_id_to_function,
27 GrowableArray<TokenPosition>* inline_id_to_token_pos, 28 GrowableArray<TokenPosition>* inline_id_to_token_pos,
28 GrowableArray<intptr_t>* caller_inline_id, 29 GrowableArray<intptr_t>* caller_inline_id,
29 bool use_speculative_inlining, 30 bool use_speculative_inlining,
30 GrowableArray<intptr_t>* inlining_black_list); 31 GrowableArray<intptr_t>* inlining_black_list,
32 Precompiler* precompiler);
31 33
32 // The flow graph is destructively updated upon inlining. 34 // The flow graph is destructively updated upon inlining.
33 void Inline(); 35 void Inline();
34 36
35 // Compute graph info if it was not already computed or if 'force' is true. 37 // Compute graph info if it was not already computed or if 'force' is true.
36 static void CollectGraphInfo(FlowGraph* flow_graph, bool force = false); 38 static void CollectGraphInfo(FlowGraph* flow_graph, bool force = false);
37 static void SetInliningId(FlowGraph* flow_graph, intptr_t inlining_id); 39 static void SetInliningId(FlowGraph* flow_graph, intptr_t inlining_id);
38 40
39 bool AlwaysInline(const Function& function); 41 bool AlwaysInline(const Function& function);
40 42
(...skipping 29 matching lines...) Expand all
70 private: 72 private:
71 friend class CallSiteInliner; 73 friend class CallSiteInliner;
72 74
73 FlowGraph* flow_graph_; 75 FlowGraph* flow_graph_;
74 GrowableArray<const Function*>* inline_id_to_function_; 76 GrowableArray<const Function*>* inline_id_to_function_;
75 GrowableArray<TokenPosition>* inline_id_to_token_pos_; 77 GrowableArray<TokenPosition>* inline_id_to_token_pos_;
76 GrowableArray<intptr_t>* caller_inline_id_; 78 GrowableArray<intptr_t>* caller_inline_id_;
77 const bool trace_inlining_; 79 const bool trace_inlining_;
78 const bool use_speculative_inlining_; 80 const bool use_speculative_inlining_;
79 GrowableArray<intptr_t>* inlining_black_list_; 81 GrowableArray<intptr_t>* inlining_black_list_;
82 Precompiler* precompiler_;
80 83
81 DISALLOW_COPY_AND_ASSIGN(FlowGraphInliner); 84 DISALLOW_COPY_AND_ASSIGN(FlowGraphInliner);
82 }; 85 };
83 86
84 } // namespace dart 87 } // namespace dart
85 88
86 #endif // VM_FLOW_GRAPH_INLINER_H_ 89 #endif // VM_FLOW_GRAPH_INLINER_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698