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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 10825483: Add --use_cha (default true, switch to false if you use dynamic class loading). Use CHA to specify … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 11101)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -2191,6 +2191,14 @@
void CheckClassComp::EmitNativeCode(FlowGraphCompiler* compiler) {
+ const intptr_t v_cid = value()->ResultCid();
+ const intptr_t num_checks = ic_data()->NumberOfChecks();
+ if ((num_checks == 1) &&
+ (v_cid == ic_data()->GetReceiverClassIdAt(0))) {
+ // No checks needed.
+ // TODO(srdjan): Should the computation have been removed instead?
+ return;
+ }
Register value = locs()->in(0).reg();
Register temp = locs()->temp(0).reg();
Label* deopt = compiler->AddDeoptStub(deopt_id(),
@@ -2201,7 +2209,6 @@
__ j(ZERO, deopt);
__ LoadClassId(temp, value);
Label is_ok;
- const intptr_t num_checks = ic_data()->NumberOfChecks();
const bool use_near_jump = num_checks < 5;
for (intptr_t i = 0; i < num_checks; i++) {
__ cmpl(temp, Immediate(ic_data()->GetReceiverClassIdAt(i)));
« 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