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

Unified Diff: runtime/vm/flow_graph_compiler.h

Issue 23766021: Fix a bug in block reordering/block compaction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.h
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h
index 3349b46a5936ad3f6bdba61a51d8db742f3293b7..3d174c232b63406088f1e3e8154fc7db550c6702 100644
--- a/runtime/vm/flow_graph_compiler.h
+++ b/runtime/vm/flow_graph_compiler.h
@@ -202,33 +202,36 @@ class FlowGraphCompiler : public ValueObject {
class BlockInfo : public ZoneAllocated {
public:
BlockInfo()
- : jump_label_(&block_label_),
- block_label_(),
- fallthrough_label_(NULL),
+ : block_label_(),
+ jump_label_(&block_label_),
+ next_nonempty_label_(NULL),
is_marked_(false) {}
+ // The label to jump to when control is transferred to this block. For
+ // nonempty blocks it is the label of the block itself. For empty
+ // blocks it is the label of the first nonempty successor block.
Label* jump_label() const { return jump_label_; }
void set_jump_label(Label* label) { jump_label_ = label; }
- // Label of the block that will follow this block in the generated code.
- // Can be NULL if the block is the last block.
- Label* fallthrough_label() const { return fallthrough_label_; }
- void set_fallthrough_label(Label* fallthrough_label) {
- fallthrough_label_ = fallthrough_label;
- }
+ // The label of the first nonempty block after this one in the block
+ // order, or NULL if there is no nonempty block following this one.
+ Label* next_nonempty_label() const { return next_nonempty_label_; }
+ void set_next_nonempty_label(Label* label) { next_nonempty_label_ = label; }
bool WasCompacted() const {
return jump_label_ != &block_label_;
}
+ // Block compaction is recursive. Block info for already-compacted
+ // blocks is marked so as to avoid cycles in the graph.
bool is_marked() const { return is_marked_; }
void mark() { is_marked_ = true; }
private:
- Label* jump_label_;
Label block_label_;
- Label* fallthrough_label_;
+ Label* jump_label_;
+ Label* next_nonempty_label_;
bool is_marked_;
};
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698