| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_TYPE_PROPAGATOR_H_ | 5 #ifndef VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_ |
| 6 #define VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_ | 6 #define VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_ |
| 7 | 7 |
| 8 #include "vm/flow_graph.h" | 8 #include "vm/flow_graph.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 | 10 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 class FlowGraphTypePropagator : public FlowGraphVisitor { | 13 class FlowGraphTypePropagator : public FlowGraphVisitor { |
| 14 public: | 14 public: |
| 15 static void Propagate(FlowGraph* flow_graph); | 15 static void Propagate(FlowGraph* flow_graph); |
| 16 | 16 |
| 17 private: | 17 private: |
| 18 explicit FlowGraphTypePropagator(FlowGraph* flow_graph); | 18 explicit FlowGraphTypePropagator(FlowGraph* flow_graph); |
| 19 | 19 |
| 20 void Propagate(); | 20 void Propagate(); |
| 21 | 21 |
| 22 void PropagateRecursive(BlockEntryInstr* block); | 22 void PropagateRecursive(BlockEntryInstr* block); |
| 23 | 23 |
| 24 void RollbackTo(intptr_t rollback_point); | 24 void RollbackTo(intptr_t rollback_point); |
| 25 | 25 |
| 26 void VisitValue(Value* value); | 26 void VisitValue(Value* value); |
| 27 | 27 |
| 28 virtual void VisitJoinEntry(JoinEntryInstr* instr); | 28 virtual void VisitJoinEntry(JoinEntryInstr* instr); |
| 29 virtual void VisitCheckSmi(CheckSmiInstr* instr); | 29 virtual void VisitCheckSmi(CheckSmiInstr* instr); |
| 30 virtual void VisitCheckArrayBound(CheckArrayBoundInstr* instr); | |
| 31 virtual void VisitCheckClass(CheckClassInstr* instr); | 30 virtual void VisitCheckClass(CheckClassInstr* instr); |
| 32 virtual void VisitCheckClassId(CheckClassIdInstr* instr); | 31 virtual void VisitCheckClassId(CheckClassIdInstr* instr); |
| 33 virtual void VisitGuardFieldClass(GuardFieldClassInstr* instr); | 32 virtual void VisitGuardFieldClass(GuardFieldClassInstr* instr); |
| 34 virtual void VisitAssertAssignable(AssertAssignableInstr* instr); | 33 virtual void VisitAssertAssignable(AssertAssignableInstr* instr); |
| 35 | 34 |
| 36 // Current reaching type of the definition. Valid only during dominator tree | 35 // Current reaching type of the definition. Valid only during dominator tree |
| 37 // traversal. | 36 // traversal. |
| 38 CompileType* TypeOf(Definition* def); | 37 CompileType* TypeOf(Definition* def); |
| 39 | 38 |
| 40 // Mark definition as having given compile type in all dominated instructions. | 39 // Mark definition as having given compile type in all dominated instructions. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 intptr_t index_; | 88 intptr_t index_; |
| 90 CompileType* type_; | 89 CompileType* type_; |
| 91 }; | 90 }; |
| 92 | 91 |
| 93 GrowableArray<RollbackEntry> rollback_; | 92 GrowableArray<RollbackEntry> rollback_; |
| 94 }; | 93 }; |
| 95 | 94 |
| 96 } // namespace dart | 95 } // namespace dart |
| 97 | 96 |
| 98 #endif // VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_ | 97 #endif // VM_FLOW_GRAPH_TYPE_PROPAGATOR_H_ |
| OLD | NEW |