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

Unified Diff: src/serialize.cc

Issue 355041: Made iteration of global handles more efficient on scavenges. (Closed)
Patch Set: Created 11 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
« src/global-handles.cc ('K') | « src/mark-compact.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index 3c333d068893408078b321408c2f6e3646d297bf..47a320e2b273cbb3ce0e02406756f898b4882bb8 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -1097,7 +1097,7 @@ void Serializer::Serialize() {
InitializeAllocators();
reference_encoder_ = new ExternalReferenceEncoder();
PutHeader();
- Heap::IterateRoots(this);
+ Heap::IterateRoots(this, VISIT_ONLY_STRONG);
PutLog();
PutContextStack();
Disable();
@@ -1200,7 +1200,7 @@ void Serializer::PutHeader() {
writer_->PutC('G');
writer_->PutC('[');
GlobalHandlesRetriever ghr(&global_handles_);
- GlobalHandles::IterateRoots(&ghr);
+ GlobalHandles::IterateStrongRoots(&ghr);
for (int i = 0; i < global_handles_.length(); i++) {
writer_->PutC('N');
}
@@ -1437,7 +1437,7 @@ class GlobalHandleDestroyer : public ObjectVisitor {
void Deserializer::Deserialize() {
// No global handles.
NoGlobalHandlesChecker checker;
- GlobalHandles::IterateRoots(&checker);
+ GlobalHandles::IterateStrongRoots(&checker);
// No active threads.
ASSERT_EQ(NULL, ThreadState::FirstInUse());
// No active handles.
@@ -1446,12 +1446,12 @@ void Deserializer::Deserialize() {
// By setting linear allocation only, we forbid the use of free list
// allocation which is not predicted by SimulatedAddress.
GetHeader();
- Heap::IterateRoots(this);
+ Heap::IterateRoots(this, VISIT_ONLY_STRONG);
GetContextStack();
// Any global handles that have been set up by deserialization are leaked
// since noone is keeping track of them. So we discard them now.
GlobalHandleDestroyer destroyer;
- GlobalHandles::IterateRoots(&destroyer);
+ GlobalHandles::IterateStrongRoots(&destroyer);
}
@@ -1854,7 +1854,7 @@ void Deserializer2::Deserialize() {
ASSERT(HandleScopeImplementer::instance()->blocks()->is_empty());
ASSERT(external_reference_decoder_ == NULL);
external_reference_decoder_ = new ExternalReferenceDecoder();
- Heap::IterateRoots(this);
+ Heap::IterateRoots(this, VISIT_ONLY_STRONG);
ASSERT(source_->AtEOF());
delete external_reference_decoder_;
external_reference_decoder_ = NULL;
@@ -2125,7 +2125,7 @@ void Serializer2::Serialize() {
CHECK_EQ(0, GlobalHandles::NumberOfWeakHandles());
ASSERT(external_reference_encoder_ == NULL);
external_reference_encoder_ = new ExternalReferenceEncoder();
- Heap::IterateRoots(this);
+ Heap::IterateRoots(this, VISIT_ONLY_STRONG);
delete external_reference_encoder_;
external_reference_encoder_ = NULL;
}
« src/global-handles.cc ('K') | « src/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698