Commit 3723a177 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

Introduce LogObjectRelocation on Isolate.

Change-Id: I93726a98978b8b18a16a253f55fc698704d27be4
Reviewed-on: https://chromium-review.googlesource.com/1228376
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56002}
parent c8fe898d
......@@ -2010,14 +2010,6 @@ void Heap::EvacuateYoungGeneration() {
SetGCState(NOT_IN_GC);
}
static bool IsLogging(Isolate* isolate) {
return FLAG_verify_predictable || isolate->logger()->is_logging() ||
isolate->is_profiling() ||
(isolate->heap_profiler() != nullptr &&
isolate->heap_profiler()->is_tracking_object_moves()) ||
isolate->heap()->has_heap_object_allocation_tracker();
}
class PageScavengingItem final : public ItemParallelJob::Item {
public:
explicit PageScavengingItem(MemoryChunk* chunk) : chunk_(chunk) {}
......@@ -2116,7 +2108,7 @@ void Heap::Scavenge() {
&parallel_scavenge_semaphore_);
const int kMainThreadId = 0;
Scavenger* scavengers[kMaxScavengerTasks];
const bool is_logging = IsLogging(isolate());
const bool is_logging = isolate()->LogObjectRelocation();
const int num_scavenge_tasks = NumberOfScavengeTasks();
OneshotBarrier barrier;
Scavenger::CopiedList copied_list(num_scavenge_tasks);
......
......@@ -2525,11 +2525,7 @@ void MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks(
compaction_speed = heap()->tracer()->CompactionSpeedInBytesPerMillisecond();
}
const bool profiling =
heap()->isolate()->is_profiling() ||
heap()->isolate()->logger()->is_listening_to_code_events() ||
heap()->isolate()->heap_profiler()->is_tracking_object_moves() ||
heap()->has_heap_object_allocation_tracker();
const bool profiling = isolate()->LogObjectRelocation();
ProfilingMigrationObserver profiling_observer(heap());
const int wanted_num_tasks =
......
......@@ -2593,6 +2593,13 @@ void Isolate::ClearSerializerData() {
external_reference_map_ = nullptr;
}
bool Isolate::LogObjectRelocation() {
return FLAG_verify_predictable || logger()->is_logging() || is_profiling() ||
heap()->isolate()->logger()->is_listening_to_code_events() ||
(heap_profiler() != nullptr &&
heap_profiler()->is_tracking_object_moves()) ||
heap()->has_heap_object_allocation_tracker();
}
void Isolate::Deinit() {
TRACE_ISOLATE(deinit);
......
......@@ -667,6 +667,8 @@ class Isolate : private HiddenFactory {
void ClearSerializerData();
bool LogObjectRelocation();
// Find the PerThread for this particular (isolate, thread) combination
// If one does not yet exist, return null.
PerIsolateThreadData* FindPerThreadDataForThisThread();
......
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