Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(557)

Unified Diff: src/compiler.cc

Issue 2187693002: [Tracing] Embed V8 runtime call stats into tracing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix memory leak Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-utils.h ('k') | src/counters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 795b0199bd9aa291e7e057979656b867983bec03..15d48429507a323f41026b8aeefd2d2eacc34b94 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -672,8 +672,8 @@ bool GetOptimizedCodeNow(CompilationJob* job) {
TimerEventScope<TimerEventRecompileSynchronous> timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::RecompileSynchronous);
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
- "V8.RecompileSynchronous");
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ isolate, &tracing::TraceEventStatsTable::RecompileSynchronous);
if (job->CreateGraph() != CompilationJob::SUCCEEDED ||
job->OptimizeGraph() != CompilationJob::SUCCEEDED ||
@@ -735,8 +735,8 @@ bool GetOptimizedCodeLater(CompilationJob* job) {
TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
RuntimeCallTimerScope runtimeTimer(info->isolate(),
&RuntimeCallStats::RecompileSynchronous);
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
- "V8.RecompileSynchronous");
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ isolate, &tracing::TraceEventStatsTable::RecompileSynchronous);
if (job->CreateGraph() != CompilationJob::SUCCEEDED) return false;
isolate->optimizing_compile_dispatcher()->QueueForOptimization(job);
@@ -814,7 +814,8 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
CanonicalHandleScope canonical(isolate);
TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::OptimizeCode);
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.OptimizeCode");
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ isolate, &tracing::TraceEventStatsTable::OptimizeCode);
// TurboFan can optimize directly from existing bytecode.
if (FLAG_turbo_from_bytecode && use_turbofan && ShouldUseIgnition(info)) {
@@ -1013,7 +1014,8 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
TimerEventScope<TimerEventCompileCode> compile_timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileCodeLazy);
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ isolate, &tracing::TraceEventStatsTable::CompileCodeLazy);
AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy());
if (FLAG_turbo_cache_shared_code) {
@@ -1068,7 +1070,8 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
Isolate* isolate = info->isolate();
TimerEventScope<TimerEventCompileCode> timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode);
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ isolate, &tracing::TraceEventStatsTable::CompileCode);
PostponeInterruptsScope postpone(isolate);
DCHECK(!isolate->native_context().is_null());
ParseInfo* parse_info = info->parse_info();
@@ -1142,8 +1145,10 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
? info->isolate()->counters()->compile_eval()
: info->isolate()->counters()->compile();
HistogramTimerScope timer(rate);
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
- parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile");
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ isolate,
+ (parse_info->is_eval() ? &tracing::TraceEventStatsTable::CompileEval
+ : &tracing::TraceEventStatsTable::Compile));
// Allocate a shared function info object.
DCHECK_EQ(kNoSourcePosition, lit->function_token_position());
@@ -1613,8 +1618,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
HistogramTimerScope timer(isolate->counters()->compile_deserialize());
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileDeserialize);
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
- "V8.CompileDeserialize");
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ isolate, &tracing::TraceEventStatsTable::CompileDeserialize);
Handle<SharedFunctionInfo> result;
if (CodeSerializer::Deserialize(isolate, *cached_data, source)
.ToHandle(&result)) {
@@ -1687,8 +1692,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
isolate->counters()->compile_serialize());
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileSerialize);
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
- "V8.CompileSerialize");
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ isolate, &tracing::TraceEventStatsTable::CompileSerialize);
*cached_data = CodeSerializer::Serialize(isolate, result, source);
if (FLAG_profile_deserialization) {
PrintF("[Compiling and serializing took %0.3f ms]\n",
@@ -1804,7 +1809,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
// Generate code
TimerEventScope<TimerEventCompileCode> timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode);
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ isolate, &tracing::TraceEventStatsTable::CompileCode);
if (lazy) {
info.SetCode(isolate->builtins()->CompileLazy());
} else if (Renumber(info.parse_info()) && GenerateUnoptimizedCode(&info)) {
@@ -1879,8 +1885,8 @@ void Compiler::FinalizeCompilationJob(CompilationJob* raw_job) {
TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::RecompileSynchronous);
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
- "V8.RecompileSynchronous");
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ isolate, &tracing::TraceEventStatsTable::RecompileSynchronous);
Handle<SharedFunctionInfo> shared = info->shared_info();
shared->code()->set_profiler_ticks(0);
« no previous file with comments | « src/builtins/builtins-utils.h ('k') | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698