| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 const String& dst_name); | 171 const String& dst_name); |
| 172 | 172 |
| 173 void BuildStoreIndexedValues(StoreIndexedNode* node, | 173 void BuildStoreIndexedValues(StoreIndexedNode* node, |
| 174 Value** array, | 174 Value** array, |
| 175 Value** index, | 175 Value** index, |
| 176 Value** value); | 176 Value** value); |
| 177 void BuildInstanceSetterValues(InstanceSetterNode* node, | 177 void BuildInstanceSetterValues(InstanceSetterNode* node, |
| 178 Value** receiver, | 178 Value** receiver, |
| 179 Value** value); | 179 Value** value); |
| 180 | 180 |
| 181 virtual void BuildInstanceOf(ComparisonNode* node); | 181 virtual void BuildTypeTest(ComparisonNode* node); |
| 182 virtual void BuildTypeCast(ComparisonNode* node); |
| 182 | 183 |
| 183 bool MustSaveRestoreContext(SequenceNode* node) const; | 184 bool MustSaveRestoreContext(SequenceNode* node) const; |
| 184 | 185 |
| 185 // Moves parent context into the context register. | 186 // Moves parent context into the context register. |
| 186 void UnchainContext(); | 187 void UnchainContext(); |
| 187 | 188 |
| 188 void CloseFragment() { exit_ = NULL; } | 189 void CloseFragment() { exit_ = NULL; } |
| 189 intptr_t AllocateTempIndex() { return temp_index_++; } | 190 intptr_t AllocateTempIndex() { return temp_index_++; } |
| 190 void DeallocateTempIndex(intptr_t n) { | 191 void DeallocateTempIndex(intptr_t n) { |
| 191 ASSERT(temp_index_ >= n); | 192 ASSERT(temp_index_ >= n); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 // parameters). | 268 // parameters). |
| 268 virtual void ReturnComputation(Computation* computation) { | 269 virtual void ReturnComputation(Computation* computation) { |
| 269 BindInstr* defn = new BindInstr(computation); | 270 BindInstr* defn = new BindInstr(computation); |
| 270 AddInstruction(defn); | 271 AddInstruction(defn); |
| 271 ReturnValue(new UseVal(defn)); | 272 ReturnValue(new UseVal(defn)); |
| 272 } | 273 } |
| 273 | 274 |
| 274 virtual void CompiletimeStringInterpolation(const Function& interpol_func, | 275 virtual void CompiletimeStringInterpolation(const Function& interpol_func, |
| 275 const Array& literals); | 276 const Array& literals); |
| 276 | 277 |
| 277 virtual void BuildInstanceOf(ComparisonNode* node); | 278 virtual void BuildTypeTest(ComparisonNode* node); |
| 279 virtual void BuildTypeCast(ComparisonNode* node); |
| 278 }; | 280 }; |
| 279 | 281 |
| 280 | 282 |
| 281 // Translate an AstNode to a control-flow graph fragment for both its | 283 // Translate an AstNode to a control-flow graph fragment for both its |
| 282 // effects and true/false control flow (e.g., for an expression in a test | 284 // effects and true/false control flow (e.g., for an expression in a test |
| 283 // context). The resulting graph is always closed (even if it is empty) | 285 // context). The resulting graph is always closed (even if it is empty) |
| 284 // Successor control flow is explicitly set by a pair of pointers to | 286 // Successor control flow is explicitly set by a pair of pointers to |
| 285 // TargetEntryInstr*. | 287 // TargetEntryInstr*. |
| 286 // | 288 // |
| 287 // To distinguish between the graphs with only nonlocal exits and graphs | 289 // To distinguish between the graphs with only nonlocal exits and graphs |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 // Output parameters. | 327 // Output parameters. |
| 326 TargetEntryInstr** true_successor_address_; | 328 TargetEntryInstr** true_successor_address_; |
| 327 TargetEntryInstr** false_successor_address_; | 329 TargetEntryInstr** false_successor_address_; |
| 328 | 330 |
| 329 intptr_t condition_token_pos_; | 331 intptr_t condition_token_pos_; |
| 330 }; | 332 }; |
| 331 | 333 |
| 332 } // namespace dart | 334 } // namespace dart |
| 333 | 335 |
| 334 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 336 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |