ExternalReference ExternalReference::store_buffer_top(Isolate* isolate) {
- return ExternalReference(isolate->heap()->store_buffer()->TopAddress());
+ return ExternalReference(isolate->heap()->store_buffer_top_address());
}
roots_[kEmptyScriptRootIndex] = script;
}
- void public_set_store_buffer_top(Address* top) {
- roots_[kStoreBufferTopRootIndex] = reinterpret_cast<Smi*>(top);
- }
-
void public_set_materialized_objects(FixedArray* objects) {
roots_[kMaterializedObjectsRootIndex] = objects;
}
// Generated code can embed this address to get access to the roots.
Object** roots_array_start() { return roots_; }
- Address* store_buffer_top_address() {
- return reinterpret_cast<Address*>(&roots_[kStoreBufferTopRootIndex]);
- }
-
void CheckHandleCount();
// Number of "runtime allocations" done so far.
return index < OBJECT_STATS_COUNT ? object_sizes_last_time_[index] : 0;
}
- // Write barrier support for address[offset] = o.
- INLINE(void RecordWrite(Address address, int offset));
-
- // Write barrier support for address[start : start + len[ = o.
- INLINE(void RecordWrites(Address address, int start, int len));
-
inline HeapState gc_state() { return gc_state_; }
inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; }
void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature);
- ExternalStringTable* external_string_table() {
- return &external_string_table_;
- }
-
bool concurrent_sweeping_enabled() { return concurrent_sweeping_enabled_; }
inline bool OldGenerationAllocationLimitReached();
return &mark_compact_collector_;
}
- StoreBuffer* store_buffer() { return &store_buffer_; }
+ ExternalStringTable* external_string_table() {
+ return &external_string_table_;
+ }
// ===========================================================================
// Inline allocation. ========================================================
ObjectSlotCallback callback);
// ===========================================================================
+ // Store buffer API. =========================================================
+ // ===========================================================================
+
+ // Write barrier support for address[offset] = o.
+ INLINE(void RecordWrite(Address address, int offset));
+
+ // Write barrier support for address[start : start + len[ = o.
+ INLINE(void RecordWrites(Address address, int start, int len));
+
+ Address* store_buffer_top_address() {
+ return reinterpret_cast<Address*>(&roots_[kStoreBufferTopRootIndex]);
+ }
+
+ // ===========================================================================
// Incremental marking API. ==================================================
// ===========================================================================
ROOT_LIST(ROOT_ACCESSOR)
#undef ROOT_ACCESSOR
+ StoreBuffer* store_buffer() { return &store_buffer_; }
+
void set_current_gc_flags(int flags) {
current_gc_flags_ = flags;
DCHECK(!ShouldFinalizeIncrementalMarking() ||
friend class MarkCompactMarkingVisitor;
friend class MapCompact;
friend class Page;
+ friend class StoreBuffer;
// Used in cctest.
friend class HeapTester;
}
-static void VerifyValidStoreAndSlotsBufferEntries(Heap* heap) {
- heap->store_buffer()->VerifyValidStoreBufferEntries();
+void MarkCompactCollector::VerifyValidStoreAndSlotsBufferEntries() {
+ heap()->store_buffer()->VerifyValidStoreBufferEntries();
- VerifyValidSlotsBufferEntries(heap, heap->old_space());
- VerifyValidSlotsBufferEntries(heap, heap->code_space());
- VerifyValidSlotsBufferEntries(heap, heap->map_space());
+ VerifyValidSlotsBufferEntries(heap(), heap()->old_space());
+ VerifyValidSlotsBufferEntries(heap(), heap()->code_space());
+ VerifyValidSlotsBufferEntries(heap(), heap()->map_space());
- LargeObjectIterator it(heap->lo_space());
+ LargeObjectIterator it(heap()->lo_space());
for (HeapObject* object = it.Next(); object != NULL; object = it.Next()) {
MemoryChunk* chunk = MemoryChunk::FromAddress(object->address());
- SlotsBuffer::VerifySlots(heap, chunk->slots_buffer());
+ SlotsBuffer::VerifySlots(heap(), chunk->slots_buffer());
}
}
#endif
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
- VerifyValidStoreAndSlotsBufferEntries(heap_);
+ VerifyValidStoreAndSlotsBufferEntries();
}
#endif
enum SweepingParallelism { SWEEP_ON_MAIN_THREAD, SWEEP_IN_PARALLEL };
#ifdef VERIFY_HEAP
+ void VerifyValidStoreAndSlotsBufferEntries();
void VerifyMarkbitsAreClean();
static void VerifyMarkbitsAreClean(PagedSpace* space);
static void VerifyMarkbitsAreClean(NewSpace* space);
namespace v8 {
namespace internal {
-Address StoreBuffer::TopAddress() {
- return reinterpret_cast<Address>(heap_->store_buffer_top_address());
-}
-
-
void StoreBuffer::Mark(Address addr) {
DCHECK(!heap_->code_space()->Contains(addr));
Address* top = reinterpret_cast<Address*>(heap_->store_buffer_top());
*top++ = addr;
- heap_->public_set_store_buffer_top(top);
+ heap_->set_store_buffer_top(reinterpret_cast<Smi*>(top));
if ((reinterpret_cast<uintptr_t>(top) & kStoreBufferOverflowBit) != 0) {
DCHECK(top == limit_);
Compact();
false)) { // Not executable.
V8::FatalProcessOutOfMemory("StoreBuffer::SetUp");
}
- heap_->public_set_store_buffer_top(start_);
+ heap_->set_store_buffer_top(reinterpret_cast<Smi*>(start_));
hash_set_1_ = new uintptr_t[kHashSetLength];
hash_set_2_ = new uintptr_t[kHashSetLength];
delete[] hash_set_2_;
old_start_ = old_top_ = old_limit_ = old_reserved_limit_ = NULL;
start_ = limit_ = NULL;
- heap_->public_set_store_buffer_top(start_);
+ heap_->set_store_buffer_top(reinterpret_cast<Smi*>(start_));
}
// There's no check of the limit in the loop below so we check here for
// the worst case (compaction doesn't eliminate any pointers).
DCHECK(top <= limit_);
- heap_->public_set_store_buffer_top(start_);
+ heap_->set_store_buffer_top(reinterpret_cast<Smi*>(start_));
EnsureSpace(top - start_);
DCHECK(may_move_store_buffer_entries_);
// Goes through the addresses in the store buffer attempting to remove
static void StoreBufferOverflow(Isolate* isolate);
- inline Address TopAddress();
-
void SetUp();
void TearDown();