Reland "[inspector] Enable async stack tagging API by default"

This is a reland of commit 4bab7a8ee6

The reland changes the way how we install the async stack tagging API
on the console object. Instead of using `v8::Object::Set`, we use
`createDataProperty` which is sufficient. With `Set`, arbitrary
JS could run via accessors, which might not be allowed depending on
when the API is installed.

Original change's description:
> [inspector] Enable async stack tagging API by default
>
> R=bmeurer@chromium.org
>
> Fixed: chromium:1334585
> Change-Id: Id79a60bac1731ea9c60654ff15c8e23f958c6e57
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3799431
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82161}

Change-Id: I9b8c8e643705f8f043acac5af14307f2dbdb5a68
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3809692
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82190}
This commit is contained in:
Simon Zünd 2022-08-04 07:50:52 +02:00 committed by V8 LUCI CQ
parent 42c602fb91
commit ddee82c078
2 changed files with 3 additions and 8 deletions

View File

@ -1670,7 +1670,7 @@ DEFINE_BOOL(
"print debug messages for side-effect-free debug-evaluate for testing")
DEFINE_BOOL(hard_abort, true, "abort by crashing")
DEFINE_BOOL(experimental_async_stack_tagging_api, false,
DEFINE_BOOL(experimental_async_stack_tagging_api, true,
"enable experimental async stacks tagging API")
DEFINE_BOOL(experimental_value_unavailable, false,
"enable experimental <value unavailable> in scopes")

View File

@ -823,13 +823,8 @@ void V8Console::installAsyncStackTaggingAPI(v8::Local<v8::Context> context,
v8::MicrotasksScope microtasksScope(isolate,
v8::MicrotasksScope::kDoNotRunMicrotasks);
console
->Set(context, toV8StringInternalized(isolate, "createTask"),
v8::Function::New(context, &V8Console::call<&V8Console::createTask>,
data, 0, v8::ConstructorBehavior::kThrow,
v8::SideEffectType::kHasSideEffect)
.ToLocalChecked())
.Check();
createBoundFunctionProperty(context, console, data, "createTask",
&V8Console::call<&V8Console::createTask>);
}
v8::Local<v8::Object> V8Console::createCommandLineAPI(