[cleanup] Reduce the includes and forward-declarations of log.h

Some includes in log.h were only needed by log.cc so move them there.
Some were not needed at all, so remove them completely.

Drive-by cleanup FunctionEvent(), which was never called without args
for the last parameters which had default values.

Change-Id: Id8b0c634c4d39d3c278ab3d932ed7af4142fd9c9
Reviewed-on: https://chromium-review.googlesource.com/c/1425914
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59003}
This commit is contained in:
Peter Marshall 2019-01-22 15:55:06 +01:00 committed by Commit Bot
parent 30602560a8
commit b63fcd190b
14 changed files with 22 additions and 12 deletions

View File

@ -30,6 +30,7 @@
#include "src/objects/feedback-cell-inl.h"
#include "src/objects/map.h"
#include "src/optimized-compilation-info.h"
#include "src/ostreams.h"
#include "src/parsing/parse-info.h"
#include "src/parsing/parser.h"
#include "src/parsing/parsing.h"

View File

@ -12,6 +12,7 @@
#include "src/isolate.h"
#include "src/log-inl.h"
#include "src/log.h"
#include "src/ostreams.h"
namespace v8 {
namespace internal {

View File

@ -25,6 +25,7 @@
#include "src/objects/free-space-inl.h"
#include "src/objects/js-array-buffer-inl.h"
#include "src/objects/js-array-inl.h"
#include "src/ostreams.h"
#include "src/snapshot/snapshot.h"
#include "src/v8.h"
#include "src/vm-state-inl.h"

View File

@ -17,6 +17,7 @@
#include "src/objects-inl.h"
#include "src/objects/shared-function-info.h"
#include "src/objects/slots.h"
#include "src/ostreams.h"
#include "src/parsing/parse-info.h"
#include "src/setup-isolate.h"
#include "src/snapshot/snapshot.h"

View File

@ -51,6 +51,7 @@
#include "src/objects/slots.h"
#include "src/objects/smi.h"
#include "src/objects/stack-frame-info-inl.h"
#include "src/ostreams.h"
#include "src/profiler/tracing-cpu-profiler.h"
#include "src/prototype.h"
#include "src/ptr-compr.h"

View File

@ -17,8 +17,10 @@
#include "src/global-handles.h"
#include "src/interpreter/bytecodes.h"
#include "src/interpreter/interpreter.h"
#include "src/isolate.h"
#include "src/libsampler/sampler.h"
#include "src/log-inl.h"
#include "src/log-utils.h"
#include "src/macro-assembler.h"
#include "src/memcopy.h"
#include "src/objects/api-callbacks.h"
@ -938,6 +940,8 @@ Logger::~Logger() {
delete log_;
}
const LogSeparator Logger::kNext = LogSeparator::kSeparator;
void Logger::AddCodeEventListener(CodeEventListener* listener) {
bool result = isolate_->code_event_dispatcher()->AddListener(listener);
CHECK(result);

View File

@ -9,15 +9,9 @@
#include <string>
#include "include/v8-profiler.h"
#include "src/allocation.h"
#include "src/base/compiler-specific.h"
#include "src/base/platform/elapsed-timer.h"
#include "src/base/platform/platform.h"
#include "src/code-events.h"
#include "src/isolate.h"
#include "src/log-utils.h"
#include "src/objects.h"
#include "src/objects/string.h"
namespace v8 {
@ -65,7 +59,6 @@ namespace internal {
// Forward declarations.
class CodeEventListener;
class CpuProfiler;
class Isolate;
class JitLogger;
class Log;
@ -73,7 +66,6 @@ class LowLevelLogger;
class PerfBasicLogger;
class PerfJitLogger;
class Profiler;
class RuntimeCallTimer;
class Ticker;
#undef LOG
@ -109,6 +101,8 @@ class ExistingCodeLogger {
CodeEventListener* listener_;
};
enum class LogSeparator;
class Logger : public CodeEventListener {
public:
enum StartEnd { START = 0, END = 1, STAMP = 2 };
@ -122,7 +116,7 @@ class Logger : public CodeEventListener {
};
// The separator is used to write an unescaped "," into the log.
static const LogSeparator kNext = LogSeparator::kSeparator;
static const LogSeparator kNext;
// Acquires resources for logging if the right flags are set.
bool SetUp(Isolate* isolate);
@ -165,8 +159,8 @@ class Logger : public CodeEventListener {
// ==== Events logged by --log-function-events ====
void FunctionEvent(const char* reason, int script_id, double time_delta_ms,
int start_position = -1, int end_position = -1,
String function_name = String());
int start_position, int end_position,
String function_name);
void FunctionEvent(const char* reason, int script_id, double time_delta_ms,
int start_position, int end_position,
const char* function_name = nullptr,
@ -473,7 +467,7 @@ class ExternalCodeEventListener : public CodeEventListener {
void CodeDeoptEvent(Code code, DeoptimizeKind kind, Address pc,
int fp_to_sp_delta) override {}
void StartListening(CodeEventHandler* code_event_handler);
void StartListening(v8::CodeEventHandler* code_event_handler);
void StopListening();
bool is_listening_to_code_events() override { return true; }

View File

@ -95,6 +95,7 @@
#include "src/objects/slots-atomic-inl.h"
#include "src/objects/stack-frame-info-inl.h"
#include "src/objects/struct-inl.h"
#include "src/ostreams.h"
#include "src/parsing/preparse-data.h"
#include "src/property-descriptor.h"
#include "src/prototype.h"

View File

@ -32,6 +32,7 @@
#include "src/assembler.h"
#include "src/eh-frame.h"
#include "src/objects-inl.h"
#include "src/ostreams.h"
#include "src/snapshot/embedded-data.h"
#include "src/source-position-table.h"
#include "src/wasm/wasm-code-manager.h"

View File

@ -17,6 +17,7 @@
#include "src/isolate-inl.h"
#include "src/message-template.h"
#include "src/objects/js-array-inl.h"
#include "src/ostreams.h"
#include "src/parsing/parse-info.h"
#include "src/parsing/parsing.h"
#include "src/runtime/runtime-utils.h"

View File

@ -14,6 +14,7 @@
#include "src/log.h"
#include "src/macro-assembler-inl.h"
#include "src/objects/smi.h"
#include "src/ostreams.h"
#include "src/tracing/trace-event.h"
#include "src/utils.h"
#include "src/wasm/baseline/liftoff-assembler.h"

View File

@ -16,6 +16,7 @@
#include "src/macro-assembler-inl.h"
#include "src/macro-assembler.h"
#include "src/objects-inl.h"
#include "src/ostreams.h"
#include "src/wasm/compilation-environment.h"
#include "src/wasm/function-compiler.h"
#include "src/wasm/jump-table-assembler.h"

View File

@ -8,6 +8,7 @@
#include "src/external-reference-table.h"
#include "src/objects-inl.h"
#include "src/objects.h"
#include "src/ostreams.h"
#include "src/snapshot/code-serializer.h"
#include "src/snapshot/serializer-common.h"
#include "src/utils.h"

View File

@ -51,6 +51,7 @@
#include "src/objects/js-collection-inl.h"
#include "src/objects/managed.h"
#include "src/objects/slots.h"
#include "src/ostreams.h"
#include "src/regexp/jsregexp.h"
#include "src/snapshot/snapshot.h"
#include "src/transitions.h"