From fff4f8e1bf7b28493634662e0cb89c510ead05c6 Mon Sep 17 00:00:00 2001 From: hpayer Date: Mon, 4 May 2015 05:15:38 -0700 Subject: [PATCH] Don't perform marking barrier for weak cell values. BUG= Review URL: https://codereview.chromium.org/1124583003 Cr-Commit-Position: refs/heads/master@{#28196} --- src/objects-inl.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/objects-inl.h b/src/objects-inl.h index 4fde394864..73fcaf0444 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -1917,7 +1917,13 @@ void WeakCell::clear() { void WeakCell::initialize(HeapObject* val) { WRITE_FIELD(this, kValueOffset, val); - WRITE_BARRIER(GetHeap(), this, kValueOffset, val); + Heap* heap = GetHeap(); + // We just have to execute the generational barrier here because we never + // mark through a weak cell and collect evacuation candidates when we process + // all weak cells. + if (heap->InNewSpace(val)) { + heap->RecordWrite(address(), kValueOffset); + } }