From 30c6bd45be34b0517ae0401822857e3c9a934748 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Tue, 21 Apr 2020 12:43:26 -0700 Subject: [PATCH] [weakrefs] Ship WeakRef and FinalizationRegistry. I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/L04PqDk9eMU Bug: v8:8179 Change-Id: I52aaa62cdab981b802fa4a986d60421ef6efcfbb Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2158371 Commit-Queue: Shu-yu Guo Reviewed-by: Ulan Degenbaev Reviewed-by: Ross McIlroy Cr-Commit-Position: refs/heads/master@{#67295} --- src/flags/flag-definitions.h | 18 +++++++++--------- src/init/bootstrapper.cc | 7 +++++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/flags/flag-definitions.h b/src/flags/flag-definitions.h index 9c4b21235b..a36900c68e 100644 --- a/src/flags/flag-definitions.h +++ b/src/flags/flag-definitions.h @@ -217,7 +217,6 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs) V(harmony_promise_any, "harmony Promise.any") \ V(harmony_string_replaceall, "harmony String.prototype.replaceAll") \ V(harmony_regexp_sequence, "RegExp Unicode sequence properties") \ - V(harmony_weak_refs, "harmony weak references") \ V(harmony_weak_refs_with_cleanup_some, \ "harmony weak references with FinalizationRegistry.prototype.cleanupSome") \ V(harmony_regexp_match_indices, "harmony regexp match indices") \ @@ -247,14 +246,15 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs) #endif // Features that are shipping (turned on by default, but internal flag remains). -#define HARMONY_SHIPPING_BASE(V) \ - V(harmony_namespace_exports, \ - "harmony namespace exports (export * as foo from 'bar')") \ - V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \ - V(harmony_import_meta, "harmony import.meta property") \ - V(harmony_dynamic_import, "harmony dynamic import") \ - V(harmony_promise_all_settled, "harmony Promise.allSettled") \ - V(harmony_private_methods, "harmony private methods in class literals") +#define HARMONY_SHIPPING_BASE(V) \ + V(harmony_namespace_exports, \ + "harmony namespace exports (export * as foo from 'bar')") \ + V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \ + V(harmony_import_meta, "harmony import.meta property") \ + V(harmony_dynamic_import, "harmony dynamic import") \ + V(harmony_promise_all_settled, "harmony Promise.allSettled") \ + V(harmony_private_methods, "harmony private methods in class literals") \ + V(harmony_weak_refs, "harmony weak references") #ifdef V8_INTL_SUPPORT #define HARMONY_SHIPPING(V) \ diff --git a/src/init/bootstrapper.cc b/src/init/bootstrapper.cc index 7f129a07d0..ffee2c8777 100644 --- a/src/init/bootstrapper.cc +++ b/src/init/bootstrapper.cc @@ -3944,9 +3944,12 @@ Handle Genesis::InstallTypedArray(const char* name, void Genesis::InitializeExperimentalGlobal() { #define FEATURE_INITIALIZE_GLOBAL(id, descr) InitializeGlobal_##id(); - HARMONY_INPROGRESS(FEATURE_INITIALIZE_GLOBAL) - HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL) + // Initialize features from more mature to less mature, because less mature + // features may depend on more mature features having been initialized + // already. HARMONY_SHIPPING(FEATURE_INITIALIZE_GLOBAL) + HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL) + HARMONY_INPROGRESS(FEATURE_INITIALIZE_GLOBAL) #undef FEATURE_INITIALIZE_GLOBAL }