Commit decfb42a authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[logger] Untangle log.h includes

Everything was including log.h through heap-inl.h, so remove that
include by moving the one user into heap.cc, and then fix all the
include errors.

This reduces the log.h include ball from ~550 to ~100.

Change-Id: I6d09bc2f365b48645fcfdc695a68ea12539a745d
Reviewed-on: https://chromium-review.googlesource.com/c/1424198
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58981}
parent 8c17e114
......@@ -17,6 +17,7 @@
#include "src/disasm.h"
#include "src/macro-assembler.h"
#include "src/objects-inl.h"
#include "src/ostreams.h"
#include "src/runtime/runtime-utils.h"
// Only build the simulator if not compiling for real ARM hardware.
......
......@@ -7,6 +7,7 @@
#include "src/builtins/builtins.h"
#include "src/counters.h"
#include "src/debug/interface-types.h"
#include "src/log.h"
#include "src/objects-inl.h"
namespace v8 {
......
......@@ -13,6 +13,7 @@
#include "src/macro-assembler.h"
#include "src/objects-inl.h"
#include "src/objects/fixed-array.h"
#include "src/ostreams.h"
#include "src/snapshot/embedded-data.h"
#include "src/visitors.h"
......
......@@ -13753,4 +13753,6 @@ void CodeStubAssembler::GotoIfInitialPrototypePropertiesModified(
}
} // namespace internal
// TODO(petermarshall): Remove. This is a workaround for crbug.com/v8/8719
namespace {} // namespace
} // namespace v8
......@@ -7,6 +7,7 @@
#include "src/counters.h"
#include "src/globals.h"
#include "src/heap/factory.h"
#include "src/log.h"
#include "src/objects-inl.h"
#include "src/objects/compilation-cache-inl.h"
#include "src/objects/slots.h"
......
......@@ -10,6 +10,7 @@
#include "src/compiler.h"
#include "src/counters.h"
#include "src/isolate.h"
#include "src/log.h"
#include "src/objects-inl.h"
#include "src/optimized-compilation-info.h"
#include "src/tracing/trace-event.h"
......
......@@ -14,6 +14,7 @@
#include "src/counters.h"
#include "src/eh-frame.h"
#include "src/frames.h"
#include "src/log.h"
#include "src/macro-assembler-inl.h"
#include "src/objects/smi.h"
#include "src/optimized-compilation-info.h"
......
......@@ -7,6 +7,7 @@
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/interpreter/bytecode-array-random-iterator.h"
#include "src/objects-inl.h"
#include "src/ostreams.h"
namespace v8 {
namespace internal {
......
......@@ -14,6 +14,7 @@
#include "src/isolate-inl.h"
#include "src/objects/js-generator-inl.h"
#include "src/objects/module.h"
#include "src/ostreams.h"
#include "src/parsing/parse-info.h"
#include "src/parsing/parsing.h"
#include "src/parsing/rewriter.h"
......
......@@ -14,6 +14,7 @@
#include "src/debug/debug.h"
#include "src/frames-inl.h"
#include "src/isolate-inl.h"
#include "src/log.h"
#include "src/objects-inl.h"
#include "src/objects/hash-table-inl.h"
#include "src/objects/js-generator-inl.h"
......
......@@ -15,6 +15,7 @@
#include "src/frames-inl.h"
#include "src/global-handles.h"
#include "src/interpreter/interpreter.h"
#include "src/log.h"
#include "src/macro-assembler.h"
#include "src/objects/debug-objects-inl.h"
#include "src/objects/heap-number-inl.h"
......
......@@ -17,6 +17,7 @@
#include "src/ic/stub-cache.h"
#include "src/interpreter/interpreter.h"
#include "src/isolate.h"
#include "src/log.h"
#include "src/math-random.h"
#include "src/microtask-queue.h"
#include "src/objects-inl.h"
......
......@@ -17,6 +17,7 @@
#include "src/heap/mark-compact-inl.h"
#include "src/interpreter/interpreter.h"
#include "src/isolate-inl.h"
#include "src/log.h"
#include "src/objects/api-callbacks.h"
#include "src/objects/arguments-inl.h"
#include "src/objects/bigint.h"
......
......@@ -22,7 +22,6 @@
#include "src/heap/spaces-inl.h"
#include "src/isolate-data.h"
#include "src/isolate.h"
#include "src/log.h"
#include "src/msan.h"
#include "src/objects-inl.h"
#include "src/objects/allocation-site-inl.h"
......@@ -267,38 +266,6 @@ void Heap::OnAllocationEvent(HeapObject object, int size_in_bytes) {
}
}
void Heap::OnMoveEvent(HeapObject target, HeapObject source,
int size_in_bytes) {
HeapProfiler* heap_profiler = isolate_->heap_profiler();
if (heap_profiler->is_tracking_object_moves()) {
heap_profiler->ObjectMoveEvent(source->address(), target->address(),
size_in_bytes);
}
for (auto& tracker : allocation_trackers_) {
tracker->MoveEvent(source->address(), target->address(), size_in_bytes);
}
if (target->IsSharedFunctionInfo()) {
LOG_CODE_EVENT(isolate_, SharedFunctionInfoMoveEvent(source->address(),
target->address()));
}
if (FLAG_verify_predictable) {
++allocations_count_;
// Advance synthetic time by making a time request.
MonotonicallyIncreasingTimeInMs();
UpdateAllocationsHash(source);
UpdateAllocationsHash(target);
UpdateAllocationsHash(size_in_bytes);
if (allocations_count_ % FLAG_dump_allocations_digest_at_alloc == 0) {
PrintAllocationsHash();
}
} else if (FLAG_fuzzer_gc_analysis) {
++allocations_count_;
}
}
bool Heap::CanAllocateInReadOnlySpace() {
return !deserialization_complete_ &&
(isolate()->serializer_enabled() ||
......
......@@ -45,6 +45,7 @@
#include "src/heap/stress-scavenge-observer.h"
#include "src/heap/sweeper.h"
#include "src/interpreter/interpreter.h"
#include "src/log.h"
#include "src/microtask-queue.h"
#include "src/objects/data-handler.h"
#include "src/objects/free-space-inl.h"
......@@ -2536,6 +2537,38 @@ bool MayContainRecordedSlots(HeapObject object) {
}
} // namespace
void Heap::OnMoveEvent(HeapObject target, HeapObject source,
int size_in_bytes) {
HeapProfiler* heap_profiler = isolate_->heap_profiler();
if (heap_profiler->is_tracking_object_moves()) {
heap_profiler->ObjectMoveEvent(source->address(), target->address(),
size_in_bytes);
}
for (auto& tracker : allocation_trackers_) {
tracker->MoveEvent(source->address(), target->address(), size_in_bytes);
}
if (target->IsSharedFunctionInfo()) {
LOG_CODE_EVENT(isolate_, SharedFunctionInfoMoveEvent(source->address(),
target->address()));
}
if (FLAG_verify_predictable) {
++allocations_count_;
// Advance synthetic time by making a time request.
MonotonicallyIncreasingTimeInMs();
UpdateAllocationsHash(source);
UpdateAllocationsHash(target);
UpdateAllocationsHash(size_in_bytes);
if (allocations_count_ % FLAG_dump_allocations_digest_at_alloc == 0) {
PrintAllocationsHash();
}
} else if (FLAG_fuzzer_gc_analysis) {
++allocations_count_;
}
}
FixedArrayBase Heap::LeftTrimFixedArray(FixedArrayBase object,
int elements_to_trim) {
if (elements_to_trim == 0) {
......
......@@ -540,8 +540,7 @@ class Heap {
inline void OnAllocationEvent(HeapObject object, int size_in_bytes);
// This event is triggered after object is moved to a new place.
inline void OnMoveEvent(HeapObject target, HeapObject source,
int size_in_bytes);
void OnMoveEvent(HeapObject target, HeapObject source, int size_in_bytes);
inline bool CanAllocateInReadOnlySpace();
bool deserialization_complete() const { return deserialization_complete_; }
......
......@@ -22,6 +22,7 @@
#include "src/objects/literal-objects-inl.h"
#include "src/objects/slots.h"
#include "src/objects/templates.h"
#include "src/ostreams.h"
namespace v8 {
namespace internal {
......
......@@ -25,6 +25,7 @@
#include "src/objects/js-generator.h"
#include "src/objects/module.h"
#include "src/objects/oddball.h"
#include "src/ostreams.h"
namespace v8 {
namespace internal {
......
......@@ -15,6 +15,7 @@
#include "src/objects/hash-table-inl.h"
#include "src/objects/js-generator-inl.h"
#include "src/objects/module-inl.h"
#include "src/ostreams.h"
namespace v8 {
namespace internal {
......
......@@ -11,6 +11,7 @@
#include "src/compiler-dispatcher/compiler-dispatcher.h"
#include "src/counters.h"
#include "src/heap/heap-inl.h"
#include "src/log.h"
#include "src/objects-inl.h"
#include "src/objects/scope-info.h"
#include "src/zone/zone.h"
......
......@@ -13,6 +13,7 @@
#include "src/debug/debug.h"
#include "src/elements.h"
#include "src/isolate-inl.h"
#include "src/log.h"
#include "src/message-template.h"
#include "src/objects/hash-table-inl.h"
#include "src/objects/literal-objects-inl.h"
......
......@@ -19,6 +19,7 @@
#include "src/isolate-inl.h"
#include "src/objects/heap-object-inl.h"
#include "src/objects/smi.h"
#include "src/ostreams.h"
#include "src/runtime-profiler.h"
#include "src/snapshot/natives.h"
#include "src/trap-handler/trap-handler.h"
......
......@@ -7,9 +7,11 @@
#include <sstream>
#include "src/assembler-inl.h"
#include "src/base/optional.h"
#include "src/compiler/linkage.h"
#include "src/compiler/wasm-compiler.h"
#include "src/macro-assembler-inl.h"
#include "src/ostreams.h"
#include "src/wasm/function-body-decoder-impl.h"
#include "src/wasm/wasm-linkage.h"
#include "src/wasm/wasm-opcodes.h"
......
......@@ -11,6 +11,7 @@
#include "src/compiler/wasm-compiler.h"
#include "src/counters.h"
#include "src/interface-descriptors.h"
#include "src/log.h"
#include "src/macro-assembler-inl.h"
#include "src/objects/smi.h"
#include "src/tracing/trace-event.h"
......
......@@ -7,6 +7,7 @@
#include "src/api.h"
#include "src/asmjs/asm-js.h"
#include "src/base/enum-set.h"
#include "src/base/optional.h"
#include "src/base/template-utils.h"
#include "src/base/utils/random-number-generator.h"
#include "src/compiler/wasm-compiler.h"
......
......@@ -12,6 +12,7 @@
#include "src/base/platform/platform.h"
#include "src/disassembler.h"
#include "src/globals.h"
#include "src/log.h"
#include "src/macro-assembler-inl.h"
#include "src/macro-assembler.h"
#include "src/objects-inl.h"
......
......@@ -9,6 +9,7 @@
#include "src/objects-inl.h"
#include "src/objects/heap-number.h"
#include "src/objects/js-promise.h"
#include "src/ostreams.h"
#include "src/wasm/function-compiler.h"
#include "src/wasm/module-compiler.h"
#include "src/wasm/module-decoder.h"
......
......@@ -20,6 +20,7 @@
#include "src/objects-inl.h"
#include "src/objects/heap-number-inl.h"
#include "src/objects/module-inl.h"
#include "src/ostreams.h"
#include "src/runtime/runtime.h"
#include "src/source-position-table.h"
#include "test/cctest/cctest.h"
......
......@@ -37,6 +37,7 @@
#include "src/base/platform/platform.h"
#include "src/deoptimizer.h"
#include "src/libplatform/default-platform.h"
#include "src/log.h"
#include "src/objects-inl.h"
#include "src/profiler/cpu-profiler-inl.h"
#include "src/profiler/profiler-listener.h"
......
......@@ -35,6 +35,7 @@
#include "src/disassembler.h"
#include "src/frames-inl.h"
#include "src/macro-assembler.h"
#include "src/ostreams.h"
#include "test/cctest/cctest.h"
namespace v8 {
......
......@@ -36,6 +36,7 @@
#include "src/frames-inl.h"
#include "src/macro-assembler.h"
#include "src/objects-inl.h"
#include "src/ostreams.h"
#include "test/cctest/cctest.h"
namespace v8 {
......
......@@ -22,6 +22,7 @@
#include "src/objects/heap-number-inl.h"
#include "src/objects/struct-inl.h"
#include "src/optimized-compilation-info.h"
#include "src/ostreams.h"
#include "src/property.h"
#include "src/transitions.h"
......
......@@ -37,6 +37,7 @@
#include "src/api-inl.h"
#include "src/assembler-inl.h"
#include "src/base/hashmap.h"
#include "src/base/optional.h"
#include "src/collector.h"
#include "src/debug/debug.h"
#include "src/objects-inl.h"
......
......@@ -30,6 +30,7 @@
#include "src/assembler-inl.h"
#include "src/macro-assembler.h"
#include "src/objects-inl.h"
#include "src/ostreams.h"
#include "src/simulator.h"
#include "src/v8.h"
#include "test/cctest/cctest.h"
......
......@@ -29,6 +29,7 @@
#include "include/v8-profiler.h"
#include "src/api-inl.h"
#include "src/log.h"
#include "src/objects-inl.h"
#include "src/profiler/cpu-profiler.h"
#include "src/profiler/profile-generator-inl.h"
......
......@@ -9,6 +9,7 @@
#include "include/v8.h"
#include "src/isolate.h"
#include "src/objects-inl.h"
#include "src/ostreams.h"
#include "src/wasm/wasm-engine.h"
#include "src/wasm/wasm-module-builder.h"
#include "src/wasm/wasm-module.h"
......
......@@ -8,6 +8,7 @@
#include "src/heap/heap-inl.h"
#include "src/heap/spaces-inl.h"
#include "src/isolate.h"
#include "src/ostreams.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
......
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