| 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 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 | 70 |
| 71 class ParsedFunction; | 71 class ParsedFunction; |
| 72 | 72 |
| 73 | 73 |
| 74 class FlowGraphTypePropagator : public FlowGraphVisitor { | 74 class FlowGraphTypePropagator : public FlowGraphVisitor { |
| 75 public: | 75 public: |
| 76 FlowGraphTypePropagator(const ParsedFunction& parsed_function, | 76 FlowGraphTypePropagator(const ParsedFunction& parsed_function, |
| 77 const GrowableArray<BlockEntryInstr*>& blocks) | 77 const GrowableArray<BlockEntryInstr*>& blocks) |
| 78 : FlowGraphVisitor(blocks), | 78 : FlowGraphVisitor(blocks), |
| 79 parsed_function_(parsed_function), | 79 parsed_function_(parsed_function) { } |
| 80 still_changing_(false) { } | 80 virtual ~FlowGraphTypePropagator() {} |
| 81 virtual ~FlowGraphTypePropagator() { } | |
| 82 | 81 |
| 83 const ParsedFunction& parsed_function() const { return parsed_function_; } | 82 const ParsedFunction& parsed_function() const { return parsed_function_; } |
| 84 | 83 |
| 85 void PropagateTypes(); | 84 void PropagateTypes(); |
| 86 | 85 |
| 87 virtual void VisitAssertAssignable(AssertAssignableComp* comp, | 86 virtual void VisitAssertAssignable(AssertAssignableComp* comp, |
| 88 BindInstr* instr); | 87 BindInstr* instr); |
| 89 | 88 |
| 90 virtual void VisitGraphEntry(GraphEntryInstr* graph_entry); | 89 virtual void VisitBind(BindInstr* instr); |
| 91 virtual void VisitJoinEntry(JoinEntryInstr* join_entry); | |
| 92 virtual void VisitBind(BindInstr* bind); | |
| 93 virtual void VisitPhi(PhiInstr* phi); | |
| 94 virtual void VisitParameter(ParameterInstr* param); | |
| 95 | 90 |
| 96 private: | 91 private: |
| 97 const ParsedFunction& parsed_function_; | 92 const ParsedFunction& parsed_function_; |
| 98 bool still_changing_; | |
| 99 DISALLOW_COPY_AND_ASSIGN(FlowGraphTypePropagator); | 93 DISALLOW_COPY_AND_ASSIGN(FlowGraphTypePropagator); |
| 100 }; | 94 }; |
| 101 | 95 |
| 102 } // namespace dart | 96 } // namespace dart |
| 103 | 97 |
| 104 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 98 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |