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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 10872096: Simplify EmitTestAndCall and eliminated excessive code generation (two Smi tests emitted). (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 11414)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -729,7 +729,6 @@
kNumArguments,
Array::Handle(), // No named arguments.
deopt, // Deoptimize target.
- NULL, // Fallthrough when done.
deopt_id(),
token_pos(),
try_index(),
@@ -2144,40 +2143,25 @@
locs());
return;
}
- Label handle_smi;
- Label* is_smi_label =
- ic_data()->GetReceiverClassIdAt(0) == kSmiCid ? &handle_smi : deopt;
// Load receiver into RAX.
__ movq(RAX,
Address(RSP, (instance_call()->ArgumentCount() - 1) * kWordSize));
- __ testq(RAX, Immediate(kSmiTagMask));
- __ j(ZERO, is_smi_label);
Label done;
+ __ movq(RDI, Immediate(kSmiCid));
+ __ testq(RAX, Immediate(kSmiTagMask));
+ __ j(ZERO, &done);
__ LoadClassId(RDI, RAX);
+ __ Bind(&done);
compiler->EmitTestAndCall(*ic_data(),
RDI, // Class id register.
instance_call()->ArgumentCount(),
instance_call()->argument_names(),
deopt,
- (is_smi_label == &handle_smi) ? &done : NULL,
instance_call()->deopt_id(),
instance_call()->token_pos(),
instance_call()->try_index(),
locs());
- if (is_smi_label == &handle_smi) {
- __ Bind(&handle_smi);
- ASSERT(ic_data()->GetReceiverClassIdAt(0) == kSmiCid);
- const Function& target = Function::ZoneHandle(ic_data()->GetTargetAt(0));
- compiler->GenerateStaticCall(instance_call()->deopt_id(),
- instance_call()->token_pos(),
- instance_call()->try_index(),
- target,
- instance_call()->ArgumentCount(),
- instance_call()->argument_names(),
- locs());
- }
- __ 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