| 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 bool IsUnknown(const Object& value) { | 354 bool IsUnknown(const Object& value) { |
| 355 return value.raw() == unknown_.raw(); | 355 return value.raw() == unknown_.raw(); |
| 356 } | 356 } |
| 357 bool IsNonConstant(const Object& value) { | 357 bool IsNonConstant(const Object& value) { |
| 358 return value.raw() == non_constant_.raw(); | 358 return value.raw() == non_constant_.raw(); |
| 359 } | 359 } |
| 360 bool IsConstant(const Object& value) { | 360 bool IsConstant(const Object& value) { |
| 361 return !IsNonConstant(value) && !IsUnknown(value); | 361 return !IsNonConstant(value) && !IsUnknown(value); |
| 362 } | 362 } |
| 363 | 363 |
| 364 void HandleBinaryOp(Definition* instr, | 364 void VisitBinaryIntegerOp(BinaryIntegerOpInstr* binary_op); |
| 365 Token::Kind op_kind, | |
| 366 const Value& left, | |
| 367 const Value& right); | |
| 368 | |
| 369 void TruncateInteger(Definition* instr, int64_t mask); | |
| 370 | 365 |
| 371 virtual void VisitBlocks() { UNREACHABLE(); } | 366 virtual void VisitBlocks() { UNREACHABLE(); } |
| 372 | 367 |
| 373 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); | 368 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); |
| 374 FOR_EACH_INSTRUCTION(DECLARE_VISIT) | 369 FOR_EACH_INSTRUCTION(DECLARE_VISIT) |
| 375 #undef DECLARE_VISIT | 370 #undef DECLARE_VISIT |
| 376 | 371 |
| 377 Isolate* isolate() const { return graph_->isolate(); } | 372 Isolate* isolate() const { return graph_->isolate(); } |
| 378 | 373 |
| 379 FlowGraph* graph_; | 374 FlowGraph* graph_; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 // Optimize spill stores inside try-blocks by identifying values that always | 504 // Optimize spill stores inside try-blocks by identifying values that always |
| 510 // contain a single known constant at catch block entry. | 505 // contain a single known constant at catch block entry. |
| 511 class TryCatchAnalyzer : public AllStatic { | 506 class TryCatchAnalyzer : public AllStatic { |
| 512 public: | 507 public: |
| 513 static void Optimize(FlowGraph* flow_graph); | 508 static void Optimize(FlowGraph* flow_graph); |
| 514 }; | 509 }; |
| 515 | 510 |
| 516 } // namespace dart | 511 } // namespace dart |
| 517 | 512 |
| 518 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 513 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |