| Index: src/heap/store-buffer.h
|
| diff --git a/src/heap/store-buffer.h b/src/heap/store-buffer.h
|
| index 1c985816413a11bd38f0d8c0b1f18edc0a55728d..09faf4dcbddba9c94eddf50e24a05ffb777e570c 100644
|
| --- a/src/heap/store-buffer.h
|
| +++ b/src/heap/store-buffer.h
|
| @@ -10,6 +10,7 @@
|
| #include "src/base/platform/platform.h"
|
| #include "src/cancelable-task.h"
|
| #include "src/globals.h"
|
| +#include "src/heap/remembered-set.h"
|
| #include "src/heap/slot-set.h"
|
|
|
| namespace v8 {
|
| @@ -28,7 +29,7 @@ class StoreBuffer {
|
| static const int kStoreBuffers = 2;
|
| static const intptr_t kDeletionTag = 1;
|
|
|
| - static void StoreBufferOverflow(Isolate* isolate);
|
| + V8_EXPORT_PRIVATE static void StoreBufferOverflow(Isolate* isolate);
|
|
|
| explicit StoreBuffer(Heap* heap);
|
| void SetUp();
|
| @@ -64,6 +65,23 @@ class StoreBuffer {
|
| // the more efficient Remove method will be called in this case.
|
| void DeleteEntry(Address start, Address end = nullptr);
|
|
|
| + void InsertEntry(Address slot) {
|
| + // Insertions coming from the GC are directly inserted into the remembered
|
| + // set. Insertions coming from the runtime are added to the store buffer to
|
| + // allow concurrent processing.
|
| + if (heap_->gc_state() == Heap::NOT_IN_GC) {
|
| + if (top_ + sizeof(Address) > limit_[current_]) {
|
| + StoreBufferOverflow(heap_->isolate());
|
| + }
|
| + *top_ = slot;
|
| + top_++;
|
| + } else {
|
| + // In GC the store buffer has to be empty at any time.
|
| + DCHECK(Empty());
|
| + RememberedSet<OLD_TO_NEW>::Insert(Page::FromAddress(slot), slot);
|
| + }
|
| + }
|
| +
|
| // Used by the concurrent processing thread to transfer entries from the
|
| // store buffer to the remembered set.
|
| void ConcurrentlyProcessStoreBuffer();
|
|
|