Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp

Issue 2764953002: WIP: Entry realm stack in Blink
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1d0dcc9ba52c15c969d8f3984cb46af2aefaa951..17936962a989c0df50eb9bdee54f143dd6391178 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -543,6 +543,8 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledScript(
probe::ExecuteScript probe(context);
ThreadDebugger::willExecuteScript(isolate,
script->GetUnboundScript()->GetId());
+ V8PerIsolateData::EntryRealmScope entryRealmScope(
+ V8PerIsolateData::from(isolate), isolate->GetCurrentContext());
result = script->Run(isolate->GetCurrentContext());
ThreadDebugger::didExecuteScript(isolate);
}
@@ -566,6 +568,8 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::compileAndRunInternalScript(
TRACE_EVENT0("v8", "v8.run");
v8::MicrotasksScope microtasksScope(isolate,
v8::MicrotasksScope::kDoNotRunMicrotasks);
+ V8PerIsolateData::EntryRealmScope entryRealmScope(
+ V8PerIsolateData::from(isolate), isolate->GetCurrentContext());
v8::MaybeLocal<v8::Value> result = script->Run(isolate->GetCurrentContext());
CHECK(!isolate->IsDead());
return result;
@@ -577,6 +581,8 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledInternalScript(
TRACE_EVENT0("v8", "v8.run");
v8::MicrotasksScope microtasksScope(isolate,
v8::MicrotasksScope::kDoNotRunMicrotasks);
+ V8PerIsolateData::EntryRealmScope entryRealmScope(
+ V8PerIsolateData::from(isolate), isolate->GetCurrentContext());
v8::MaybeLocal<v8::Value> result = script->Run(isolate->GetCurrentContext());
CHECK(!isolate->IsDead());
return result;
@@ -613,6 +619,8 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callAsConstructor(
v8::MicrotasksScope::kRunMicrotasks);
probe::CallFunction probe(context, function, depth);
ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
+ V8PerIsolateData::EntryRealmScope entryRealmScope(
+ V8PerIsolateData::from(isolate), isolate->GetCurrentContext());
v8::MaybeLocal<v8::Value> result =
constructor->CallAsConstructor(isolate->GetCurrentContext(), argc, argv);
CHECK(!isolate->IsDead());
@@ -652,6 +660,8 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callFunction(
v8::MicrotasksScope::kRunMicrotasks);
probe::CallFunction probe(context, function, depth);
ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
+ V8PerIsolateData::EntryRealmScope entryRealmScope(
+ V8PerIsolateData::from(isolate), isolate->GetCurrentContext());
v8::MaybeLocal<v8::Value> result =
function->Call(isolate->GetCurrentContext(), receiver, argc, args);
CHECK(!isolate->IsDead());
@@ -670,6 +680,8 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callInternalFunction(
CHECK(!ThreadState::current()->isWrapperTracingForbidden());
v8::MicrotasksScope microtasksScope(isolate,
v8::MicrotasksScope::kDoNotRunMicrotasks);
+ V8PerIsolateData::EntryRealmScope entryRealmScope(
+ V8PerIsolateData::from(isolate), isolate->GetCurrentContext());
v8::MaybeLocal<v8::Value> result =
function->Call(isolate->GetCurrentContext(), receiver, argc, args);
CHECK(!isolate->IsDead());
@@ -683,6 +695,8 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::evaluateModule(
TRACE_EVENT0("v8", "v8.evaluateModule");
v8::MicrotasksScope microtasksScope(isolate,
v8::MicrotasksScope::kRunMicrotasks);
+ V8PerIsolateData::EntryRealmScope entryRealmScope(
+ V8PerIsolateData::from(isolate), context);
return module->Evaluate(context);
}
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698