ASSERT(MB >= Page::kPageSize);
memset(roots_, 0, sizeof(roots_[0]) * kRootListLength);
- native_contexts_list_ = NULL;
- array_buffers_list_ = Smi::FromInt(0);
- allocation_sites_list_ = Smi::FromInt(0);
+ set_native_contexts_list(NULL);
+ set_array_buffers_list(Smi::FromInt(0));
+ set_allocation_sites_list(Smi::FromInt(0));
// Put a dummy entry in the remembered pages so we can find the list the
// minidump even if there are no real unmapped pages.
RememberUnmappedPage(NULL, false);
void Heap::ClearJSFunctionResultCaches() {
if (isolate_->bootstrapper()->IsActive()) return;
- Object* context = native_contexts_list_;
+ Object* context = native_contexts_list();
while (!context->IsUndefined()) {
// Get the caches for this context. GC can happen when the context
// is not fully initialized, so the caches can be undefined.
return;
}
- Object* context = native_contexts_list_;
+ Object* context = native_contexts_list();
while (!context->IsUndefined()) {
// GC can happen when the context is not fully initialized,
// so the cache can be undefined.
collector->code_flusher()->IteratePointersToFromSpace(&scavenge_visitor);
}
- // Scavenge object reachable from the native contexts list directly.
- scavenge_visitor.VisitPointer(BitCast<Object**>(&native_contexts_list_));
-
new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
while (isolate()->global_handles()->IterateObjectGroups(
VisitWeakList<Context>(
this, native_contexts_list(), retainer, record_slots);
// Update the head of the list of contexts.
- native_contexts_list_ = head;
+ set_native_contexts_list(head);
}
Runtime::FreeArrayBuffer(isolate(), buffer);
o = buffer->weak_next();
}
- array_buffers_list_ = undefined;
+ set_array_buffers_list(undefined);
}
CreateInitialObjects();
CHECK_EQ(0, gc_count_);
- native_contexts_list_ = undefined_value();
- array_buffers_list_ = undefined_value();
- allocation_sites_list_ = undefined_value();
+ set_native_contexts_list(undefined_value());
+ set_array_buffers_list(undefined_value());
+ set_allocation_sites_list(undefined_value());
weak_object_to_code_table_ = undefined_value();
return true;
}
void set_native_contexts_list(Object* object) {
native_contexts_list_ = object;
}
- Object* native_contexts_list() { return native_contexts_list_; }
+ Object* native_contexts_list() const { return native_contexts_list_; }
void set_array_buffers_list(Object* object) {
array_buffers_list_ = object;
}
- Object* array_buffers_list() { return array_buffers_list_; }
+ Object* array_buffers_list() const { return array_buffers_list_; }
void set_allocation_sites_list(Object* object) {
allocation_sites_list_ = object;
}
Object* allocation_sites_list() { return allocation_sites_list_; }
+
+ // Used in CreateAllocationSiteStub and the (de)serializer.
Object** allocation_sites_list_address() { return &allocation_sites_list_; }
Object* weak_object_to_code_table() { return weak_object_to_code_table_; }
return reinterpret_cast<Address*>(&roots_[kStoreBufferTopRootIndex]);
}
- // Get address of native contexts list for serialization support.
- Object** native_contexts_list_address() {
- return &native_contexts_list_;
- }
-
#ifdef VERIFY_HEAP
// Verify the heap is in its normal state before or after a GC.
void Verify();
void MarkCompactCollector::ProcessMapCaches() {
- Object* raw_context = heap()->native_contexts_list_;
+ Object* raw_context = heap()->native_contexts_list();
while (raw_context != heap()->undefined_value()) {
Context* context = reinterpret_cast<Context*>(raw_context);
if (IsMarked(context)) {
}
}
- // Update the head of the native contexts list in the heap.
- updating_visitor.VisitPointer(heap_->native_contexts_list_address());
-
heap_->string_table()->Iterate(&updating_visitor);
updating_visitor.VisitPointer(heap_->weak_object_to_code_table_address());
if (heap_->weak_object_to_code_table()->IsHashTable()) {