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

Unified Diff: src/heap.cc

Issue 548149: Another step on the way to context snapshots. We can now refer to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 11 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 | « src/heap.h ('k') | src/mksnapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 3696)
+++ src/heap.cc (working copy)
@@ -3344,6 +3344,11 @@
void Heap::IterateRoots(ObjectVisitor* v, VisitMode mode) {
IterateStrongRoots(v, mode);
+ IterateWeakRoots(v, mode);
+}
+
+
+void Heap::IterateWeakRoots(ObjectVisitor* v, VisitMode mode) {
v->VisitPointer(reinterpret_cast<Object**>(&roots_[kSymbolTableRootIndex]));
v->Synchronize("symbol_table");
if (mode != VISIT_ALL_IN_SCAVENGE) {
@@ -3398,6 +3403,20 @@
// Iterate over pointers being held by inactive threads.
ThreadManager::Iterate(v);
v->Synchronize("threadmanager");
+
+ // Iterate over the pointers the Serialization/Deserialization code is
+ // holding.
+ // During garbage collection this keeps the partial snapshot cache alive.
+ // During deserialization of the startup snapshot this creates the partial
+ // snapshot cache and deserializes the objects it refers to. During
+ // serialization this does nothing, since the partial snapshot cache is
+ // empty. However the next thing we do is create the partial snapshot,
+ // filling up the partial snapshot cache with objects it needs as we go.
+ SerializerDeserializer::Iterate(v);
+ // We don't do a v->Synchronize call here, because in debug mode that will
+ // output a flag to the snapshot. However at this point the serializer and
+ // deserializer are deliberately a little unsynchronized (see above) so the
+ // checking of the sync flag in the snapshot would fail.
}
« no previous file with comments | « src/heap.h ('k') | src/mksnapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698