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}
This commit is contained in:
parent
73f154ba60
commit
6bf6ab79e3
@ -1938,7 +1938,7 @@ MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal(
|
||||
i::Handle<i::SharedFunctionInfo> result;
|
||||
{
|
||||
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> source_map_url;
|
||||
int line_offset = 0;
|
||||
|
@ -663,7 +663,8 @@ bool GetOptimizedCodeNow(CompilationJob* job) {
|
||||
TimerEventScope<TimerEventRecompileSynchronous> timer(isolate);
|
||||
RuntimeCallTimerScope runtimeTimer(isolate,
|
||||
&RuntimeCallStats::RecompileSynchronous);
|
||||
TRACE_EVENT0("v8", "V8.RecompileSynchronous");
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
|
||||
"V8.RecompileSynchronous");
|
||||
|
||||
if (job->CreateGraph() != CompilationJob::SUCCEEDED ||
|
||||
job->OptimizeGraph() != CompilationJob::SUCCEEDED ||
|
||||
@ -716,7 +717,8 @@ bool GetOptimizedCodeLater(CompilationJob* job) {
|
||||
TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
|
||||
RuntimeCallTimerScope runtimeTimer(info->isolate(),
|
||||
&RuntimeCallStats::RecompileSynchronous);
|
||||
TRACE_EVENT0("v8", "V8.RecompileSynchronous");
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
|
||||
"V8.RecompileSynchronous");
|
||||
|
||||
if (job->CreateGraph() != CompilationJob::SUCCEEDED) return false;
|
||||
isolate->optimizing_compile_dispatcher()->QueueForOptimization(job);
|
||||
@ -784,7 +786,7 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
|
||||
CanonicalHandleScope canonical(isolate);
|
||||
TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate);
|
||||
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.
|
||||
if (FLAG_turbo_from_bytecode && use_turbofan &&
|
||||
@ -974,7 +976,7 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
|
||||
TimerEventScope<TimerEventCompileCode> compile_timer(isolate);
|
||||
RuntimeCallTimerScope runtimeTimer(isolate,
|
||||
&RuntimeCallStats::CompileCodeLazy);
|
||||
TRACE_EVENT0("v8", "V8.CompileCode");
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
|
||||
AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy());
|
||||
|
||||
if (FLAG_turbo_cache_shared_code) {
|
||||
@ -1029,7 +1031,7 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
|
||||
Isolate* isolate = info->isolate();
|
||||
TimerEventScope<TimerEventCompileCode> timer(isolate);
|
||||
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode);
|
||||
TRACE_EVENT0("v8", "V8.CompileCode");
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
|
||||
PostponeInterruptsScope postpone(isolate);
|
||||
DCHECK(!isolate->native_context().is_null());
|
||||
ParseInfo* parse_info = info->parse_info();
|
||||
@ -1096,7 +1098,8 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
|
||||
? info->isolate()->counters()->compile_eval()
|
||||
: info->isolate()->counters()->compile();
|
||||
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.
|
||||
DCHECK_EQ(kNoSourcePosition, lit->function_token_position());
|
||||
@ -1496,7 +1499,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
|
||||
HistogramTimerScope timer(isolate->counters()->compile_deserialize());
|
||||
RuntimeCallTimerScope runtimeTimer(isolate,
|
||||
&RuntimeCallStats::CompileDeserialize);
|
||||
TRACE_EVENT0("v8", "V8.CompileDeserialize");
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
|
||||
"V8.CompileDeserialize");
|
||||
Handle<SharedFunctionInfo> result;
|
||||
if (CodeSerializer::Deserialize(isolate, *cached_data, source)
|
||||
.ToHandle(&result)) {
|
||||
@ -1569,7 +1573,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
|
||||
isolate->counters()->compile_serialize());
|
||||
RuntimeCallTimerScope runtimeTimer(isolate,
|
||||
&RuntimeCallStats::CompileSerialize);
|
||||
TRACE_EVENT0("v8", "V8.CompileSerialize");
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
|
||||
"V8.CompileSerialize");
|
||||
*cached_data = CodeSerializer::Serialize(isolate, result, source);
|
||||
if (FLAG_profile_deserialization) {
|
||||
PrintF("[Compiling and serializing took %0.3f ms]\n",
|
||||
@ -1686,7 +1691,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
|
||||
// Generate code
|
||||
TimerEventScope<TimerEventCompileCode> timer(isolate);
|
||||
RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::CompileCode);
|
||||
TRACE_EVENT0("v8", "V8.CompileCode");
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode");
|
||||
if (lazy) {
|
||||
info.SetCode(isolate->builtins()->CompileLazy());
|
||||
} else if (Renumber(info.parse_info()) && GenerateUnoptimizedCode(&info)) {
|
||||
@ -1761,7 +1766,8 @@ void Compiler::FinalizeCompilationJob(CompilationJob* raw_job) {
|
||||
TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate());
|
||||
RuntimeCallTimerScope runtimeTimer(isolate,
|
||||
&RuntimeCallStats::RecompileSynchronous);
|
||||
TRACE_EVENT0("v8", "V8.RecompileSynchronous");
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
|
||||
"V8.RecompileSynchronous");
|
||||
|
||||
Handle<SharedFunctionInfo> shared = info->shared_info();
|
||||
shared->code()->set_profiler_ticks(0);
|
||||
|
@ -32,7 +32,7 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
|
||||
RuntimeCallTimerScope runtimeTimer(isolate,
|
||||
&RuntimeCallStats::CompileFullCode);
|
||||
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();
|
||||
if (!script->IsUndefined(isolate) &&
|
||||
|
@ -135,7 +135,7 @@ bool Interpreter::MakeBytecode(CompilationInfo* info) {
|
||||
RuntimeCallTimerScope runtimeTimer(info->isolate(),
|
||||
&RuntimeCallStats::CompileIgnition);
|
||||
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) {
|
||||
OFStream os(stdout);
|
||||
|
@ -52,7 +52,9 @@ class OptimizingCompileDispatcher::CompileTask : public v8::Task {
|
||||
isolate_->optimizing_compile_dispatcher();
|
||||
{
|
||||
TimerEventScope<TimerEventRecompileConcurrent> timer(isolate_);
|
||||
TRACE_EVENT0("v8", "V8.RecompileConcurrent");
|
||||
|
||||
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
|
||||
"V8.RecompileConcurrent");
|
||||
|
||||
if (dispatcher->recompilation_delay_ != 0) {
|
||||
base::OS::Sleep(base::TimeDelta::FromMilliseconds(
|
||||
|
@ -839,7 +839,7 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) {
|
||||
|
||||
HistogramTimerScope timer_scope(isolate->counters()->parse(), true);
|
||||
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()));
|
||||
isolate->counters()->total_parse_size()->Increment(source->length());
|
||||
base::ElapsedTimer timer;
|
||||
@ -1007,7 +1007,7 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info) {
|
||||
DCHECK(parsing_on_main_thread_);
|
||||
RuntimeCallTimerScope runtime_timer(isolate, &RuntimeCallStats::ParseLazy);
|
||||
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()));
|
||||
isolate->counters()->total_parse_size()->Increment(source->length());
|
||||
base::ElapsedTimer timer;
|
||||
@ -4894,7 +4894,7 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
|
||||
if (pre_parse_timer_ != NULL) {
|
||||
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());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user