Commit 41a4651a authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[tracing] Correct "V8.OptimizeCode" scope.

The "V8.OptimizeCode" trace event (in "disabled-by-default-v8.compile"
category) didn't include the setup of the OptimizedCompilationJob, which
is quite expensive already and should be accounted for properly.

Bug: v8:8598
Change-Id: Ieec139c8d555d02edfbc52e904ee214d1007afbd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1533871Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60413}
parent 8d605323
...@@ -781,6 +781,11 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, ...@@ -781,6 +781,11 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
function->feedback_vector()->set_profiler_ticks(0); function->feedback_vector()->set_profiler_ticks(0);
VMState<COMPILER> state(isolate); VMState<COMPILER> state(isolate);
TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate,
RuntimeCallCounterId::kOptimizeCode);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.OptimizeCode");
DCHECK(!isolate->has_pending_exception()); DCHECK(!isolate->has_pending_exception());
PostponeInterruptsScope postpone(isolate); PostponeInterruptsScope postpone(isolate);
bool has_script = shared->script()->IsScript(); bool has_script = shared->script()->IsScript();
...@@ -806,11 +811,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, ...@@ -806,11 +811,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
return MaybeHandle<Code>(); return MaybeHandle<Code>();
} }
TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate);
RuntimeCallTimerScope runtimeTimer(isolate,
RuntimeCallCounterId::kOptimizeCode);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.OptimizeCode");
// In case of concurrent recompilation, all handles below this point will be // In case of concurrent recompilation, all handles below this point will be
// allocated in a deferred handle scope that is detached and handed off to // allocated in a deferred handle scope that is detached and handed off to
// the background thread when we return. // the background thread when we return.
......
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