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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 12209057: Optimize branches in polymorphic equality operations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('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_x64.cc
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 18211)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -459,7 +459,11 @@
ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmiCid) || (i == 0));
Label next_test;
__ cmpq(temp, Immediate(ic_data.GetReceiverClassIdAt(i)));
- __ j(NOT_EQUAL, &next_test);
+ if (i < len - 1) {
+ __ j(NOT_EQUAL, &next_test);
+ } else {
+ __ j(NOT_EQUAL, deopt);
+ }
const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i));
if (target.Owner() == object_store->object_class()) {
// Object.== is same as ===.
@@ -495,7 +499,6 @@
__ jmp(&done);
__ Bind(&false_label);
__ LoadObject(RAX, Bool::False());
- __ jmp(&done);
}
} else {
if (branch->is_checked()) {
@@ -505,11 +508,11 @@
branch->EmitBranchOnCondition(compiler, cond);
}
}
- __ jmp(&done);
- __ Bind(&next_test);
+ if (i < len - 1) {
+ __ jmp(&done);
+ __ Bind(&next_test);
+ }
}
- // Fall through leads to deoptimization
- __ jmp(deopt);
__ Bind(&done);
}
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698