| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // preparation of a constructor call. | 149 // preparation of a constructor call. |
| 150 // May be called only if allocating an object of a parameterized class. | 150 // May be called only if allocating an object of a parameterized class. |
| 151 void BuildConstructorTypeArguments(ConstructorCallNode* node, | 151 void BuildConstructorTypeArguments(ConstructorCallNode* node, |
| 152 intptr_t start_index, | 152 intptr_t start_index, |
| 153 ZoneGrowableArray<Value*>* args); | 153 ZoneGrowableArray<Value*>* args); |
| 154 | 154 |
| 155 // Returns the value of the type arguments of the instantiator. | 155 // Returns the value of the type arguments of the instantiator. |
| 156 Value* BuildInstantiatorTypeArguments(intptr_t token_index, | 156 Value* BuildInstantiatorTypeArguments(intptr_t token_index, |
| 157 intptr_t start_index); | 157 intptr_t start_index); |
| 158 | 158 |
| 159 void BuildInstanceOf(ComparisonNode* node); | 159 virtual void BuildInstanceOf(ComparisonNode* node); |
| 160 | 160 |
| 161 bool MustSaveRestoreContext(SequenceNode* node) const; | 161 bool MustSaveRestoreContext(SequenceNode* node) const; |
| 162 | 162 |
| 163 // Moves parent context into the context register. | 163 // Moves parent context into the context register. |
| 164 void UnchainContext(); | 164 void UnchainContext(); |
| 165 | 165 |
| 166 void CloseFragment() { exit_ = NULL; } | 166 void CloseFragment() { exit_ = NULL; } |
| 167 intptr_t AllocateTempIndex() { return temp_index_++; } | 167 intptr_t AllocateTempIndex() { return temp_index_++; } |
| 168 | 168 |
| 169 virtual void CompiletimeStringInterpolation(const Function& interpol_func, | 169 virtual void CompiletimeStringInterpolation(const Function& interpol_func, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // Specify a computation as the final result. Adds a Bind instruction to | 233 // Specify a computation as the final result. Adds a Bind instruction to |
| 234 // the graph and returns its temporary value (i.e., set the output | 234 // the graph and returns its temporary value (i.e., set the output |
| 235 // parameters). | 235 // parameters). |
| 236 virtual void ReturnComputation(Computation* computation) { | 236 virtual void ReturnComputation(Computation* computation) { |
| 237 AddInstruction(new BindInstr(temp_index(), computation)); | 237 AddInstruction(new BindInstr(temp_index(), computation)); |
| 238 value_ = new TempVal(AllocateTempIndex()); | 238 value_ = new TempVal(AllocateTempIndex()); |
| 239 } | 239 } |
| 240 | 240 |
| 241 virtual void CompiletimeStringInterpolation(const Function& interpol_func, | 241 virtual void CompiletimeStringInterpolation(const Function& interpol_func, |
| 242 const Array& literals); | 242 const Array& literals); |
| 243 |
| 244 virtual void BuildInstanceOf(ComparisonNode* node); |
| 243 }; | 245 }; |
| 244 | 246 |
| 245 | 247 |
| 246 // Translate an AstNode to a control-flow graph fragment for both its effects | 248 // Translate an AstNode to a control-flow graph fragment for both its effects |
| 247 // and value as an outgoing argument. Implements a function from an AstNode | 249 // and value as an outgoing argument. Implements a function from an AstNode |
| 248 // and next temporary index to a graph fragment (as in the | 250 // and next temporary index to a graph fragment (as in the |
| 249 // EffectGraphBuilder), an updated temporary index, and an intermediate | 251 // EffectGraphBuilder), an updated temporary index, and an intermediate |
| 250 // language Value. | 252 // language Value. |
| 251 class ArgumentGraphVisitor : public ValueGraphVisitor { | 253 class ArgumentGraphVisitor : public ValueGraphVisitor { |
| 252 public: | 254 public: |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 } | 309 } |
| 308 | 310 |
| 309 // Output parameters. | 311 // Output parameters. |
| 310 TargetEntryInstr** true_successor_address_; | 312 TargetEntryInstr** true_successor_address_; |
| 311 TargetEntryInstr** false_successor_address_; | 313 TargetEntryInstr** false_successor_address_; |
| 312 }; | 314 }; |
| 313 | 315 |
| 314 } // namespace dart | 316 } // namespace dart |
| 315 | 317 |
| 316 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 318 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |