Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 1278c2a50d8acb4e406920852b409d874a3770f4..fe20637a3dd74efbd5e73e08c89013501725c411 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -2038,13 +2038,14 @@ void WeakCell::clear() { |
void WeakCell::initialize(HeapObject* val) { |
WRITE_FIELD(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); |
- } |
+ WriteBarrierMode mode = |
+ Page::FromAddress(this->address())->IsFlagSet(Page::BLACK_PAGE) |
+ ? UPDATE_WRITE_BARRIER |
ulan
2016/02/10 10:27:39
Invoking the marking visitor of the weak cell migh
Hannes Payer (out of office)
2016/02/11 18:18:07
As discussed offline, this change was done on purp
|
+ : UPDATE_WEAK_WRITE_BARRIER; |
+ CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kValueOffset, val, mode); |
} |