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

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

Issue 1423063005: VM: Speculative inlining in precompiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 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_compiler.cc ('k') | runtime/vm/flow_graph_optimizer.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_OPTIMIZER_H_ 5 #ifndef VM_FLOW_GRAPH_OPTIMIZER_H_
6 #define VM_FLOW_GRAPH_OPTIMIZER_H_ 6 #define VM_FLOW_GRAPH_OPTIMIZER_H_
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/flow_graph.h" 9 #include "vm/flow_graph.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 class CSEInstructionMap; 13 class CSEInstructionMap;
14 template <typename T> class GrowableArray; 14 template <typename T> class GrowableArray;
15 class ParsedFunction; 15 class ParsedFunction;
16 16
17 class FlowGraphOptimizer : public FlowGraphVisitor { 17 class FlowGraphOptimizer : public FlowGraphVisitor {
18 public: 18 public:
19 explicit FlowGraphOptimizer(FlowGraph* flow_graph) 19 explicit FlowGraphOptimizer(
20 FlowGraph* flow_graph,
21 bool use_speculative_inlining = false,
22 GrowableArray<intptr_t>* inlining_black_list = NULL)
20 : FlowGraphVisitor(flow_graph->reverse_postorder()), 23 : FlowGraphVisitor(flow_graph->reverse_postorder()),
21 flow_graph_(flow_graph) { } 24 flow_graph_(flow_graph),
25 use_speculative_inlining_(use_speculative_inlining),
26 inlining_black_list_(inlining_black_list) {
27 ASSERT(!use_speculative_inlining || (inlining_black_list != NULL));
28 }
22 virtual ~FlowGraphOptimizer() {} 29 virtual ~FlowGraphOptimizer() {}
23 30
24 FlowGraph* flow_graph() const { return flow_graph_; } 31 FlowGraph* flow_graph() const { return flow_graph_; }
25 32
26 // Add ICData to InstanceCalls, so that optimizations can be run on them. 33 // Add ICData to InstanceCalls, so that optimizations can be run on them.
27 // TODO(srdjan): StaticCals as well? 34 // TODO(srdjan): StaticCals as well?
28 void PopulateWithICData(); 35 void PopulateWithICData();
29 36
30 // Use ICData to optimize, replace or eliminate instructions. 37 // Use ICData to optimize, replace or eliminate instructions.
31 void ApplyICData(); 38 void ApplyICData();
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 void InstanceCallNoopt(InstanceCallInstr* instr); 264 void InstanceCallNoopt(InstanceCallInstr* instr);
258 265
259 RawField* GetField(intptr_t class_id, const String& field_name); 266 RawField* GetField(intptr_t class_id, const String& field_name);
260 267
261 Thread* thread() const { return flow_graph_->thread(); } 268 Thread* thread() const { return flow_graph_->thread(); }
262 Isolate* isolate() const { return flow_graph_->isolate(); } 269 Isolate* isolate() const { return flow_graph_->isolate(); }
263 Zone* zone() const { return flow_graph_->zone(); } 270 Zone* zone() const { return flow_graph_->zone(); }
264 271
265 const Function& function() const { return flow_graph_->function(); } 272 const Function& function() const { return flow_graph_->function(); }
266 273
274 bool IsBlackListedForInlining(intptr_t deopt_id);
275
267 FlowGraph* flow_graph_; 276 FlowGraph* flow_graph_;
268 277
278 const bool use_speculative_inlining_;
279
280 GrowableArray<intptr_t>* inlining_black_list_;
281
269 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); 282 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer);
270 }; 283 };
271 284
272 285
273 // Loop invariant code motion. 286 // Loop invariant code motion.
274 class LICM : public ValueObject { 287 class LICM : public ValueObject {
275 public: 288 public:
276 explicit LICM(FlowGraph* flow_graph); 289 explicit LICM(FlowGraph* flow_graph);
277 290
278 void Optimize(); 291 void Optimize();
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 // Optimize spill stores inside try-blocks by identifying values that always 447 // Optimize spill stores inside try-blocks by identifying values that always
435 // contain a single known constant at catch block entry. 448 // contain a single known constant at catch block entry.
436 class TryCatchAnalyzer : public AllStatic { 449 class TryCatchAnalyzer : public AllStatic {
437 public: 450 public:
438 static void Optimize(FlowGraph* flow_graph); 451 static void Optimize(FlowGraph* flow_graph);
439 }; 452 };
440 453
441 } // namespace dart 454 } // namespace dart
442 455
443 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 456 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698