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

Unified Diff: runtime/vm/intermediate_language_ia32.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/flow_graph_compiler_x64.h ('k') | 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 11414)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -718,7 +718,6 @@
kNumArguments,
Array::Handle(), // No named arguments.
deopt, // Deoptimize target.
- NULL, // Fallthrough when done.
deopt_id(),
token_pos(),
try_index(),
@@ -2134,40 +2133,27 @@
locs());
return;
}
- Label handle_smi;
- Label* is_smi_label =
- ic_data()->GetReceiverClassIdAt(0) == kSmiCid ? &handle_smi : deopt;
// Load receiver into EAX.
__ movl(EAX,
Address(ESP, (instance_call()->ArgumentCount() - 1) * kWordSize));
- __ testl(EAX, Immediate(kSmiTagMask));
- __ j(ZERO, is_smi_label);
+
Label done;
+ __ movl(EDI, Immediate(kSmiCid));
+ __ testl(EAX, Immediate(kSmiTagMask));
+ __ j(ZERO, &done);
__ LoadClassId(EDI, EAX);
+ __ Bind(&done);
+
compiler->EmitTestAndCall(*ic_data(),
EDI, // 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/flow_graph_compiler_x64.h ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698