Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index 73eeba09cf96e96cc417aaccf1cdb87e46a6f62d..b470ac0873dc04cfa8cbbf49468f9691b0421f68 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -678,6 +678,8 @@ bool GetOptimizedCodeNow(CompilationJob* job) { |
if (!Compiler::ParseAndAnalyze(info->parse_info())) return false; |
} |
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
+ RuntimeCallTimerScope runtimeTimer(isolate, &stats->RecompileSynchronous); |
TimerEventScope<TimerEventRecompileSynchronous> timer(isolate); |
TRACE_EVENT0("v8", "V8.RecompileSynchronous"); |
@@ -726,6 +728,9 @@ bool GetOptimizedCodeLater(CompilationJob* job) { |
info->ReopenHandlesInNewHandleScope(); |
info->parse_info()->ReopenHandlesInNewHandleScope(); |
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
+ RuntimeCallTimerScope runtimeTimer(info->isolate(), |
+ &stats->RecompileSynchronous); |
TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); |
TRACE_EVENT0("v8", "V8.RecompileSynchronous"); |
@@ -805,6 +810,8 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, |
} |
CanonicalHandleScope canonical(isolate); |
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
+ RuntimeCallTimerScope runtimeTimer(isolate, &stats->OptimizeCode); |
TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate); |
TRACE_EVENT0("v8", "V8.OptimizeCode"); |
@@ -950,6 +957,8 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) { |
Isolate* isolate = function->GetIsolate(); |
DCHECK(!isolate->has_pending_exception()); |
DCHECK(!function->is_compiled()); |
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
+ RuntimeCallTimerScope runtimeTimer(isolate, &stats->CompileCode); |
TimerEventScope<TimerEventCompileCode> compile_timer(isolate); |
TRACE_EVENT0("v8", "V8.CompileCode"); |
AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy()); |
@@ -1022,6 +1031,8 @@ Handle<SharedFunctionInfo> NewSharedFunctionInfoForLiteral( |
Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) { |
Isolate* isolate = info->isolate(); |
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
+ RuntimeCallTimerScope runtimeTimer(isolate, &stats->CompileCode); |
TimerEventScope<TimerEventCompileCode> timer(isolate); |
TRACE_EVENT0("v8", "V8.CompileCode"); |
PostponeInterruptsScope postpone(isolate); |
@@ -1084,9 +1095,12 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) { |
// Measure how long it takes to do the compilation; only take the |
// rest of the function into account to avoid overlap with the |
// parsing statistics. |
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
+ RuntimeCallTimerScope runtimeTimer( |
+ isolate, info->is_eval() ? &stats->CompileEval : &stats->Compile); |
HistogramTimer* rate = info->is_eval() |
- ? info->isolate()->counters()->compile_eval() |
- : info->isolate()->counters()->compile(); |
+ ? info->isolate()->counters()->compile_eval() |
+ : info->isolate()->counters()->compile(); |
HistogramTimerScope timer(rate); |
TRACE_EVENT0("v8", info->is_eval() ? "V8.CompileEval" : "V8.Compile"); |
@@ -1463,6 +1477,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript( |
compile_options == ScriptCompiler::kConsumeCodeCache && |
!isolate->debug()->is_loaded()) { |
// Then check cached code provided by embedder. |
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
+ RuntimeCallTimerScope runtimeTimer(isolate, &stats->CompileDeserialize); |
HistogramTimerScope timer(isolate->counters()->compile_deserialize()); |
TRACE_EVENT0("v8", "V8.CompileDeserialize"); |
Handle<SharedFunctionInfo> result; |
@@ -1533,6 +1549,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript( |
compilation_cache->PutScript(source, context, language_mode, result); |
if (FLAG_serialize_toplevel && |
compile_options == ScriptCompiler::kProduceCodeCache) { |
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
+ RuntimeCallTimerScope runtimeTimer(isolate, &stats->CompileSerialize); |
HistogramTimerScope histogram_timer( |
isolate->counters()->compile_serialize()); |
TRACE_EVENT0("v8", "V8.CompileSerialize"); |
@@ -1656,6 +1674,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo( |
!(FLAG_ignition && FLAG_ignition_eager && !isolate->serializer_enabled()); |
// Generate code |
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
+ RuntimeCallTimerScope runtimeTimer(isolate, &stats->CompileCode); |
TimerEventScope<TimerEventCompileCode> timer(isolate); |
TRACE_EVENT0("v8", "V8.CompileCode"); |
if (lazy) { |
@@ -1731,6 +1751,8 @@ void Compiler::FinalizeCompilationJob(CompilationJob* raw_job) { |
Isolate* isolate = info->isolate(); |
VMState<COMPILER> state(isolate); |
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
+ RuntimeCallTimerScope runtimeTimer(isolate, &stats->RecompileSynchronous); |
TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); |
TRACE_EVENT0("v8", "V8.RecompileSynchronous"); |