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

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

Issue 9453014: Implement a simple InstructionVisitor class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 16 matching lines...) Expand all
27 27
28 const ParsedFunction& parsed_function() const { return parsed_function_; } 28 const ParsedFunction& parsed_function() const { return parsed_function_; }
29 29
30 bool HasBailedOut() const { return bailout_reason_ != NULL; } 30 bool HasBailedOut() const { return bailout_reason_ != NULL; }
31 void Bailout(const char* reason) { 31 void Bailout(const char* reason) {
32 // Cannot give a NULL reason because we use it to detect bailout. 32 // Cannot give a NULL reason because we use it to detect bailout.
33 ASSERT(!HasBailedOut() && (reason != NULL)); 33 ASSERT(!HasBailedOut() && (reason != NULL));
34 bailout_reason_ = reason; 34 bailout_reason_ = reason;
35 } 35 }
36 void TraceBailout() const; 36 void TraceBailout() const;
37 void PrintGraph() const;
38 37
39 private: 38 private:
40 const ParsedFunction& parsed_function_; 39 const ParsedFunction& parsed_function_;
41 const char* bailout_reason_; 40 const char* bailout_reason_;
42 GrowableArray<Instruction*> postorder_block_entries_; 41 GrowableArray<BlockEntryInstr*> postorder_block_entries_;
43 }; 42 };
44 43
45 44
46 #define DEFINE_VISIT(type, name) virtual void Visit##type(type* node); 45 #define DEFINE_VISIT(type, name) virtual void Visit##type(type* node);
47 46
48 class TestGraphVisitor; 47 class TestGraphVisitor;
49 48
50 // Translate an AstNode to a control-flow graph fragment for its effects 49 // Translate an AstNode to a control-flow graph fragment for its effects
51 // (e.g., a statement or an expression in an effect context). Implements a 50 // (e.g., a statement or an expression in an effect context). Implements a
52 // function from an AstNode and next temporary index to a graph fragment 51 // function from an AstNode and next temporary index to a graph fragment
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 TargetEntryInstr** true_successor_address_; 212 TargetEntryInstr** true_successor_address_;
214 TargetEntryInstr** false_successor_address_; 213 TargetEntryInstr** false_successor_address_;
215 }; 214 };
216 215
217 #undef DEFINE_VISIT 216 #undef DEFINE_VISIT
218 217
219 218
220 } // namespace dart 219 } // namespace dart
221 220
222 #endif // VM_FLOW_GRAPH_BUILDER_H_ 221 #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