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

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

Issue 1608583002: New page local store buffer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase and fix signed unsigned conversion 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') | src/ia32/code-stubs-ia32.cc » ('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 454b2c22929ae41c72bdba838f1a10302fe715aa..cd8278ef694858f4c0689fcf581430317c6c6782 100644
--- a/src/heap/store-buffer-inl.h
+++ b/src/heap/store-buffer-inl.h
@@ -12,37 +12,26 @@
namespace v8 {
namespace internal {
-void StoreBuffer::Mark(Address addr) {
- DCHECK(!heap_->code_space()->Contains(addr));
- Address* top = reinterpret_cast<Address*>(heap_->store_buffer_top());
- *top++ = addr;
- heap_->set_store_buffer_top(reinterpret_cast<Smi*>(top));
- if ((reinterpret_cast<uintptr_t>(top) & kStoreBufferOverflowBit) != 0) {
- DCHECK(top == limit_);
- Compact();
+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 {
- DCHECK(top < limit_);
+ *slots = &chunk->old_to_new_slots()[offset / Page::kPageSize];
+ offset = offset % Page::kPageSize;
}
+ return static_cast<uint32_t>(offset);
}
-void StoreBuffer::EnterDirectlyIntoStoreBuffer(Address addr) {
- if (store_buffer_rebuilding_enabled_) {
- SLOW_DCHECK(!heap_->code_space()->Contains(addr) &&
- !heap_->new_space()->Contains(addr));
- Address* top = old_top_;
- *top++ = addr;
- old_top_ = top;
- old_buffer_is_sorted_ = false;
- old_buffer_is_filtered_ = false;
- if (top >= old_limit_) {
- DCHECK(callback_ != NULL);
- (*callback_)(heap_, MemoryChunk::FromAnyPointerAddress(heap_, addr),
- kStoreBufferFullEvent);
- }
- }
-}
-
void LocalStoreBuffer::Record(Address addr) {
if (top_->is_full()) top_ = new Node(top_);
top_->buffer[top_->count++] = addr;
@@ -58,6 +47,13 @@ void LocalStoreBuffer::Process(StoreBuffer* store_buffer) {
}
}
+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') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698