| 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_BUILDER_H_ | 5 #ifndef VM_FLOW_GRAPH_BUILDER_H_ |
| 6 #define VM_FLOW_GRAPH_BUILDER_H_ | 6 #define VM_FLOW_GRAPH_BUILDER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // which parts are reachable. Afterward, the graph exit is the false | 140 // which parts are reachable. Afterward, the graph exit is the false |
| 141 // successor of the loop condition. | 141 // successor of the loop condition. |
| 142 void TieLoop(const TestGraphVisitor& test_fragment, | 142 void TieLoop(const TestGraphVisitor& test_fragment, |
| 143 const EffectGraphVisitor& body_fragment); | 143 const EffectGraphVisitor& body_fragment); |
| 144 | 144 |
| 145 // Wraps a value in a push-argument instruction and adds the result to the | 145 // Wraps a value in a push-argument instruction and adds the result to the |
| 146 // graph. | 146 // graph. |
| 147 PushArgumentInstr* PushArgument(Value* value); | 147 PushArgumentInstr* PushArgument(Value* value); |
| 148 | 148 |
| 149 protected: | 149 protected: |
| 150 Computation* BuildStoreLocal(const LocalVariable& local, Value* value); | 150 Computation* BuildStoreLocal(const LocalVariable* local, Value* value); |
| 151 Computation* BuildLoadLocal(const LocalVariable& local); | 151 Computation* BuildLoadLocal(const LocalVariable* local); |
| 152 | 152 |
| 153 // Helpers for translating parts of the AST. | 153 // Helpers for translating parts of the AST. |
| 154 void TranslateArgumentList(const ArgumentListNode& node, | 154 void TranslateArgumentList(const ArgumentListNode& node, |
| 155 ZoneGrowableArray<Value*>* values); | 155 ZoneGrowableArray<Value*>* values); |
| 156 void BuildPushArguments(const ArgumentListNode& node, | 156 void BuildPushArguments(const ArgumentListNode& node, |
| 157 ZoneGrowableArray<PushArgumentInstr*>* values); | 157 ZoneGrowableArray<PushArgumentInstr*>* values); |
| 158 | 158 |
| 159 // Creates an instantiated type argument vector used in preparation of an | 159 // Creates an instantiated type argument vector used in preparation of an |
| 160 // allocation call. | 160 // allocation call. |
| 161 // May be called only if allocating an object of a parameterized class. | 161 // May be called only if allocating an object of a parameterized class. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 intptr_t AllocateTempIndex() { return temp_index_++; } | 210 intptr_t AllocateTempIndex() { return temp_index_++; } |
| 211 void DeallocateTempIndex(intptr_t n) { | 211 void DeallocateTempIndex(intptr_t n) { |
| 212 ASSERT(temp_index_ >= n); | 212 ASSERT(temp_index_ >= n); |
| 213 temp_index_ -= n; | 213 temp_index_ -= n; |
| 214 } | 214 } |
| 215 | 215 |
| 216 Value* BuildObjectAllocation(ConstructorCallNode* node); | 216 Value* BuildObjectAllocation(ConstructorCallNode* node); |
| 217 void BuildConstructorCall(ConstructorCallNode* node, | 217 void BuildConstructorCall(ConstructorCallNode* node, |
| 218 PushArgumentInstr* alloc_value); | 218 PushArgumentInstr* alloc_value); |
| 219 | 219 |
| 220 void BuildStoreContext(const LocalVariable& variable); | 220 void BuildStoreContext(const LocalVariable* variable); |
| 221 void BuildLoadContext(const LocalVariable& variable); | 221 void BuildLoadContext(const LocalVariable* variable); |
| 222 | 222 |
| 223 void BuildThrowNode(ThrowNode* node); | 223 void BuildThrowNode(ThrowNode* node); |
| 224 | 224 |
| 225 ClosureCallComp* BuildClosureCall(ClosureCallNode* node); | 225 ClosureCallComp* BuildClosureCall(ClosureCallNode* node); |
| 226 | 226 |
| 227 Value* BuildNullValue(); | 227 Value* BuildNullValue(); |
| 228 | 228 |
| 229 private: | 229 private: |
| 230 // Specify a computation as the final result. Adds a Do instruction to | 230 // Specify a computation as the final result. Adds a Do instruction to |
| 231 // the graph, but normally overridden in subclasses. | 231 // the graph, but normally overridden in subclasses. |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // Output parameters. | 352 // Output parameters. |
| 353 TargetEntryInstr** true_successor_address_; | 353 TargetEntryInstr** true_successor_address_; |
| 354 TargetEntryInstr** false_successor_address_; | 354 TargetEntryInstr** false_successor_address_; |
| 355 | 355 |
| 356 intptr_t condition_token_pos_; | 356 intptr_t condition_token_pos_; |
| 357 }; | 357 }; |
| 358 | 358 |
| 359 } // namespace dart | 359 } // namespace dart |
| 360 | 360 |
| 361 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 361 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |