Commit e8f5a272 authored by rmcilroy's avatar rmcilroy Committed by Commit bot

Add V8.Execute histogram to measure time spent executing JS code.

Adds a V8.Execute histogram to measure the amount of time spent executing
JS code.

BUG=v8:4865
LOG=N

Review-Url: https://codereview.chromium.org/1974003002
Cr-Commit-Position: refs/heads/master@{#36217}
parent f73cf983
......@@ -1783,6 +1783,7 @@ Local<Value> UnboundScript::GetSourceMappingURL() {
MaybeLocal<Value> Script::Run(Local<Context> context) {
PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Script::Run()", Value)
i::HistogramTimerScope execute_timer(isolate->counters()->execute());
i::AggregatingHistogramTimerScope timer(isolate->counters()->compile_lazy());
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute");
......@@ -4379,6 +4380,7 @@ MaybeLocal<Value> Object::CallAsFunction(Local<Context> context,
Local<Value> argv[]) {
PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Object::CallAsFunction()",
Value);
i::HistogramTimerScope execute_timer(isolate->counters()->execute());
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute");
auto self = Utils::OpenHandle(this);
......@@ -4406,6 +4408,7 @@ MaybeLocal<Value> Object::CallAsConstructor(Local<Context> context, int argc,
Local<Value> argv[]) {
PREPARE_FOR_EXECUTION_WITH_CALLBACK(context,
"v8::Object::CallAsConstructor()", Value);
i::HistogramTimerScope execute_timer(isolate->counters()->execute());
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute");
auto self = Utils::OpenHandle(this);
......@@ -4456,6 +4459,7 @@ MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc,
v8::Local<v8::Value> argv[]) const {
PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Function::NewInstance()",
Object);
i::HistogramTimerScope execute_timer(isolate->counters()->execute());
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute");
auto self = Utils::OpenHandle(this);
......@@ -4480,6 +4484,7 @@ MaybeLocal<v8::Value> Function::Call(Local<Context> context,
v8::Local<v8::Value> recv, int argc,
v8::Local<v8::Value> argv[]) {
PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Function::Call()", Value);
i::HistogramTimerScope execute_timer(isolate->counters()->execute());
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute");
auto self = Utils::OpenHandle(this);
......
......@@ -700,6 +700,8 @@ class RuntimeCallTimerScope {
MICROSECOND) \
/* Total compilation time incl. caching/parsing */ \
HT(compile_script, V8.CompileScriptMicroSeconds, 1000000, MICROSECOND) \
/* Total JavaScript execution time (including callbacks and runtime calls */ \
HT(execute, V8.Execute, 1000000, MICROSECOND) \
/* Asm/Wasm */ \
HT(wasm_instantiate_module_time, V8.WasmInstantiateModuleMicroSeconds, \
1000000, MICROSECOND) \
......
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