Commit ec8904ae authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] Scavenger: Cache pretenuring feedback locally

Bug: chromium:738865
Change-Id: Icb92b649ecd3d4ab4c60f35ffe0649a35fe8b3f6
Reviewed-on: https://chromium-review.googlesource.com/565285Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46530}
parent 44962945
......@@ -1782,6 +1782,8 @@ void Heap::Scavenge() {
&root_scavenge_visitor);
scavenger.Process();
scavenger.Finalize();
UpdateNewSpaceReferencesInExternalStringTable(
&UpdateNewSpaceReferenceInExternalStringTableEntry);
......
......@@ -245,8 +245,8 @@ void Scavenger::ScavengeObject(HeapObject** p, HeapObject* object) {
return;
}
heap()->UpdateAllocationSite<Heap::kGlobal>(
object, heap()->global_pretenuring_feedback_);
heap()->UpdateAllocationSite<Heap::kCached>(object,
&local_pretenuring_feedback_);
// AllocationMementos are unrooted and shouldn't survive a scavenge
DCHECK_NE(heap()->allocation_memento_map(), object->map());
......
......@@ -132,6 +132,10 @@ void Scavenger::RecordCopiedObject(HeapObject* obj) {
}
}
void Scavenger::Finalize() {
heap()->MergeAllocationSitePretenuringFeedback(local_pretenuring_feedback_);
}
void RootScavengeVisitor::VisitRootPointer(Root root, Object** p) {
ScavengePointer(p);
}
......
......@@ -73,6 +73,7 @@ class Scavenger {
: heap_(heap),
promotion_list_(promotion_list, task_id),
copied_list_(copied_list, task_id),
local_pretenuring_feedback_(kInitialLocalPretenuringFeedbackCapacity),
is_logging_(is_logging),
is_incremental_marking_(is_incremental_marking) {}
......@@ -89,7 +90,12 @@ class Scavenger {
// manually scavenged using ScavengeObject or CheckAndScavengeObject.
void Process();
// Finalize the Scavenger. Needs to be called from the main thread.
void Finalize();
private:
static const int kInitialLocalPretenuringFeedbackCapacity = 256;
inline Heap* heap() { return heap_; }
V8_INLINE HeapObject* MigrateObject(HeapObject* source, HeapObject* target,
......@@ -125,6 +131,7 @@ class Scavenger {
Heap* const heap_;
PromotionList::View promotion_list_;
CopiedRangesList copied_list_;
base::HashMap local_pretenuring_feedback_;
bool is_logging_;
bool is_incremental_marking_;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment