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

Side by Side Diff: runtime/vm/flow_graph_builder.h

Issue 10032009: Fix a crash in graoh builder where a throw node is added in an expression tree by the parser: allow… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | runtime/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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 virtual void CompiletimeStringInterpolation(const Function& interpol_func, 157 virtual void CompiletimeStringInterpolation(const Function& interpol_func,
158 const Array& literals); 158 const Array& literals);
159 159
160 TempVal* BuildObjectAllocation(ConstructorCallNode* node, 160 TempVal* BuildObjectAllocation(ConstructorCallNode* node,
161 int start_index); 161 int start_index);
162 void BuildConstructorCall(ConstructorCallNode* node, 162 void BuildConstructorCall(ConstructorCallNode* node,
163 int start_index, 163 int start_index,
164 Value* alloc_value); 164 Value* alloc_value);
165 165
166 void BuildThrowNode(ThrowNode* node);
167
166 private: 168 private:
167 // Specify a computation as the final result. Adds a Do instruction to 169 // Specify a computation as the final result. Adds a Do instruction to
168 // the graph, but normally overridden in subclasses. 170 // the graph, but normally overridden in subclasses.
169 virtual void ReturnComputation(Computation* computation) { 171 virtual void ReturnComputation(Computation* computation) {
170 AddInstruction(new DoInstr(computation)); 172 AddInstruction(new DoInstr(computation));
171 } 173 }
172 174
173 // Shared global state. 175 // Shared global state.
174 FlowGraphBuilder* owner_; 176 FlowGraphBuilder* owner_;
175 177
(...skipping 18 matching lines...) Expand all
194 196
195 // Visit functions overridden by this class. 197 // Visit functions overridden by this class.
196 virtual void VisitLiteralNode(LiteralNode* node); 198 virtual void VisitLiteralNode(LiteralNode* node);
197 virtual void VisitIncrOpLocalNode(IncrOpLocalNode* node); 199 virtual void VisitIncrOpLocalNode(IncrOpLocalNode* node);
198 virtual void VisitIncrOpInstanceFieldNode(IncrOpInstanceFieldNode* node); 200 virtual void VisitIncrOpInstanceFieldNode(IncrOpInstanceFieldNode* node);
199 virtual void VisitIncrOpIndexedNode(IncrOpIndexedNode* node); 201 virtual void VisitIncrOpIndexedNode(IncrOpIndexedNode* node);
200 virtual void VisitConstructorCallNode(ConstructorCallNode* node); 202 virtual void VisitConstructorCallNode(ConstructorCallNode* node);
201 virtual void VisitBinaryOpNode(BinaryOpNode* node); 203 virtual void VisitBinaryOpNode(BinaryOpNode* node);
202 virtual void VisitConditionalExprNode(ConditionalExprNode* node); 204 virtual void VisitConditionalExprNode(ConditionalExprNode* node);
203 virtual void VisitLoadLocalNode(LoadLocalNode* node); 205 virtual void VisitLoadLocalNode(LoadLocalNode* node);
206 virtual void VisitThrowNode(ThrowNode* node);
204 207
205 Value* value() const { return value_; } 208 Value* value() const { return value_; }
206 209
207 protected: 210 protected:
208 // Output parameters. 211 // Output parameters.
209 Value* value_; 212 Value* value_;
210 213
211 private: 214 private:
212 // Helper to set the output state to return a Value. 215 // Helper to set the output state to return a Value.
213 virtual void ReturnValue(Value* value) { value_ = value; } 216 virtual void ReturnValue(Value* value) { value_ = value; }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 292 }
290 293
291 // Output parameters. 294 // Output parameters.
292 TargetEntryInstr** true_successor_address_; 295 TargetEntryInstr** true_successor_address_;
293 TargetEntryInstr** false_successor_address_; 296 TargetEntryInstr** false_successor_address_;
294 }; 297 };
295 298
296 } // namespace dart 299 } // namespace dart
297 300
298 #endif // VM_FLOW_GRAPH_BUILDER_H_ 301 #endif // VM_FLOW_GRAPH_BUILDER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698