| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // Returns true if any instructions were canonicalized away. | 37 // Returns true if any instructions were canonicalized away. |
| 38 bool Canonicalize(); | 38 bool Canonicalize(); |
| 39 | 39 |
| 40 void EliminateDeadPhis(); | 40 void EliminateDeadPhis(); |
| 41 | 41 |
| 42 void SelectRepresentations(); | 42 void SelectRepresentations(); |
| 43 | 43 |
| 44 void InferIntRanges(); | 44 void InferIntRanges(); |
| 45 | 45 |
| 46 void SelectIntegerInstructions(); |
| 47 |
| 46 void AnalyzeTryCatch(); | 48 void AnalyzeTryCatch(); |
| 47 | 49 |
| 48 bool TryInlineRecognizedMethod(intptr_t receiver_cid, | 50 bool TryInlineRecognizedMethod(intptr_t receiver_cid, |
| 49 const Function& target, | 51 const Function& target, |
| 50 Instruction* call, | 52 Instruction* call, |
| 51 Definition* receiver, | 53 Definition* receiver, |
| 52 intptr_t token_pos, | 54 intptr_t token_pos, |
| 53 const ICData& ic_data, | 55 const ICData& ic_data, |
| 54 TargetEntryInstr** entry, | 56 TargetEntryInstr** entry, |
| 55 Definition** last); | 57 Definition** last); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 } | 351 } |
| 350 bool IsConstant(const Object& value) { | 352 bool IsConstant(const Object& value) { |
| 351 return !IsNonConstant(value) && !IsUnknown(value); | 353 return !IsNonConstant(value) && !IsUnknown(value); |
| 352 } | 354 } |
| 353 | 355 |
| 354 void HandleBinaryOp(Definition* instr, | 356 void HandleBinaryOp(Definition* instr, |
| 355 Token::Kind op_kind, | 357 Token::Kind op_kind, |
| 356 const Value& left, | 358 const Value& left, |
| 357 const Value& right); | 359 const Value& right); |
| 358 | 360 |
| 361 void TruncateInteger(Definition* instr, int64_t mask); |
| 362 |
| 359 virtual void VisitBlocks() { UNREACHABLE(); } | 363 virtual void VisitBlocks() { UNREACHABLE(); } |
| 360 | 364 |
| 361 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); | 365 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); |
| 362 FOR_EACH_INSTRUCTION(DECLARE_VISIT) | 366 FOR_EACH_INSTRUCTION(DECLARE_VISIT) |
| 363 #undef DECLARE_VISIT | 367 #undef DECLARE_VISIT |
| 364 | 368 |
| 365 Isolate* isolate() const { return graph_->isolate(); } | 369 Isolate* isolate() const { return graph_->isolate(); } |
| 366 | 370 |
| 367 FlowGraph* graph_; | 371 FlowGraph* graph_; |
| 368 | 372 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 // Optimize spill stores inside try-blocks by identifying values that always | 455 // Optimize spill stores inside try-blocks by identifying values that always |
| 452 // contain a single known constant at catch block entry. | 456 // contain a single known constant at catch block entry. |
| 453 class TryCatchAnalyzer : public AllStatic { | 457 class TryCatchAnalyzer : public AllStatic { |
| 454 public: | 458 public: |
| 455 static void Optimize(FlowGraph* flow_graph); | 459 static void Optimize(FlowGraph* flow_graph); |
| 456 }; | 460 }; |
| 457 | 461 |
| 458 } // namespace dart | 462 } // namespace dart |
| 459 | 463 |
| 460 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 464 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |