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

Unified Diff: vm/intermediate_language_ia32.cc

Issue 10831176: Make CreateArrayComp a call by using explicit push-argument instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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
Index: vm/intermediate_language_ia32.cc
===================================================================
--- vm/intermediate_language_ia32.cc (revision 10278)
+++ vm/intermediate_language_ia32.cc (working copy)
@@ -1023,40 +1023,26 @@
LocationSummary* CreateArrayComp::MakeLocationSummary() const {
- // TODO(regis): The elements of the array could be considered as arguments to
- // CreateArrayComp, thereby making CreateArrayComp a call.
- // For VerifyCallComputation to work, CreateArrayComp would need an
- // ArgumentCount getter and an ArgumentAt getter.
- const intptr_t kNumInputs = 1;
- const intptr_t kNumTemps = 1;
- LocationSummary* locs =
- new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
- locs->set_in(0, Location::RegisterLocation(ECX));
- locs->set_temp(0, Location::RegisterLocation(EDX));
- locs->set_out(Location::RegisterLocation(EAX));
- return locs;
+ return MakeCallSummary();
}
void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) {
- Register temp_reg = locs()->temp(0).reg();
- Register result_reg = locs()->out().reg();
-
+ // TODO(fschneider): Support call-instructions that take inputs in registers.
// Allocate the array. EDX = length, ECX = element type.
- ASSERT(temp_reg == EDX);
- ASSERT(locs()->in(0).reg() == ECX);
- __ movl(temp_reg, Immediate(Smi::RawValue(ElementCount())));
+ __ popl(ECX);
+ __ movl(EDX, Immediate(Smi::RawValue(ElementCount())));
compiler->GenerateCall(token_pos(),
try_index(),
&StubCode::AllocateArrayLabel(),
PcDescriptors::kOther);
- ASSERT(result_reg == EAX);
+ ASSERT(locs()->out().reg() == EAX);
// Pop the element values from the stack into the array.
- __ leal(temp_reg, FieldAddress(result_reg, Array::data_offset()));
+ __ leal(EDX, FieldAddress(EAX, Array::data_offset()));
for (int i = ElementCount() - 1; i >= 0; --i) {
ASSERT(ElementAt(i)->IsUse());
- __ popl(Address(temp_reg, i * kWordSize));
+ __ popl(Address(EDX, i * kWordSize));
}
}

Powered by Google App Engine
This is Rietveld 408576698