| Index: src/x64/codegen-x64.cc
|
| diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc
|
| index d30ca498f04c249fef010713138fdfd5ac98b67a..939051b0f0c9d45fff4d20ad067215d28237489c 100644
|
| --- a/src/x64/codegen-x64.cc
|
| +++ b/src/x64/codegen-x64.cc
|
| @@ -184,26 +184,29 @@ ModuloFunction CreateModuloFunction() {
|
| #define __ ACCESS_MASM(masm)
|
|
|
| void ElementsTransitionGenerator::GenerateMapChangeElementsTransition(
|
| - MacroAssembler* masm, AllocationSiteMode mode,
|
| + MacroAssembler* masm,
|
| + Register receiver,
|
| + Register key,
|
| + Register value,
|
| + Register target_map,
|
| + AllocationSiteMode mode,
|
| Label* allocation_memento_found) {
|
| - // ----------- S t a t e -------------
|
| - // -- rax : value
|
| - // -- rbx : target map
|
| - // -- rcx : key
|
| - // -- rdx : receiver
|
| - // -- rsp[0] : return address
|
| - // -----------------------------------
|
| + // Return address is on the stack.
|
| + Register scratch = rdi;
|
| + ASSERT(!AreAliased(receiver, key, value, target_map, scratch));
|
| +
|
| if (mode == TRACK_ALLOCATION_SITE) {
|
| ASSERT(allocation_memento_found != NULL);
|
| - __ JumpIfJSArrayHasAllocationMemento(rdx, rdi, allocation_memento_found);
|
| + __ JumpIfJSArrayHasAllocationMemento(
|
| + receiver, scratch, allocation_memento_found);
|
| }
|
|
|
| // Set transitioned map.
|
| - __ movp(FieldOperand(rdx, HeapObject::kMapOffset), rbx);
|
| - __ RecordWriteField(rdx,
|
| + __ movp(FieldOperand(receiver, HeapObject::kMapOffset), target_map);
|
| + __ RecordWriteField(receiver,
|
| HeapObject::kMapOffset,
|
| - rbx,
|
| - rdi,
|
| + target_map,
|
| + scratch,
|
| kDontSaveFPRegs,
|
| EMIT_REMEMBERED_SET,
|
| OMIT_SMI_CHECK);
|
| @@ -211,14 +214,19 @@ void ElementsTransitionGenerator::GenerateMapChangeElementsTransition(
|
|
|
|
|
| void ElementsTransitionGenerator::GenerateSmiToDouble(
|
| - MacroAssembler* masm, AllocationSiteMode mode, Label* fail) {
|
| - // ----------- S t a t e -------------
|
| - // -- rax : value
|
| - // -- rbx : target map
|
| - // -- rcx : key
|
| - // -- rdx : receiver
|
| - // -- rsp[0] : return address
|
| - // -----------------------------------
|
| + MacroAssembler* masm,
|
| + Register receiver,
|
| + Register key,
|
| + Register value,
|
| + Register target_map,
|
| + AllocationSiteMode mode,
|
| + Label* fail) {
|
| + // Return address is on the stack.
|
| + ASSERT(receiver.is(rdx));
|
| + ASSERT(key.is(rcx));
|
| + ASSERT(value.is(rax));
|
| + ASSERT(target_map.is(rbx));
|
| +
|
| // The fail label is not actually used since we do not allocate.
|
| Label allocated, new_backing_store, only_change_map, done;
|
|
|
| @@ -345,14 +353,19 @@ void ElementsTransitionGenerator::GenerateSmiToDouble(
|
|
|
|
|
| void ElementsTransitionGenerator::GenerateDoubleToObject(
|
| - MacroAssembler* masm, AllocationSiteMode mode, Label* fail) {
|
| - // ----------- S t a t e -------------
|
| - // -- rax : value
|
| - // -- rbx : target map
|
| - // -- rcx : key
|
| - // -- rdx : receiver
|
| - // -- rsp[0] : return address
|
| - // -----------------------------------
|
| + MacroAssembler* masm,
|
| + Register receiver,
|
| + Register key,
|
| + Register value,
|
| + Register target_map,
|
| + AllocationSiteMode mode,
|
| + Label* fail) {
|
| + // Return address is on the stack.
|
| + ASSERT(receiver.is(rdx));
|
| + ASSERT(key.is(rcx));
|
| + ASSERT(value.is(rax));
|
| + ASSERT(target_map.is(rbx));
|
| +
|
| Label loop, entry, convert_hole, gc_required, only_change_map;
|
|
|
| if (mode == TRACK_ALLOCATION_SITE) {
|
|
|