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

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

Issue 374093003: Fix branch optimizations based on range analysis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 // } 324 // }
325 // 325 //
326 // where b is known to be null. 326 // where b is known to be null.
327 static void OptimizeBranches(FlowGraph* graph); 327 static void OptimizeBranches(FlowGraph* graph);
328 328
329 // Used to initialize the abstract value of definitions. 329 // Used to initialize the abstract value of definitions.
330 static RawObject* Unknown() { return Object::unknown_constant().raw(); } 330 static RawObject* Unknown() { return Object::unknown_constant().raw(); }
331 331
332 private: 332 private:
333 void Analyze(); 333 void Analyze();
334 void VisitBranches();
335 void Transform(); 334 void Transform();
336 void EliminateRedundantBranches(); 335 void EliminateRedundantBranches();
337 336
338 void SetReachable(BlockEntryInstr* block); 337 void SetReachable(BlockEntryInstr* block);
339 void SetValue(Definition* definition, const Object& value); 338 void SetValue(Definition* definition, const Object& value);
340 339
341 // Assign the join (least upper bound) of a pair of abstract values to the 340 // Assign the join (least upper bound) of a pair of abstract values to the
342 // first one. 341 // first one.
343 void Join(Object* left, const Object& right); 342 void Join(Object* left, const Object& right);
344 343
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 // Optimize spill stores inside try-blocks by identifying values that always 451 // Optimize spill stores inside try-blocks by identifying values that always
453 // contain a single known constant at catch block entry. 452 // contain a single known constant at catch block entry.
454 class TryCatchAnalyzer : public AllStatic { 453 class TryCatchAnalyzer : public AllStatic {
455 public: 454 public:
456 static void Optimize(FlowGraph* flow_graph); 455 static void Optimize(FlowGraph* flow_graph);
457 }; 456 };
458 457
459 } // namespace dart 458 } // namespace dart
460 459
461 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 460 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698