From f031466e9059a01f7f781403f13cb66cb4b0912e Mon Sep 17 00:00:00 2001 From: Chengzhong Wu Date: Fri, 24 Nov 2023 11:38:54 +0800 Subject: [PATCH] deps: V8: cherry-pick 0f9ebbc672c7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [flags] Remove --harmony-string-is-well-formed The String.prototype.isWellFormed and toWellFormed have shipped since M111. Bug: v8:13557 Change-Id: I27e332d2fde0f9ea8ad649c016a84d2d3e0bf592 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4931269 Reviewed-by: Shu-yu Guo Commit-Queue: Chengzhong Wu (legendecas) Cr-Commit-Position: refs/heads/main@{#90398} Refs: https://github.com/v8/v8/commit/0f9ebbc672c77594feb9176cf52601116aa7c34c PR-URL: https://github.com/nodejs/node/pull/50867 Reviewed-By: Michaƫl Zasso Reviewed-By: Jiawen Geng Reviewed-By: Richard Lau Reviewed-By: Yagiz Nizipli PR-URL: https://github.com/nodejs/node/pull/50115 Reviewed-By: Rafael Gonzaga Reviewed-By: Michael Dawson --- common.gypi | 2 +- deps/v8/src/flags/flag-definitions.h | 1 - deps/v8/src/init/bootstrapper.cc | 16 ++++------------ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/common.gypi b/common.gypi index 4ec9cf586803b8..5a2f34b6e058a2 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.9', + 'v8_embedder_string': '-node.10', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/flags/flag-definitions.h b/deps/v8/src/flags/flag-definitions.h index 2b807fedfc10cc..e20dd29fa59bb5 100644 --- a/deps/v8/src/flags/flag-definitions.h +++ b/deps/v8/src/flags/flag-definitions.h @@ -297,7 +297,6 @@ DEFINE_WEAK_IMPLICATION(harmony_rab_gsab_transfer, harmony_rab_gsab) #define HARMONY_SHIPPING_BASE(V) \ V(harmony_import_assertions, "harmony import assertions") \ V(harmony_change_array_by_copy, "harmony change-Array-by-copy") \ - V(harmony_string_is_well_formed, "harmony String#{is,to}WellFormed") \ V(harmony_rab_gsab, \ "harmony ResizableArrayBuffer / GrowableSharedArrayBuffer") \ V(harmony_regexp_unicode_sets, "harmony RegExp Unicode Sets") \ diff --git a/deps/v8/src/init/bootstrapper.cc b/deps/v8/src/init/bootstrapper.cc index 9c194809cbf8e0..9a582d2349a54e 100644 --- a/deps/v8/src/init/bootstrapper.cc +++ b/deps/v8/src/init/bootstrapper.cc @@ -2158,6 +2158,8 @@ void Genesis::InitializeGlobal(Handle global_object, Builtin::kStringPrototypeIncludes, 1, false); SimpleInstallFunction(isolate_, prototype, "indexOf", Builtin::kStringPrototypeIndexOf, 1, false); + SimpleInstallFunction(isolate(), prototype, "isWellFormed", + Builtin::kStringPrototypeIsWellFormed, 0, false); SimpleInstallFunction(isolate_, prototype, "italics", Builtin::kStringPrototypeItalics, 0, false); SimpleInstallFunction(isolate_, prototype, "lastIndexOf", @@ -2214,6 +2216,8 @@ void Genesis::InitializeGlobal(Handle global_object, Builtin::kStringPrototypeStartsWith, 1, false); SimpleInstallFunction(isolate_, prototype, "toString", Builtin::kStringPrototypeToString, 0, true); + SimpleInstallFunction(isolate(), prototype, "toWellFormed", + Builtin::kStringPrototypeToWellFormed, 0, false); SimpleInstallFunction(isolate_, prototype, "trim", Builtin::kStringPrototypeTrim, 0, false); @@ -5068,18 +5072,6 @@ void Genesis::InitializeGlobal_harmony_rab_gsab() { Builtin::kSharedArrayBufferPrototypeGrow, 1, true); } -void Genesis::InitializeGlobal_harmony_string_is_well_formed() { - if (!v8_flags.harmony_string_is_well_formed) return; - Handle string_function(native_context()->string_function(), - isolate()); - Handle string_prototype( - JSObject::cast(string_function->initial_map()->prototype()), isolate()); - SimpleInstallFunction(isolate(), string_prototype, "isWellFormed", - Builtin::kStringPrototypeIsWellFormed, 0, false); - SimpleInstallFunction(isolate(), string_prototype, "toWellFormed", - Builtin::kStringPrototypeToWellFormed, 0, false); -} - void Genesis::InitializeGlobal_harmony_temporal() { if (!v8_flags.harmony_temporal) return; // -- T e m p o r a l