| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 const Array& literals); | 173 const Array& literals); |
| 174 | 174 |
| 175 Definition* BuildObjectAllocation(ConstructorCallNode* node); | 175 Definition* BuildObjectAllocation(ConstructorCallNode* node); |
| 176 void BuildConstructorCall(ConstructorCallNode* node, Value* alloc_value); | 176 void BuildConstructorCall(ConstructorCallNode* node, Value* alloc_value); |
| 177 | 177 |
| 178 void BuildStoreContext(const LocalVariable& variable); | 178 void BuildStoreContext(const LocalVariable& variable); |
| 179 void BuildLoadContext(const LocalVariable& variable); | 179 void BuildLoadContext(const LocalVariable& variable); |
| 180 | 180 |
| 181 void BuildThrowNode(ThrowNode* node); | 181 void BuildThrowNode(ThrowNode* node); |
| 182 | 182 |
| 183 ClosureCallComp* BuildClosureCall(ClosureCallNode* node); |
| 184 |
| 183 private: | 185 private: |
| 184 // Specify a computation as the final result. Adds a Do instruction to | 186 // Specify a computation as the final result. Adds a Do instruction to |
| 185 // the graph, but normally overridden in subclasses. | 187 // the graph, but normally overridden in subclasses. |
| 186 virtual void ReturnComputation(Computation* computation) { | 188 virtual void ReturnComputation(Computation* computation) { |
| 187 AddInstruction(new DoInstr(computation)); | 189 AddInstruction(new DoInstr(computation)); |
| 188 } | 190 } |
| 189 | 191 |
| 190 // Shared global state. | 192 // Shared global state. |
| 191 FlowGraphBuilder* owner_; | 193 FlowGraphBuilder* owner_; |
| 192 | 194 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 210 : EffectGraphVisitor(owner, temp_index), value_(NULL) { } | 212 : EffectGraphVisitor(owner, temp_index), value_(NULL) { } |
| 211 | 213 |
| 212 // Visit functions overridden by this class. | 214 // Visit functions overridden by this class. |
| 213 virtual void VisitLiteralNode(LiteralNode* node); | 215 virtual void VisitLiteralNode(LiteralNode* node); |
| 214 virtual void VisitAssignableNode(AssignableNode* node); | 216 virtual void VisitAssignableNode(AssignableNode* node); |
| 215 virtual void VisitConstructorCallNode(ConstructorCallNode* node); | 217 virtual void VisitConstructorCallNode(ConstructorCallNode* node); |
| 216 virtual void VisitBinaryOpNode(BinaryOpNode* node); | 218 virtual void VisitBinaryOpNode(BinaryOpNode* node); |
| 217 virtual void VisitConditionalExprNode(ConditionalExprNode* node); | 219 virtual void VisitConditionalExprNode(ConditionalExprNode* node); |
| 218 virtual void VisitLoadLocalNode(LoadLocalNode* node); | 220 virtual void VisitLoadLocalNode(LoadLocalNode* node); |
| 219 virtual void VisitThrowNode(ThrowNode* node); | 221 virtual void VisitThrowNode(ThrowNode* node); |
| 222 virtual void VisitClosureCallNode(ClosureCallNode* node); |
| 220 | 223 |
| 221 Value* value() const { return value_; } | 224 Value* value() const { return value_; } |
| 222 | 225 |
| 223 protected: | 226 protected: |
| 224 // Output parameters. | 227 // Output parameters. |
| 225 Value* value_; | 228 Value* value_; |
| 226 | 229 |
| 227 private: | 230 private: |
| 228 // Helper to set the output state to return a Value. | 231 // Helper to set the output state to return a Value. |
| 229 virtual void ReturnValue(Value* value) { | 232 virtual void ReturnValue(Value* value) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // Output parameters. | 297 // Output parameters. |
| 295 TargetEntryInstr** true_successor_address_; | 298 TargetEntryInstr** true_successor_address_; |
| 296 TargetEntryInstr** false_successor_address_; | 299 TargetEntryInstr** false_successor_address_; |
| 297 | 300 |
| 298 intptr_t condition_token_index_; | 301 intptr_t condition_token_index_; |
| 299 }; | 302 }; |
| 300 | 303 |
| 301 } // namespace dart | 304 } // namespace dart |
| 302 | 305 |
| 303 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 306 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |