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

Unified Diff: runtime/vm/intermediate_language_ia32.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 | « no previous file | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 18211)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -462,7 +462,11 @@
ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmiCid) || (i == 0));
Label next_test;
__ cmpl(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 ===.
@@ -497,7 +501,6 @@
__ jmp(&done);
__ Bind(&false_label);
__ LoadObject(EAX, Bool::False());
- __ jmp(&done);
}
} else {
if (branch->is_checked()) {
@@ -507,11 +510,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 | « no previous file | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698