From d93a0029dc421e16946cc29187443ce979029e3c Mon Sep 17 00:00:00 2001 From: "chunyang.dai" Date: Mon, 13 Apr 2015 02:35:59 -0700 Subject: [PATCH] X87: Reland "Merge cellspace into old pointer space". port 4bd9bdbb28c0f4004b113534bf6082ec4d3385b9 (r27751) original commit message: BUG= Review URL: https://codereview.chromium.org/1051323003 Cr-Commit-Position: refs/heads/master@{#27778} --- src/x87/assembler-x87-inl.h | 1 + src/x87/code-stubs-x87.cc | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/x87/assembler-x87-inl.h b/src/x87/assembler-x87-inl.h index 800ead2..4f5768e 100644 --- a/src/x87/assembler-x87-inl.h +++ b/src/x87/assembler-x87-inl.h @@ -205,6 +205,7 @@ Cell* RelocInfo::target_cell() { void RelocInfo::set_target_cell(Cell* cell, WriteBarrierMode write_barrier_mode, ICacheFlushMode icache_flush_mode) { + DCHECK(cell->IsCell()); DCHECK(rmode_ == RelocInfo::CELL); Address address = cell->address() + Cell::kValueOffset; Memory::Address_at(pc_) = address; diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc index 1a21569..cba6734 100644 --- a/src/x87/code-stubs-x87.cc +++ b/src/x87/code-stubs-x87.cc @@ -2452,6 +2452,12 @@ void InstanceofStub::Generate(MacroAssembler* masm) { } __ mov(scratch, Operand(scratch, kDeltaToCmpImmediate)); __ mov(Operand(scratch, 0), map); + __ push(map); + // Scratch points at the cell payload. Calculate the start of the object. + __ sub(scratch, Immediate(Cell::kValueOffset - 1)); + __ RecordWriteField(scratch, Cell::kValueOffset, map, function, + kDontSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); + __ pop(map); } // Loop through the prototype chain of the object looking for the function -- 2.7.4