| 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 "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 // This implementation shares state among visitors by using the builder. | 311 // This implementation shares state among visitors by using the builder. |
| 312 // The implementation is incorrect if a visitor that hits a return is not | 312 // The implementation is incorrect if a visitor that hits a return is not |
| 313 // actually added to the graph. | 313 // actually added to the graph. |
| 314 void AddReturnExit(intptr_t token_pos, Value* value); | 314 void AddReturnExit(intptr_t token_pos, Value* value); |
| 315 | 315 |
| 316 protected: | 316 protected: |
| 317 Definition* BuildStoreTemp(const LocalVariable& local, Value* value); | 317 Definition* BuildStoreTemp(const LocalVariable& local, Value* value); |
| 318 Definition* BuildStoreExprTemp(Value* value); | 318 Definition* BuildStoreExprTemp(Value* value); |
| 319 Definition* BuildLoadExprTemp(); | 319 Definition* BuildLoadExprTemp(); |
| 320 | 320 |
| 321 Definition* BuildStoreLocal(const LocalVariable& local, | 321 Definition* BuildStoreLocal(const LocalVariable& local, Value* value); |
| 322 Value* value, | |
| 323 bool result_is_needed); | |
| 324 Definition* BuildLoadLocal(const LocalVariable& local); | 322 Definition* BuildLoadLocal(const LocalVariable& local); |
| 325 | 323 |
| 326 void HandleStoreLocal(StoreLocalNode* node, bool result_is_needed); | |
| 327 | |
| 328 // Helpers for translating parts of the AST. | 324 // Helpers for translating parts of the AST. |
| 329 void BuildPushArguments(const ArgumentListNode& node, | 325 void BuildPushArguments(const ArgumentListNode& node, |
| 330 ZoneGrowableArray<PushArgumentInstr*>* values); | 326 ZoneGrowableArray<PushArgumentInstr*>* values); |
| 331 | 327 |
| 332 // Creates an instantiated type argument vector used in preparation of an | 328 // Creates an instantiated type argument vector used in preparation of an |
| 333 // allocation call. | 329 // allocation call. |
| 334 // May be called only if allocating an object of a parameterized class. | 330 // May be called only if allocating an object of a parameterized class. |
| 335 Value* BuildInstantiatedTypeArguments( | 331 Value* BuildInstantiatedTypeArguments( |
| 336 intptr_t token_pos, | 332 intptr_t token_pos, |
| 337 const TypeArguments& type_arguments); | 333 const TypeArguments& type_arguments); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 explicit ValueGraphVisitor(FlowGraphBuilder* owner) | 459 explicit ValueGraphVisitor(FlowGraphBuilder* owner) |
| 464 : EffectGraphVisitor(owner), value_(NULL) { } | 460 : EffectGraphVisitor(owner), value_(NULL) { } |
| 465 | 461 |
| 466 // Visit functions overridden by this class. | 462 // Visit functions overridden by this class. |
| 467 virtual void VisitLiteralNode(LiteralNode* node); | 463 virtual void VisitLiteralNode(LiteralNode* node); |
| 468 virtual void VisitAssignableNode(AssignableNode* node); | 464 virtual void VisitAssignableNode(AssignableNode* node); |
| 469 virtual void VisitConstructorCallNode(ConstructorCallNode* node); | 465 virtual void VisitConstructorCallNode(ConstructorCallNode* node); |
| 470 virtual void VisitBinaryOpNode(BinaryOpNode* node); | 466 virtual void VisitBinaryOpNode(BinaryOpNode* node); |
| 471 virtual void VisitConditionalExprNode(ConditionalExprNode* node); | 467 virtual void VisitConditionalExprNode(ConditionalExprNode* node); |
| 472 virtual void VisitLoadLocalNode(LoadLocalNode* node); | 468 virtual void VisitLoadLocalNode(LoadLocalNode* node); |
| 473 virtual void VisitStoreLocalNode(StoreLocalNode* node); | |
| 474 virtual void VisitStoreIndexedNode(StoreIndexedNode* node); | 469 virtual void VisitStoreIndexedNode(StoreIndexedNode* node); |
| 475 virtual void VisitInstanceSetterNode(InstanceSetterNode* node); | 470 virtual void VisitInstanceSetterNode(InstanceSetterNode* node); |
| 476 virtual void VisitThrowNode(ThrowNode* node); | 471 virtual void VisitThrowNode(ThrowNode* node); |
| 477 virtual void VisitClosureCallNode(ClosureCallNode* node); | 472 virtual void VisitClosureCallNode(ClosureCallNode* node); |
| 478 virtual void VisitStaticSetterNode(StaticSetterNode* node); | 473 virtual void VisitStaticSetterNode(StaticSetterNode* node); |
| 479 virtual void VisitStoreStaticFieldNode(StoreStaticFieldNode* node); | 474 virtual void VisitStoreStaticFieldNode(StoreStaticFieldNode* node); |
| 480 virtual void VisitTypeNode(TypeNode* node); | 475 virtual void VisitTypeNode(TypeNode* node); |
| 481 virtual void VisitLetNode(LetNode* node); | 476 virtual void VisitLetNode(LetNode* node); |
| 482 | 477 |
| 483 Value* value() const { return value_; } | 478 Value* value() const { return value_; } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 // Output parameters. | 555 // Output parameters. |
| 561 GrowableArray<TargetEntryInstr**> true_successor_addresses_; | 556 GrowableArray<TargetEntryInstr**> true_successor_addresses_; |
| 562 GrowableArray<TargetEntryInstr**> false_successor_addresses_; | 557 GrowableArray<TargetEntryInstr**> false_successor_addresses_; |
| 563 | 558 |
| 564 intptr_t condition_token_pos_; | 559 intptr_t condition_token_pos_; |
| 565 }; | 560 }; |
| 566 | 561 |
| 567 } // namespace dart | 562 } // namespace dart |
| 568 | 563 |
| 569 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 564 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |