| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 bool is_leaf() const { return is_leaf_; } | 62 bool is_leaf() const { return is_leaf_; } |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 const GrowableArray<BlockEntryInstr*>& blocks_; | 65 const GrowableArray<BlockEntryInstr*>& blocks_; |
| 66 bool is_leaf_; | 66 bool is_leaf_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(FlowGraphAnalyzer); | 68 DISALLOW_COPY_AND_ASSIGN(FlowGraphAnalyzer); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 |
| 72 class ParsedFunction; |
| 73 |
| 74 |
| 75 class FlowGraphTypePropagator : public FlowGraphVisitor { |
| 76 public: |
| 77 FlowGraphTypePropagator(const ParsedFunction& parsed_function, |
| 78 const GrowableArray<BlockEntryInstr*>& blocks) |
| 79 : FlowGraphVisitor(blocks), |
| 80 parsed_function_(parsed_function) { } |
| 81 virtual ~FlowGraphTypePropagator() {} |
| 82 |
| 83 const ParsedFunction& parsed_function() const { return parsed_function_; } |
| 84 |
| 85 void PropagateTypes(); |
| 86 |
| 87 virtual void VisitAssertAssignable(AssertAssignableComp* comp, |
| 88 BindInstr* instr); |
| 89 |
| 90 virtual void VisitBind(BindInstr* instr); |
| 91 |
| 92 private: |
| 93 const ParsedFunction& parsed_function_; |
| 94 DISALLOW_COPY_AND_ASSIGN(FlowGraphTypePropagator); |
| 95 }; |
| 96 |
| 71 } // namespace dart | 97 } // namespace dart |
| 72 | 98 |
| 73 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 99 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |