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

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

Issue 9969192: Implement condition type checks in new compiler, thereby removing last bailouts. (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 | « runtime/vm/dart_api_message.cc ('k') | 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')
Property Changes:
Deleted: svn:eol-style
- LF
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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // TargetEntryInstr*. 268 // TargetEntryInstr*.
269 // 269 //
270 // To distinguish between the graphs with only nonlocal exits and graphs 270 // To distinguish between the graphs with only nonlocal exits and graphs
271 // with both true and false exits, there are a pair of TargetEntryInstr**: 271 // with both true and false exits, there are a pair of TargetEntryInstr**:
272 // 272 //
273 // - Both NULL: only non-local exits, truly closed 273 // - Both NULL: only non-local exits, truly closed
274 // - Neither NULL: true and false successors at the given addresses 274 // - Neither NULL: true and false successors at the given addresses
275 // 275 //
276 // We expect that AstNode in test contexts either have only nonlocal exits 276 // We expect that AstNode in test contexts either have only nonlocal exits
277 // or else control flow has both true and false successors. 277 // or else control flow has both true and false successors.
278 class TestGraphVisitor : public ValueGraphVisitor { 278 class TestGraphVisitor : public ValueGraphVisitor {
srdjan 2012/04/16 23:52:38 Please add a comment why we need the node id and t
regis 2012/04/17 00:17:18 Added comment and removed the setters. Both condit
279 public: 279 public:
280 TestGraphVisitor(FlowGraphBuilder* owner, intptr_t temp_index) 280 TestGraphVisitor(FlowGraphBuilder* owner, intptr_t temp_index)
281 : ValueGraphVisitor(owner, temp_index), 281 : ValueGraphVisitor(owner, temp_index),
282 true_successor_address_(NULL), 282 true_successor_address_(NULL),
283 false_successor_address_(NULL) { 283 false_successor_address_(NULL),
284 node_id_(AstNode::kNoId),
285 token_index_(0) {
284 } 286 }
285 287
286 // Visit functions overridden by this class. 288 // Visit functions overridden by this class.
287 virtual void VisitLiteralNode(LiteralNode* node); 289 virtual void VisitLiteralNode(LiteralNode* node);
288 virtual void VisitLoadLocalNode(LoadLocalNode* node); 290 virtual void VisitLoadLocalNode(LoadLocalNode* node);
289 291
290 TargetEntryInstr** true_successor_address() const { 292 TargetEntryInstr** true_successor_address() const {
291 ASSERT(true_successor_address_ != NULL); 293 ASSERT(true_successor_address_ != NULL);
292 return true_successor_address_; 294 return true_successor_address_;
293 } 295 }
294 TargetEntryInstr** false_successor_address() const { 296 TargetEntryInstr** false_successor_address() const {
295 ASSERT(false_successor_address_ != NULL); 297 ASSERT(false_successor_address_ != NULL);
296 return false_successor_address_; 298 return false_successor_address_;
297 } 299 }
298 300
301 intptr_t node_id() const { return node_id_; }
302 void set_node_id(intptr_t node_id) { node_id_ = node_id; }
303 intptr_t token_index() const { return token_index_; }
304 void set_token_index(intptr_t token_index) { token_index_ = token_index; }
305
299 private: 306 private:
300 // Construct and concatenate a Branch instruction to this graph fragment. 307 // Construct and concatenate a Branch instruction to this graph fragment.
301 // Closes the fragment and sets the output parameters. 308 // Closes the fragment and sets the output parameters.
302 virtual void ReturnValue(Value* value); 309 virtual void ReturnValue(Value* value);
303 310
304 // Specify a computation as the final result. Adds a Bind instruction to 311 // Specify a computation as the final result. Adds a Bind instruction to
305 // the graph and branches on its value. 312 // the graph and branches on its value.
306 virtual void ReturnComputation(Computation* computation) { 313 virtual void ReturnComputation(Computation* computation) {
307 AddInstruction(new BindInstr(temp_index(), computation)); 314 AddInstruction(new BindInstr(temp_index(), computation));
308 ReturnValue(new TempVal(temp_index())); 315 ReturnValue(new TempVal(temp_index()));
309 } 316 }
310 317
311 // Output parameters. 318 // Output parameters.
312 TargetEntryInstr** true_successor_address_; 319 TargetEntryInstr** true_successor_address_;
313 TargetEntryInstr** false_successor_address_; 320 TargetEntryInstr** false_successor_address_;
321
322 intptr_t node_id_;
323 intptr_t token_index_;
314 }; 324 };
315 325
316 } // namespace dart 326 } // namespace dart
317 327
318 #endif // VM_FLOW_GRAPH_BUILDER_H_ 328 #endif // VM_FLOW_GRAPH_BUILDER_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_message.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698