| OLD | NEW |
| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 static JoinEntryInstr* ToJoinEntry(TargetEntryInstr* target); | 332 static JoinEntryInstr* ToJoinEntry(TargetEntryInstr* target); |
| 333 | 333 |
| 334 private: | 334 private: |
| 335 // Match an instance of the pattern to rewrite. See the implementation | 335 // Match an instance of the pattern to rewrite. See the implementation |
| 336 // for the patterns that are handled by this pass. | 336 // for the patterns that are handled by this pass. |
| 337 static bool Match(JoinEntryInstr* block); | 337 static bool Match(JoinEntryInstr* block); |
| 338 | 338 |
| 339 // Duplicate a branch while replacing its comparison's left and right | 339 // Duplicate a branch while replacing its comparison's left and right |
| 340 // inputs. | 340 // inputs. |
| 341 static BranchInstr* CloneBranch(BranchInstr* branch, | 341 static BranchInstr* CloneBranch(BranchInstr* branch, |
| 342 Value* left, | 342 Value* new_left, |
| 343 Value* right); | 343 Value* new_right); |
| 344 }; | 344 }; |
| 345 | 345 |
| 346 | 346 |
| 347 // Rewrite diamond control flow patterns that materialize values to use more | 347 // Rewrite diamond control flow patterns that materialize values to use more |
| 348 // efficient branchless code patterns if such are supported on the current | 348 // efficient branchless code patterns if such are supported on the current |
| 349 // platform. | 349 // platform. |
| 350 class IfConverter : public AllStatic { | 350 class IfConverter : public AllStatic { |
| 351 public: | 351 public: |
| 352 static void Simplify(FlowGraph* flow_graph); | 352 static void Simplify(FlowGraph* flow_graph); |
| 353 }; | 353 }; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 381 // Optimize spill stores inside try-blocks by identifying values that always | 381 // Optimize spill stores inside try-blocks by identifying values that always |
| 382 // contain a single known constant at catch block entry. | 382 // contain a single known constant at catch block entry. |
| 383 class TryCatchAnalyzer : public AllStatic { | 383 class TryCatchAnalyzer : public AllStatic { |
| 384 public: | 384 public: |
| 385 static void Optimize(FlowGraph* flow_graph); | 385 static void Optimize(FlowGraph* flow_graph); |
| 386 }; | 386 }; |
| 387 | 387 |
| 388 } // namespace dart | 388 } // namespace dart |
| 389 | 389 |
| 390 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 390 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |