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