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 #include "vm/flow_graph.h" | 9 #include "vm/flow_graph.h" |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 void OptimizeComputations(); | 25 void OptimizeComputations(); |
| 26 | 26 |
| 27 virtual void VisitStaticCall(StaticCallComp* comp, BindInstr* instr); | 27 virtual void VisitStaticCall(StaticCallComp* comp, BindInstr* instr); |
| 28 virtual void VisitInstanceCall(InstanceCallComp* comp, BindInstr* instr); | 28 virtual void VisitInstanceCall(InstanceCallComp* comp, BindInstr* instr); |
| 29 virtual void VisitRelationalOp(RelationalOpComp* comp, BindInstr* instr); | 29 virtual void VisitRelationalOp(RelationalOpComp* comp, BindInstr* instr); |
| 30 virtual void VisitEqualityCompare(EqualityCompareComp* comp, | 30 virtual void VisitEqualityCompare(EqualityCompareComp* comp, |
| 31 BindInstr* instr); | 31 BindInstr* instr); |
| 32 virtual void VisitBind(BindInstr* instr); | 32 virtual void VisitBind(BindInstr* instr); |
| 33 virtual void VisitBranch(BranchInstr* instr); | 33 virtual void VisitBranch(BranchInstr* instr); |
| 34 | 34 |
| 35 // TODO(fschneider): Once we get rid of the distinction between Instruction | |
| 36 // and computation, this can be made private again. | |
|
srdjan
2012/08/30 18:36:12
Fix comment indent.
Florian Schneider
2012/09/03 09:25:09
Done.
| |
| 37 BindInstr* InsertBefore(Instruction* instr, | |
| 38 Computation* comp, | |
| 39 Environment* env, | |
| 40 BindInstr::UseKind use_kind); | |
| 41 | |
| 35 private: | 42 private: |
| 36 bool TryReplaceWithArrayOp(BindInstr* instr, | 43 bool TryReplaceWithArrayOp(BindInstr* instr, |
| 37 InstanceCallComp* comp, | 44 InstanceCallComp* comp, |
| 38 Token::Kind op_kind); | 45 Token::Kind op_kind); |
| 39 bool TryReplaceWithBinaryOp(BindInstr* instr, | 46 bool TryReplaceWithBinaryOp(BindInstr* instr, |
| 40 InstanceCallComp* comp, | 47 InstanceCallComp* comp, |
| 41 Token::Kind op_kind); | 48 Token::Kind op_kind); |
| 42 bool TryReplaceWithUnaryOp(BindInstr* instr, | 49 bool TryReplaceWithUnaryOp(BindInstr* instr, |
| 43 InstanceCallComp* comp, | 50 InstanceCallComp* comp, |
| 44 Token::Kind op_kind); | 51 Token::Kind op_kind); |
| 45 | 52 |
| 46 bool TryInlineInstanceGetter(BindInstr* instr, | 53 bool TryInlineInstanceGetter(BindInstr* instr, |
| 47 InstanceCallComp* comp); | 54 InstanceCallComp* comp); |
| 48 bool TryInlineInstanceSetter(BindInstr* instr, InstanceCallComp* comp); | 55 bool TryInlineInstanceSetter(BindInstr* instr, InstanceCallComp* comp); |
| 49 | 56 |
| 50 bool TryInlineInstanceMethod(BindInstr* instr, InstanceCallComp* comp); | 57 bool TryInlineInstanceMethod(BindInstr* instr, InstanceCallComp* comp); |
| 51 | 58 |
| 52 void AddCheckClass(BindInstr* instr, InstanceCallComp* comp, Value* value); | 59 void AddCheckClass(BindInstr* instr, InstanceCallComp* comp, Value* value); |
| 53 | 60 |
| 54 BindInstr* InsertBefore(Instruction* instr, | |
| 55 Computation* comp, | |
| 56 Environment* env, | |
| 57 BindInstr::UseKind use_kind); | |
| 58 | |
| 59 BindInstr* InsertAfter(Instruction* instr, | 61 BindInstr* InsertAfter(Instruction* instr, |
| 60 Computation* comp, | 62 Computation* comp, |
| 61 Environment* env, | 63 Environment* env, |
| 62 BindInstr::UseKind use_kind); | 64 BindInstr::UseKind use_kind); |
| 63 | 65 |
| 64 FlowGraph* flow_graph_; | 66 FlowGraph* flow_graph_; |
| 65 | 67 |
| 66 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); | 68 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); |
| 67 }; | 69 }; |
| 68 | 70 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 private: | 132 private: |
| 131 static void OptimizeRecursive( | 133 static void OptimizeRecursive( |
| 132 BlockEntryInstr* entry, | 134 BlockEntryInstr* entry, |
| 133 DirectChainedHashMap<BindInstr*>* map); | 135 DirectChainedHashMap<BindInstr*>* map); |
| 134 }; | 136 }; |
| 135 | 137 |
| 136 | 138 |
| 137 } // namespace dart | 139 } // namespace dart |
| 138 | 140 |
| 139 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 141 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |