diff --git a/src/compiler-dispatcher/optimizing-compile-dispatcher.cc b/src/compiler-dispatcher/optimizing-compile-dispatcher.cc index 8c578ca30c..d2836f4209 100644 --- a/src/compiler-dispatcher/optimizing-compile-dispatcher.cc +++ b/src/compiler-dispatcher/optimizing-compile-dispatcher.cc @@ -50,6 +50,8 @@ class OptimizingCompileDispatcher::CompileTask : public v8::Task { DisallowHandleDereference no_deref; { + HistogramTimerScope histogram_timer( + isolate_->counters()->compile_optimized_background_thread()); TimerEventScope timer(isolate_); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), diff --git a/src/compiler.cc b/src/compiler.cc index 4e34407eb7..a94e4ebffe 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -874,6 +874,8 @@ MaybeHandle GetOptimizedCode(Handle function, return MaybeHandle(); } + HistogramTimerScope timer( + isolate->counters()->compile_optimized_main_thread()); TimerEventScope optimize_code_timer(isolate); RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::OptimizeCode); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.OptimizeCode"); @@ -928,6 +930,8 @@ CompilationJob::Status FinalizeOptimizedCompilationJob(CompilationJob* job) { CompilationInfo* info = job->info(); Isolate* isolate = info->isolate(); + HistogramTimerScope histogram_timer( + isolate->counters()->compile_optimized_main_thread()); TimerEventScope timer(info->isolate()); RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::RecompileSynchronous); diff --git a/src/counters.h b/src/counters.h index 06a680c60d..bfe39cdfe9 100644 --- a/src/counters.h +++ b/src/counters.h @@ -969,6 +969,11 @@ class RuntimeCallTimerScope { HT(compile_serialize, V8.CompileSerializeMicroSeconds, 100000, MICROSECOND) \ HT(compile_deserialize, V8.CompileDeserializeMicroSeconds, 1000000, \ MICROSECOND) \ + /* Optimized compile times. */ \ + HT(compile_optimized_main_thread, V8.CompileOptimizedMainThreadMicroSeconds, \ + 1000000, MICROSECOND) \ + HT(compile_optimized_background_thread, \ + V8.CompileOptimizeBackgroundThreadMicroSeconds, 1000000, MICROSECOND) \ /* Total compilation time incl. caching/parsing */ \ HT(compile_script, V8.CompileScriptMicroSeconds, 1000000, MICROSECOND) \ /* Total JavaScript execution time (including callbacks and runtime calls */ \