Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2046)

Side by Side Diff: vm/flow_graph_builder.h

Issue 10409043: Make saving and restoring of the context around closure calls explicit. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | vm/flow_graph_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698