| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 TestGraphVisitor(FlowGraphBuilder* owner, intptr_t temp_index) | 233 TestGraphVisitor(FlowGraphBuilder* owner, intptr_t temp_index) |
| 234 : ValueGraphVisitor(owner, temp_index), | 234 : ValueGraphVisitor(owner, temp_index), |
| 235 true_successor_address_(NULL), | 235 true_successor_address_(NULL), |
| 236 false_successor_address_(NULL) { | 236 false_successor_address_(NULL) { |
| 237 } | 237 } |
| 238 | 238 |
| 239 // Visit functions overridden by this class. | 239 // Visit functions overridden by this class. |
| 240 virtual void VisitLiteralNode(LiteralNode* node); | 240 virtual void VisitLiteralNode(LiteralNode* node); |
| 241 virtual void VisitLoadLocalNode(LoadLocalNode* node); | 241 virtual void VisitLoadLocalNode(LoadLocalNode* node); |
| 242 | 242 |
| 243 BlockEntryInstr** true_successor_address() const { | 243 TargetEntryInstr** true_successor_address() const { |
| 244 ASSERT(true_successor_address_ != NULL); | 244 ASSERT(true_successor_address_ != NULL); |
| 245 return true_successor_address_; | 245 return true_successor_address_; |
| 246 } | 246 } |
| 247 BlockEntryInstr** false_successor_address() const { | 247 TargetEntryInstr** false_successor_address() const { |
| 248 ASSERT(false_successor_address_ != NULL); | 248 ASSERT(false_successor_address_ != NULL); |
| 249 return false_successor_address_; | 249 return false_successor_address_; |
| 250 } | 250 } |
| 251 | 251 |
| 252 private: | 252 private: |
| 253 // Construct and concatenate a Branch instruction to this graph fragment. | 253 // Construct and concatenate a Branch instruction to this graph fragment. |
| 254 // Closes the fragment and sets the output parameters. | 254 // Closes the fragment and sets the output parameters. |
| 255 virtual void ReturnValue(Value* value); | 255 virtual void ReturnValue(Value* value); |
| 256 | 256 |
| 257 // Specify a computation as the final result. Adds a Bind instruction to | 257 // Specify a computation as the final result. Adds a Bind instruction to |
| 258 // the graph and branches on its value. | 258 // the graph and branches on its value. |
| 259 virtual void ReturnComputation(Computation* computation) { | 259 virtual void ReturnComputation(Computation* computation) { |
| 260 AddInstruction(new BindInstr(temp_index(), computation)); | 260 AddInstruction(new BindInstr(temp_index(), computation)); |
| 261 ReturnValue(new TempVal(temp_index())); | 261 ReturnValue(new TempVal(temp_index())); |
| 262 } | 262 } |
| 263 | 263 |
| 264 // Output parameters. | 264 // Output parameters. |
| 265 BlockEntryInstr** true_successor_address_; | 265 TargetEntryInstr** true_successor_address_; |
| 266 BlockEntryInstr** false_successor_address_; | 266 TargetEntryInstr** false_successor_address_; |
| 267 }; | 267 }; |
| 268 | 268 |
| 269 } // namespace dart | 269 } // namespace dart |
| 270 | 270 |
| 271 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 271 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |