From f3b95f11d29b87047539acfd60f87137b48364fd Mon Sep 17 00:00:00 2001 From: "hpayer@chromium.org" Date: Tue, 11 Feb 2014 10:52:30 +0000 Subject: [PATCH] Make sure that allocation site scratchpad entries get recorded. BUG= R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/153173008 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/heap.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/heap.cc b/src/heap.cc index 5ede02c..099012e 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -3621,8 +3621,14 @@ void Heap::InitializeAllocationSitesScratchpad() { void Heap::AddAllocationSiteToScratchpad(AllocationSite* site) { if (allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize) { + // We cannot use the normal write-barrier because slots need to be + // recorded with non-incremental marking as well. We have to explicitly + // record the slot to take evacuation candidates into account. allocation_sites_scratchpad()->set( - allocation_sites_scratchpad_length_, site); + allocation_sites_scratchpad_length_, site, SKIP_WRITE_BARRIER); + Object** slot = allocation_sites_scratchpad()->RawFieldOfElementAt( + allocation_sites_scratchpad_length_); + mark_compact_collector()->RecordSlot(slot, slot, *slot); allocation_sites_scratchpad_length_++; } } -- 2.7.4