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

Unified Diff: src/heap/store-buffer-inl.h

Issue 1683653002: Add a generic remembered set class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months 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
« no previous file with comments | « src/heap/store-buffer.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/store-buffer-inl.h
diff --git a/src/heap/store-buffer-inl.h b/src/heap/store-buffer-inl.h
index 3546ee2173c473bed7a879b776a767042791b822..920ec3411dc16687efc604441a3f3037818f4c9d 100644
--- a/src/heap/store-buffer-inl.h
+++ b/src/heap/store-buffer-inl.h
@@ -6,31 +6,13 @@
#define V8_STORE_BUFFER_INL_H_
#include "src/heap/heap.h"
+#include "src/heap/remembered-set.h"
#include "src/heap/spaces-inl.h"
#include "src/heap/store-buffer.h"
namespace v8 {
namespace internal {
-uint32_t StoreBuffer::AddressToSlotSetAndOffset(Address addr, SlotSet** slots) {
- MemoryChunk* chunk = MemoryChunk::FromAddress(addr);
- uintptr_t offset = addr - chunk->address();
- if (offset < MemoryChunk::kHeaderSize || chunk->owner() == nullptr) {
- chunk = heap_->lo_space()->FindPage(addr);
- offset = addr - chunk->address();
- }
- if (chunk->old_to_new_slots() == nullptr) {
- chunk->AllocateOldToNewSlots();
- }
- if (offset < Page::kPageSize) {
- *slots = chunk->old_to_new_slots();
- } else {
- *slots = &chunk->old_to_new_slots()[offset / Page::kPageSize];
- offset = offset % Page::kPageSize;
- }
- return static_cast<uint32_t>(offset);
-}
-
void LocalStoreBuffer::Record(Address addr) {
if (top_->is_full()) top_ = new Node(top_);
top_->buffer[top_->count++] = addr;
@@ -40,19 +22,14 @@ void LocalStoreBuffer::Process(StoreBuffer* store_buffer) {
Node* current = top_;
while (current != nullptr) {
for (int i = 0; i < current->count; i++) {
- store_buffer->Mark(current->buffer[i]);
+ Address slot = current->buffer[i];
+ Page* page = Page::FromAnyPointerAddress(heap_, slot);
+ RememberedSet<OLD_TO_NEW>::Insert(page, slot);
}
current = current->next;
}
}
-void StoreBuffer::Mark(Address addr) {
- SlotSet* slots;
- uint32_t offset;
- offset = AddressToSlotSetAndOffset(addr, &slots);
- slots->Insert(offset);
-}
-
} // namespace internal
} // namespace v8
« no previous file with comments | « src/heap/store-buffer.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698