From e3c1960f439225eaf507d7f9b26b6d5057954110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 8 May 2025 10:50:25 +0200 Subject: [PATCH 1/5] deps: patch V8 to 13.6.233.10 Refs: https://github.com/v8/v8/compare/13.6.233.8...13.6.233.10 --- deps/v8/include/v8-version.h | 2 +- deps/v8/infra/testing/builders.pyl | 34 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 6478aae4da7c04..ef65881ed91063 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 13 #define V8_MINOR_VERSION 6 #define V8_BUILD_NUMBER 233 -#define V8_PATCH_LEVEL 8 +#define V8_PATCH_LEVEL 10 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl index 8bc7b6c49b49ef..21d290d8b1f2d1 100644 --- a/deps/v8/infra/testing/builders.pyl +++ b/deps/v8/infra/testing/builders.pyl @@ -1050,7 +1050,7 @@ 'v8_mac64_asan_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-14', + 'os': 'Mac-15', }, 'tests': [ {'name': 'v8testing', 'shards': 8}, @@ -1059,7 +1059,7 @@ 'v8_mac64_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-14', + 'os': 'Mac-15', }, 'tests': [ {'name': 'mozilla'}, @@ -1074,7 +1074,7 @@ 'v8_mac_arm64_gc_stress_dbg': { 'swarming_dimensions' : { 'cpu': 'arm64', - 'os': 'Mac-14', + 'os': 'Mac-15', }, 'tests': [ {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 3}, @@ -1083,7 +1083,7 @@ 'v8_mac64_noopt_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-14', + 'os': 'Mac-15', }, 'tests': [ {'name': 'v8testing', 'shards': 6}, @@ -1092,7 +1092,7 @@ 'v8_mac64_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-14', + 'os': 'Mac-15', }, 'tests': [ {'name': 'mozilla'}, @@ -1107,7 +1107,7 @@ 'v8_mac_arm64_rel': { 'swarming_dimensions' : { 'cpu': 'arm64', - 'os': 'Mac-14', + 'os': 'Mac-15', 'pool': 'chromium.tests', }, 'tests': [ @@ -1128,7 +1128,7 @@ 'v8_mac_arm64_dbg': { 'swarming_dimensions' : { 'cpu': 'arm64', - 'os': 'Mac-14', + 'os': 'Mac-15', 'pool': 'chromium.tests', }, 'tests': [ @@ -1149,7 +1149,7 @@ 'v8_mac_arm64_full_dbg': { 'swarming_dimensions' : { 'cpu': 'arm64', - 'os': 'Mac-14', + 'os': 'Mac-15', 'pool': 'chromium.tests', }, 'tests': [ @@ -1170,7 +1170,7 @@ 'v8_mac_arm64_no_pointer_compression_dbg': { 'swarming_dimensions' : { 'cpu': 'arm64', - 'os': 'Mac-14', + 'os': 'Mac-15', 'pool': 'chromium.tests', }, 'tests': [ @@ -2026,7 +2026,7 @@ 'V8 Mac64': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-14', + 'os': 'Mac-15', }, 'tests': [ {'name': 'mozilla'}, @@ -2041,7 +2041,7 @@ 'V8 Mac64 - debug': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-14', + 'os': 'Mac-15', }, 'tests': [ {'name': 'mozilla'}, @@ -2056,7 +2056,7 @@ 'V8 Mac64 ASAN': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-14', + 'os': 'Mac-15', }, 'tests': [ {'name': 'v8testing', 'shards': 10}, @@ -2065,7 +2065,7 @@ 'V8 Mac - arm64 - gc stress': { 'swarming_dimensions': { 'cpu': 'arm64', - 'os': 'Mac-14', + 'os': 'Mac-15', }, 'tests': [ {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 3}, @@ -2073,7 +2073,7 @@ }, 'V8 Mac - arm64': { 'swarming_dimensions' : { - 'os': 'Mac-14', + 'os': 'Mac-15', 'cpu': 'arm64', 'pool': 'chromium.tests', }, @@ -2095,7 +2095,7 @@ }, 'V8 Mac - arm64 - release': { 'swarming_dimensions' : { - 'os': 'Mac-14', + 'os': 'Mac-15', 'cpu': 'arm64', 'pool': 'chromium.tests', }, @@ -2117,7 +2117,7 @@ }, 'V8 Mac - arm64 - debug': { 'swarming_dimensions' : { - 'os': 'Mac-14', + 'os': 'Mac-15', 'cpu': 'arm64', 'pool': 'chromium.tests', }, @@ -2140,7 +2140,7 @@ 'V8 Mac - arm64 - no pointer compression debug': { 'swarming_dimensions' : { 'cpu': 'arm64', - 'os': 'Mac-14', + 'os': 'Mac-15', 'pool': 'chromium.tests', }, 'tests': [ From e09a29915686c5cddb9df341da0976eccbc728fb Mon Sep 17 00:00:00 2001 From: Rezvan Mahdavi Hezaveh Date: Thu, 1 May 2025 23:57:26 +0000 Subject: [PATCH 2/5] deps: V8: cherry-pick 044b9b6f589d Original commit message: [explicit-resource-management] disallow using in switch cases This CL disallows `using` and `await using` in switch cases. This was a normative change that got consensus in TC39 meetings: https://github.com/rbuckton/ecma262/pull/14 Bug: 409478039 Change-Id: I077e75d7d0d632c8b34150cfc76e4903984d6091 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6500234 Reviewed-by: Shu-yu Guo Commit-Queue: Rezvan Mahdavi Hezaveh Cr-Commit-Position: refs/heads/main@{#100037} Refs: https://github.com/v8/v8/commit/044b9b6f589df8ccaa52b4641d51c8a7801c9545 --- common.gypi | 2 +- deps/v8/src/parsing/parser-base.h | 16 +++++----- deps/v8/test/test262/test262.status | 4 +++ .../test/unittests/parser/decls-unittest.cc | 29 +++++++++++++++++++ 4 files changed, 43 insertions(+), 8 deletions(-) diff --git a/common.gypi b/common.gypi index 3c906e809d317d..cb46e33f8b873e 100644 --- a/common.gypi +++ b/common.gypi @@ -38,7 +38,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.13', + 'v8_embedder_string': '-node.14', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/parsing/parser-base.h b/deps/v8/src/parsing/parser-base.h index 5d3ca843c48ca0..e9d0cc5a18a57b 100644 --- a/deps/v8/src/parsing/parser-base.h +++ b/deps/v8/src/parsing/parser-base.h @@ -1165,16 +1165,18 @@ class ParserBase { } bool is_using_allowed() const { // UsingDeclaration and AwaitUsingDeclaration are Syntax Errors if the goal - // symbol is Script. UsingDeclaration and AwaitUsingDeclaration are not - // contained, either directly or indirectly, within a Block, CaseBlock, - // ForStatement, ForInOfStatement, FunctionBody, GeneratorBody, + // symbol is Script. UsingDeclaration and AwaitUsingDeclaration are Syntax + // Errors if they are not contained, either directly or indirectly, within a + // Block, ForStatement, ForInOfStatement, FunctionBody, GeneratorBody, // AsyncGeneratorBody, AsyncFunctionBody, ClassStaticBlockBody, or - // ClassBody. Unless the current scope's ScopeType is ScriptScope, the + // ClassBody. They are disallowed in 'bare' switch cases. + // Unless the current scope's ScopeType is ScriptScope, the // current position is directly or indirectly within one of the productions // listed above since they open a new scope. - return ((scope()->scope_type() != SCRIPT_SCOPE && - scope()->scope_type() != EVAL_SCOPE) || - scope()->scope_type() == REPL_MODE_SCOPE); + return (((scope()->scope_type() != SCRIPT_SCOPE && + scope()->scope_type() != EVAL_SCOPE) || + scope()->scope_type() == REPL_MODE_SCOPE) && + !scope()->is_nonlinear()); } bool IsNextUsingKeyword(Token::Value token_after_using, bool is_await_using) { // using and await using declarations in for-of statements must be followed diff --git a/deps/v8/test/test262/test262.status b/deps/v8/test/test262/test262.status index 43cc46a99ffb47..a0574653b7a75d 100644 --- a/deps/v8/test/test262/test262.status +++ b/deps/v8/test/test262/test262.status @@ -1277,6 +1277,10 @@ # May OOM fatally 'staging/sm/regress/regress-610026': [SKIP], + # https://github.com/rbuckton/ecma262/pull/14 + 'staging/explicit-resource-management/await-using-in-switch-case-block': [SKIP], + 'staging/explicit-resource-management/call-dispose-methods': [SKIP], + ############################ SLOW TESTS ############################# 'annexB/built-ins/RegExp/RegExp-leading-escape-BMP': [PASS, SLOW], diff --git a/deps/v8/test/unittests/parser/decls-unittest.cc b/deps/v8/test/unittests/parser/decls-unittest.cc index 86ffdc35029d4c..f1f8cad98a4f2d 100644 --- a/deps/v8/test/unittests/parser/decls-unittest.cc +++ b/deps/v8/test/unittests/parser/decls-unittest.cc @@ -1082,6 +1082,24 @@ TEST_F(DeclsTest, TestUsing) { EXPECT_ERROR); context.Check("{var using; \n using = 42;}", EXPECT_RESULT, Number::New(isolate(), 42)); + context.Check( + "let label = \"1\"; \n switch (label) { \n case 1: \n let y = 2; \n" + "using x = { \n " + " value: 1, \n " + " [Symbol.dispose]() { \n " + " return 42; \n " + " } \n " + " }; }", + EXPECT_ERROR); + context.Check( + "let label = \"1\"; \n switch (label) { \n case 1: {\n let y = 2; \n" + "using x = { \n " + " value: 1, \n " + " [Symbol.dispose]() { \n " + " return 42; \n " + " } \n " + " }; } }", + EXPECT_RESULT, Undefined(isolate())); } } @@ -1144,6 +1162,17 @@ TEST_F(DeclsTest, TestAwaitUsing) { " } } \n " " f(); ", EXPECT_ERROR); + context.Check( + "async function f() {let label = \"1\"; \n switch (label){ \n case 1: " + "\n let y = 2;" + "\n await using x = { \n " + " value: 1, \n " + " [Symbol.asyncDispose]() { \n " + " classStaticBlockBodyValues.push(42); \n " + " } \n " + " }; \n }" + "} \n f();", + EXPECT_ERROR); } } From 44f091aa837f30e4d2dabc472c4488f0f1816d4b Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Mon, 5 May 2025 10:35:01 -0700 Subject: [PATCH 3/5] deps: V8: cherry-pick 4f38995c8295 Original commit message: [explicit-resource-management] Turn flag on by default This feature has shipped since M134 on the blink side, and is highly unlikely to be unshipped now, so flip the flag on. Bug: 42203506 Change-Id: I9554cea721983464b150c0de70b58a4b50fd477b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6513391 Reviewed-by: Rezvan Mahdavi Hezaveh Commit-Queue: Shu-yu Guo Cr-Commit-Position: refs/heads/main@{#100069} Refs: https://github.com/v8/v8/commit/4f38995c8295ec71815083c9d8946606994ab0ce --- common.gypi | 2 +- deps/v8/src/flags/flag-definitions.h | 6 +++--- deps/v8/test/mjsunit/es6/iterator-prototype.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common.gypi b/common.gypi index cb46e33f8b873e..318663c82957ff 100644 --- a/common.gypi +++ b/common.gypi @@ -38,7 +38,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.14', + 'v8_embedder_string': '-node.15', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/flags/flag-definitions.h b/deps/v8/src/flags/flag-definitions.h index dd713090c67458..1cb6f5d6e1e6f6 100644 --- a/deps/v8/src/flags/flag-definitions.h +++ b/deps/v8/src/flags/flag-definitions.h @@ -295,7 +295,6 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features") // Features that are complete (but still behind the --harmony flag). #define HARMONY_STAGED_BASE(V) #define JAVASCRIPT_STAGED_FEATURES_BASE(V) \ - V(js_explicit_resource_management, "explicit resource management") \ V(js_float16array, \ "Float16Array, Math.f16round, DataView.getFloat16, DataView.setFloat16") @@ -311,7 +310,7 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features") #endif // Features that are shipping (turned on by default, but internal flag remains). -#define HARMONY_SHIPPING_BASE(V) \ +#define HARMONY_SHIPPING_BASE(V) \ V(harmony_import_attributes, "harmony import attributes") #define JAVASCRIPT_SHIPPING_FEATURES_BASE(V) \ @@ -320,7 +319,8 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features") V(js_promise_try, "Promise.try") \ V(js_atomics_pause, "Atomics.pause") \ V(js_error_iserror, "Error.isError") \ - V(js_regexp_escape, "RegExp.escape") + V(js_regexp_escape, "RegExp.escape") \ + V(js_explicit_resource_management, "explicit resource management") #ifdef V8_INTL_SUPPORT #define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V) diff --git a/deps/v8/test/mjsunit/es6/iterator-prototype.js b/deps/v8/test/mjsunit/es6/iterator-prototype.js index 68cbafe3dab761..1bb60c6e366954 100644 --- a/deps/v8/test/mjsunit/es6/iterator-prototype.js +++ b/deps/v8/test/mjsunit/es6/iterator-prototype.js @@ -9,7 +9,7 @@ var iteratorPrototype = arrayIteratorPrototype.__proto__; assertSame(Object.prototype, Object.getPrototypeOf(iteratorPrototype)); assertTrue(Object.isExtensible(iteratorPrototype)); assertSame(12, Object.getOwnPropertyNames(iteratorPrototype).length); -assertSame(2, Object.getOwnPropertySymbols(iteratorPrototype).length); +assertSame(3, Object.getOwnPropertySymbols(iteratorPrototype).length); assertSame(Symbol.iterator, Object.getOwnPropertySymbols(iteratorPrototype)[0]); From 9c2d5d06c46d8932e0d1ff598534637edc09f594 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Tue, 6 May 2025 14:40:37 -0700 Subject: [PATCH 4/5] deps: V8: backport 1d3362c55396 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [float16array] Turn flag on by default Float16Array has shipped in blink since M135. It is unlikely it'll unship by now, so turn the flag on by default. Bug: 42203953 Change-Id: Ibd9de407b8810dd7bcdb46194fe04fc290ff8fb8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6513988 Reviewed-by: Rezvan Mahdavi Hezaveh Commit-Queue: Shu-yu Guo Cr-Commit-Position: refs/heads/main@{#100104} Refs: https://github.com/v8/v8/commit/1d3362c553969f22d89f62dd4137ad9d183b5376 Co-authored-by: Michaƫl Zasso --- common.gypi | 2 +- deps/v8/src/flags/flag-definitions.h | 8 ++++---- deps/v8/src/init/bootstrapper.cc | 5 +++++ deps/v8/test/test262/test262.status | 4 ---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/common.gypi b/common.gypi index 318663c82957ff..162faabcefc3bc 100644 --- a/common.gypi +++ b/common.gypi @@ -38,7 +38,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.15', + 'v8_embedder_string': '-node.16', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/flags/flag-definitions.h b/deps/v8/src/flags/flag-definitions.h index 1cb6f5d6e1e6f6..68affded4e1342 100644 --- a/deps/v8/src/flags/flag-definitions.h +++ b/deps/v8/src/flags/flag-definitions.h @@ -294,9 +294,7 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features") // Features that are complete (but still behind the --harmony flag). #define HARMONY_STAGED_BASE(V) -#define JAVASCRIPT_STAGED_FEATURES_BASE(V) \ - V(js_float16array, \ - "Float16Array, Math.f16round, DataView.getFloat16, DataView.setFloat16") +#define JAVASCRIPT_STAGED_FEATURES_BASE(V) #ifdef V8_INTL_SUPPORT #define HARMONY_STAGED(V) \ @@ -320,7 +318,9 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features") V(js_atomics_pause, "Atomics.pause") \ V(js_error_iserror, "Error.isError") \ V(js_regexp_escape, "RegExp.escape") \ - V(js_explicit_resource_management, "explicit resource management") + V(js_explicit_resource_management, "explicit resource management") \ + V(js_float16array, \ + "Float16Array, Math.f16round, DataView.getFloat16, DataView.setFloat16") #ifdef V8_INTL_SUPPORT #define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V) diff --git a/deps/v8/src/init/bootstrapper.cc b/deps/v8/src/init/bootstrapper.cc index 0df675047737b3..0249e150cf5547 100644 --- a/deps/v8/src/init/bootstrapper.cc +++ b/deps/v8/src/init/bootstrapper.cc @@ -5211,6 +5211,11 @@ DirectHandle Genesis::InstallTypedArray( GetCorrespondingRabGsabElementsKind(elements_kind), 0); rab_gsab_initial_map->SetConstructor(*result); + if (rab_gsab_initial_map_index == Context::RAB_GSAB_FLOAT16_ARRAY_MAP_INDEX && + v8_flags.js_float16array) { + LOG(isolate(), MapDetails(*rab_gsab_initial_map)); + } + native_context()->set(rab_gsab_initial_map_index, *rab_gsab_initial_map, UPDATE_WRITE_BARRIER, kReleaseStore); Map::SetPrototype(isolate(), rab_gsab_initial_map, prototype); diff --git a/deps/v8/test/test262/test262.status b/deps/v8/test/test262/test262.status index a0574653b7a75d..f9c2b3813d0730 100644 --- a/deps/v8/test/test262/test262.status +++ b/deps/v8/test/test262/test262.status @@ -2500,7 +2500,6 @@ 'staging/sm/Temporal/PlainMonthDay/from-coptic': [FAIL], 'staging/sm/Temporal/PlainMonthDay/from-gregory': [FAIL], 'staging/sm/Temporal/PlainMonthDay/result-not-after-1972-dec-31': [FAIL], - 'staging/sm/Math/f16round': [FAIL], 'staging/sm/RegExp/unicode-ignoreCase': [FAIL], 'staging/sm/String/string-code-point-upper-lower-mapping': [FAIL], 'staging/sm/String/string-upper-lower-mapping': [FAIL], @@ -2511,13 +2510,10 @@ 'staging/sm/TypedArray/prototype-constructor-identity': [FAIL], 'staging/sm/TypedArray/set-detached-bigint': [FAIL], 'staging/sm/TypedArray/seal-and-freeze': [FAIL], - 'staging/sm/TypedArray/sort-negative-nan': [FAIL], - 'staging/sm/TypedArray/sort_small': [FAIL], 'staging/sm/TypedArray/test-integrity-level': [FAIL], 'staging/sm/TypedArray/test-integrity-level-detached': [FAIL], 'staging/sm/TypedArray/toReversed-detached': [FAIL], 'staging/sm/TypedArray/toSorted-detached': [FAIL], - 'staging/sm/TypedArray/toString': [FAIL], 'staging/sm/TypedArray/with': [FAIL], 'staging/sm/TypedArray/with-detached': [FAIL], }], From fa6d943642b5b3ad98bf94d80f84991e8674417b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 8 May 2025 11:35:17 +0200 Subject: [PATCH 5/5] src: remove unneeded explicit V8 flags --- src/node.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/node.cc b/src/node.cc index ddde8d4b2a24ba..1941404f6fa528 100644 --- a/src/node.cc +++ b/src/node.cc @@ -845,11 +845,6 @@ static ExitCode InitializeNodeWithArgsInternal( // is security relevant, for Node it's less important. V8::SetFlagsFromString("--no-freeze-flags-after-init"); - // These features are completed and enabled by default in Chrome, but not - // in V8. - V8::SetFlagsFromString("--js-explicit-resource-management"); - V8::SetFlagsFromString("--js-float16array"); - #if defined(NODE_V8_OPTIONS) // Should come before the call to V8::SetFlagsFromCommandLine() // so the user can disable a flag --foo at run-time by passing