Chromium Code Reviews| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 DISALLOW_COPY_AND_ASSIGN(FlowGraphAnalyzer); | 68 DISALLOW_COPY_AND_ASSIGN(FlowGraphAnalyzer); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 | 71 |
| 72 class ParsedFunction; | 72 class ParsedFunction; |
| 73 | 73 |
| 74 | 74 |
| 75 class FlowGraphTypePropagator : public FlowGraphVisitor { | 75 class FlowGraphTypePropagator : public FlowGraphVisitor { |
| 76 public: | 76 public: |
| 77 FlowGraphTypePropagator(const ParsedFunction& parsed_function, | 77 FlowGraphTypePropagator(const ParsedFunction& parsed_function, |
| 78 const GrowableArray<BlockEntryInstr*>& blocks) | 78 const GrowableArray<BlockEntryInstr*>& blocks, |
| 79 bool is_ssa) | |
| 79 : FlowGraphVisitor(blocks), | 80 : FlowGraphVisitor(blocks), |
| 80 parsed_function_(parsed_function), | 81 parsed_function_(parsed_function), |
| 82 is_ssa_(is_ssa), | |
| 81 still_changing_(false) { } | 83 still_changing_(false) { } |
| 82 virtual ~FlowGraphTypePropagator() { } | 84 virtual ~FlowGraphTypePropagator() { } |
| 83 | 85 |
| 84 const ParsedFunction& parsed_function() const { return parsed_function_; } | 86 const ParsedFunction& parsed_function() const { return parsed_function_; } |
| 85 | 87 |
| 86 void PropagateTypes(); | 88 void PropagateTypes(); |
| 87 | 89 |
| 88 virtual void VisitAssertAssignable(AssertAssignableComp* comp, | 90 virtual void VisitAssertAssignable(AssertAssignableComp* comp, |
| 89 BindInstr* instr); | 91 BindInstr* instr); |
| 90 virtual void VisitAssertBoolean(AssertBooleanComp* comp, | 92 virtual void VisitAssertBoolean(AssertBooleanComp* comp, BindInstr* instr); |
| 91 BindInstr* instr); | 93 virtual void VisitInstanceOf(InstanceOfComp* comp, BindInstr* instr); |
| 92 | 94 |
| 93 virtual void VisitGraphEntry(GraphEntryInstr* graph_entry); | 95 virtual void VisitGraphEntry(GraphEntryInstr* graph_entry); |
| 94 virtual void VisitJoinEntry(JoinEntryInstr* join_entry); | 96 virtual void VisitJoinEntry(JoinEntryInstr* join_entry); |
| 95 virtual void VisitBind(BindInstr* bind); | 97 virtual void VisitBind(BindInstr* bind); |
| 96 virtual void VisitPhi(PhiInstr* phi); | 98 virtual void VisitPhi(PhiInstr* phi); |
| 97 virtual void VisitParameter(ParameterInstr* param); | 99 virtual void VisitParameter(ParameterInstr* param); |
| 98 | 100 |
| 99 private: | 101 private: |
| 100 const ParsedFunction& parsed_function_; | 102 const ParsedFunction& parsed_function_; |
| 103 bool is_ssa_; // TODO(regis): Remove once virtual frame backend is removed. | |
|
srdjan
2012/08/15 17:49:56
const
regis
2012/08/15 22:49:18
Done.
| |
| 101 bool still_changing_; | 104 bool still_changing_; |
| 102 DISALLOW_COPY_AND_ASSIGN(FlowGraphTypePropagator); | 105 DISALLOW_COPY_AND_ASSIGN(FlowGraphTypePropagator); |
| 103 }; | 106 }; |
| 104 | 107 |
| 105 } // namespace dart | 108 } // namespace dart |
| 106 | 109 |
| 107 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 110 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |