Chromium Code Reviews

Unified Diff: src/objects-inl.h

Issue 1124583003: Don't perform marking barrier for weak cell values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 4fde394864d57c25320473bfb6cbd9dd021e9cba..73fcaf0444b284e9538c26e3f2156365e72b9d6b 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);
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine