From 469fc9854a75d9b28959570eb56c8cde6da33ee2 Mon Sep 17 00:00:00 2001 From: Cormick Holland Date: Tue, 29 Sep 2026 16:09:07 -0400 Subject: [PATCH] Update to V8 15.6.75 Bump V8 from 15.5.35.7 to 15.6.75 and rebase our V8 patches onto it. Extend 0043 to also disable metagen instance types in the Bazel build, since V8 15.6 enables them by default. Since V8 15.6, new Function() with no arguments passes isCodeLike = false to the code generation callback, and V8 also reports each object argument before converting it to a string. The empty-function allowance in modifyCodeGenCallback therefore now matches on the exact synthesized source alone. setup-test covers new Function(''), which is now allowed, and an object argument, which stays blocked. V8 15.6 deprecates FunctionCallbackInfo::Data() in favor of DataV2(), which returns a v8::Data. Switch our callbacks to DataV2().As(), since clang-tidy treats the deprecation warning as an error. V8 15.6 also deprecates the V2 continuation-preserved embedder data accessors, which are now plain aliases. Call the unsuffixed Get/SetContinuationPreservedEmbedderData() instead. Standard API audit: V8 15.6.75 enables no new standard API by default, so this update disables none and needs no compatibility flag. V8's shipped feature list (src/flags/feature-flags.h) gains only homomorphic_ic, an internal IC optimization. Wasm wide_arithmetic moves from pre-staged to staged and stays off. No flag default changes to enable a feature, and src/init/bootstrapper.cc and src/builtins/builtins-definitions.h are unchanged from 15.5.35.7. The only newly installed function, Sandbox.getMetadata, belongs to V8's sandbox testing API, which workerd does not enable. Import text shipped before 15.6 and stays disabled with --nojs-import-text. Generated by the V8 nightly (ci/v8-nightly). Co-Authored-By: Claude Opus 5.5 --- build/deps/deps.jsonc | 4 +- build/deps/gen/deps.MODULE.bazel | 8 +-- build/deps/v8.MODULE.bazel | 6 +-- ...etting-ValueDeserializer-format-vers.patch | 4 +- ...etting-ValueSerializer-format-versio.patch | 6 +-- ...003-Allow-Windows-builds-under-Bazel.patch | 4 +- ...zel-build-by-always-using-target-cfg.patch | 6 +-- ...06-Implement-Promise-Context-Tagging.patch | 44 ++++++++--------- ...itial-ExecutionContextId-used-by-the.patch | 2 +- ...lizer-SetTreatFunctionsAsHostObjects.patch | 6 +-- ...look-for-fp16-dependency.-This-depen.patch | 6 +-- ...masm-specific-unwinding-annotations-.patch | 6 +-- ...legal-invocation-error-message-in-v8.patch | 8 +-- ...request-context-promise-resolve-hand.patch | 32 ++++++------ ...her-slot-in-the-isolate-for-embedder.patch | 4 +- ...ializer-SetTreatProxiesAsHostObjects.patch | 6 +-- .../v8/0017-Enable-V8-shared-linkage.patch | 16 +++--- ...e-to-look-for-fast_float-and-simdutf.patch | 10 ++-- ...et-heap-and-external-memory-sizes-di.patch | 8 +-- ...1-Port-concurrent-mksnapshot-support.patch | 4 +- .../v8/0022-Port-V8_USE_ZLIB-support.patch | 4 +- ...3-Modify-where-to-look-for-dragonbox.patch | 4 +- ...ional-Exception-construction-methods.patch | 4 +- .../v8/0028-bind-icu-to-googlesource.patch | 6 +-- .../v8/0029-Add-v8-String-IsFlat-API.patch | 4 +- ...untOfExternalAllocatedMemoryImpl-as-.patch | 6 +-- ...e_barriers-flag-in-V8-s-bazel-config.patch | 2 +- ...Object.hasOwnProperty-with-intercept.patch | 2 +- .../0038-Properly-depend-on-llvm-libc.patch | 6 +-- ...ix-TSan-build-without-the-V8-sandbox.patch | 8 +-- ...rfetto-support-in-the-V8-Bazel-build.patch | 10 ++-- ..._most-on-Windows-x64-before-Clang-22.patch | 4 +- ...ppgc-eagerly-with-non-incremental-GC.patch | 2 +- ...-archives-without-metagen-Clang-head.patch | 28 ----------- ...-V8-release-archives-without-metagen.patch | 49 +++++++++++++++++++ src/workerd/api/capnp.h | 4 +- src/workerd/jsg/async-context.c++ | 4 +- src/workerd/jsg/function.h | 7 +-- src/workerd/jsg/observer.h | 4 +- src/workerd/jsg/promise.h | 6 +-- src/workerd/jsg/setup-test.c++ | 8 +++ src/workerd/jsg/setup.c++ | 28 ++++++----- 42 files changed, 212 insertions(+), 178 deletions(-) delete mode 100644 patches/v8/0043-Allow-V8-release-archives-without-metagen-Clang-head.patch create mode 100644 patches/v8/0043-Build-V8-release-archives-without-metagen.patch diff --git a/build/deps/deps.jsonc b/build/deps/deps.jsonc index 4b47bded5fe..195b0f0dc30 100644 --- a/build/deps/deps.jsonc +++ b/build/deps/deps.jsonc @@ -44,7 +44,7 @@ "url": "https://chromium.googlesource.com/chromium/deps/icu.git", "branch": "main", "build_file": "@v8//:bazel/BUILD.icu", - "freeze_commit": "6ebb40c594776cc2c21ea14df85a2a89a328b364", + "freeze_commit": "5aa526207171ecadf31597f0980a7b7ad8872f33", "patch_cmds": [ "find source -name BUILD.bazel | xargs rm" ], @@ -70,7 +70,7 @@ "owner": "fastfloat", "repo": "fast_float", "branch": "main", - "freeze_commit": "34164f547b7df3f5d794ff67e9f885c36819ebfc", + "freeze_commit": "b0ab987b3dfdde13fa1915f65ef2a5c068d9208c", "build_file_content": "cc_library(name = 'fast_float', hdrs = glob(['include/fast_float/*.h']), visibility = ['//visibility:public'], include_prefix = 'third_party/fast_float/src')", "use_module_bazel_from_bcr": "8.0.2" }, diff --git a/build/deps/gen/deps.MODULE.bazel b/build/deps/gen/deps.MODULE.bazel index fb2c7766e27..d7956cbe707 100644 --- a/build/deps/gen/deps.MODULE.bazel +++ b/build/deps/gen/deps.MODULE.bazel @@ -38,7 +38,7 @@ use_repo(http, "capnp-cpp") git_repository( name = "com_googlesource_chromium_icu", build_file = "@v8//:bazel/BUILD.icu", - commit = "6ebb40c594776cc2c21ea14df85a2a89a328b364", + commit = "5aa526207171ecadf31597f0980a7b7ad8872f33", patch_cmds = [ "find source -name BUILD.bazel | xargs rm", ], @@ -66,10 +66,10 @@ archive_override( build_file_content = "cc_library(name = 'fast_float', hdrs = glob(['include/fast_float/*.h']), visibility = ['//visibility:public'], include_prefix = 'third_party/fast_float/src')", remote_file_integrity = {"MODULE.bazel": "sha256-Q1BGZO/fpMbPE0libIcTXJuHkmMlxyBFjzlu7iVWjto="}, remote_file_urls = {"MODULE.bazel": ["https://raw.githubusercontent.com/bazelbuild/bazel-central-registry/refs/heads/main/modules/fast_float/8.0.2/MODULE.bazel"]}, - sha256 = "9b239eaa54c58fc3a1bb7e1a11030b67211e38ce7f4781b41b004f26f6fd1528", - strip_prefix = "fastfloat-fast_float-34164f5", + sha256 = "65d04c661d51fb9715881fc8689bed94ba2976c9cd126d80775b190995362169", + strip_prefix = "fastfloat-fast_float-b0ab987", type = "tgz", - url = "https://github.com/fastfloat/fast_float/tarball/34164f547b7df3f5d794ff67e9f885c36819ebfc", + url = "https://github.com/fastfloat/fast_float/tarball/b0ab987b3dfdde13fa1915f65ef2a5c068d9208c", ) # fp16 diff --git a/build/deps/v8.MODULE.bazel b/build/deps/v8.MODULE.bazel index 2e598a4e2fd..c6983c53311 100644 --- a/build/deps/v8.MODULE.bazel +++ b/build/deps/v8.MODULE.bazel @@ -18,9 +18,9 @@ http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "ht git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") -VERSION = "15.5.35.7" +VERSION = "15.6.75" -INTEGRITY = "sha256-J2p4t1TJHVIbIfPgX3NUKsSX0yCyM3z6x75R7kWx2gU=" +INTEGRITY = "sha256-XnqZSOkB22CsG/fXWcxu8zMvCWz48V7LGLaM4TA/kig=" PATCHES = [ "0001-Allow-manually-setting-ValueDeserializer-format-vers.patch", @@ -65,7 +65,7 @@ PATCHES = [ "0040-Enable-Perfetto-support-in-the-V8-Bazel-build.patch", "0041-Disable-preserve_most-on-Windows-x64-before-Clang-22.patch", "0042-cppgc-Sweep-cppgc-eagerly-with-non-incremental-GC.patch", - "0043-Allow-V8-release-archives-without-metagen-Clang-head.patch", + "0043-Build-V8-release-archives-without-metagen.patch", ] http_archive( diff --git a/patches/v8/0001-Allow-manually-setting-ValueDeserializer-format-vers.patch b/patches/v8/0001-Allow-manually-setting-ValueDeserializer-format-vers.patch index 498170c3139..5be03dd2fdf 100644 --- a/patches/v8/0001-Allow-manually-setting-ValueDeserializer-format-vers.patch +++ b/patches/v8/0001-Allow-manually-setting-ValueDeserializer-format-vers.patch @@ -37,10 +37,10 @@ index 731965722fb310fec7aa503c0866f923266f374e..923a13a76f5220cbb106447f84c279b9 * Reads raw data in various common formats to the buffer. * Note that integer types are read in base-128 varint format, not with a diff --git a/src/api/api.cc b/src/api/api.cc -index adee19691fcf4dbcc719e58330d3b894bbf9911f..aaa787e6ef52e8e9d96d206c591c3354620b6f5b 100644 +index 568671193c5ad61c81889fa9959eed12ac85536c..9f282a4c7df8b07e4896ed3877462284fabccb70 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -3822,6 +3822,10 @@ uint32_t ValueDeserializer::GetWireFormatVersion() const { +@@ -3826,6 +3826,10 @@ uint32_t ValueDeserializer::GetWireFormatVersion() const { return private_->deserializer.GetWireFormatVersion(); } diff --git a/patches/v8/0002-Allow-manually-setting-ValueSerializer-format-versio.patch b/patches/v8/0002-Allow-manually-setting-ValueSerializer-format-versio.patch index 77ad88a39d2..b945b61003f 100644 --- a/patches/v8/0002-Allow-manually-setting-ValueSerializer-format-versio.patch +++ b/patches/v8/0002-Allow-manually-setting-ValueSerializer-format-versio.patch @@ -23,10 +23,10 @@ index 923a13a76f5220cbb106447f84c279b9a1df3079..240fd2da3b1eb2c7858b026525a96340 * Writes out a header, which includes the format version. */ diff --git a/src/api/api.cc b/src/api/api.cc -index aaa787e6ef52e8e9d96d206c591c3354620b6f5b..d91aeb2d6be8d45cffcb0b9dd6c171926baa3adc 100644 +index 9f282a4c7df8b07e4896ed3877462284fabccb70..a108cb5cb12874835b5c6ca40ccf0d3e4897e9c2 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -3682,6 +3682,10 @@ ValueSerializer::ValueSerializer( +@@ -3686,6 +3686,10 @@ ValueSerializer::ValueSerializer( ValueSerializer::~ValueSerializer() { delete private_; } @@ -38,7 +38,7 @@ index aaa787e6ef52e8e9d96d206c591c3354620b6f5b..d91aeb2d6be8d45cffcb0b9dd6c17192 void ValueSerializer::SetTreatArrayBufferViewsAsHostObjects(bool mode) { diff --git a/src/objects/value-serializer.cc b/src/objects/value-serializer.cc -index 2c3434f3de292de6099791e7223975d7e4f683be..8124403d7c0a887a73fea4aab39a22c91d855ad9 100644 +index 36a784bcbf5a8cf0e95fdbd6b0d23f3713e7b637..7c6e1f7cfb27f49b0df997b4d7f2a4a7f5ec2921 100644 --- a/src/objects/value-serializer.cc +++ b/src/objects/value-serializer.cc @@ -313,6 +313,7 @@ ValueSerializer::ValueSerializer( diff --git a/patches/v8/0003-Allow-Windows-builds-under-Bazel.patch b/patches/v8/0003-Allow-Windows-builds-under-Bazel.patch index 21a1e67e51a..d1ae560f235 100644 --- a/patches/v8/0003-Allow-Windows-builds-under-Bazel.patch +++ b/patches/v8/0003-Allow-Windows-builds-under-Bazel.patch @@ -6,10 +6,10 @@ Subject: Allow Windows builds under Bazel Signed-off-by: James M Snell diff --git a/BUILD.bazel b/BUILD.bazel -index 2350f14126e5792326eb725a7e28b0ff9afe2841..e2ef53e129be12ae1963f447a2d05536768b435b 100644 +index 914fe144311eb7ec5dfe2635c28a1c2adaa96df1..a672f3299ba55574585bb5985a260d708cd31f11 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -4177,6 +4177,8 @@ filegroup( +@@ -4182,6 +4182,8 @@ filegroup( "@v8//bazel/config:is_inline_asm_x64": ["src/heap/base/asm/x64/push_registers_asm.cc"], "@v8//bazel/config:is_inline_asm_arm": ["src/heap/base/asm/arm/push_registers_asm.cc"], "@v8//bazel/config:is_inline_asm_arm64": ["src/heap/base/asm/arm64/push_registers_asm.cc"], diff --git a/patches/v8/0005-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch b/patches/v8/0005-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch index 8fc6ff28db7..022dce122cb 100644 --- a/patches/v8/0005-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch +++ b/patches/v8/0005-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch @@ -10,7 +10,7 @@ both target and exec configurations as generator tools depend on them. Signed-off-by: James M Snell diff --git a/BUILD.bazel b/BUILD.bazel -index e2ef53e129be12ae1963f447a2d05536768b435b..83939aede73463d501714c4213647f0320341d42 100644 +index a672f3299ba55574585bb5985a260d708cd31f11..29df31fa21b2addd10a1d6b9ed450ee585dd42f7 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -20,6 +20,7 @@ load( @@ -21,7 +21,7 @@ index e2ef53e129be12ae1963f447a2d05536768b435b..83939aede73463d501714c4213647f03 ) load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression") -@@ -4749,22 +4750,20 @@ filegroup( +@@ -4754,22 +4755,20 @@ filegroup( ], ) @@ -50,7 +50,7 @@ index e2ef53e129be12ae1963f447a2d05536768b435b..83939aede73463d501714c4213647f03 ) v8_mksnapshot( -@@ -5015,7 +5014,6 @@ v8_binary( +@@ -5020,7 +5019,6 @@ v8_binary( srcs = [ "src/regexp/gen-regexp-special-case.cc", "src/regexp/special-case.h", diff --git a/patches/v8/0006-Implement-Promise-Context-Tagging.patch b/patches/v8/0006-Implement-Promise-Context-Tagging.patch index 39072723b7c..0319b424cb7 100644 --- a/patches/v8/0006-Implement-Promise-Context-Tagging.patch +++ b/patches/v8/0006-Implement-Promise-Context-Tagging.patch @@ -5,10 +5,10 @@ Subject: Implement Promise Context Tagging diff --git a/include/v8-callbacks.h b/include/v8-callbacks.h -index 456af07fe1d89feeb03daabc869072220808460d..2feae234f77b60de3220804edc6d2ccd067f5670 100644 +index efa9de293072848caf8df6c57e5e0039d1d4f95e..334f59f16b6365f3562ef004fb637f090f629c9e 100644 --- a/include/v8-callbacks.h +++ b/include/v8-callbacks.h -@@ -532,6 +532,14 @@ using FilterETWSessionByURL2Callback = FilterETWSessionByURLResult (*)( +@@ -540,6 +540,14 @@ using FilterETWSessionByURL2Callback = FilterETWSessionByURLResult (*)( Local context, const std::string& etw_filter_payload); #endif // V8_OS_WIN @@ -24,10 +24,10 @@ index 456af07fe1d89feeb03daabc869072220808460d..2feae234f77b60de3220804edc6d2ccd #endif // INCLUDE_V8_ISOLATE_CALLBACKS_H_ diff --git a/include/v8-isolate.h b/include/v8-isolate.h -index 50c87b78de5e9f15a24a48008a3301b0c0e4a66a..b642d8191d57ba690c86088bb74cb07414edeb7f 100644 +index a352b5f0164ff23f045a26413a6cac2ed2c5706f..8ee9a10b6a219f72ff27eeec8b2e6f3f3457ba00 100644 --- a/include/v8-isolate.h +++ b/include/v8-isolate.h -@@ -1885,6 +1885,9 @@ class V8_EXPORT Isolate { +@@ -1893,6 +1893,9 @@ class V8_EXPORT Isolate { */ uint64_t GetHashSeed(); @@ -37,7 +37,7 @@ index 50c87b78de5e9f15a24a48008a3301b0c0e4a66a..b642d8191d57ba690c86088bb74cb074 Isolate() = delete; ~Isolate() = delete; Isolate(const Isolate&) = delete; -@@ -1931,6 +1934,19 @@ MaybeLocal Isolate::GetDataFromSnapshotOnce(size_t index) { +@@ -1939,6 +1942,19 @@ MaybeLocal Isolate::GetDataFromSnapshotOnce(size_t index) { return {}; } @@ -58,10 +58,10 @@ index 50c87b78de5e9f15a24a48008a3301b0c0e4a66a..b642d8191d57ba690c86088bb74cb074 #endif // INCLUDE_V8_ISOLATE_H_ diff --git a/src/api/api.cc b/src/api/api.cc -index d91aeb2d6be8d45cffcb0b9dd6c171926baa3adc..e57e95d1889078e45a3a897073b735dbae033c18 100644 +index a108cb5cb12874835b5c6ca40ccf0d3e4897e9c2..c95da6f8c88a4aabefa33a0df6b4534e05aaea19 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -12710,6 +12710,25 @@ std::string SourceLocation::ToString() const { +@@ -12744,6 +12744,25 @@ std::string SourceLocation::ToString() const { .str(); } @@ -205,7 +205,7 @@ index 2a1946aea904042cbafe60d1afab46eaee755d1e..0851372fdc5c1c5876f35cea0d267823 offset < static_cast(sizeof(JSPromise)) + v8::Promise::kEmbedderFieldCount * kEmbedderDataSlotSize; diff --git a/src/diagnostics/objects-printer.cc b/src/diagnostics/objects-printer.cc -index a59c8453c986f713a0bff070dcf27fa6744274ea..11bf7ce2b8fddbd49d242c8dd3dcac794b67c318 100644 +index 96fb166732a665e5b45f7e415adba09d712cbd78..1cd2ba89b72e4dc6c2c917ad63b684b0845f6472 100644 --- a/src/diagnostics/objects-printer.cc +++ b/src/diagnostics/objects-printer.cc @@ -1025,6 +1025,7 @@ void JSPromise::JSPromisePrint(std::ostream& os) { @@ -247,7 +247,7 @@ index de710c8fad334d5fc29ee0d4627b4eb370e58550..fb7d83dd6fcff7aa7aba2ba5ad533fa8 Tagged Isolate::VerifyBuiltinsResult(Tagged result) { if (is_execution_terminating() && !v8_flags.strict_termination_checks) { diff --git a/src/execution/isolate.cc b/src/execution/isolate.cc -index af0e139d671689637e1259fb9c922e10552db566..399663afad2fb114ee71262368c62044e3a005f3 100644 +index 7ef444669c8eac0c6d0c92d1fd48371dfa856c80..362ece15281c4167698f16eab30a937fa057b059 100644 --- a/src/execution/isolate.cc +++ b/src/execution/isolate.cc @@ -681,6 +681,8 @@ void Isolate::Iterate(RootVisitor* v, ThreadLocalTop* thread) { @@ -259,7 +259,7 @@ index af0e139d671689637e1259fb9c922e10552db566..399663afad2fb114ee71262368c62044 for (v8::TryCatch* block = thread->try_catch_handler_; block != nullptr; block = block->next_) { -@@ -6488,6 +6490,7 @@ bool Isolate::Init(SnapshotData* startup_snapshot_data, +@@ -6494,6 +6496,7 @@ bool Isolate::Init(SnapshotData* startup_snapshot_data, shared_heap_object_cache_.push_back(ReadOnlyRoots(this).undefined_value()); } @@ -267,7 +267,7 @@ index af0e139d671689637e1259fb9c922e10552db566..399663afad2fb114ee71262368c62044 InitializeThreadLocal(); // Profiler has to be created after ThreadLocal is initialized -@@ -8704,5 +8707,40 @@ void Isolate::PrintNumberStringCacheStats(const char* comment, +@@ -8725,5 +8728,40 @@ void Isolate::PrintNumberStringCacheStats(const char* comment, PrintF("\n"); } @@ -309,10 +309,10 @@ index af0e139d671689637e1259fb9c922e10552db566..399663afad2fb114ee71262368c62044 } // namespace internal } // namespace v8 diff --git a/src/execution/isolate.h b/src/execution/isolate.h -index fab13a6a35b4bde42b2509f015ae0b8aa2fcf5b6..6db8bb8e63cd3255a69313fbae01d730c83f5a3e 100644 +index f8c0c95e78fd8e6403d7c1e498fdd0639dfbb054..07a8fccbbcaddfe884caf069fb636911f2d8e2dc 100644 --- a/src/execution/isolate.h +++ b/src/execution/isolate.h -@@ -2516,6 +2516,15 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { +@@ -2523,6 +2523,15 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { v8::ExceptionContext callback_kind); void SetExceptionPropagationCallback(ExceptionPropagationCallback callback); @@ -328,7 +328,7 @@ index fab13a6a35b4bde42b2509f015ae0b8aa2fcf5b6..6db8bb8e63cd3255a69313fbae01d730 #ifdef V8_ENABLE_WASM_SIMD256_REVEC void set_wasm_revec_verifier_for_test( compiler::turboshaft::WasmRevecVerifier* verifier) { -@@ -3055,6 +3064,12 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { +@@ -3062,6 +3071,12 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { bool is_frozen_ = false; friend class HandleScopeImplementer; @@ -341,7 +341,7 @@ index fab13a6a35b4bde42b2509f015ae0b8aa2fcf5b6..6db8bb8e63cd3255a69313fbae01d730 friend class GlobalSafepoint; friend class heap::HeapTester; friend class IsolateForPointerCompression; -@@ -3062,6 +3077,7 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { +@@ -3069,6 +3084,7 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { friend class IsolateGroup; friend class TestSerializer; friend class SharedHeapNoClientsTest; @@ -350,10 +350,10 @@ index fab13a6a35b4bde42b2509f015ae0b8aa2fcf5b6..6db8bb8e63cd3255a69313fbae01d730 // The current entered Isolate and its thread data. Do not access these diff --git a/src/heap/factory.cc b/src/heap/factory.cc -index 6390e956594d9163bfde9aaf40873419c3903d5f..c7f41c8ae93fb5c541e667dc2cfadadbc7c24d9f 100644 +index d2a5f284e01fd07a7508dfa3325806d5cf5ac407..1af06a1fdfe03fc9e0f241ad21ec24da28f32660 100644 --- a/src/heap/factory.cc +++ b/src/heap/factory.cc -@@ -5170,6 +5170,12 @@ Handle Factory::NewJSPromiseWithoutHook() { +@@ -5165,6 +5165,12 @@ Handle Factory::NewJSPromiseWithoutHook() { DisallowGarbageCollection no_gc; Tagged raw = *promise; raw->set_reactions_or_result(Smi::zero(), SKIP_WRITE_BARRIER); @@ -367,10 +367,10 @@ index 6390e956594d9163bfde9aaf40873419c3903d5f..c7f41c8ae93fb5c541e667dc2cfadadb // TODO(v8) remove once embedder data slots are always zero-initialized. InitEmbedderFields(*promise, Smi::zero()); diff --git a/src/maglev/maglev-reducer-inl.h b/src/maglev/maglev-reducer-inl.h -index 2bfe98dbf1de4d2ebcabafb0193e01a45884768e..837787063fbcefaeeea8cb798f68067068e3e2ac 100644 +index 413713365738261f9158bf53005f1bec20f8a659..d4084fa37f0ef333f43ca69aca78f01e72807d3a 100644 --- a/src/maglev/maglev-reducer-inl.h +++ b/src/maglev/maglev-reducer-inl.h -@@ -6108,9 +6108,10 @@ VirtualObject* MaglevReducer::CreateJSPromiseObject() { +@@ -6123,9 +6123,10 @@ VirtualObject* MaglevReducer::CreateJSPromiseObject() { vobj->set(offsetof(JSObject, elements_), GetRootConstant(RootIndex::kEmptyFixedArray)); vobj->set(offsetof(JSPromise, reactions_or_result_), GetSmiConstant(0)); @@ -454,10 +454,10 @@ index 2e498caeb9a4dea6f4ef361ffe6547769e749874..227d693af230ef14dbc3f90f95570171 } diff --git a/src/profiler/heap-snapshot-generator.cc b/src/profiler/heap-snapshot-generator.cc -index 1683d0f8430c1db4ecdf3fb4b85be2cc6ef9dd00..8a1c55f648f6a5ec21f6590db7893720fcf4a7c1 100644 +index 30994012c4b5c66b0f5f66bf53953ad283604967..acea63a193d263572b263798e77a141e94d5c507 100644 --- a/src/profiler/heap-snapshot-generator.cc +++ b/src/profiler/heap-snapshot-generator.cc -@@ -2379,6 +2379,8 @@ void V8HeapExplorer::ExtractJSPromiseReferences(HeapEntry* entry, +@@ -2524,6 +2524,8 @@ void V8HeapExplorer::ExtractJSPromiseReferences(HeapEntry* entry, SetInternalReference(entry, "reactions_or_result", promise->reactions_or_result(), offsetof(JSPromise, reactions_or_result_)); @@ -513,7 +513,7 @@ index 169d48bd4567686a94cc2dbca54daab3e73ad658..618dbb2f0d6e946c34f0271ec25b143c } // namespace internal } // namespace v8 diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h -index 9d06fcb2f82cd9a18727034594126db46c2dbabb..00e9803d059a31e7cc0255a141fb6fdede763bcb 100644 +index 9c9dfa45a44e559f58158a949c0c2e105e45c72d..2d5184b3761eb00aaaf873ed7daf0f689a8e8c7c 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -439,18 +439,20 @@ constexpr bool CanTriggerGC(T... properties) { diff --git a/patches/v8/0007-Randomize-the-initial-ExecutionContextId-used-by-the.patch b/patches/v8/0007-Randomize-the-initial-ExecutionContextId-used-by-the.patch index 4c3670b4ca3..1c21edc92cf 100644 --- a/patches/v8/0007-Randomize-the-initial-ExecutionContextId-used-by-the.patch +++ b/patches/v8/0007-Randomize-the-initial-ExecutionContextId-used-by-the.patch @@ -10,7 +10,7 @@ live workers (https://chat.google.com/room/AAAAnS2bXT4/GX5-pa8O0ts). Signed-off-by: James M Snell diff --git a/src/inspector/v8-inspector-impl.cc b/src/inspector/v8-inspector-impl.cc -index e4bd1415e26803f0759b01ff016600e8b43a8f8c..90b2c64e92ac2d2d6c18ccd131ee2e9106adc65f 100644 +index 5f89266767ba0126d694700d12154e11b07849d8..ce1eae3c0c3cfabaeb8d1ac016cccd41010586e4 100644 --- a/src/inspector/v8-inspector-impl.cc +++ b/src/inspector/v8-inspector-impl.cc @@ -68,7 +68,7 @@ V8InspectorImpl::V8InspectorImpl(v8::Isolate* isolate, diff --git a/patches/v8/0009-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch b/patches/v8/0009-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch index de9a9ce2d71..d76b19f7fc7 100644 --- a/patches/v8/0009-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch +++ b/patches/v8/0009-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch @@ -30,10 +30,10 @@ index 240fd2da3b1eb2c7858b026525a963402bcb5c62..c9234089b2e663ea0ea8f495af59d64d * Write raw data in various common formats to the buffer. * Note that integer types are written in base-128 varint format, not with a diff --git a/src/api/api.cc b/src/api/api.cc -index e57e95d1889078e45a3a897073b735dbae033c18..af5043b64ea454c53d7e8bf5d2694b437dac8e3b 100644 +index c95da6f8c88a4aabefa33a0df6b4534e05aaea19..89b421cc4bac24935717bac29653e6fd1626683e 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -3704,6 +3704,10 @@ ValueSerializer::ReleaseSharedImmutableBackingStores() { +@@ -3708,6 +3708,10 @@ ValueSerializer::ReleaseSharedImmutableBackingStores() { return result; } @@ -45,7 +45,7 @@ index e57e95d1889078e45a3a897073b735dbae033c18..af5043b64ea454c53d7e8bf5d2694b43 Local value) { auto i_isolate = i::Isolate::Current(); diff --git a/src/objects/value-serializer.cc b/src/objects/value-serializer.cc -index 8124403d7c0a887a73fea4aab39a22c91d855ad9..430014ca3961fc829d6e2f062cd49a3064056d06 100644 +index 7c6e1f7cfb27f49b0df997b4d7f2a4a7f5ec2921..8c0234ab79a7a003dbee51196eef5b791ee6c9ee 100644 --- a/src/objects/value-serializer.cc +++ b/src/objects/value-serializer.cc @@ -356,6 +356,10 @@ void ValueSerializer::SetTreatArrayBufferViewsAsHostObjects(bool mode) { diff --git a/patches/v8/0010-Modify-where-to-look-for-fp16-dependency.-This-depen.patch b/patches/v8/0010-Modify-where-to-look-for-fp16-dependency.-This-depen.patch index 3687403b069..1bcfe602578 100644 --- a/patches/v8/0010-Modify-where-to-look-for-fp16-dependency.-This-depen.patch +++ b/patches/v8/0010-Modify-where-to-look-for-fp16-dependency.-This-depen.patch @@ -8,10 +8,10 @@ Subject: Modify where to look for fp16 dependency. This dependency is normally Signed-off-by: James M Snell diff --git a/BUILD.bazel b/BUILD.bazel -index 83939aede73463d501714c4213647f0320341d42..ab7a935e1b54ca9025e072630ef66a6ffe7bc794 100644 +index 29df31fa21b2addd10a1d6b9ed450ee585dd42f7..4abddcdb7579d15600231a5093c08252ca358366 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -4200,17 +4200,23 @@ v8_library( +@@ -4205,17 +4205,23 @@ v8_library( ], ) @@ -42,7 +42,7 @@ index 83939aede73463d501714c4213647f0320341d42..ab7a935e1b54ca9025e072630ef66a6f ) filegroup( -@@ -4510,7 +4516,6 @@ filegroup( +@@ -4515,7 +4521,6 @@ filegroup( "third_party/utf8-decoder/**/*.h", "third_party/simdutf/**/*.h", "third_party/rapidhash-v8/**/*.h", diff --git a/patches/v8/0011-Revert-heap-Add-masm-specific-unwinding-annotations-.patch b/patches/v8/0011-Revert-heap-Add-masm-specific-unwinding-annotations-.patch index 1f01fb758dc..4da6c110d5c 100644 --- a/patches/v8/0011-Revert-heap-Add-masm-specific-unwinding-annotations-.patch +++ b/patches/v8/0011-Revert-heap-Add-masm-specific-unwinding-annotations-.patch @@ -14,10 +14,10 @@ of getting our V8 upgrade unblocked. Signed-off-by: James M Snell diff --git a/BUILD.gn b/BUILD.gn -index c6132807ff6c488543b4df1f3ba8793d9dea98d5..a4cbb51a991dbe21c3d375d47e427e31d2554516 100644 +index 1df3d4e31bcc427acc5c2fd705ede40018412d9e..daabb371b0af5f5b40e4fc74f975000f7cc6f995 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -4975,8 +4975,8 @@ v8_header_set("v8_internal_headers") { +@@ -4991,8 +4991,8 @@ v8_header_set("v8_internal_headers") { "src/tasks/operations-barrier.h", "src/tasks/task-utils.h", "src/torque/runtime-macro-shims.h", @@ -27,7 +27,7 @@ index c6132807ff6c488543b4df1f3ba8793d9dea98d5..a4cbb51a991dbe21c3d375d47e427e31 "src/tracing/trace-id.h", "src/tracing/traced-value.h", "src/tracing/tracing-category-observer.h", -@@ -7907,12 +7907,7 @@ v8_source_set("v8_heap_base") { +@@ -7952,12 +7952,7 @@ v8_source_set("v8_heap_base") { ] if (current_cpu == "x64") { diff --git a/patches/v8/0012-Update-illegal-invocation-error-message-in-v8.patch b/patches/v8/0012-Update-illegal-invocation-error-message-in-v8.patch index 1544b3b8ae2..5e61619914d 100644 --- a/patches/v8/0012-Update-illegal-invocation-error-message-in-v8.patch +++ b/patches/v8/0012-Update-illegal-invocation-error-message-in-v8.patch @@ -23,10 +23,10 @@ index 4b47483f3998ada2320ed48f44a30b003ed97b6b..4591cbc5f6d721796efa19ecf02ebdc8 "Immutable prototype object '%' cannot have their prototype set") \ T(ImportAttributesDuplicateKey, "Import attribute has duplicate key '%'") \ diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc -index 2c5d1dceebb911a27e5f1585d0028afb537350c7..19ff04e632c27fb62c2b1d3a6d56e5bbd575e45d 100644 +index c98c4e2ecb33fadae4ceb6b62ee089c0aaee1efe..bc7589c4bc9c3ea43098d488ad2ee6ba6f0d1e6c 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc -@@ -228,6 +228,17 @@ THREADED_TEST(IsolateOfContext) { +@@ -229,6 +229,17 @@ THREADED_TEST(IsolateOfContext) { CHECK(isolate->IsCurrent()); } @@ -44,7 +44,7 @@ index 2c5d1dceebb911a27e5f1585d0028afb537350c7..19ff04e632c27fb62c2b1d3a6d56e5bb static void TestSignatureLooped(const char* operation, Local receiver, v8::Isolate* isolate) { auto source = v8::base::OwnedVector::NewForOverwrite(200); -@@ -245,12 +256,7 @@ static void TestSignatureLooped(const char* operation, Local receiver, +@@ -246,12 +257,7 @@ static void TestSignatureLooped(const char* operation, Local receiver, if (!expected_to_throw) { CHECK_EQ(10, signature_callback_count); } else { @@ -58,7 +58,7 @@ index 2c5d1dceebb911a27e5f1585d0028afb537350c7..19ff04e632c27fb62c2b1d3a6d56e5bb } signature_expected_receiver_global.Reset(); } -@@ -277,12 +283,7 @@ static void TestSignatureOptimized(const char* operation, Local receiver, +@@ -278,12 +284,7 @@ static void TestSignatureOptimized(const char* operation, Local receiver, if (!expected_to_throw) { CHECK_EQ(3, signature_callback_count); } else { diff --git a/patches/v8/0013-Implement-cross-request-context-promise-resolve-hand.patch b/patches/v8/0013-Implement-cross-request-context-promise-resolve-hand.patch index 220abb8e1ec..ad9fab378e8 100644 --- a/patches/v8/0013-Implement-cross-request-context-promise-resolve-hand.patch +++ b/patches/v8/0013-Implement-cross-request-context-promise-resolve-hand.patch @@ -6,10 +6,10 @@ Subject: Implement cross-request context promise resolve handling Signed-off-by: James M Snell diff --git a/include/v8-callbacks.h b/include/v8-callbacks.h -index 2feae234f77b60de3220804edc6d2ccd067f5670..cb04861438b5f16abefb2375d1284be382961cc2 100644 +index 334f59f16b6365f3562ef004fb637f090f629c9e..a67163db9a6f194a3c17f020a0b8a12fad3a0ba2 100644 --- a/include/v8-callbacks.h +++ b/include/v8-callbacks.h -@@ -540,6 +540,25 @@ using FilterETWSessionByURL2Callback = FilterETWSessionByURLResult (*)( +@@ -548,6 +548,25 @@ using FilterETWSessionByURL2Callback = FilterETWSessionByURLResult (*)( using PromiseCrossContextCallback = MaybeLocal (*)( Local context, Local promise, Local tag); @@ -36,10 +36,10 @@ index 2feae234f77b60de3220804edc6d2ccd067f5670..cb04861438b5f16abefb2375d1284be3 #endif // INCLUDE_V8_ISOLATE_CALLBACKS_H_ diff --git a/include/v8-isolate.h b/include/v8-isolate.h -index b642d8191d57ba690c86088bb74cb07414edeb7f..0bb9950cd2423ecb3fa47fc415df83c703632a1f 100644 +index 8ee9a10b6a219f72ff27eeec8b2e6f3f3457ba00..69b1d9efeafe91eadbebd07005074d5162164720 100644 --- a/include/v8-isolate.h +++ b/include/v8-isolate.h -@@ -1887,6 +1887,8 @@ class V8_EXPORT Isolate { +@@ -1895,6 +1895,8 @@ class V8_EXPORT Isolate { class PromiseContextScope; void SetPromiseCrossContextCallback(PromiseCrossContextCallback callback); @@ -49,10 +49,10 @@ index b642d8191d57ba690c86088bb74cb07414edeb7f..0bb9950cd2423ecb3fa47fc415df83c7 Isolate() = delete; ~Isolate() = delete; diff --git a/src/api/api.cc b/src/api/api.cc -index af5043b64ea454c53d7e8bf5d2694b437dac8e3b..1fd95669329a273e82dc5f7be12948aa033fee5d 100644 +index 89b421cc4bac24935717bac29653e6fd1626683e..440727a033c91008cabc0312d261d147450edf69 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -12720,13 +12720,19 @@ void Isolate::SetPromiseCrossContextCallback( +@@ -12754,13 +12754,19 @@ void Isolate::SetPromiseCrossContextCallback( isolate->set_promise_cross_context_callback(callback); } @@ -166,7 +166,7 @@ index fb7d83dd6fcff7aa7aba2ba5ad533fa8b877e1e1..46bb8d6283ea8e00c03c3c0422f1afcc Tagged Isolate::VerifyBuiltinsResult(Tagged result) { if (is_execution_terminating() && !v8_flags.strict_termination_checks) { diff --git a/src/execution/isolate.cc b/src/execution/isolate.cc -index 399663afad2fb114ee71262368c62044e3a005f3..b61f78fb7cfa4bbc54c8cc74dc7b68c8987c8dbf 100644 +index 362ece15281c4167698f16eab30a937fa057b059..1ff03085293966012772e8406a058e2cadf06e4c 100644 --- a/src/execution/isolate.cc +++ b/src/execution/isolate.cc @@ -681,8 +681,6 @@ void Isolate::Iterate(RootVisitor* v, ThreadLocalTop* thread) { @@ -178,7 +178,7 @@ index 399663afad2fb114ee71262368c62044e3a005f3..b61f78fb7cfa4bbc54c8cc74dc7b68c8 for (v8::TryCatch* block = thread->try_catch_handler_; block != nullptr; block = block->next_) { -@@ -8742,5 +8740,23 @@ MaybeHandle Isolate::RunPromiseCrossContextCallback( +@@ -8763,5 +8761,23 @@ MaybeHandle Isolate::RunPromiseCrossContextCallback( return v8::Utils::OpenHandle(*result); } @@ -203,7 +203,7 @@ index 399663afad2fb114ee71262368c62044e3a005f3..b61f78fb7cfa4bbc54c8cc74dc7b68c8 } // namespace internal } // namespace v8 diff --git a/src/execution/isolate.h b/src/execution/isolate.h -index 6db8bb8e63cd3255a69313fbae01d730c83f5a3e..6246c9e2038b4c56fd0c6ebf6720bf02523c8e06 100644 +index 07a8fccbbcaddfe884caf069fb636911f2d8e2dc..a3ed5f84f8d0c46457220a22a9931f0b9dead991 100644 --- a/src/execution/isolate.h +++ b/src/execution/isolate.h @@ -48,6 +48,7 @@ @@ -214,7 +214,7 @@ index 6db8bb8e63cd3255a69313fbae01d730c83f5a3e..6246c9e2038b4c56fd0c6ebf6720bf02 #include "src/objects/tagged.h" #include "src/runtime/runtime.h" #include "src/sandbox/external-pointer-table.h" -@@ -2516,15 +2517,24 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { +@@ -2523,15 +2524,24 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { v8::ExceptionContext callback_kind); void SetExceptionPropagationCallback(ExceptionPropagationCallback callback); @@ -241,7 +241,7 @@ index 6db8bb8e63cd3255a69313fbae01d730c83f5a3e..6246c9e2038b4c56fd0c6ebf6720bf02 #ifdef V8_ENABLE_WASM_SIMD256_REVEC void set_wasm_revec_verifier_for_test( compiler::turboshaft::WasmRevecVerifier* verifier) { -@@ -3064,9 +3074,11 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { +@@ -3071,9 +3081,11 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { bool is_frozen_ = false; friend class HandleScopeImplementer; @@ -256,10 +256,10 @@ index 6db8bb8e63cd3255a69313fbae01d730c83f5a3e..6246c9e2038b4c56fd0c6ebf6720bf02 class PromiseCrossContextCallbackScope; diff --git a/src/heap/factory.cc b/src/heap/factory.cc -index c7f41c8ae93fb5c541e667dc2cfadadbc7c24d9f..7680f83e7fc49e7a4882556d9ffe6e12f53011e5 100644 +index 1af06a1fdfe03fc9e0f241ad21ec24da28f32660..c8966aede18298be3fce0a73c38f613384bd220e 100644 --- a/src/heap/factory.cc +++ b/src/heap/factory.cc -@@ -5168,18 +5168,17 @@ Handle Factory::NewJSPromiseWithoutHook() { +@@ -5163,18 +5163,17 @@ Handle Factory::NewJSPromiseWithoutHook() { Handle promise = Cast(NewJSObject(isolate()->promise_function())); DisallowGarbageCollection no_gc; @@ -395,10 +395,10 @@ index 3ff2dd2f8d52f664ad4bc36142950eba02d859ab..4bc5d3e8779fdcf06332e8e283f6c7f2 Isolate* isolate, DirectHandle reactions, DirectHandle argument, PromiseReaction::Type type) { diff --git a/src/roots/roots.h b/src/roots/roots.h -index 73296da9753e1a94f438026b61539a947c1f9ee1..87fd6cf5f2170955e29484d04bfce07e23a13279 100644 +index b995b4bffd6ce299cf13376d2298fbb5c4049ff8..77105aee154b6ed3139a150ca7fe16019e0aacdc 100644 --- a/src/roots/roots.h +++ b/src/roots/roots.h -@@ -456,7 +456,8 @@ class RootVisitor; +@@ -465,7 +465,8 @@ class RootVisitor; V(FunctionTemplateInfo, error_stack_getter_fun_template, \ ErrorStackGetterSharedFun) \ V(FunctionTemplateInfo, error_stack_setter_fun_template, \ @@ -473,7 +473,7 @@ index 618dbb2f0d6e946c34f0271ec25b143cc0d7338f..87e76df57f58096f82da95c5af72ae87 } // namespace internal } // namespace v8 diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h -index 00e9803d059a31e7cc0255a141fb6fdede763bcb..0f5262e67f1995e8083bb479c11c84e7d98a5e39 100644 +index 2d5184b3761eb00aaaf873ed7daf0f689a8e8c7c..7d7d0ab12992a4847579f59ed58f1102bebeb93f 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -452,7 +452,8 @@ constexpr bool CanTriggerGC(T... properties) { diff --git a/patches/v8/0014-Add-another-slot-in-the-isolate-for-embedder.patch b/patches/v8/0014-Add-another-slot-in-the-isolate-for-embedder.patch index 03e0735c37a..94e8f4de4a8 100644 --- a/patches/v8/0014-Add-another-slot-in-the-isolate-for-embedder.patch +++ b/patches/v8/0014-Add-another-slot-in-the-isolate-for-embedder.patch @@ -6,10 +6,10 @@ Subject: Add another slot in the isolate for embedder Signed-off-by: James M Snell diff --git a/include/v8-internal.h b/include/v8-internal.h -index 43b598c4a0c2407f3c06fa0f772b45a760ee72fa..4c3e193d03197c2c944a40c8c823b3255086090d 100644 +index 5c20dc45827fc4670e8894b795c467fce1e9cb00..cf7bbce241d71595a95cf95d348c0a77d1e330d8 100644 --- a/include/v8-internal.h +++ b/include/v8-internal.h -@@ -1014,7 +1014,7 @@ class Internals { +@@ -1022,7 +1022,7 @@ class Internals { // AccessorInfo::data and InterceptorInfo::data field. static const int kCallbackInfoDataOffset = 1 * kApiTaggedSize; diff --git a/patches/v8/0015-Add-ValueSerializer-SetTreatProxiesAsHostObjects.patch b/patches/v8/0015-Add-ValueSerializer-SetTreatProxiesAsHostObjects.patch index e2addeb07fc..806f8b6644d 100644 --- a/patches/v8/0015-Add-ValueSerializer-SetTreatProxiesAsHostObjects.patch +++ b/patches/v8/0015-Add-ValueSerializer-SetTreatProxiesAsHostObjects.patch @@ -30,10 +30,10 @@ index c9234089b2e663ea0ea8f495af59d64de32622a7..5be6fcf6465fcc5698f260bdfad22939 * Write raw data in various common formats to the buffer. * Note that integer types are written in base-128 varint format, not with a diff --git a/src/api/api.cc b/src/api/api.cc -index 1fd95669329a273e82dc5f7be12948aa033fee5d..b8562ec14ada8460742e2cd6c488c4501733f44c 100644 +index 440727a033c91008cabc0312d261d147450edf69..300bd1c253c21290afc14d634f96ca379647f147 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -3708,6 +3708,10 @@ void ValueSerializer::SetTreatFunctionsAsHostObjects(bool mode) { +@@ -3712,6 +3712,10 @@ void ValueSerializer::SetTreatFunctionsAsHostObjects(bool mode) { private_->serializer.SetTreatFunctionsAsHostObjects(mode); } @@ -45,7 +45,7 @@ index 1fd95669329a273e82dc5f7be12948aa033fee5d..b8562ec14ada8460742e2cd6c488c450 Local value) { auto i_isolate = i::Isolate::Current(); diff --git a/src/objects/value-serializer.cc b/src/objects/value-serializer.cc -index 430014ca3961fc829d6e2f062cd49a3064056d06..39325754e05b84ef9cade5796277df8fda7665e2 100644 +index 8c0234ab79a7a003dbee51196eef5b791ee6c9ee..2c1a8a1a034f7c4901818a300c8fae8229317cff 100644 --- a/src/objects/value-serializer.cc +++ b/src/objects/value-serializer.cc @@ -360,6 +360,10 @@ void ValueSerializer::SetTreatFunctionsAsHostObjects(bool mode) { diff --git a/patches/v8/0017-Enable-V8-shared-linkage.patch b/patches/v8/0017-Enable-V8-shared-linkage.patch index 7521b318ddf..1ffe7d7f5fa 100644 --- a/patches/v8/0017-Enable-V8-shared-linkage.patch +++ b/patches/v8/0017-Enable-V8-shared-linkage.patch @@ -6,10 +6,10 @@ Subject: Enable V8 shared linkage Signed-off-by: James M Snell diff --git a/BUILD.bazel b/BUILD.bazel -index ab7a935e1b54ca9025e072630ef66a6ffe7bc794..ace64692dcec743e96b8b6a797dddd671063a158 100644 +index 4abddcdb7579d15600231a5093c08252ca358366..74a610af2887d8527a20eb52ac11da3c2a2fd4e8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -1540,6 +1540,7 @@ filegroup( +@@ -1542,6 +1542,7 @@ filegroup( "src/builtins/constants-table-builder.cc", "src/builtins/constants-table-builder.h", "src/builtins/data-view-ops.h", @@ -17,7 +17,7 @@ index ab7a935e1b54ca9025e072630ef66a6ffe7bc794..ace64692dcec743e96b8b6a797dddd67 "src/builtins/profile-data-reader.h", "src/builtins/superspread.h", "src/codegen/aligned-slot-allocator.cc", -@@ -1723,7 +1724,6 @@ filegroup( +@@ -1727,7 +1728,6 @@ filegroup( "src/execution/futex-emulation.h", "src/execution/interrupts-scope.cc", "src/execution/interrupts-scope.h", @@ -25,7 +25,7 @@ index ab7a935e1b54ca9025e072630ef66a6ffe7bc794..ace64692dcec743e96b8b6a797dddd67 "src/execution/isolate.h", "src/execution/isolate-data.h", "src/execution/isolate-data-fields.h", -@@ -3366,7 +3366,6 @@ filegroup( +@@ -3371,7 +3371,6 @@ filegroup( filegroup( name = "v8_compiler_files", srcs = [ @@ -33,7 +33,7 @@ index ab7a935e1b54ca9025e072630ef66a6ffe7bc794..ace64692dcec743e96b8b6a797dddd67 "src/compiler/access-builder.cc", "src/compiler/access-builder.h", "src/compiler/access-info.cc", -@@ -3990,8 +3989,6 @@ filegroup( +@@ -3995,8 +3994,6 @@ filegroup( "src/builtins/growable-fixed-array-gen.cc", "src/builtins/growable-fixed-array-gen.h", "src/builtins/number-builtins-reducer-inl.h", @@ -42,7 +42,7 @@ index ab7a935e1b54ca9025e072630ef66a6ffe7bc794..ace64692dcec743e96b8b6a797dddd67 "src/builtins/setup-builtins-internal.cc", "src/builtins/torque-csa-header-includes.h", "src/codegen/turboshaft-builtins-assembler-inl.h", -@@ -4263,6 +4260,7 @@ filegroup( +@@ -4268,6 +4265,7 @@ filegroup( "src/snapshot/snapshot-empty.cc", "src/snapshot/static-roots-gen.cc", "src/snapshot/static-roots-gen.h", @@ -50,7 +50,7 @@ index ab7a935e1b54ca9025e072630ef66a6ffe7bc794..ace64692dcec743e96b8b6a797dddd67 ], ) -@@ -4373,6 +4371,10 @@ filegroup( +@@ -4378,6 +4376,10 @@ filegroup( name = "noicu/snapshot_files", srcs = [ "src/init/setup-isolate-deserialize.cc", @@ -61,7 +61,7 @@ index ab7a935e1b54ca9025e072630ef66a6ffe7bc794..ace64692dcec743e96b8b6a797dddd67 ] + select({ "@v8//bazel/config:v8_target_arm": [ "google3/snapshots/arm/noicu/embedded.S", -@@ -4390,6 +4392,7 @@ filegroup( +@@ -4395,6 +4397,7 @@ filegroup( name = "icu/snapshot_files", srcs = [ "src/init/setup-isolate-deserialize.cc", diff --git a/patches/v8/0018-Modify-where-to-look-for-fast_float-and-simdutf.patch b/patches/v8/0018-Modify-where-to-look-for-fast_float-and-simdutf.patch index 8d3ebbd807f..1ea7f0b9fb2 100644 --- a/patches/v8/0018-Modify-where-to-look-for-fast_float-and-simdutf.patch +++ b/patches/v8/0018-Modify-where-to-look-for-fast_float-and-simdutf.patch @@ -12,10 +12,10 @@ include changes are needed. Signed-off-by: James M Snell diff --git a/BUILD.bazel b/BUILD.bazel -index ace64692dcec743e96b8b6a797dddd671063a158..e958ea3b034395506f2c68974dadc65dd2fa49a0 100644 +index 74a610af2887d8527a20eb52ac11da3c2a2fd4e8..e050165da217db64b24febc589f2bef9686115f8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -4517,7 +4517,6 @@ filegroup( +@@ -4522,7 +4522,6 @@ filegroup( # than a blanket third_party/**, which would also stage the # large gclient trees. "third_party/utf8-decoder/**/*.h", @@ -23,7 +23,7 @@ index ace64692dcec743e96b8b6a797dddd671063a158..e958ea3b034395506f2c68974dadc65d "third_party/rapidhash-v8/**/*.h", "third_party/wasm-api/**/*.h", "third_party/siphash/**/*.h", -@@ -4622,7 +4621,7 @@ metagen_instance_types( +@@ -4627,7 +4626,7 @@ metagen_instance_types( ":define_flags", ":v8_libbase", ":lib_fp16", @@ -32,7 +32,7 @@ index ace64692dcec743e96b8b6a797dddd671063a158..e958ea3b034395506f2c68974dadc65d "@abseil-cpp//absl/container:btree", "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/container:flat_hash_set", -@@ -4869,18 +4868,19 @@ cc_library( +@@ -4874,18 +4873,19 @@ cc_library( ], ) @@ -64,7 +64,7 @@ index ace64692dcec743e96b8b6a797dddd671063a158..e958ea3b034395506f2c68974dadc65d v8_library( name = "v8_libshared", -@@ -4927,15 +4927,15 @@ v8_library( +@@ -4932,15 +4932,15 @@ v8_library( }), deps = [ ":lib_dragonbox", diff --git a/patches/v8/0020-Add-methods-to-get-heap-and-external-memory-sizes-di.patch b/patches/v8/0020-Add-methods-to-get-heap-and-external-memory-sizes-di.patch index 20e2f495b7c..e5e86745965 100644 --- a/patches/v8/0020-Add-methods-to-get-heap-and-external-memory-sizes-di.patch +++ b/patches/v8/0020-Add-methods-to-get-heap-and-external-memory-sizes-di.patch @@ -8,10 +8,10 @@ Subject: Add methods to get heap and external memory sizes directly. Signed-off-by: James M Snell diff --git a/include/v8-isolate.h b/include/v8-isolate.h -index 0bb9950cd2423ecb3fa47fc415df83c703632a1f..176d0c4dbe1313ac41e46d37a3018a6f19b76f6d 100644 +index 69b1d9efeafe91eadbebd07005074d5162164720..ed7cb05b8f6d5c36acb4eec8b2ecd4f74d896e23 100644 --- a/include/v8-isolate.h +++ b/include/v8-isolate.h -@@ -1093,6 +1093,16 @@ class V8_EXPORT Isolate { +@@ -1102,6 +1102,16 @@ class V8_EXPORT Isolate { V8_DEPRECATE_SOON("Use ExternalMemoryAccounter instead.") int64_t AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes); @@ -29,10 +29,10 @@ index 0bb9950cd2423ecb3fa47fc415df83c703632a1f..176d0c4dbe1313ac41e46d37a3018a6f * Returns heap profiler for this isolate. Will return NULL until the isolate * is initialized. diff --git a/src/api/api.cc b/src/api/api.cc -index b8562ec14ada8460742e2cd6c488c4501733f44c..0fdf7c6b4e8e9763102e8277a6fbef1c39e2cb41 100644 +index 300bd1c253c21290afc14d634f96ca379647f147..0494ed871f94c8fcd50e4a6ade120ceb2d5cc855 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -10602,6 +10602,14 @@ void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) { +@@ -10610,6 +10610,14 @@ void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) { #endif // V8_ENABLE_WEBASSEMBLY } diff --git a/patches/v8/0021-Port-concurrent-mksnapshot-support.patch b/patches/v8/0021-Port-concurrent-mksnapshot-support.patch index 6121ced01e1..6d09c2da7a5 100644 --- a/patches/v8/0021-Port-concurrent-mksnapshot-support.patch +++ b/patches/v8/0021-Port-concurrent-mksnapshot-support.patch @@ -6,7 +6,7 @@ Subject: Port concurrent mksnapshot support Change-Id: I57c8158ff5d624e5379e6b072f27ac7a40419522 diff --git a/BUILD.bazel b/BUILD.bazel -index e958ea3b034395506f2c68974dadc65dd2fa49a0..214bcd2dc166b04fc3ab8d3a034f7a5b8d40714a 100644 +index e050165da217db64b24febc589f2bef9686115f8..e2c2ce554123b29fd69f648e052dc44a7f2b2cea 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -123,6 +123,11 @@ v8_flag(name = "v8_enable_hugepage") @@ -21,7 +21,7 @@ index e958ea3b034395506f2c68974dadc65dd2fa49a0..214bcd2dc166b04fc3ab8d3a034f7a5b v8_flag(name = "v8_enable_future") # NOTE: Transitions are not recommended in library targets: -@@ -4787,6 +4792,13 @@ v8_mksnapshot( +@@ -4792,6 +4797,13 @@ v8_mksnapshot( "--no-turbo-verify-allocation", ], "//conditions:default": [], diff --git a/patches/v8/0022-Port-V8_USE_ZLIB-support.patch b/patches/v8/0022-Port-V8_USE_ZLIB-support.patch index a6d857fd97d..1dbf97f6c4b 100644 --- a/patches/v8/0022-Port-V8_USE_ZLIB-support.patch +++ b/patches/v8/0022-Port-V8_USE_ZLIB-support.patch @@ -6,7 +6,7 @@ Subject: Port V8_USE_ZLIB support Change-Id: Icfedf3e90522f1ff5037517a39a5f0e3d44abace diff --git a/BUILD.bazel b/BUILD.bazel -index 214bcd2dc166b04fc3ab8d3a034f7a5b8d40714a..a714df90df89e4932f2620ab6afeb60f0d6e5e57 100644 +index e2c2ce554123b29fd69f648e052dc44a7f2b2cea..eb0124cc974928f6ac1baba7ea6e12173b4d069a 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -170,6 +170,11 @@ v8_flag(name = "v8_enable_verify_predictable") @@ -29,7 +29,7 @@ index 214bcd2dc166b04fc3ab8d3a034f7a5b8d40714a..a714df90df89e4932f2620ab6afeb60f }, defines = [ "GOOGLE3", -@@ -4948,6 +4954,8 @@ v8_library( +@@ -4953,6 +4959,8 @@ v8_library( "@highway//:hwy", "@fast_float", "@simdutf", diff --git a/patches/v8/0023-Modify-where-to-look-for-dragonbox.patch b/patches/v8/0023-Modify-where-to-look-for-dragonbox.patch index 850e89b4050..41924f67ac7 100644 --- a/patches/v8/0023-Modify-where-to-look-for-dragonbox.patch +++ b/patches/v8/0023-Modify-where-to-look-for-dragonbox.patch @@ -5,10 +5,10 @@ Subject: Modify where to look for dragonbox diff --git a/BUILD.bazel b/BUILD.bazel -index a714df90df89e4932f2620ab6afeb60f0d6e5e57..e255deb3845b13aec48441beef07b2ec954ea5c9 100644 +index eb0124cc974928f6ac1baba7ea6e12173b4d069a..1fbf951d325322da19071c96585f2d74c6a2c2d8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -4199,13 +4199,8 @@ filegroup( +@@ -4204,13 +4204,8 @@ filegroup( v8_library( name = "lib_dragonbox", diff --git a/patches/v8/0026-Implement-additional-Exception-construction-methods.patch b/patches/v8/0026-Implement-additional-Exception-construction-methods.patch index 18c458733f1..29e48db8294 100644 --- a/patches/v8/0026-Implement-additional-Exception-construction-methods.patch +++ b/patches/v8/0026-Implement-additional-Exception-construction-methods.patch @@ -25,10 +25,10 @@ index 74f57311a5257e8fdba3a060e9f6844a26a6dd69..88ba0737664800d8bcc1e091d9648ca7 /** * Creates an error message for the given exception. diff --git a/src/api/api.cc b/src/api/api.cc -index 0fdf7c6b4e8e9763102e8277a6fbef1c39e2cb41..72b31b8250bf60460d82d0e0e0827a81af2f4f36 100644 +index 0494ed871f94c8fcd50e4a6ade120ceb2d5cc855..29db2534ed3b639d3bbab0f5790929744436870c 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -11487,6 +11487,10 @@ DEFINE_ERROR(WasmCompileError, wasm_compile_error) +@@ -11498,6 +11498,10 @@ DEFINE_ERROR(WasmCompileError, wasm_compile_error) DEFINE_ERROR(WasmLinkError, wasm_link_error) DEFINE_ERROR(WasmRuntimeError, wasm_runtime_error) DEFINE_ERROR(WasmSuspendError, wasm_suspend_error) diff --git a/patches/v8/0028-bind-icu-to-googlesource.patch b/patches/v8/0028-bind-icu-to-googlesource.patch index 7315a16934d..33031974ef6 100644 --- a/patches/v8/0028-bind-icu-to-googlesource.patch +++ b/patches/v8/0028-bind-icu-to-googlesource.patch @@ -5,10 +5,10 @@ Subject: bind icu to googlesource diff --git a/BUILD.bazel b/BUILD.bazel -index e255deb3845b13aec48441beef07b2ec954ea5c9..56c9e18986d8004c12001a3dd445704079d05a56 100644 +index 1fbf951d325322da19071c96585f2d74c6a2c2d8..a5e2035ec799f5df7367b9b8d6e49831397eef70 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -4909,7 +4909,7 @@ v8_library( +@@ -4914,7 +4914,7 @@ v8_library( copts = ["-Wno-implicit-fallthrough"], icu_deps = [ ":icu/generated_torque_definitions_headers", @@ -17,7 +17,7 @@ index e255deb3845b13aec48441beef07b2ec954ea5c9..56c9e18986d8004c12001a3dd4457040 ] + select({ ":is_v8_use_metagen_instance_types": [ ":icu/metagen_instance_types_headers", -@@ -5048,7 +5048,7 @@ v8_binary( +@@ -5053,7 +5053,7 @@ v8_binary( ], deps = [ ":v8_libbase", diff --git a/patches/v8/0029-Add-v8-String-IsFlat-API.patch b/patches/v8/0029-Add-v8-String-IsFlat-API.patch index 2d35f711608..a24ed03b6af 100644 --- a/patches/v8/0029-Add-v8-String-IsFlat-API.patch +++ b/patches/v8/0029-Add-v8-String-IsFlat-API.patch @@ -24,10 +24,10 @@ index 8466df80175de9362dd785d83fa527a20a3be1a6..c28282462218fb5e7c66face4402e39d enum { kNone = 0, diff --git a/src/api/api.cc b/src/api/api.cc -index 72b31b8250bf60460d82d0e0e0827a81af2f4f36..f2e6ee4e55e1325e0ddfdc4a70e7e74cbc9806db 100644 +index 29db2534ed3b639d3bbab0f5790929744436870c..b97ec7a4098781652527ae9b6db463ed01bb89f7 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -5969,6 +5969,10 @@ bool String::IsOneByte() const { +@@ -5977,6 +5977,10 @@ bool String::IsOneByte() const { return Utils::OpenDirectHandle(this)->IsOneByteRepresentation(); } diff --git a/patches/v8/0030-Expose-AdjustAmountOfExternalAllocatedMemoryImpl-as-.patch b/patches/v8/0030-Expose-AdjustAmountOfExternalAllocatedMemoryImpl-as-.patch index 31242099a03..a58ff31f44d 100644 --- a/patches/v8/0030-Expose-AdjustAmountOfExternalAllocatedMemoryImpl-as-.patch +++ b/patches/v8/0030-Expose-AdjustAmountOfExternalAllocatedMemoryImpl-as-.patch @@ -14,10 +14,10 @@ method. This patch simply makes it public for embedder use. Signed-off-by: Aditya Tewari diff --git a/include/v8-isolate.h b/include/v8-isolate.h -index 176d0c4dbe1313ac41e46d37a3018a6f19b76f6d..0f5ffcfcf59ff054e7945046034d82b0518f0a5d 100644 +index ed7cb05b8f6d5c36acb4eec8b2ecd4f74d896e23..36fc00314b1fbd10d39e17f33434d4f041e26cf1 100644 --- a/include/v8-isolate.h +++ b/include/v8-isolate.h -@@ -1103,6 +1103,14 @@ class V8_EXPORT Isolate { +@@ -1112,6 +1112,14 @@ class V8_EXPORT Isolate { */ size_t GetHeapSize(); @@ -32,7 +32,7 @@ index 176d0c4dbe1313ac41e46d37a3018a6f19b76f6d..0f5ffcfcf59ff054e7945046034d82b0 /** * Returns heap profiler for this isolate. Will return NULL until the isolate * is initialized. -@@ -1918,7 +1926,6 @@ class V8_EXPORT Isolate { +@@ -1926,7 +1934,6 @@ class V8_EXPORT Isolate { internal::ValueHelper::InternalRepresentationType GetDataFromSnapshotOnce( size_t index); diff --git a/patches/v8/0031-Add-verify_write_barriers-flag-in-V8-s-bazel-config.patch b/patches/v8/0031-Add-verify_write_barriers-flag-in-V8-s-bazel-config.patch index b396985146e..34247a552bd 100644 --- a/patches/v8/0031-Add-verify_write_barriers-flag-in-V8-s-bazel-config.patch +++ b/patches/v8/0031-Add-verify_write_barriers-flag-in-V8-s-bazel-config.patch @@ -5,7 +5,7 @@ Subject: Add verify_write_barriers flag in V8's bazel config diff --git a/BUILD.bazel b/BUILD.bazel -index 56c9e18986d8004c12001a3dd445704079d05a56..858dd0fece9ea1979752528d5badffc5ccad5607 100644 +index a5e2035ec799f5df7367b9b8d6e49831397eef70..47d285a961edcecd3495845375530f159b2af291 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -575,6 +575,7 @@ v8_config( diff --git a/patches/v8/0033-Return-false-on-Object.hasOwnProperty-with-intercept.patch b/patches/v8/0033-Return-false-on-Object.hasOwnProperty-with-intercept.patch index 98dcc51c70d..d97ba1a446f 100644 --- a/patches/v8/0033-Return-false-on-Object.hasOwnProperty-with-intercept.patch +++ b/patches/v8/0033-Return-false-on-Object.hasOwnProperty-with-intercept.patch @@ -5,7 +5,7 @@ Subject: Return false on Object.hasOwnProperty with interceptors diff --git a/src/objects/js-objects.cc b/src/objects/js-objects.cc -index b7c8a0406ab9aa2fe28b126e3d9c4cbf2be17f47..2550753ed584c1e1e888d78d54b15494153e2a88 100644 +index b6950f5d2eb652cd651ef181f9d9e2e135df06ed..1bca8eab0b538f885e05b13911a1ac3e5897360a 100644 --- a/src/objects/js-objects.cc +++ b/src/objects/js-objects.cc @@ -165,6 +165,9 @@ Maybe JSReceiver::HasOwnProperty(Isolate* isolate, diff --git a/patches/v8/0038-Properly-depend-on-llvm-libc.patch b/patches/v8/0038-Properly-depend-on-llvm-libc.patch index f7fced42afe..b1cf3a94975 100644 --- a/patches/v8/0038-Properly-depend-on-llvm-libc.patch +++ b/patches/v8/0038-Properly-depend-on-llvm-libc.patch @@ -6,10 +6,10 @@ Subject: Properly depend on llvm-libc Change-Id: I9858b147d027e67704c6ca84e0c42fab39a5c97a diff --git a/BUILD.bazel b/BUILD.bazel -index 858dd0fece9ea1979752528d5badffc5ccad5607..5eaff6ae55890819ee33f82b5896dcfbfaa8d3d4 100644 +index 47d285a961edcecd3495845375530f159b2af291..d4dc5621b1000a61e2f9b24cb64f90befd3f2e28 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -4831,13 +4831,6 @@ cc_library( +@@ -4836,13 +4836,6 @@ cc_library( strip_include_prefix = "noicu", ) @@ -23,7 +23,7 @@ index 858dd0fece9ea1979752528d5badffc5ccad5607..5eaff6ae55890819ee33f82b5896dcfb v8_library( name = "v8_libbase", srcs = [ -@@ -4846,7 +4839,7 @@ v8_library( +@@ -4851,7 +4844,7 @@ v8_library( ], copts = ["-Wno-implicit-fallthrough"], deps = [ diff --git a/patches/v8/0039-Fix-TSan-build-without-the-V8-sandbox.patch b/patches/v8/0039-Fix-TSan-build-without-the-V8-sandbox.patch index 920375c1e85..7d0c49f821a 100644 --- a/patches/v8/0039-Fix-TSan-build-without-the-V8-sandbox.patch +++ b/patches/v8/0039-Fix-TSan-build-without-the-V8-sandbox.patch @@ -9,10 +9,10 @@ without the sandbox, so compile the indirect-pointer handling only when the field is present. diff --git a/src/compiler/backend/x64/code-generator-x64.cc b/src/compiler/backend/x64/code-generator-x64.cc -index b0be9bc5878966c027ee1a926f23a7849ffc4cad..bba2bb16e2604a49d17a05b26e84824fbc24e50c 100644 +index 42ae89aeba43c54b9de8dd3da0c2faf7f76374cc..440f15e0146cd41248b7245ec7a3dc975128ecc4 100644 --- a/src/compiler/backend/x64/code-generator-x64.cc +++ b/src/compiler/backend/x64/code-generator-x64.cc -@@ -815,6 +815,7 @@ Register GetTSANValueRegister(MacroAssembler* masm, Register value, +@@ -813,6 +813,7 @@ Register GetTSANValueRegister(MacroAssembler* masm, Register value, masm->movq(value_reg, value); masm->EncodeSandboxedPointer(value_reg); return value_reg; @@ -20,7 +20,7 @@ index b0be9bc5878966c027ee1a926f23a7849ffc4cad..bba2bb16e2604a49d17a05b26e84824f } else if (rep == MachineRepresentation::kIndirectPointer) { // Indirect pointer fields contain an index to a pointer table entry, which // is obtained from the referenced object. -@@ -823,6 +824,7 @@ Register GetTSANValueRegister(MacroAssembler* masm, Register value, +@@ -821,6 +822,7 @@ Register GetTSANValueRegister(MacroAssembler* masm, Register value, FieldOperand(value, offsetof(ExposedTrustedObject, self_indirect_pointer_))); return value_reg; @@ -28,7 +28,7 @@ index b0be9bc5878966c027ee1a926f23a7849ffc4cad..bba2bb16e2604a49d17a05b26e84824f } return value; } -@@ -841,12 +843,14 @@ Register GetTSANValueRegister( +@@ -839,12 +841,14 @@ Register GetTSANValueRegister( if (rep == MachineRepresentation::kSandboxedPointer) { // SandboxedPointers need to be encoded. masm->EncodeSandboxedPointer(value_reg); diff --git a/patches/v8/0040-Enable-Perfetto-support-in-the-V8-Bazel-build.patch b/patches/v8/0040-Enable-Perfetto-support-in-the-V8-Bazel-build.patch index db19d8de945..2779288ff29 100644 --- a/patches/v8/0040-Enable-Perfetto-support-in-the-V8-Bazel-build.patch +++ b/patches/v8/0040-Enable-Perfetto-support-in-the-V8-Bazel-build.patch @@ -11,7 +11,7 @@ Use V8's standard v8_flag mechanism so the define, sources, and Perfetto dependency are controlled together. diff --git a/BUILD.bazel b/BUILD.bazel -index 5eaff6ae55890819ee33f82b5896dcfbfaa8d3d4..c75adb604ede34589eaee4cc108133c75044823d 100644 +index d4dc5621b1000a61e2f9b24cb64f90befd3f2e28..74bc831191fc833939bc4429b093b7e2ce5404a6 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -202,6 +202,8 @@ v8_flag( @@ -31,7 +31,7 @@ index 5eaff6ae55890819ee33f82b5896dcfbfaa8d3d4..c75adb604ede34589eaee4cc108133c7 "v8_use_zlib": "V8_USE_ZLIB", }, defines = [ -@@ -1084,16 +1087,22 @@ filegroup( +@@ -1086,16 +1089,22 @@ filegroup( "src/libplatform/task-queue.cc", "src/libplatform/task-queue.h", "src/libplatform/tracing/recorder.h", @@ -60,7 +60,7 @@ index 5eaff6ae55890819ee33f82b5896dcfbfaa8d3d4..c75adb604ede34589eaee4cc108133c7 ) filegroup( -@@ -2741,7 +2750,6 @@ filegroup( +@@ -2746,7 +2755,6 @@ filegroup( "src/tracing/perfetto-sdk.h", "src/tracing/trace-event.cc", "src/tracing/trace-event.h", @@ -68,7 +68,7 @@ index 5eaff6ae55890819ee33f82b5896dcfbfaa8d3d4..c75adb604ede34589eaee4cc108133c7 "src/tracing/trace-id.h", "src/tracing/traced-value.cc", "src/tracing/traced-value.h", -@@ -2805,6 +2813,22 @@ filegroup( +@@ -2810,6 +2818,22 @@ filegroup( ":v8_bigint", ":v8_heap_base_files", ] + select({ @@ -91,7 +91,7 @@ index 5eaff6ae55890819ee33f82b5896dcfbfaa8d3d4..c75adb604ede34589eaee4cc108133c7 "@v8//bazel/config:v8_target_ia32": [ "src/baseline/ia32/baseline-assembler-ia32-inl.h", "src/baseline/ia32/baseline-compiler-ia32-inl.h", -@@ -4945,7 +4969,10 @@ v8_library( +@@ -4950,7 +4974,10 @@ v8_library( "@simdutf", "@zlib", "@zlib//:compression_utils_portable", diff --git a/patches/v8/0041-Disable-preserve_most-on-Windows-x64-before-Clang-22.patch b/patches/v8/0041-Disable-preserve_most-on-Windows-x64-before-Clang-22.patch index 415e674cd57..9703195a4de 100644 --- a/patches/v8/0041-Disable-preserve_most-on-Windows-x64-before-Clang-22.patch +++ b/patches/v8/0041-Disable-preserve_most-on-Windows-x64-before-Clang-22.patch @@ -15,10 +15,10 @@ unchanged. See https://github.com/llvm/llvm-project/pull/156817. diff --git a/include/v8config.h b/include/v8config.h -index b36169f1f77d85e46d2840d19f78f98fd0494749..3be703206ca1c241c0d63803c4b8242aaa63c9d0 100644 +index b7aeeade6b81054edee802d058a2b944562a40d0..738d8d19e7615c7ae0e87e553540f73e66127792 100644 --- a/include/v8config.h +++ b/include/v8config.h -@@ -396,8 +396,13 @@ path. Add it with -I to the command line +@@ -403,8 +403,13 @@ path. Add it with -I to the command line && !defined(_WIN32))) /* not on windows */ \ && !defined(COMPONENT_BUILD) /* no component build */\ && __clang_major__ >= 17 /* clang >= 17 */ diff --git a/patches/v8/0042-cppgc-Sweep-cppgc-eagerly-with-non-incremental-GC.patch b/patches/v8/0042-cppgc-Sweep-cppgc-eagerly-with-non-incremental-GC.patch index 1c51a7ff2ed..5ced4edc28c 100644 --- a/patches/v8/0042-cppgc-Sweep-cppgc-eagerly-with-non-incremental-GC.patch +++ b/patches/v8/0042-cppgc-Sweep-cppgc-eagerly-with-non-incremental-GC.patch @@ -10,7 +10,7 @@ the setting and does cppgc sweeping and calling of cppgc finalizers in the atomic GC pause. diff --git a/src/heap/cppgc-js/cpp-heap.cc b/src/heap/cppgc-js/cpp-heap.cc -index 120bcce5a11b636bba9559eb5a79b6b74c176145..676d3667c81f09c3b92fdabda705fd72b714d0f9 100644 +index c1de0c1c279f09a9e6c5da2cb5d64b431ee8b03a..852c3e11eaa1697c454c960618fe8dc3a2008e73 100644 --- a/src/heap/cppgc-js/cpp-heap.cc +++ b/src/heap/cppgc-js/cpp-heap.cc @@ -760,6 +760,19 @@ CppHeap::SweepingType CppHeap::SelectSweepingType() const { diff --git a/patches/v8/0043-Allow-V8-release-archives-without-metagen-Clang-head.patch b/patches/v8/0043-Allow-V8-release-archives-without-metagen-Clang-head.patch deleted file mode 100644 index 90726cc3258..00000000000 --- a/patches/v8/0043-Allow-V8-release-archives-without-metagen-Clang-head.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Harris Hancock -Date: Mon, 28 Sep 2026 15:31:26 +0100 -Subject: Allow V8 release archives without metagen Clang headers - -workerd builds V8 from GitHub source archives, which do not include the -Clang files downloaded by gclient. V8 requires the optional metagen -header glob to match while loading the Bazel package even though metagen -is disabled, so the archive cannot otherwise be built. - -Allow the glob to be empty. Builds that enable metagen still require the -actual Clang headers. - -Assisted-by: Codex:gpt-5.6-sol - -diff --git a/BUILD.bazel b/BUILD.bazel -index c75adb604ede34589eaee4cc108133c75044823d..e40bb6e41247a538e7949a34c60cc5a2aa4ddd1d 100644 ---- a/BUILD.bazel -+++ b/BUILD.bazel -@@ -4588,7 +4588,7 @@ filegroup( - name = "metagen_clang_builtin_headers", - srcs = glob([ - "third_party/llvm-build/Release+Asserts/lib/clang/*/include/**", -- ]), -+ ], allow_empty = True), - ) - - # The harvest's checked-in C++ driver, shared with GN and metagen.py. It diff --git a/patches/v8/0043-Build-V8-release-archives-without-metagen.patch b/patches/v8/0043-Build-V8-release-archives-without-metagen.patch new file mode 100644 index 00000000000..72c3be6b706 --- /dev/null +++ b/patches/v8/0043-Build-V8-release-archives-without-metagen.patch @@ -0,0 +1,49 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Harris Hancock +Date: Mon, 28 Sep 2026 15:31:26 +0100 +Subject: Build V8 release archives without metagen + +workerd builds V8 from GitHub source archives, which do not include the +llvm-libclang and llvm-build dependencies downloaded by gclient. V8's +metagen instance-type generator needs them, so the archive cannot be +built with it. + +V8 15.6 enables metagen by default. Default +v8_use_metagen_instance_types to False so V8 uses the Torque-emitted +instance types, as it did by default before 15.6. + +V8 also requires the optional metagen Clang header glob to match while +loading the Bazel package, even when metagen is disabled. Allow the glob +to be empty. Builds that enable metagen still require the actual Clang +headers. + +Assisted-by: Codex:gpt-5.6-sol + +diff --git a/BUILD.bazel b/BUILD.bazel +index 74bc831191fc833939bc4429b093b7e2ce5404a6..55d5150ef335d04f4bca0c9f9606c95651102477 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -192,9 +192,13 @@ v8_flag(name = "v8_enable_experimental_tq_to_tsa") + # Mirrors the GN arg of the same name: selects which instance-type + # generator's output V8 compiles in, metagen or Torque's emission. When + # off, the metagen action is not part of the build graph. ++# ++# Off by default for workerd: the harvest needs the llvm-libclang and ++# llvm-build gclient dependencies, which are not in the V8 source ++# tarball that the workerd build fetches. + v8_flag( + name = "v8_use_metagen_instance_types", +- default = True, ++ default = False, + ) + + v8_flag( +@@ -4593,7 +4597,7 @@ filegroup( + name = "metagen_clang_builtin_headers", + srcs = glob([ + "third_party/llvm-build/Release+Asserts/lib/clang/*/include/**", +- ]), ++ ], allow_empty = True), + ) + + # The harvest's checked-in C++ driver, shared with GN and metagen.py. It diff --git a/src/workerd/api/capnp.h b/src/workerd/api/capnp.h index 6aa6265b046..8f1b9a8550f 100644 --- a/src/workerd/api/capnp.h +++ b/src/workerd/api/capnp.h @@ -330,7 +330,7 @@ class CapnpTypeWrapper: private CapnpTypeWrapperBase { static void constructorCallback(const v8::FunctionCallbackInfo& args) { jsg::liftKj(args, [&]() { - auto data = args.Data(); + auto data = args.DataV2().As(); KJ_ASSERT(data->IsExternal()); void* schemaAsPtr = data.As()->Value(v8::kExternalPointerTypeTagDefault); capnp::Schema schema; @@ -363,7 +363,7 @@ class CapnpTypeWrapper: private CapnpTypeWrapperBase { static void methodCallback(const v8::FunctionCallbackInfo& args) { jsg::liftKj(args, [&]() { - auto data = args.Data(); + auto data = args.DataV2().As(); KJ_ASSERT(data->IsExternal()); auto& method = *reinterpret_cast( data.As()->Value(v8::kExternalPointerTypeTagDefault)); diff --git a/src/workerd/jsg/async-context.c++ b/src/workerd/jsg/async-context.c++ index 0ae4761fab7..0f5f76350f0 100644 --- a/src/workerd/jsg/async-context.c++ +++ b/src/workerd/jsg/async-context.c++ @@ -20,7 +20,7 @@ inline void maybeSetV8ContinuationContext( } else { value = v8::Undefined(isolate); } - isolate->SetContinuationPreservedEmbedderDataV2(value); + isolate->SetContinuationPreservedEmbedderData(value); } } // namespace @@ -65,7 +65,7 @@ kj::Maybe> AsyncContextFrame::currentRef(v8::Isolate* iso } kj::Maybe AsyncContextFrame::current(v8::Isolate* isolate) { - auto value = isolate->GetContinuationPreservedEmbedderDataV2(); + auto value = isolate->GetContinuationPreservedEmbedderData(); KJ_IF_SOME(wrappable, Wrappable::tryUnwrapOpaque(isolate, value.As())) { AsyncContextFrame* frame = dynamic_cast(&wrappable); KJ_ASSERT(frame != nullptr); diff --git a/src/workerd/jsg/function.h b/src/workerd/jsg/function.h index 6c9e229962f..0b203421ab1 100644 --- a/src/workerd/jsg/function.h +++ b/src/workerd/jsg/function.h @@ -85,8 +85,8 @@ struct FunctorCallback> { auto context = isolate->GetCurrentContext(); auto& js = Lock::from(isolate); auto& wrapper = TypeWrapper::from(isolate); - auto& func = extractInternalPointer, false>( - isolate, context, args.Data().As(), kNonResourceWrappableTagRange); + auto& func = extractInternalPointer, false>(isolate, context, + args.DataV2().As().As(), kNonResourceWrappableTagRange); auto unwrapped = _::unwrapArgs(wrapper, js, context, args, []() { return TypeErrorContext::callbackArgument(i); }); @@ -117,7 +117,8 @@ struct FunctorCallback&, Args...)>, false>( - isolate, context, args.Data().As(), kNonResourceWrappableTagRange); + isolate, context, args.DataV2().As().As(), + kNonResourceWrappableTagRange); auto unwrapped = _::unwrapArgs(wrapper, js, context, args, []() { return TypeErrorContext::callbackArgument(i); }); diff --git a/src/workerd/jsg/observer.h b/src/workerd/jsg/observer.h index 58495598efe..22f51043c6b 100644 --- a/src/workerd/jsg/observer.h +++ b/src/workerd/jsg/observer.h @@ -169,8 +169,8 @@ struct IsolateObserver: public CompilationObserver, virtual ~IsolateObserver() noexcept(false) {} // Called when eval(), new Function(), or similar dynamic code generation - // is performed. Note that the source here may not be a string if isCodeLike - // is YES. + // is performed. Note that the source here may not be a string: V8 also reports + // each object argument to new Function() before converting it to a string. virtual void onDynamicEval( v8::Local context, v8::Local source, IsCodeLike isCodeLike) { // Default is to do nothing. diff --git a/src/workerd/jsg/promise.h b/src/workerd/jsg/promise.h index 5654f7e5817..38fcb353763 100644 --- a/src/workerd/jsg/promise.h +++ b/src/workerd/jsg/promise.h @@ -158,7 +158,7 @@ struct ThenCatchPair { }; // FunctionCallback implementing a C++ .then() continuation on a JS promise. // -// We expect the input is already an opaque-wrapped value, args.Data() is an opaque-wrapped C++ +// We expect the input is already an opaque-wrapped value, args.DataV2() is an opaque-wrapped C++ // function to execute, and we want to produce an opaque-wrapped output or Promise. template void promiseContinuation(const v8::FunctionCallbackInfo& args) { @@ -170,7 +170,7 @@ void promiseContinuation(const v8::FunctionCallbackInfo& args) { // so it's likely to be caught in debug, and we'd like to avoid the extra overhead in releases. DISALLOW_KJ_IO_DESTRUCTORS_SCOPE; #endif - auto funcPair = unwrapOpaque(isolate, args.Data()); + auto funcPair = unwrapOpaque(isolate, args.DataV2().As()); #ifdef KJ_DEBUG kj::AllowAsyncDestructorsScope allowAsyncDestructors; #endif @@ -211,7 +211,7 @@ void promiseContinuation(const v8::FunctionCallbackInfo& args) { template void identityPromiseContinuation(const v8::FunctionCallbackInfo& args) { auto isolate = args.GetIsolate(); - dropOpaque(isolate, args.Data()); + dropOpaque(isolate, args.DataV2().As()); if constexpr (isCatch) { isolate->ThrowException(args[0]); } else { diff --git a/src/workerd/jsg/setup-test.c++ b/src/workerd/jsg/setup-test.c++ index 21ab6ef3ca6..9c3eaca16ad 100644 --- a/src/workerd/jsg/setup-test.c++ +++ b/src/workerd/jsg/setup-test.c++ @@ -30,6 +30,14 @@ KJ_TEST("eval() is blocked") { // synthesized source matches the known empty-body, no-parameter pattern). e.expectEval("typeof new Function()", "string", "function"); + // An empty string body synthesizes the same source, so it is allowed too. + e.expectEval("typeof new Function('')", "string", "function"); + + // An object argument is checked before it is converted to a string, so it is blocked + // even if it would convert to an empty body. + e.expectEval("new Function({ toString() { return ''; } })", "throws", + "EvalError: Code generation from strings disallowed for this context"); + // new Function() with params and an undefined body is blocked (the body becomes // the string "undefined" via ToString, producing a non-empty source). e.expectEval("new Function('a', 'b', undefined)", "throws", diff --git a/src/workerd/jsg/setup.c++ b/src/workerd/jsg/setup.c++ index 7bfe1ffafb3..b913a2b0a1c 100644 --- a/src/workerd/jsg/setup.c++ +++ b/src/workerd/jsg/setup.c++ @@ -553,26 +553,30 @@ v8::ModifyCodeGenerationFromStringsResult IsolateBase::modifyCodeGenCallback( // // V8 synthesizes the full source string before calling this callback (see // CreateDynamicFunction in v8/src/builtins/builtins-function.cc). When called with - // no arguments (argc == 0), isCodeLike is true and the source is the exact string - // below — which contains no user-provided code. + // no arguments (argc == 0), the source is the exact string below, which contains no + // user-provided code. + // + // We don't check isCodeLike here. Since V8 15.6, a call with no arguments passes + // isCodeLike = false, so isCodeLike no longer tells `new Function()` apart from + // `eval()` or from calls with string arguments. // // Security notes: - // - isCodeLike is false on the eval() path, so this check cannot be reached via - // eval(). An attacker cannot use eval(" {\n\n}") to bypass this. - // - isCodeLike is also false when any arguments are plain strings (not CodeLike - // objects), so new Function('a', 'b', undefined) cannot reach this check either. // - The exact string match ensures no user content (parameters or body) is present. - // - We intentionally only match the no-parameter, no-body case. Calls like - // new Function('a', 'b') are always blocked since the last argument becomes the - // body via ToString(), producing a non-matching source string. + // Whichever path produces this source, including eval() of it or + // new Function(''), compiling it only creates an empty function. + // - Calls like new Function('a', 'b') or new Function('a', 'b', undefined) are + // always blocked, since the last argument becomes the body via ToString(), + // producing a non-matching source string. + // - Since V8 15.6, V8 also calls this callback with each object argument before + // converting it to a string. Such a source is neither undefined nor a string, so + // it falls through to the evalAllowed check below. // // NOTE: This pattern is tied to V8's CreateDynamicFunction format in - // builtins-function.cc:46-71 and must be reviewed during V8 updates. If the format + // builtins-function.cc and must be reviewed during V8 updates. If the format // changes, the setup-test and worker-test will fail, signaling that this constant // needs updating. static constexpr auto kEmptyFunctionSource = "(function anonymous(\n) {\n\n})"_kj; - if (isCodeLike && source->IsString() && - kj::str(source.As()) == kEmptyFunctionSource) { + if (source->IsString() && kj::str(source.As()) == kEmptyFunctionSource) { return {.codegen_allowed = true, .modified_source = {}}; }