| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void TieLoop(const TestGraphVisitor& test_fragment, | 112 void TieLoop(const TestGraphVisitor& test_fragment, |
| 113 const EffectGraphVisitor& body_fragment); | 113 const EffectGraphVisitor& body_fragment); |
| 114 | 114 |
| 115 protected: | 115 protected: |
| 116 // Helpers for translating parts of the AST. | 116 // Helpers for translating parts of the AST. |
| 117 void TranslateArgumentList(const ArgumentListNode& node, | 117 void TranslateArgumentList(const ArgumentListNode& node, |
| 118 intptr_t next_temp_index, | 118 intptr_t next_temp_index, |
| 119 ZoneGrowableArray<Value*>* values); | 119 ZoneGrowableArray<Value*>* values); |
| 120 | 120 |
| 121 // Build the load part of a instance field increment. Translates the | 121 // Build the load part of a instance field increment. Translates the |
| 122 // receiver and loads the value. The receiver will be named with | 122 // receiver and loads the value. The receiver will be returned in the |
| 123 // start_index, the temporary index of the value is returned (always | 123 // output parameter 'receiver'. |
| 124 // start_index+1). | 124 Definition* BuildIncrOpFieldLoad(IncrOpInstanceFieldNode* node, |
| 125 int BuildIncrOpFieldLoad(IncrOpInstanceFieldNode* node, intptr_t start_index); | 125 Value** receiver); |
| 126 | 126 |
| 127 // Build the load part of an indexed increment. Translates the receiver | 127 // Build the load part of an indexed increment. Translates the receiver |
| 128 // and index and loads the value. The receiver will be named with | 128 // and index and loads the value. The receiver will be returned in the |
| 129 // start_index, the index with start_index+1, and the temporary index of | 129 // output parameter 'receiver' and the index will be returned in the |
| 130 // the value is returned (always start_index+2). | 130 // output parameter 'index'.. |
| 131 int BuildIncrOpIndexedLoad(IncrOpIndexedNode* node, intptr_t start_index); | 131 Definition* BuildIncrOpIndexedLoad(IncrOpIndexedNode* node, |
| 132 Value** receiver, |
| 133 Value** index); |
| 132 | 134 |
| 133 // Build the increment part of an increment operation (add or subtract 1). | 135 // Build the increment part of an increment operation (add or subtract 1). |
| 134 // The original value is expected to be named with start_index-1, and the | 136 // Consumes the original value and produces the value +/- 1. |
| 135 // result will be named with start_index. | 137 Definition* BuildIncrOpIncrement(Token::Kind kind, |
| 136 void BuildIncrOpIncrement(Token::Kind kind, | 138 intptr_t node_id, |
| 137 intptr_t node_id, | 139 intptr_t token_index, |
| 138 intptr_t token_index, | 140 Value* original); |
| 139 intptr_t start_index); | |
| 140 | 141 |
| 141 // Creates an instantiated type argument vector used in preparation of a | 142 // Creates an instantiated type argument vector used in preparation of a |
| 142 // factory call. | 143 // factory call. |
| 143 // May be called only if allocating an object of a parameterized class. | 144 // May be called only if allocating an object of a parameterized class. |
| 144 Value* BuildFactoryTypeArguments(ConstructorCallNode* node, | 145 Value* BuildFactoryTypeArguments(ConstructorCallNode* node, |
| 145 intptr_t start_index); | 146 intptr_t start_index); |
| 146 | 147 |
| 147 // Creates a possibly uninstantiated type argument vector and the type | 148 // Creates a possibly uninstantiated type argument vector and the type |
| 148 // argument vector of the instantiator (two values in 'args') used in | 149 // argument vector of the instantiator (two values in 'args') used in |
| 149 // preparation of a constructor call. | 150 // preparation of a constructor call. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 174 | 175 |
| 175 virtual void BuildInstanceOf(ComparisonNode* node); | 176 virtual void BuildInstanceOf(ComparisonNode* node); |
| 176 | 177 |
| 177 bool MustSaveRestoreContext(SequenceNode* node) const; | 178 bool MustSaveRestoreContext(SequenceNode* node) const; |
| 178 | 179 |
| 179 // Moves parent context into the context register. | 180 // Moves parent context into the context register. |
| 180 void UnchainContext(); | 181 void UnchainContext(); |
| 181 | 182 |
| 182 void CloseFragment() { exit_ = NULL; } | 183 void CloseFragment() { exit_ = NULL; } |
| 183 intptr_t AllocateTempIndex() { return temp_index_++; } | 184 intptr_t AllocateTempIndex() { return temp_index_++; } |
| 185 void DeallocateTempIndex() { --temp_index_; } |
| 184 | 186 |
| 185 virtual void CompiletimeStringInterpolation(const Function& interpol_func, | 187 virtual void CompiletimeStringInterpolation(const Function& interpol_func, |
| 186 const Array& literals); | 188 const Array& literals); |
| 187 | 189 |
| 188 TempVal* BuildObjectAllocation(ConstructorCallNode* node, | 190 TempVal* BuildObjectAllocation(ConstructorCallNode* node, |
| 189 int start_index); | 191 int start_index); |
| 190 void BuildConstructorCall(ConstructorCallNode* node, | 192 void BuildConstructorCall(ConstructorCallNode* node, |
| 191 int start_index, | 193 int start_index, |
| 192 Value* alloc_value); | 194 Value* alloc_value); |
| 193 | 195 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 TargetEntryInstr** true_successor_address_; | 342 TargetEntryInstr** true_successor_address_; |
| 341 TargetEntryInstr** false_successor_address_; | 343 TargetEntryInstr** false_successor_address_; |
| 342 | 344 |
| 343 intptr_t condition_node_id_; | 345 intptr_t condition_node_id_; |
| 344 intptr_t condition_token_index_; | 346 intptr_t condition_token_index_; |
| 345 }; | 347 }; |
| 346 | 348 |
| 347 } // namespace dart | 349 } // namespace dart |
| 348 | 350 |
| 349 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 351 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |