| Index: src/x64/lithium-codegen-x64.cc
|
| ===================================================================
|
| --- src/x64/lithium-codegen-x64.cc (revision 9327)
|
| +++ src/x64/lithium-codegen-x64.cc (working copy)
|
| @@ -223,11 +223,8 @@
|
| // Store it in the context.
|
| int context_offset = Context::SlotOffset(var->index());
|
| __ movq(Operand(rsi, context_offset), rax);
|
| - // Update the write barrier. This clobbers all involved
|
| - // registers, so we have use a third register to avoid
|
| - // clobbering rsi.
|
| - __ movq(rcx, rsi);
|
| - __ RecordWrite(rcx, context_offset, rax, rbx);
|
| + // Update the write barrier. This clobbers rax and rbx.
|
| + __ RecordWriteContextSlot(rsi, context_offset, rax, rbx, kSaveFPRegs);
|
| }
|
| }
|
| Comment(";;; End allocate local context");
|
| @@ -673,7 +670,7 @@
|
| int deoptimization_index) {
|
| ASSERT(kind == expected_safepoint_kind_);
|
|
|
| - const ZoneList<LOperand*>* operands = pointers->operands();
|
| + const ZoneList<LOperand*>* operands = pointers->GetNormalizedOperands();
|
|
|
| Safepoint safepoint = safepoints_.DefineSafepoint(masm(),
|
| kind, arguments, deoptimization_index);
|
| @@ -2025,25 +2022,39 @@
|
|
|
|
|
| void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
|
| + Register object = ToRegister(instr->TempAt(0));
|
| + Register address = ToRegister(instr->TempAt(1));
|
| Register value = ToRegister(instr->InputAt(0));
|
| - Register temp = ToRegister(instr->TempAt(0));
|
| - ASSERT(!value.is(temp));
|
| - bool check_hole = instr->hydrogen()->check_hole_value();
|
| - if (!check_hole && value.is(rax)) {
|
| - __ store_rax(instr->hydrogen()->cell().location(),
|
| - RelocInfo::GLOBAL_PROPERTY_CELL);
|
| - return;
|
| - }
|
| + ASSERT(!value.is(object));
|
| + Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell());
|
| +
|
| + __ movq(address, cell_handle, RelocInfo::GLOBAL_PROPERTY_CELL);
|
| +
|
| // If the cell we are storing to contains the hole it could have
|
| // been deleted from the property dictionary. In that case, we need
|
| // to update the property details in the property dictionary to mark
|
| // it as no longer deleted. We deoptimize in that case.
|
| - __ movq(temp, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL);
|
| - if (check_hole) {
|
| - __ CompareRoot(Operand(temp, 0), Heap::kTheHoleValueRootIndex);
|
| + if (instr->hydrogen()->check_hole_value()) {
|
| + __ CompareRoot(Operand(address, 0), Heap::kTheHoleValueRootIndex);
|
| DeoptimizeIf(equal, instr->environment());
|
| }
|
| - __ movq(Operand(temp, 0), value);
|
| +
|
| + // Store the value.
|
| + __ movq(Operand(address, 0), value);
|
| +
|
| + Label smi_store;
|
| + __ JumpIfSmi(value, &smi_store, Label::kNear);
|
| +
|
| + int offset = JSGlobalPropertyCell::kValueOffset - kHeapObjectTag;
|
| + __ lea(object, Operand(address, -offset));
|
| + // Cells are always in the remembered set.
|
| + __ RecordWrite(object,
|
| + address,
|
| + value,
|
| + kSaveFPRegs,
|
| + OMIT_REMEMBERED_SET,
|
| + OMIT_SMI_CHECK);
|
| + __ bind(&smi_store);
|
| }
|
|
|
|
|
| @@ -2073,7 +2084,7 @@
|
| if (instr->needs_write_barrier()) {
|
| int offset = Context::SlotOffset(instr->slot_index());
|
| Register scratch = ToRegister(instr->TempAt(0));
|
| - __ RecordWrite(context, offset, value, scratch);
|
| + __ RecordWriteContextSlot(context, offset, value, scratch, kSaveFPRegs);
|
| }
|
| }
|
|
|
| @@ -3042,7 +3053,7 @@
|
| if (instr->needs_write_barrier()) {
|
| Register temp = ToRegister(instr->TempAt(0));
|
| // Update the write barrier for the object for in-object properties.
|
| - __ RecordWrite(object, offset, value, temp);
|
| + __ RecordWriteField(object, offset, value, temp, kSaveFPRegs);
|
| }
|
| } else {
|
| Register temp = ToRegister(instr->TempAt(0));
|
| @@ -3051,7 +3062,7 @@
|
| if (instr->needs_write_barrier()) {
|
| // Update the write barrier for the properties array.
|
| // object is used as a scratch register.
|
| - __ RecordWrite(temp, offset, value, object);
|
| + __ RecordWriteField(temp, offset, value, object, kSaveFPRegs);
|
| }
|
| }
|
| }
|
| @@ -3155,7 +3166,7 @@
|
| key,
|
| times_pointer_size,
|
| FixedArray::kHeaderSize));
|
| - __ RecordWrite(elements, key, value);
|
| + __ RecordWrite(elements, key, value, kSaveFPRegs);
|
| }
|
| }
|
|
|
|
|