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

Unified Diff: src/heap/spaces-inl.h

Issue 2770253002: [heap] Enforce explicit MarkingState (Closed)
Patch Set: rebase Created 3 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 | « src/heap/spaces.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces-inl.h
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h
index 3ec2db51abde463061202c41d134f127dbc3c93d..3c5c99af9491852d8c92f187aae3c1d288b8515f 100644
--- a/src/heap/spaces-inl.h
+++ b/src/heap/spaces-inl.h
@@ -182,7 +182,7 @@ Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable,
page->AllocateLocalTracker();
if (FLAG_minor_mc) {
page->AllocateYoungGenerationBitmap();
- page->ClearLiveness<MarkingMode::YOUNG_GENERATION>();
+ MarkingState::External(page).ClearLiveness();
}
return page;
}
@@ -230,54 +230,6 @@ void Page::InitializeFreeListCategories() {
}
}
-template <MarkingMode mode>
-void MemoryChunk::IncrementLiveBytes(HeapObject* object, int by) {
- MemoryChunk::FromAddress(object->address())->IncrementLiveBytes<mode>(by);
-}
-
-template <MarkingMode mode>
-void MemoryChunk::TraceLiveBytes(intptr_t old_value, intptr_t new_value) {
- if (!FLAG_trace_live_bytes) return;
- PrintIsolate(heap()->isolate(),
- "live-bytes[%p:%s]: %" V8PRIdPTR "-> %" V8PRIdPTR "\n",
- static_cast<void*>(this),
- mode == MarkingMode::FULL ? "internal" : "external", old_value,
- new_value);
-}
-
-template <MarkingMode mode>
-void MemoryChunk::ResetLiveBytes() {
- switch (mode) {
- case MarkingMode::FULL:
- TraceLiveBytes(live_byte_count_, 0);
- live_byte_count_ = 0;
- break;
- case MarkingMode::YOUNG_GENERATION:
- TraceLiveBytes(young_generation_live_byte_count_, 0);
- young_generation_live_byte_count_ = 0;
- break;
- }
-}
-
-template <MarkingMode mode>
-void MemoryChunk::IncrementLiveBytes(int by) {
- switch (mode) {
- case MarkingMode::FULL:
- TraceLiveBytes(live_byte_count_, live_byte_count_ + by);
- live_byte_count_ += by;
- DCHECK_GE(live_byte_count_, 0);
- DCHECK_LE(static_cast<size_t>(live_byte_count_), size_);
- break;
- case MarkingMode::YOUNG_GENERATION:
- TraceLiveBytes(young_generation_live_byte_count_,
- young_generation_live_byte_count_ + by);
- young_generation_live_byte_count_ += by;
- DCHECK_GE(young_generation_live_byte_count_, 0);
- DCHECK_LE(static_cast<size_t>(young_generation_live_byte_count_), size_);
- break;
- }
-}
-
bool PagedSpace::Contains(Address addr) {
return MemoryChunk::FromAnyPointerAddress(heap(), addr)->owner() == this;
}
« no previous file with comments | « src/heap/spaces.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698