| Index: src/heap.cc
|
| diff --git a/src/heap.cc b/src/heap.cc
|
| index 23bfbd807d8d1430e4e38c3dc9044c41652dfe3f..51408a9dc0e7f72d9993f5e2695ef823d5a38b4f 100644
|
| --- a/src/heap.cc
|
| +++ b/src/heap.cc
|
| @@ -51,6 +51,7 @@
|
| namespace v8 {
|
| namespace internal {
|
|
|
| +Atomic32 RootsPartitioner::partitions_state_[kNumberOfRootsPartitions];
|
|
|
| String* Heap::hidden_symbol_;
|
| Object* Heap::roots_[Heap::kRootListLength];
|
| @@ -4039,6 +4040,69 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) {
|
| }
|
|
|
|
|
| +void Heap::ClaimAndIterateStrongRootsGroup(ObjectVisitor* v,
|
| + VisitMode mode,
|
| + RootsPartition partition) {
|
| + if (!RootsPartitioner::Claim(partition)) return;
|
| +
|
| + switch (partition) {
|
| + case kStrongRootsList:
|
| + v->VisitPointers(&roots_[0], &roots_[kStrongRootListLength]);
|
| + v->VisitPointer(BitCast<Object**>(&hidden_symbol_));
|
| + break;
|
| +
|
| + case kBootstrapperRoots:
|
| + Bootstrapper::Iterate(v);
|
| + break;
|
| +
|
| + case kTopRoots:
|
| + Top::Iterate(v);
|
| + break;
|
| +
|
| + case kRelocatableRoots:
|
| + Relocatable::Iterate(v);
|
| + break;
|
| +
|
| +#ifdef ENABLE_DEBUGGER_SUPPORT
|
| + case kDebugRoots:
|
| + Debug::Iterate(v);
|
| + break;
|
| +#endif
|
| +
|
| + case kCompilationCacheRoots:
|
| + CompilationCache::Iterate(v);
|
| + break;
|
| +
|
| + case kHandleScopeRoots:
|
| + HandleScopeImplementer::Iterate(v);
|
| + break;
|
| +
|
| + case kBuiltinsRoots:
|
| + if (mode != VISIT_ALL_IN_SCAVENGE) Builtins::IterateBuiltins(v);
|
| + break;
|
| +
|
| + case kGlobalHandlesRoots:
|
| + if (mode == VISIT_ONLY_STRONG) {
|
| + GlobalHandles::IterateStrongRoots(v);
|
| + } else {
|
| + GlobalHandles::IterateAllRoots(v);
|
| + }
|
| + break;
|
| +
|
| + case kThreadManagerRoots:
|
| + ThreadManager::Iterate(v);
|
| + break;
|
| +
|
| + case kSerializerDeserializerRoots:
|
| + SerializerDeserializer::Iterate(v);
|
| + break;
|
| +
|
| + default:
|
| + UNREACHABLE();
|
| + }
|
| +}
|
| +
|
| +
|
| // Flag is set when the heap has been configured. The heap can be repeatedly
|
| // configured through the API until it is setup.
|
| static bool heap_configured = false;
|
| @@ -4773,14 +4837,15 @@ GCTracer::GCTracer()
|
| gc_count_(0),
|
| full_gc_count_(0),
|
| is_compacting_(false),
|
| +#ifdef DEBUG
|
| marked_count_(0),
|
| +#endif
|
| allocated_since_last_gc_(0),
|
| spent_in_mutator_(0),
|
| promoted_objects_size_(0) {
|
| // These two fields reflect the state of the previous full collection.
|
| // Set them before they are changed by the collector.
|
| previous_has_compacted_ = MarkCompactCollector::HasCompacted();
|
| - previous_marked_count_ = MarkCompactCollector::previous_marked_count();
|
| if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return;
|
| start_time_ = OS::TimeCurrentMillis();
|
| start_size_ = Heap::SizeOfObjects();
|
|
|