Commit 6bf6ab79 authored by ulan's avatar ulan Committed by Commit bot

Move compile and parse trace events to a separate category.

For motivation see the bug.

BUG=625865
LOG=NO

Review-Url: https://codereview.chromium.org/2121273002
Cr-Commit-Position: refs/heads/master@{#37581}
parent 73f154ba
...@@ -1938,7 +1938,7 @@ MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal( ...@@ -1938,7 +1938,7 @@ MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal(
i::Handle<i::SharedFunctionInfo> result; i::Handle<i::SharedFunctionInfo> result;
{ {
i::HistogramTimerScope total(isolate->counters()->compile_script(), true); i::HistogramTimerScope total(isolate->counters()->compile_script(), true);
TRACE_EVENT0("v8", "V8.CompileScript"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileScript");
i::Handle<i::Object> name_obj; i::Handle<i::Object> name_obj;
i::Handle<i::Object> source_map_url; i::Handle<i::Object> source_map_url;
int line_offset = 0; int line_offset = 0;
......
...@@ -663,7 +663,8 @@ bool GetOptimizedCodeNow(CompilationJob* job) { ...@@ -663,7 +663,8 @@ bool GetOptimizedCodeNow(CompilationJob* job) {
TimerEventScope<TimerEventRecompileSynchronous> timer(isolate); TimerEventScope<TimerEventRecompileSynchronous> timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::RecompileSynchronous); &RuntimeCallStats::RecompileSynchronous);
TRACE_EVENT0("v8", "V8.RecompileSynchronous"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.RecompileSynchronous");
if (job->CreateGraph() != CompilationJob::SUCCEEDED || if (job->CreateGraph() != CompilationJob::SUCCEEDED ||
job->OptimizeGraph() != CompilationJob::SUCCEEDED || job->OptimizeGraph() != CompilationJob::SUCCEEDED ||
...@@ -716,7 +717,8 @@ bool GetOptimizedCodeLater(CompilationJob* job) { ...@@ -716,7 +717,8 @@ bool GetOptimizedCodeLater(CompilationJob* job) {
TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
RuntimeCallTimerScope runtimeTimer(info->isolate(), RuntimeCallTimerScope runtimeTimer(info->isolate(),
&RuntimeCallStats::RecompileSynchronous); &RuntimeCallStats::RecompileSynchronous);
TRACE_EVENT0("v8", "V8.RecompileSynchronous"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.RecompileSynchronous");
if (job->CreateGraph() != CompilationJob::SUCCEEDED) return false; if (job->CreateGraph() != CompilationJob::SUCCEEDED) return false;
isolate->optimizing_compile_dispatcher()->QueueForOptimization(job); isolate->optimizing_compile_dispatcher()->QueueForOptimization(job);
...@@ -784,7 +786,7 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, ...@@ -784,7 +786,7 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
CanonicalHandleScope canonical(isolate); CanonicalHandleScope canonical(isolate);
TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate); TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::OptimizeCode); RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::OptimizeCode);
TRACE_EVENT0("v8", "V8.OptimizeCode"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.OptimizeCode");
// TurboFan can optimize directly from existing bytecode. // TurboFan can optimize directly from existing bytecode.
if (FLAG_turbo_from_bytecode && use_turbofan && if (FLAG_turbo_from_bytecode && use_turbofan &&
...@@ -974,7 +976,7 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) { ...@@ -974,7 +976,7 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
TimerEventScope<TimerEventCompileCode> compile_timer(isolate); TimerEventScope<TimerEventCompileCode> compile_timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileCodeLazy); &RuntimeCallStats::CompileCodeLazy);
TRACE_EVENT0("v8", "V8.CompileCode"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy()); AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy());
if (FLAG_turbo_cache_shared_code) { if (FLAG_turbo_cache_shared_code) {
...@@ -1029,7 +1031,7 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) { ...@@ -1029,7 +1031,7 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
Isolate* isolate = info->isolate(); Isolate* isolate = info->isolate();
TimerEventScope<TimerEventCompileCode> timer(isolate); TimerEventScope<TimerEventCompileCode> timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode); RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode);
TRACE_EVENT0("v8", "V8.CompileCode"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
PostponeInterruptsScope postpone(isolate); PostponeInterruptsScope postpone(isolate);
DCHECK(!isolate->native_context().is_null()); DCHECK(!isolate->native_context().is_null());
ParseInfo* parse_info = info->parse_info(); ParseInfo* parse_info = info->parse_info();
...@@ -1096,7 +1098,8 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) { ...@@ -1096,7 +1098,8 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
? info->isolate()->counters()->compile_eval() ? info->isolate()->counters()->compile_eval()
: info->isolate()->counters()->compile(); : info->isolate()->counters()->compile();
HistogramTimerScope timer(rate); HistogramTimerScope timer(rate);
TRACE_EVENT0("v8", parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile");
// Allocate a shared function info object. // Allocate a shared function info object.
DCHECK_EQ(kNoSourcePosition, lit->function_token_position()); DCHECK_EQ(kNoSourcePosition, lit->function_token_position());
...@@ -1496,7 +1499,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript( ...@@ -1496,7 +1499,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
HistogramTimerScope timer(isolate->counters()->compile_deserialize()); HistogramTimerScope timer(isolate->counters()->compile_deserialize());
RuntimeCallTimerScope runtimeTimer(isolate, RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileDeserialize); &RuntimeCallStats::CompileDeserialize);
TRACE_EVENT0("v8", "V8.CompileDeserialize"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.CompileDeserialize");
Handle<SharedFunctionInfo> result; Handle<SharedFunctionInfo> result;
if (CodeSerializer::Deserialize(isolate, *cached_data, source) if (CodeSerializer::Deserialize(isolate, *cached_data, source)
.ToHandle(&result)) { .ToHandle(&result)) {
...@@ -1569,7 +1573,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript( ...@@ -1569,7 +1573,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
isolate->counters()->compile_serialize()); isolate->counters()->compile_serialize());
RuntimeCallTimerScope runtimeTimer(isolate, RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileSerialize); &RuntimeCallStats::CompileSerialize);
TRACE_EVENT0("v8", "V8.CompileSerialize"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.CompileSerialize");
*cached_data = CodeSerializer::Serialize(isolate, result, source); *cached_data = CodeSerializer::Serialize(isolate, result, source);
if (FLAG_profile_deserialization) { if (FLAG_profile_deserialization) {
PrintF("[Compiling and serializing took %0.3f ms]\n", PrintF("[Compiling and serializing took %0.3f ms]\n",
...@@ -1686,7 +1691,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo( ...@@ -1686,7 +1691,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
// Generate code // Generate code
TimerEventScope<TimerEventCompileCode> timer(isolate); TimerEventScope<TimerEventCompileCode> timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode); RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode);
TRACE_EVENT0("v8", "V8.CompileCode"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
if (lazy) { if (lazy) {
info.SetCode(isolate->builtins()->CompileLazy()); info.SetCode(isolate->builtins()->CompileLazy());
} else if (Renumber(info.parse_info()) && GenerateUnoptimizedCode(&info)) { } else if (Renumber(info.parse_info()) && GenerateUnoptimizedCode(&info)) {
...@@ -1761,7 +1766,8 @@ void Compiler::FinalizeCompilationJob(CompilationJob* raw_job) { ...@@ -1761,7 +1766,8 @@ void Compiler::FinalizeCompilationJob(CompilationJob* raw_job) {
TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
RuntimeCallTimerScope runtimeTimer(isolate, RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::RecompileSynchronous); &RuntimeCallStats::RecompileSynchronous);
TRACE_EVENT0("v8", "V8.RecompileSynchronous"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.RecompileSynchronous");
Handle<SharedFunctionInfo> shared = info->shared_info(); Handle<SharedFunctionInfo> shared = info->shared_info();
shared->code()->set_profiler_ticks(0); shared->code()->set_profiler_ticks(0);
......
...@@ -32,7 +32,7 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) { ...@@ -32,7 +32,7 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
RuntimeCallTimerScope runtimeTimer(isolate, RuntimeCallTimerScope runtimeTimer(isolate,
&RuntimeCallStats::CompileFullCode); &RuntimeCallStats::CompileFullCode);
TimerEventScope<TimerEventCompileFullCode> timer(info->isolate()); TimerEventScope<TimerEventCompileFullCode> timer(info->isolate());
TRACE_EVENT0("v8", "V8.CompileFullCode"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileFullCode");
Handle<Script> script = info->script(); Handle<Script> script = info->script();
if (!script->IsUndefined(isolate) && if (!script->IsUndefined(isolate) &&
......
...@@ -135,7 +135,7 @@ bool Interpreter::MakeBytecode(CompilationInfo* info) { ...@@ -135,7 +135,7 @@ bool Interpreter::MakeBytecode(CompilationInfo* info) {
RuntimeCallTimerScope runtimeTimer(info->isolate(), RuntimeCallTimerScope runtimeTimer(info->isolate(),
&RuntimeCallStats::CompileIgnition); &RuntimeCallStats::CompileIgnition);
TimerEventScope<TimerEventCompileIgnition> timer(info->isolate()); TimerEventScope<TimerEventCompileIgnition> timer(info->isolate());
TRACE_EVENT0("v8", "V8.CompileIgnition"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileIgnition");
if (FLAG_print_bytecode || FLAG_print_source || FLAG_print_ast) { if (FLAG_print_bytecode || FLAG_print_source || FLAG_print_ast) {
OFStream os(stdout); OFStream os(stdout);
......
...@@ -52,7 +52,9 @@ class OptimizingCompileDispatcher::CompileTask : public v8::Task { ...@@ -52,7 +52,9 @@ class OptimizingCompileDispatcher::CompileTask : public v8::Task {
isolate_->optimizing_compile_dispatcher(); isolate_->optimizing_compile_dispatcher();
{ {
TimerEventScope<TimerEventRecompileConcurrent> timer(isolate_); TimerEventScope<TimerEventRecompileConcurrent> timer(isolate_);
TRACE_EVENT0("v8", "V8.RecompileConcurrent");
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.RecompileConcurrent");
if (dispatcher->recompilation_delay_ != 0) { if (dispatcher->recompilation_delay_ != 0) {
base::OS::Sleep(base::TimeDelta::FromMilliseconds( base::OS::Sleep(base::TimeDelta::FromMilliseconds(
......
...@@ -839,7 +839,7 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) { ...@@ -839,7 +839,7 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) {
HistogramTimerScope timer_scope(isolate->counters()->parse(), true); HistogramTimerScope timer_scope(isolate->counters()->parse(), true);
RuntimeCallTimerScope runtime_timer(isolate, &RuntimeCallStats::Parse); RuntimeCallTimerScope runtime_timer(isolate, &RuntimeCallStats::Parse);
TRACE_EVENT0("v8", "V8.Parse"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.Parse");
Handle<String> source(String::cast(info->script()->source())); Handle<String> source(String::cast(info->script()->source()));
isolate->counters()->total_parse_size()->Increment(source->length()); isolate->counters()->total_parse_size()->Increment(source->length());
base::ElapsedTimer timer; base::ElapsedTimer timer;
...@@ -1007,7 +1007,7 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info) { ...@@ -1007,7 +1007,7 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info) {
DCHECK(parsing_on_main_thread_); DCHECK(parsing_on_main_thread_);
RuntimeCallTimerScope runtime_timer(isolate, &RuntimeCallStats::ParseLazy); RuntimeCallTimerScope runtime_timer(isolate, &RuntimeCallStats::ParseLazy);
HistogramTimerScope timer_scope(isolate->counters()->parse_lazy()); HistogramTimerScope timer_scope(isolate->counters()->parse_lazy());
TRACE_EVENT0("v8", "V8.ParseLazy"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.ParseLazy");
Handle<String> source(String::cast(info->script()->source())); Handle<String> source(String::cast(info->script()->source()));
isolate->counters()->total_parse_size()->Increment(source->length()); isolate->counters()->total_parse_size()->Increment(source->length());
base::ElapsedTimer timer; base::ElapsedTimer timer;
...@@ -4894,7 +4894,7 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser( ...@@ -4894,7 +4894,7 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
if (pre_parse_timer_ != NULL) { if (pre_parse_timer_ != NULL) {
pre_parse_timer_->Start(); pre_parse_timer_->Start();
} }
TRACE_EVENT0("v8", "V8.PreParse"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.PreParse");
DCHECK_EQ(Token::LBRACE, scanner()->current_token()); DCHECK_EQ(Token::LBRACE, scanner()->current_token());
......
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