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

Unified Diff: src/heap/mark-compact-inl.h

Issue 2211893002: [heap] Temporarily do not use size to iterate live object to investigate Win 10 memory regression. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove invalid check Created 4 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 | « no previous file | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact-inl.h
diff --git a/src/heap/mark-compact-inl.h b/src/heap/mark-compact-inl.h
index 735632e3e8386bb65932c9ad359d18d9496f15ab..3ea9828a0e975aaa70e1c2c210b39238eda9b4fd 100644
--- a/src/heap/mark-compact-inl.h
+++ b/src/heap/mark-compact-inl.h
@@ -168,25 +168,20 @@ HeapObject* LiveObjectIterator<T>::Next() {
// make sure that we skip all set bits in the black area until the
// object ends.
HeapObject* black_object = HeapObject::FromAddress(addr);
- Address end = addr + black_object->Size() - kPointerSize;
+ Address end = addr + black_object->Size();
// One word filler objects do not borrow the second mark bit. We have
// to jump over the advancing and clearing part.
// Note that we know that we are at a one word filler when
// object_start + object_size - kPointerSize == object_start.
if (addr != end) {
- DCHECK_EQ(chunk_, MemoryChunk::FromAddress(end));
- uint32_t end_mark_bit_index = chunk_->AddressToMarkbitIndex(end);
- unsigned int end_cell_index =
- end_mark_bit_index >> Bitmap::kBitsPerCellLog2;
- MarkBit::CellType end_index_mask =
- 1u << Bitmap::IndexInCell(end_mark_bit_index);
- if (it_.Advance(end_cell_index)) {
- cell_base_ = it_.CurrentCellBase();
- current_cell_ = *it_.CurrentCell();
- }
-
- // Clear all bits in current_cell, including the end index.
- current_cell_ &= ~(end_index_mask | (end_index_mask - 1));
+ // Clear all bits from second_bit_index.
+ current_cell_ &= ~(second_bit_index | (second_bit_index - 1));
+
+ // Check that all bits corresponding to in object fields after the
+ // two cleared bits in the beginning are indeed zero.
+ CHECK(chunk_->markbits()->AllBitsClearInRange(
+ chunk_->AddressToMarkbitIndex(addr + 2 * kPointerSize),
+ chunk_->AddressToMarkbitIndex(end)));
}
if (T == kBlackObjects || T == kAllLiveObjects) {
« no previous file with comments | « no previous file | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698