Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« 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
This is Rietveld 408576698