Chromium Code Reviews| Index: runtime/vm/intermediate_language_x64.cc |
| =================================================================== |
| --- runtime/vm/intermediate_language_x64.cc (revision 10728) |
| +++ runtime/vm/intermediate_language_x64.cc (working copy) |
| @@ -638,8 +638,8 @@ |
| LocationSummary* RelationalOpComp::MakeLocationSummary() const { |
| + const intptr_t kNumInputs = 2; |
| if (operands_class_id() == kSmiCid || operands_class_id() == kDoubleCid) { |
| - const intptr_t kNumInputs = 2; |
| const intptr_t kNumTemps = 1; |
| LocationSummary* summary = |
| new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| @@ -649,7 +649,13 @@ |
| summary->set_temp(0, Location::RequiresRegister()); |
| return summary; |
| } |
| - return MakeCallSummary(); |
| + const intptr_t kNumTemps = 0; |
| + LocationSummary* locs = |
| + new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| + locs->set_in(0, Location::RegisterLocation(RAX)); |
| + locs->set_in(1, Location::RegisterLocation(RCX)); |
| + locs->set_out(Location::RegisterLocation(RAX)); |
| + return locs; |
| } |
| @@ -668,15 +674,23 @@ |
| Label* deopt = compiler->AddDeoptStub(deopt_id(), |
| try_index(), |
| kDeoptRelationalOp); |
| - // Load receiver into RAX, class into RDI. |
| + // Push arguments for the call. |
| + // TODO(fschneider): Split this instruction into different types to avoid |
| + // explicitly pushing arguments to the call here. |
| + Register left = locs()->in(0).reg(); |
| + Register right = locs()->in(1).reg(); |
| + __ pushq(left); |
| + __ pushq(right); |
| + |
|
srdjan
2012/08/15 21:48:38
ditto
Florian Schneider
2012/08/16 08:30:37
Done.
|
| + // Load class into RDI. |
| + ASSERT((left != RDI) && (right != RDI)); |
| Label done; |
| - const intptr_t kNumArguments = 2; |
| __ movq(RDI, Immediate(kSmiCid)); |
| - __ movq(RAX, Address(RSP, (kNumArguments - 1) * kWordSize)); |
| - __ testq(RAX, Immediate(kSmiTagMask)); |
| + __ testq(left, Immediate(kSmiTagMask)); |
| __ j(ZERO, &done); |
| - __ LoadClassId(RDI, RAX); |
| + __ LoadClassId(RDI, left); |
| __ Bind(&done); |
| + const intptr_t kNumArguments = 2; |
| compiler->EmitTestAndCall(ICData::Handle(ic_data()->AsUnaryClassChecks()), |
| RDI, // Class id register. |
| kNumArguments, |
| @@ -687,8 +701,17 @@ |
| token_pos(), |
| try_index(), |
| locs()->stack_bitmap()); |
| + ASSERT(locs()->out().reg() == RAX); |
| return; |
| } |
| + // Push arguments to the call. |
| + // TODO(fschneider): Split this instruction into different types to avoid |
| + // explicitly pushing arguments to the call here. |
| + Register left = locs()->in(0).reg(); |
| + Register right = locs()->in(1).reg(); |
| + __ pushq(left); |
| + __ pushq(right); |
| + |
| const String& function_name = |
| String::ZoneHandle(Symbols::New(Token::Str(kind()))); |
| compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |