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_CONSTANT_PROPAGATOR_H_ | 5 #ifndef VM_CONSTANT_PROPAGATOR_H_ |
6 #define VM_CONSTANT_PROPAGATOR_H_ | 6 #define VM_CONSTANT_PROPAGATOR_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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return value.raw() == unknown_.raw(); | 53 return value.raw() == unknown_.raw(); |
54 } | 54 } |
55 bool IsNonConstant(const Object& value) { | 55 bool IsNonConstant(const Object& value) { |
56 return value.raw() == non_constant_.raw(); | 56 return value.raw() == non_constant_.raw(); |
57 } | 57 } |
58 bool IsConstant(const Object& value) { | 58 bool IsConstant(const Object& value) { |
59 return !IsNonConstant(value) && !IsUnknown(value); | 59 return !IsNonConstant(value) && !IsUnknown(value); |
60 } | 60 } |
61 | 61 |
62 void VisitBinaryIntegerOp(BinaryIntegerOpInstr* binary_op); | 62 void VisitBinaryIntegerOp(BinaryIntegerOpInstr* binary_op); |
| 63 void VisitUnaryIntegerOp(UnaryIntegerOpInstr* unary_op); |
63 | 64 |
64 virtual void VisitBlocks() { UNREACHABLE(); } | 65 virtual void VisitBlocks() { UNREACHABLE(); } |
65 | 66 |
66 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); | 67 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); |
67 FOR_EACH_INSTRUCTION(DECLARE_VISIT) | 68 FOR_EACH_INSTRUCTION(DECLARE_VISIT) |
68 #undef DECLARE_VISIT | 69 #undef DECLARE_VISIT |
69 | 70 |
70 Isolate* isolate() const { return graph_->isolate(); } | 71 Isolate* isolate() const { return graph_->isolate(); } |
71 | 72 |
72 FlowGraph* graph_; | 73 FlowGraph* graph_; |
(...skipping 10 matching lines...) Expand all Loading... |
83 | 84 |
84 // Worklists of blocks and definitions. | 85 // Worklists of blocks and definitions. |
85 GrowableArray<BlockEntryInstr*> block_worklist_; | 86 GrowableArray<BlockEntryInstr*> block_worklist_; |
86 DefinitionWorklist definition_worklist_; | 87 DefinitionWorklist definition_worklist_; |
87 }; | 88 }; |
88 | 89 |
89 | 90 |
90 } // namespace dart | 91 } // namespace dart |
91 | 92 |
92 #endif // VM_CONSTANT_PROPAGATOR_H_ | 93 #endif // VM_CONSTANT_PROPAGATOR_H_ |
OLD | NEW |