| 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 51bc05d7fd9fc95f72e0411f9ed57381384dd7a5..de8a036d9f524a54370239529c3759fc281b69b9 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
|
| @@ -29,7 +29,6 @@
|
| #include "bindings/core/v8/ScriptStreamer.h"
|
| #include "bindings/core/v8/V8Binding.h"
|
| #include "bindings/core/v8/V8GCController.h"
|
| -#include "bindings/core/v8/V8RecursionScope.h"
|
| #include "bindings/core/v8/V8ThrowException.h"
|
| #include "core/dom/ExecutionContext.h"
|
| #include "core/fetch/CachedMetadata.h"
|
| @@ -400,7 +399,7 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledScript(v8::Isolate* isolate
|
| TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
|
| TRACE_EVENT1("v8", "v8.run", "fileName", TRACE_STR_COPY(*v8::String::Utf8Value(script->GetUnboundScript()->GetScriptName())));
|
|
|
| - if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth)
|
| + if (v8::MicrotasksScope::GetCurrentDepth(isolate) >= kMaxRecursionDepth)
|
| return throwStackOverflowExceptionIfNeeded(isolate);
|
|
|
| RELEASE_ASSERT(!context->isIteratingOverObservers());
|
| @@ -412,7 +411,7 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledScript(v8::Isolate* isolate
|
| throwScriptForbiddenException(isolate);
|
| return v8::MaybeLocal<v8::Value>();
|
| }
|
| - V8RecursionScope recursionScope(isolate);
|
| + v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
|
| InspectorInstrumentationCookie cookie = InspectorInstrumentation::willExecuteScript(context, script->GetUnboundScript()->GetId());
|
| result = script->Run(isolate->GetCurrentContext());
|
| InspectorInstrumentation::didExecuteScript(cookie);
|
| @@ -430,7 +429,7 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::compileAndRunInternalScript(v8::Local<
|
|
|
| TRACE_EVENT0("v8", "v8.run");
|
| TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
|
| - V8RecursionScope::MicrotaskSuppression recursionScope(isolate);
|
| + v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
|
| v8::MaybeLocal<v8::Value> result = script->Run(isolate->GetCurrentContext());
|
| crashIfIsolateIsDead(isolate);
|
| return result;
|
| @@ -440,7 +439,7 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledInternalScript(v8::Isolate*
|
| {
|
| TRACE_EVENT0("v8", "v8.run");
|
| TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
|
| - V8RecursionScope::MicrotaskSuppression recursionScope(isolate);
|
| + v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
|
| v8::MaybeLocal<v8::Value> result = script->Run(isolate->GetCurrentContext());
|
| crashIfIsolateIsDead(isolate);
|
| return result;
|
| @@ -451,7 +450,7 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callFunction(v8::Local<v8::Function> f
|
| TRACE_EVENT1("devtools.timeline,v8", "FunctionCall", "data", devToolsTraceEventData(isolate, context, function));
|
| TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
|
|
|
| - if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth)
|
| + if (v8::MicrotasksScope::GetCurrentDepth(isolate) >= kMaxRecursionDepth)
|
| return v8::MaybeLocal<v8::Value>(throwStackOverflowExceptionIfNeeded(isolate));
|
|
|
| RELEASE_ASSERT(!context->isIteratingOverObservers());
|
| @@ -460,7 +459,7 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callFunction(v8::Local<v8::Function> f
|
| throwScriptForbiddenException(isolate);
|
| return v8::MaybeLocal<v8::Value>();
|
| }
|
| - V8RecursionScope recursionScope(isolate);
|
| + v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
|
| InspectorInstrumentationCookie cookie = InspectorInstrumentation::willExecuteScript(context, function->ScriptId());
|
| v8::MaybeLocal<v8::Value> result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
|
| crashIfIsolateIsDead(isolate);
|
| @@ -472,7 +471,7 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callInternalFunction(v8::Local<v8::Fun
|
| {
|
| TRACE_EVENT0("v8", "v8.callFunction");
|
| TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
|
| - V8RecursionScope::MicrotaskSuppression recursionScope(isolate);
|
| + v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
|
| v8::MaybeLocal<v8::Value> result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
|
| crashIfIsolateIsDead(isolate);
|
| return result;
|
| @@ -483,7 +482,7 @@ v8::MaybeLocal<v8::Object> V8ScriptRunner::instantiateObject(v8::Isolate* isolat
|
| TRACE_EVENT0("v8", "v8.newInstance");
|
| TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
|
|
|
| - V8RecursionScope::MicrotaskSuppression scope(isolate);
|
| + v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
|
| v8::MaybeLocal<v8::Object> result = objectTemplate->NewInstance(isolate->GetCurrentContext());
|
| crashIfIsolateIsDead(isolate);
|
| return result;
|
| @@ -494,7 +493,7 @@ v8::MaybeLocal<v8::Object> V8ScriptRunner::instantiateObject(v8::Isolate* isolat
|
| TRACE_EVENT0("v8", "v8.newInstance");
|
| TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
|
|
|
| - V8RecursionScope::MicrotaskSuppression scope(isolate);
|
| + v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
|
| v8::MaybeLocal<v8::Object> result = function->NewInstance(isolate->GetCurrentContext(), argc, argv);
|
| crashIfIsolateIsDead(isolate);
|
| return result;
|
| @@ -508,7 +507,7 @@ v8::MaybeLocal<v8::Object> V8ScriptRunner::instantiateObjectInDocument(v8::Isola
|
| throwScriptForbiddenException(isolate);
|
| return v8::MaybeLocal<v8::Object>();
|
| }
|
| - V8RecursionScope scope(isolate);
|
| + v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
|
| v8::MaybeLocal<v8::Object> result = function->NewInstance(isolate->GetCurrentContext(), argc, argv);
|
| crashIfIsolateIsDead(isolate);
|
| return result;
|
|
|