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

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

Issue 1886493003: [heap] Templatize markbit clearing during evacuation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 fff55f4d04dd201f421ada0f337706bbcfe2f973..24d3e97e7db50124014aa8d138f7407b75ff3f0d 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2997,6 +2997,7 @@ class MarkCompactCollector::Evacuator : public Malloced {
bytes_compacted_ += bytes_compacted;
}
+ template <IterationMode mode>
inline bool EvacuateSinglePage(MemoryChunk* p, HeapObjectVisitor* visitor);
MarkCompactCollector* collector_;
@@ -3014,6 +3015,7 @@ class MarkCompactCollector::Evacuator : public Malloced {
intptr_t bytes_compacted_;
};
+template <MarkCompactCollector::IterationMode mode>
bool MarkCompactCollector::Evacuator::EvacuateSinglePage(
MemoryChunk* p, HeapObjectVisitor* visitor) {
bool success = false;
@@ -3023,7 +3025,7 @@ bool MarkCompactCollector::Evacuator::EvacuateSinglePage(
{
AlwaysAllocateScope always_allocate(heap()->isolate());
TimedScope timed_scope(&evacuation_time);
- success = collector_->VisitLiveObjects(p, visitor, kClearMarkbits);
+ success = collector_->VisitLiveObjects(p, visitor, mode);
}
if (FLAG_trace_evacuation) {
const char age_mark_tag =
@@ -3051,13 +3053,13 @@ bool MarkCompactCollector::Evacuator::EvacuatePage(MemoryChunk* chunk) {
if (chunk->InNewSpace()) {
DCHECK_EQ(chunk->concurrent_sweeping_state().Value(),
NewSpacePage::kSweepingDone);
- success = EvacuateSinglePage(chunk, &new_space_visitor_);
+ success = EvacuateSinglePage<kClearMarkbits>(chunk, &new_space_visitor_);
DCHECK(success);
USE(success);
} else {
DCHECK(chunk->IsEvacuationCandidate());
DCHECK_EQ(chunk->concurrent_sweeping_state().Value(), Page::kSweepingDone);
- success = EvacuateSinglePage(chunk, &old_space_visitor_);
+ success = EvacuateSinglePage<kClearMarkbits>(chunk, &old_space_visitor_);
}
return success;
}
« 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