| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 } | 286 } |
| 287 bool IsConstant(const Object& value) { | 287 bool IsConstant(const Object& value) { |
| 288 return !IsNonConstant(value) && !IsUnknown(value); | 288 return !IsNonConstant(value) && !IsUnknown(value); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void HandleBinaryOp(Definition* instr, | 291 void HandleBinaryOp(Definition* instr, |
| 292 Token::Kind op_kind, | 292 Token::Kind op_kind, |
| 293 const Value& left, | 293 const Value& left, |
| 294 const Value& right); | 294 const Value& right); |
| 295 | 295 |
| 296 void RemoveInterpolationInputs(const StaticCallInstr& call); | |
| 297 | |
| 298 virtual void VisitBlocks() { UNREACHABLE(); } | 296 virtual void VisitBlocks() { UNREACHABLE(); } |
| 299 | 297 |
| 300 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); | 298 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); |
| 301 FOR_EACH_INSTRUCTION(DECLARE_VISIT) | 299 FOR_EACH_INSTRUCTION(DECLARE_VISIT) |
| 302 #undef DECLARE_VISIT | 300 #undef DECLARE_VISIT |
| 303 | 301 |
| 304 FlowGraph* graph_; | 302 FlowGraph* graph_; |
| 305 | 303 |
| 306 // Sentinels for unknown constant and non-constant values. | 304 // Sentinels for unknown constant and non-constant values. |
| 307 const Object& unknown_; | 305 const Object& unknown_; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 // Optimize spill stores inside try-blocks by identifying values that always | 382 // Optimize spill stores inside try-blocks by identifying values that always |
| 385 // contain a single known constant at catch block entry. | 383 // contain a single known constant at catch block entry. |
| 386 class TryCatchAnalyzer : public AllStatic { | 384 class TryCatchAnalyzer : public AllStatic { |
| 387 public: | 385 public: |
| 388 static void Optimize(FlowGraph* flow_graph); | 386 static void Optimize(FlowGraph* flow_graph); |
| 389 }; | 387 }; |
| 390 | 388 |
| 391 } // namespace dart | 389 } // namespace dart |
| 392 | 390 |
| 393 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 391 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |