| Index: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
|
| index e88e061f997a16e20448a0d992b00f657930ca94..6eb2f137f27a4ac94ec4d790f2321ec1fce2df7e 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
|
| @@ -439,10 +439,11 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledInternalScript(v8::Isolate*
|
|
|
| v8::MaybeLocal<v8::Value> V8ScriptRunner::callFunction(v8::Local<v8::Function> function, ExecutionContext* context, v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> args[], v8::Isolate* isolate)
|
| {
|
| - TRACE_EVENT1("devtools.timeline,v8", "FunctionCall", "data", InspectorFunctionCallEvent::data(context, function));
|
| + TRACE_EVENT0("v8", "v8.callFunction");
|
| TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
|
|
|
| - if (v8::MicrotasksScope::GetCurrentDepth(isolate) >= kMaxRecursionDepth)
|
| + int depth = v8::MicrotasksScope::GetCurrentDepth(isolate);
|
| + if (depth >= kMaxRecursionDepth)
|
| return v8::MaybeLocal<v8::Value>(throwStackOverflowExceptionIfNeeded(isolate));
|
|
|
| RELEASE_ASSERT(!context->isIteratingOverObservers());
|
| @@ -451,11 +452,15 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callFunction(v8::Local<v8::Function> f
|
| throwScriptForbiddenException(isolate);
|
| return v8::MaybeLocal<v8::Value>();
|
| }
|
| + if (!depth)
|
| + TRACE_EVENT_BEGIN1("devtools.timeline", "FunctionCall", "data", InspectorFunctionCallEvent::data(context, function));
|
| v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
|
| ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
|
| v8::MaybeLocal<v8::Value> result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
|
| crashIfIsolateIsDead(isolate);
|
| ThreadDebugger::didExecuteScript(isolate);
|
| + if (!depth)
|
| + TRACE_EVENT_END0("devtools.timeline", "FunctionCall");
|
| return result;
|
| }
|
|
|
|
|