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

Unified Diff: src/heap/mark-compact.cc

Issue 1020853022: Use a slot that is located on a heap page when removing invalid entries from the SlotsBuffer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index b4fafec10939aea23ddd4bc2aada41fee52eced9..489b92aca987fd251128e262404e03baafbeaa41 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -4558,14 +4558,14 @@ bool SlotsBuffer::AddTo(SlotsBufferAllocator* allocator,
}
-static Object* g_smi_slot = NULL;
-
-
void SlotsBuffer::RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer) {
- DCHECK_EQ(Smi::FromInt(0), g_smi_slot);
-
- // Remove entries by replacing them with a dummy slot containing a smi.
- const ObjectSlot kRemovedEntry = &g_smi_slot;
+ // Remove entries by replacing them with an old-space slot containing a smi
+ // that is located in an unmovable page.
+ const ObjectSlot kRemovedEntry =
+ HeapObject::RawField(heap->empty_fixed_array(),
+ FixedArrayBase::kLengthOffset);
+ DCHECK(Page::FromAddress(
+ reinterpret_cast<Address>(kRemovedEntry))->NeverEvacuate());
while (buffer != NULL) {
SlotsBuffer::ObjectSlot* slots = buffer->slots_;
@@ -4593,8 +4593,6 @@ void SlotsBuffer::RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer) {
void SlotsBuffer::VerifySlots(Heap* heap, SlotsBuffer* buffer) {
- DCHECK_EQ(Smi::FromInt(0), g_smi_slot);
-
while (buffer != NULL) {
SlotsBuffer::ObjectSlot* slots = buffer->slots_;
intptr_t slots_count = buffer->idx_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698