| 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 28 matching lines...) Expand all Loading... |
| 39 bool TryReplaceWithUnaryOp(InstanceCallComp* comp, Token::Kind op_kind); | 39 bool TryReplaceWithUnaryOp(InstanceCallComp* comp, Token::Kind op_kind); |
| 40 | 40 |
| 41 bool TryInlineInstanceGetter(InstanceCallComp* comp); | 41 bool TryInlineInstanceGetter(InstanceCallComp* comp); |
| 42 bool TryInlineInstanceSetter(InstanceSetterComp* comp); | 42 bool TryInlineInstanceSetter(InstanceSetterComp* comp); |
| 43 | 43 |
| 44 bool TryInlineInstanceMethod(InstanceCallComp* comp); | 44 bool TryInlineInstanceMethod(InstanceCallComp* comp); |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); | 46 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 |
| 50 // Analyze the generated flow graph. Currently only if it is a leaf |
| 51 // method, i.e., does not contain any calls to runtime or other Dart code. |
| 52 class FlowGraphAnalyzer : public ValueObject { |
| 53 public: |
| 54 explicit FlowGraphAnalyzer(const GrowableArray<BlockEntryInstr*>& blocks); |
| 55 virtual ~FlowGraphAnalyzer() {} |
| 56 |
| 57 void Analyze(); |
| 58 |
| 59 bool is_leaf() const { return is_leaf_; } |
| 60 |
| 61 private: |
| 62 const GrowableArray<BlockEntryInstr*>& blocks_; |
| 63 bool is_leaf_; |
| 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(FlowGraphAnalyzer); |
| 66 }; |
| 67 |
| 49 } // namespace dart | 68 } // namespace dart |
| 50 | 69 |
| 51 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 70 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |