| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // The cis and token_pos are used in checked mode to verify that the | 308 // The cis and token_pos are used in checked mode to verify that the |
| 309 // condition of the test is of type bool. | 309 // condition of the test is of type bool. |
| 310 class TestGraphVisitor : public ValueGraphVisitor { | 310 class TestGraphVisitor : public ValueGraphVisitor { |
| 311 public: | 311 public: |
| 312 TestGraphVisitor(FlowGraphBuilder* owner, | 312 TestGraphVisitor(FlowGraphBuilder* owner, |
| 313 intptr_t temp_index, | 313 intptr_t temp_index, |
| 314 intptr_t condition_token_pos) | 314 intptr_t condition_token_pos) |
| 315 : ValueGraphVisitor(owner, temp_index), | 315 : ValueGraphVisitor(owner, temp_index), |
| 316 true_successor_address_(NULL), | 316 true_successor_address_(NULL), |
| 317 false_successor_address_(NULL), | 317 false_successor_address_(NULL), |
| 318 condition_token_pos_(condition_token_pos) { | 318 condition_token_pos_(condition_token_pos) { } |
| 319 } | |
| 320 | 319 |
| 321 TargetEntryInstr** true_successor_address() const { | 320 TargetEntryInstr** true_successor_address() const { |
| 322 ASSERT(true_successor_address_ != NULL); | 321 ASSERT(true_successor_address_ != NULL); |
| 323 return true_successor_address_; | 322 return true_successor_address_; |
| 324 } | 323 } |
| 325 TargetEntryInstr** false_successor_address() const { | 324 TargetEntryInstr** false_successor_address() const { |
| 326 ASSERT(false_successor_address_ != NULL); | 325 ASSERT(false_successor_address_ != NULL); |
| 327 return false_successor_address_; | 326 return false_successor_address_; |
| 328 } | 327 } |
| 329 | 328 |
| 330 intptr_t condition_token_pos() const { return condition_token_pos_; } | 329 intptr_t condition_token_pos() const { return condition_token_pos_; } |
| 331 | 330 |
| 332 private: | 331 private: |
| 333 // Construct and concatenate a Branch instruction to this graph fragment. | 332 // Construct and concatenate a Branch instruction to this graph fragment. |
| 334 // Closes the fragment and sets the output parameters. | 333 // Closes the fragment and sets the output parameters. |
| 335 virtual void ReturnValue(Value* value); | 334 virtual void ReturnValue(Value* value); |
| 336 | 335 |
| 336 // Either merges the computation into BranchInstr (Comparison, BooleanNegate) |
| 337 // or adds a Bind instruction to the graph and returns its temporary value. |
| 338 virtual void ReturnComputation(Computation* computation); |
| 339 |
| 340 void MergeBranchWithComparison(ComparisonComp* comp); |
| 341 void MergeBranchWithNegate(BooleanNegateComp* comp); |
| 342 |
| 337 // Output parameters. | 343 // Output parameters. |
| 338 TargetEntryInstr** true_successor_address_; | 344 TargetEntryInstr** true_successor_address_; |
| 339 TargetEntryInstr** false_successor_address_; | 345 TargetEntryInstr** false_successor_address_; |
| 340 | 346 |
| 341 intptr_t condition_token_pos_; | 347 intptr_t condition_token_pos_; |
| 342 }; | 348 }; |
| 343 | 349 |
| 344 } // namespace dart | 350 } // namespace dart |
| 345 | 351 |
| 346 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 352 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |