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

Unified Diff: vm/intermediate_language_x64.cc

Issue 10425007: Move two more instructions to intermediate_language_x64.cc. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | « vm/flow_graph_compiler_x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/intermediate_language_x64.cc
===================================================================
--- vm/intermediate_language_x64.cc (revision 7916)
+++ vm/intermediate_language_x64.cc (working copy)
@@ -369,24 +369,49 @@
void AllocateObjectComp::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ const Class& cls = Class::ZoneHandle(constructor().owner());
+ const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls));
+ const ExternalLabel label(cls.ToCString(), stub.EntryPoint());
+ compiler->GenerateCall(token_index(),
+ try_index(),
+ &label,
+ PcDescriptors::kOther);
+ __ Drop(arguments().length()); // Discard arguments.
}
LocationSummary* AllocateObjectComp::MakeLocationSummary() const {
- return NULL;
+ return MakeCallSummary();
}
void AllocateObjectWithBoundsCheckComp::EmitNativeCode(
FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ const Class& cls = Class::ZoneHandle(constructor().owner());
+ Register type_arguments = locs()->in(0).reg();
+ Register instantiator_type_arguments = locs()->in(1).reg();
+ Register result = locs()->out().reg();
+
+ // Push the result place holder initialized to NULL.
+ __ PushObject(Object::ZoneHandle());
+ __ pushq(Immediate(Smi::RawValue(token_index())));
+ __ PushObject(cls);
+ __ pushq(type_arguments);
+ __ pushq(instantiator_type_arguments);
+ compiler->GenerateCallRuntime(cid(),
+ token_index(),
+ try_index(),
+ kAllocateObjectWithBoundsCheckRuntimeEntry);
+ // Pop instantiator type arguments, type arguments, class, and
+ // source location.
+ __ Drop(4);
+ __ popq(result); // Pop new instance.
}
LocationSummary* AllocateObjectWithBoundsCheckComp::
MakeLocationSummary() const {
- return NULL;
+ return MakeSimpleLocationSummary(2, Location::RequiresRegister());
}
« no previous file with comments | « vm/flow_graph_compiler_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698