Commit c45c9bc2 authored by Bill Budge's avatar Bill Budge Committed by Commit Bot

[flags] Add a flag to independently enable/disable Atomics

- Adds a --harmony-atomics feature to gate Atomics. This allows us to
  independently add SharedArrayBuffer and Atomics on the global object
  of Contexts, which is necessary for migration to a COOP+COEP site
  isolation requirement.

Bug: chromium:923807
Change-Id: If80c12eb86dc0251a5e5fad62a6dd5ced3380b5b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2340322
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Reviewed-by: 's avatarBen Smith <binji@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70129}
parent 41577283
......@@ -276,6 +276,7 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs)
V(harmony_namespace_exports, \
"harmony namespace exports (export * as foo from 'bar')") \
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_atomics, "harmony atomics") \
V(harmony_import_meta, "harmony import.meta property") \
V(harmony_dynamic_import, "harmony dynamic import") \
V(harmony_promise_all_settled, "harmony Promise.allSettled") \
......
......@@ -4151,6 +4151,12 @@ void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
JSObject::AddProperty(isolate_, global, "SharedArrayBuffer",
isolate()->shared_array_buffer_fun(), DONT_ENUM);
}
void Genesis::InitializeGlobal_harmony_atomics() {
if (!FLAG_harmony_atomics) return;
Handle<JSGlobalObject> global(native_context()->global_object(), isolate());
JSObject::AddProperty(isolate_, global, "Atomics",
isolate()->atomics_object(), DONT_ENUM);
......
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