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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 64483002: Streamline code generator for branches and comparisons. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: added other platformd, comments addressed Created 7 years, 1 month 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
Index: runtime/vm/flow_graph_compiler.cc
===================================================================
--- runtime/vm/flow_graph_compiler.cc (revision 30153)
+++ runtime/vm/flow_graph_compiler.cc (working copy)
@@ -317,13 +317,26 @@
}
-bool FlowGraphCompiler::CanFallThroughTo(BlockEntryInstr* block_entry) const {
+Label* FlowGraphCompiler::NextNonEmptyLabel() const {
const intptr_t current_index = current_block()->postorder_number();
- Label* next_nonempty = block_info_[current_index]->next_nonempty_label();
- return next_nonempty == GetJumpLabel(block_entry);
+ return block_info_[current_index]->next_nonempty_label();
}
+bool FlowGraphCompiler::CanFallThroughTo(BlockEntryInstr* block_entry) const {
+ return NextNonEmptyLabel() == GetJumpLabel(block_entry);
+}
+
+
+BranchLabels FlowGraphCompiler::CreateBranchLabels(BranchInstr* branch) const {
+ Label* true_label = GetJumpLabel(branch->true_successor());
+ Label* false_label = GetJumpLabel(branch->false_successor());
+ Label* fall_through = NextNonEmptyLabel();
+ BranchLabels result = { true_label, false_label, fall_through };
+ return result;
+}
+
+
void FlowGraphCompiler::AddSlowPathCode(SlowPathCode* code) {
slow_path_code_.Add(code);
}

Powered by Google App Engine
This is Rietveld 408576698