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

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

Issue 1286323004: Version 4.5.103.24 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.5
Patch Set: Created 5 years, 4 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 | « include/v8-version.h ('k') | 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 8bbfeb173f7ba3ac5e55b63145e62d3085338727..9ca06cf2e64c449188656fd494ae84370ccde554 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3058,11 +3058,18 @@ bool MarkCompactCollector::TryPromoteObject(HeapObject* object,
bool MarkCompactCollector::IsSlotInBlackObject(Page* p, Address slot,
HeapObject** out_object) {
- // This function does not support large objects right now.
Space* owner = p->owner();
if (owner == heap_->lo_space() || owner == NULL) {
- *out_object = NULL;
- return true;
+ Object* large_object = heap_->lo_space()->FindObject(slot);
+ // This object has to exist, otherwise we would not have recorded a slot
+ // for it.
+ CHECK(large_object->IsHeapObject());
+ HeapObject* large_heap_object = HeapObject::cast(large_object);
+ if (IsMarked(large_heap_object)) {
+ *out_object = large_heap_object;
+ return true;
+ }
+ return false;
}
uint32_t mark_bit_index = p->AddressToMarkbitIndex(slot);
@@ -3179,13 +3186,8 @@ bool MarkCompactCollector::IsSlotInLiveObject(Address slot) {
return false;
}
- // |object| is NULL only when the slot belongs to large object space.
- DCHECK(object != NULL ||
- Page::FromAnyPointerAddress(heap_, slot)->owner() ==
- heap_->lo_space());
- // We don't need to check large objects' layout descriptor since it can't
- // contain in-object fields anyway.
- if (object != NULL) {
+ DCHECK(object != NULL);
+
switch (object->ContentType()) {
case HeapObjectContents::kTaggedValues:
return true;
@@ -3214,9 +3216,7 @@ bool MarkCompactCollector::IsSlotInLiveObject(Address slot) {
}
}
UNREACHABLE();
- }
-
- return true;
+ return true;
}
@@ -4444,12 +4444,10 @@ void SlotsBuffer::RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer) {
ObjectSlot slot = slots[slot_idx];
if (!IsTypedSlot(slot)) {
Object* object = *slot;
- if (object->IsHeapObject()) {
- if (heap->InNewSpace(object) ||
- !heap->mark_compact_collector()->IsSlotInLiveObject(
- reinterpret_cast<Address>(slot))) {
- slots[slot_idx] = kRemovedEntry;
- }
+ if ((object->IsHeapObject() && heap->InNewSpace(object)) ||
+ !heap->mark_compact_collector()->IsSlotInLiveObject(
+ reinterpret_cast<Address>(slot))) {
+ slots[slot_idx] = kRemovedEntry;
}
} else {
++slot_idx;
@@ -4506,9 +4504,10 @@ void SlotsBuffer::VerifySlots(Heap* heap, SlotsBuffer* buffer) {
if (!IsTypedSlot(slot)) {
Object* object = *slot;
if (object->IsHeapObject()) {
+ HeapObject* heap_object = HeapObject::cast(object);
CHECK(!heap->InNewSpace(object));
- CHECK(heap->mark_compact_collector()->IsSlotInLiveObject(
- reinterpret_cast<Address>(slot)));
+ heap->mark_compact_collector()->VerifyIsSlotInLiveObject(
+ reinterpret_cast<Address>(slot), heap_object);
}
} else {
++slot_idx;
« no previous file with comments | « include/v8-version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698