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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10559072: Fuse Comparison->BooleanNegate->Branch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 8878)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -1016,6 +1016,9 @@
void BranchInstr::EmitBranchOnCondition(FlowGraphCompiler* compiler,
Condition true_condition) {
+ if (is_negated()) {
+ true_condition = NegateCondition(true_condition);
+ }
if (compiler->IsNextBlock(false_successor())) {
// If the next block is the false successor we will fall through to it.
__ j(true_condition, compiler->GetBlockLabel(true_successor()));
@@ -1071,7 +1074,9 @@
Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQUAL : NOT_EQUAL;
__ CompareRegisters(left, right);
- if (!is_fused_with_branch()) {
+ if (is_fused_with_branch()) {
+ fused_with_branch()->EmitBranchOnCondition(compiler, true_condition);
+ } else {
Register result = locs()->out().reg();
Label load_true, done;
__ j(true_condition, &load_true, Assembler::kNearJump);
@@ -1080,8 +1085,6 @@
__ Bind(&load_true);
__ LoadObject(result, compiler->bool_true());
__ Bind(&done);
- } else {
- fused_with_branch()->EmitBranchOnCondition(compiler, true_condition);
}
}
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698