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

Unified Diff: src/heap/objects-visiting.cc

Issue 1463483002: [heap] Move slot recording of weak fields in native context to native context list retainer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/objects-visiting.cc
diff --git a/src/heap/objects-visiting.cc b/src/heap/objects-visiting.cc
index 22d3aba7ec6cc0a1aeac9db70a3fc31705e739fc..c56db57c2331ca53f761b18acb2daafc5118a742 100644
--- a/src/heap/objects-visiting.cc
+++ b/src/heap/objects-visiting.cc
@@ -307,9 +307,17 @@ struct WeakListVisitor<Context> {
DoWeakList<JSFunction>(heap, context, retainer,
Context::OPTIMIZED_FUNCTIONS_LIST);
- // Code objects are always allocated in Code space, we do not have to visit
- // them during scavenges.
if (heap->gc_state() == Heap::MARK_COMPACT) {
+ // Record the slots of the weak entries in the native context.
+ MarkCompactCollector* collector = heap->mark_compact_collector();
+ for (int idx = Context::FIRST_WEAK_SLOT;
+ idx < Context::NATIVE_CONTEXT_SLOTS; ++idx) {
+ Object** slot = Context::cast(context)->RawFieldOfElementAt(idx);
+ collector->RecordSlot(context, slot, *slot);
+ }
+ // Code objects are always allocated in Code space, we do not have to
+ // visit
+ // them during scavenges.
DoWeakList<Code>(heap, context, retainer, Context::OPTIMIZED_CODE_LIST);
DoWeakList<Code>(heap, context, retainer, Context::DEOPTIMIZED_CODE_LIST);
}
« no previous file with comments | « no previous file | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698