Commit 2c1b6d38 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[v8] Even finer grain trace events for EVACUATE_COPY step.

Fine grain events are showing that LiveObjectVisitor::VisitBlackObjectsNoFail
is the suspiciously slow step, breaking it down further.
https://docs.google.com/document/d/1bdlWAWeP3j2yo2DYfeok6URqFCrt57yx-nucGMybGGQ/edit#heading=h.97pqg2eosnw8
https://drive.google.com/file/d/1FKZHkXtWK2fZCk_3PClPcbpzKilnbuOr/view

R=mlippautz@chromium.org

Bug: chromium:813824
Change-Id: Idcebcbb268d3e00f5f1e304c66564b4b9c85a064
Reviewed-on: https://chromium-review.googlesource.com/929161Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51447}
parent dab696e7
......@@ -1361,6 +1361,8 @@ class EvacuateVisitorBase : public HeapObjectVisitor {
static void RawMigrateObject(EvacuateVisitorBase* base, HeapObject* dst,
HeapObject* src, int size,
AllocationSpace dest) {
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"EvacuateVisitorBase::RawMigrateObject", "dest", dest);
Address dst_addr = dst->address();
Address src_addr = src->address();
DCHECK(base->heap_->AllowedToBeMigrated(src, dest));
......@@ -1403,6 +1405,9 @@ class EvacuateVisitorBase : public HeapObjectVisitor {
inline bool TryEvacuateObject(AllocationSpace target_space,
HeapObject* object, int size,
HeapObject** target_object) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"EvacuateVisitorBase::TryEvacuateObject");
#ifdef VERIFY_HEAP
if (AbortCompactionForTesting(object)) return false;
#endif // VERIFY_HEAP
......@@ -1418,6 +1423,8 @@ class EvacuateVisitorBase : public HeapObjectVisitor {
inline void ExecuteMigrationObservers(AllocationSpace dest, HeapObject* src,
HeapObject* dst, int size) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"EvacuateVisitorBase::ExecuteMigrationObservers");
for (MigrationObserver* obs : observers_) {
obs->Move(dest, src, dst, size);
}
......@@ -1425,6 +1432,8 @@ class EvacuateVisitorBase : public HeapObjectVisitor {
inline void MigrateObject(HeapObject* dst, HeapObject* src, int size,
AllocationSpace dest) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"EvacuateVisitorBase::MigrateObject");
migration_function_(this, dst, src, size, dest);
}
......@@ -1469,6 +1478,8 @@ class EvacuateNewSpaceVisitor final : public EvacuateVisitorBase {
is_incremental_marking_(heap->incremental_marking()->IsMarking()) {}
inline bool Visit(HeapObject* object, int size) override {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"EvacuateNewSpaceVisitor::Visit");
if (TryEvacuateWithoutCopy(object)) return true;
HeapObject* target_object = nullptr;
if (heap_->ShouldBePromoted(object->address()) &&
......@@ -1571,10 +1582,16 @@ class EvacuateNewSpacePageVisitor final : public HeapObjectVisitor {
}
inline bool Visit(HeapObject* object, int size) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"EvacuateNewSpacePageVisitor::Visit");
if (mode == NEW_TO_NEW) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"EvacuateNewSpacePageVisitor::Visit UpdateAllocationSite");
heap_->UpdateAllocationSite(object->map(), object,
local_pretenuring_feedback_);
} else if (mode == NEW_TO_OLD) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"EvacuateNewSpacePageVisitor::Visit IterateBodyFast");
object->IterateBodyFast(record_visitor_);
}
return true;
......@@ -1597,6 +1614,8 @@ class EvacuateOldSpaceVisitor final : public EvacuateVisitorBase {
: EvacuateVisitorBase(heap, local_allocator, record_visitor) {}
inline bool Visit(HeapObject* object, int size) override {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"EvacuateOldSpaceVisitor::Visit");
HeapObject* target_object = nullptr;
if (TryEvacuateObject(
Page::FromAddress(object->address())->owner()->identity(), object,
......@@ -1613,6 +1632,8 @@ class EvacuateRecordOnlyVisitor final : public HeapObjectVisitor {
explicit EvacuateRecordOnlyVisitor(Heap* heap) : heap_(heap) {}
inline bool Visit(HeapObject* object, int size) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"EvacuateRecordOnlyVisitor::Visit");
RecordMigratedSlotVisitor visitor(heap_->mark_compact_collector());
object->IterateBody(&visitor);
return true;
......
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