diff --git a/Makefile b/Makefile index 7a9e0a2425c..f83f5a540c0 100644 --- a/Makefile +++ b/Makefile @@ -909,15 +909,9 @@ else ifeq ($(findstring ppc64,$(UNAME_M)),ppc64) DESTCPU ?= ppc64 else -ifeq ($(findstring ppc,$(UNAME_M)),ppc) -DESTCPU ?= ppc -else ifeq ($(findstring s390x,$(UNAME_M)),s390x) DESTCPU ?= s390x else -ifeq ($(findstring s390,$(UNAME_M)),s390) -DESTCPU ?= s390 -else ifeq ($(findstring OS/390,$(shell uname -s)),OS/390) DESTCPU ?= s390x else @@ -947,8 +941,6 @@ endif endif endif endif -endif -endif ifeq ($(DESTCPU),x64) ARCH=x64 else @@ -961,12 +953,6 @@ else ifeq ($(DESTCPU),ppc64) ARCH=ppc64 else -ifeq ($(DESTCPU),ppc) -ARCH=ppc -else -ifeq ($(DESTCPU),s390) -ARCH=s390 -else ifeq ($(DESTCPU),s390x) ARCH=s390x else @@ -980,8 +966,6 @@ endif endif endif endif -endif -endif # node and v8 use different arch names (e.g. node 'x86' vs v8 'ia32'). # pass the proper v8 arch name to $V8_ARCH based on user-specified $DESTCPU. diff --git a/common.gypi b/common.gypi index b2a4cd9d69c..66af19e8234 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.15', + 'v8_embedder_string': '-node.6', ##### V8 defaults for Node.js ##### @@ -110,7 +110,7 @@ 'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a', }], # V8 pointer compression only supports 64bit architectures. - ['target_arch in "arm ia32 mips mipsel ppc"', { + ['target_arch in "arm ia32 mips mipsel"', { 'v8_enable_pointer_compression': 0, 'v8_enable_31bit_smis_on_64bit_arch': 0, 'v8_enable_sandbox': 0 @@ -516,10 +516,6 @@ 'cflags': [ '-m64' ], 'ldflags': [ '-m64' ], }], - [ 'host_arch=="ppc" and OS not in "aix os400"', { - 'cflags': [ '-m32' ], - 'ldflags': [ '-m32' ], - }], [ 'host_arch=="ppc64" and OS not in "aix os400"', { 'cflags': [ '-m64', '-mminimal-toc' ], 'ldflags': [ '-m64' ], @@ -540,10 +536,6 @@ 'cflags': [ '-m64' ], 'ldflags': [ '-m64' ], }], - [ 'target_arch=="ppc" and OS not in "aix os400"', { - 'cflags': [ '-m32' ], - 'ldflags': [ '-m32' ], - }], [ 'target_arch=="ppc64" and OS not in "aix os400"', { 'cflags': [ '-m64', '-mminimal-toc' ], 'ldflags': [ '-m64' ], diff --git a/configure.py b/configure.py index 073cc0c390f..30128219459 100755 --- a/configure.py +++ b/configure.py @@ -47,7 +47,7 @@ valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', 'android', 'aix', 'cloudabi', 'os400', 'ios') -valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc', +valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc64', 'x64', 'x86', 'x86_64', 's390x', 'riscv64', 'loong64') valid_arm_float_abi = ('soft', 'softfp', 'hard') valid_arm_fpu = ('vfp', 'vfpv3', 'vfpv3-d16', 'neon') diff --git a/deps/v8/.clang-tidy b/deps/v8/.clang-tidy index f4796364697..aa7d3813aa1 100644 --- a/deps/v8/.clang-tidy +++ b/deps/v8/.clang-tidy @@ -2,6 +2,10 @@ --- Checks: '-*, bugprone-unique-ptr-array-mismatch, + # google-build-explicit-make-pair, + google-default-arguments, + google-explicit-constructor, + google-readability-casting, modernize-redundant-void-arg, modernize-replace-random-shuffle, modernize-shrink-to-fit, @@ -11,12 +15,10 @@ # modernize-use-equals-delete, modernize-use-nullptr, modernize-use-override, - # google-build-explicit-make-pair, - google-default-arguments, - google-explicit-constructor, - google-readability-casting' + performance-inefficient-vector-operation, + performance-trivially-destructible, + performance-unnecessary-copy-initialization' WarningsAsErrors: '' HeaderFilterRegex: '' AnalyzeTemporaryDtors: false ... - diff --git a/deps/v8/.editorconfig b/deps/v8/.editorconfig index 9d08a1a828a..0a4c9a6c2f0 100644 --- a/deps/v8/.editorconfig +++ b/deps/v8/.editorconfig @@ -1,9 +1,9 @@ -root = true +# editorconfig.org [*] charset = utf-8 -indent_style = space -indent_size = 2 end_of_line = lf +indent_size = 2 +indent_style = space insert_final_newline = true trim_trailing_whitespace = true diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index e805b2aabfe..6ecb0ebecd7 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -68,6 +68,9 @@ /third_party/colorama/src !/third_party/cpu_features /third_party/cpu_features/src +!/third_party/fast_float +/third_party/fast_float/src/* +!/third_party/fast_float/src/include !/third_party/glibc !/third_party/googletest /third_party/googletest/src/* @@ -88,8 +91,8 @@ !/third_party/test262-harness !/third_party/v8 !/third_party/wasm-api -/tools/builtins-pgo/profiles/*.profile -/tools/builtins-pgo/profiles/profiles_version +/tools/builtins-pgo/profiles/* +!/tools/builtins-pgo/profiles/.* /tools/clang /tools/gcmole/bootstrap /tools/gcmole/gcmole-tools diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index e53a6577c54..9e0a6558d20 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -71,7 +71,9 @@ Anton Bershanskiy <8knots@protonmail.com> Anton Bikineev Ao Wang Archil Sharashenidze +Artem Kobzar Arthur Islamov +Asuka Shikina Aurèle Barrière Bala Avulapati Bangfu Tao @@ -143,11 +145,11 @@ Henrique Ferreiro Helmut Januschka Hirofumi Mako Hisham Muhammad -Ho Cheung Honggyu Kim Huáng Jùnliàng HyeockJin Kim Iain Ireland +Ilya Gavrilin Ingvar Stepanyan Ioseb Dzmanashvili Isiah Meadows @@ -170,6 +172,7 @@ Joel Stanley Johan Bergström Johan Levin John Paul Adrian Glaubitz +Jojo R Jonathan Liu Juan Arboleda Julien Brianceau @@ -205,7 +208,9 @@ Matt Hanselman Matthew Sporleder Maxim Mazurok Maxim Mossienko +Md Hasibul Hasan Meir Shpilraien +Meng Tan Michael Lutz Michael Mclaughlin Michael Smith @@ -264,6 +269,7 @@ Sébastien Doeraene Seo Sanghyeon Shawn Anastasio Shawn Presser +Sho Miyamoto Stefan Penner Stefan Stojanovic Stephan Hartmann @@ -307,11 +313,13 @@ Youfeng Hao Yu Yin Yujie Wang Yuri Iozzelli +Yuri Gaevsky Yusif Khudhur Yuxiang Cao Zac Hansen Zeynep Cankara Zhao Jiazhong +Zhaojun Meng Zheng Liu Zhongping Wang 柳荣一 diff --git a/deps/v8/BUILD.bazel b/deps/v8/BUILD.bazel index 0718b28b052..c5f62d1798f 100644 --- a/deps/v8/BUILD.bazel +++ b/deps/v8/BUILD.bazel @@ -43,7 +43,6 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression # v8_enable_concurrent_marking # v8_enable_conservative_stack_scanning # v8_enable_direct_handle -# v8_enable_direct_local # v8_enable_local_off_stack_check # v8_enable_ignition_dispatch_counting # v8_enable_builtins_optimization @@ -60,8 +59,6 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression # v8_enable_gdbjit # v8_check_header_includes # v8_enable_lazy_source_positions -# v8_enable_third_party_heap -# v8_third_party_heap_files # v8_disable_write_barriers # v8_enable_unconditional_write_barriers # v8_enable_single_generation @@ -208,6 +205,49 @@ v8_flag( default = True, ) +v8_flag( + name = "v8_enable_drumbrake", + default = False, +) + +v8_flag( + name = "v8_enable_drumbrake_tracing", + default = False, +) + +selects.config_setting_group( + name = "enable_drumbrake_x64", + match_all = [ + ":is_v8_enable_drumbrake", + "@v8//bazel/config:v8_target_x64", + ], +) + +selects.config_setting_group( + name = "enable_drumbrake_arm64", + match_all = [ + ":is_v8_enable_drumbrake", + "@v8//bazel/config:v8_target_arm64", + ], +) + +selects.config_setting_group( + name = "is_drumbrake_trap_handling_platform", + match_any = [ + "@v8//bazel/config:is_linux", + "@v8//bazel/config:is_macos", + "@v8//bazel/config:is_windows", + ], +) + +selects.config_setting_group( + name = "v8_drumbrake_bounds_checks", + match_all = [ + ":enable_drumbrake_x64", + ":is_drumbrake_trap_handling_platform", + ], +) + v8_flag( name = "v8_jitless", default = False, @@ -286,10 +326,10 @@ selects.config_setting_group( ], ) -# Enable isolated cage if v8_enable_pointer_compression and +# Enable multiple cages if v8_enable_pointer_compression and # NOT v8_enable_pointer_compression_shared_cage. selects.config_setting_group( - name = "enable_pointer_compression_isolated_cage", + name = "enable_pointer_compression_multiple_cages", match_all = [ ":is_v8_enable_pointer_compression", ":is_not_v8_enable_pointer_compression_shared_cage", @@ -411,6 +451,8 @@ v8_config( "v8_enable_verify_heap": "VERIFY_HEAP", "v8_enable_verify_predictable": "VERIFY_PREDICTABLE", "v8_enable_webassembly": "V8_ENABLE_WEBASSEMBLY", + "v8_enable_drumbrake": "V8_ENABLE_DRUMBRAKE", + "v8_enable_drumbrake_tracing": "V8_ENABLE_DRUMBRAKE_TRACING", "v8_jitless": "V8_JITLESS", "v8_enable_vtunejit": "ENABLE_VTUNE_JIT_INTERFACE", }, @@ -438,8 +480,7 @@ v8_config( ], "@v8//bazel/config:v8_target_arm64": ["V8_TARGET_ARCH_ARM64"], "@v8//bazel/config:v8_target_s390x": [ - "V8_TARGET_ARCH_S390", - "V8_TARGET_ARCH_S390X", + "V8_TARGET_ARCH_S390X" ], "@v8//bazel/config:v8_target_riscv64": [ # NOTE: Bazel rules for riscv64 weren't tested on a real system. @@ -448,8 +489,7 @@ v8_config( ], "@v8//bazel/config:v8_target_ppc64le": [ # NOTE: Bazel rules for ppc64le weren't tested on a real system. - "V8_TARGET_ARCH_PPC64", - "V8_TARGET_ARCH_PPC_LE", + "V8_TARGET_ARCH_PPC64" ], }, no_match_error = "Please specify a target cpu supported by v8", @@ -484,8 +524,8 @@ v8_config( ":enable_pointer_compression_shared_cage": [ "V8_COMPRESS_POINTERS_IN_SHARED_CAGE", ], - ":enable_pointer_compression_isolated_cage": [ - "V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE", + ":enable_pointer_compression_multiple_cages": [ + "V8_COMPRESS_POINTERS_IN_MULTIPLE_CAGES", ], "//conditions:default": [], }) + select({ @@ -518,7 +558,13 @@ v8_config( "V8_ENABLE_DOUBLE_CONST_STORE_CHECK", ], "//conditions:default": [], + }) + select({ + "v8_drumbrake_bounds_checks": [ + "V8_DRUMBRAKE_BOUNDS_CHECKS" + ], + "//conditions:default": [], }), + deps = [":default"], ) @@ -757,7 +803,6 @@ filegroup( "src/base/numbers/strtod.h", "src/base/once.cc", "src/base/once.h", - "src/base/optional.h", "src/base/overflowing-math.h", "src/base/page-allocator.cc", "src/base/page-allocator.h", @@ -1268,6 +1313,7 @@ filegroup( "src/builtins/builtins.cc", "src/builtins/builtins-inl.h", "src/builtins/builtins.h", + "src/builtins/builtins-abstract-module-source.cc", "src/builtins/builtins-api.cc", "src/builtins/builtins-array.cc", "src/builtins/builtins-arraybuffer.cc", @@ -1402,6 +1448,8 @@ filegroup( "src/common/ptr-compr.cc", "src/common/ptr-compr.h", "src/common/ptr-compr-inl.h", + "src/common/segmented-table.h", + "src/common/segmented-table-inl.h", "src/common/simd128.h", "src/compiler-dispatcher/lazy-compile-dispatcher.cc", "src/compiler-dispatcher/lazy-compile-dispatcher.h", @@ -1625,6 +1673,8 @@ filegroup( "src/heap/heap-controller.cc", "src/heap/heap-controller.h", "src/heap/heap-inl.h", + "src/heap/heap-layout.h", + "src/heap/heap-layout-inl.h", "src/heap/heap-layout-tracer.cc", "src/heap/heap-layout-tracer.h", "src/heap/heap-verifier.cc", @@ -1741,8 +1791,6 @@ filegroup( "src/heap/stress-scavenge-observer.h", "src/heap/sweeper.cc", "src/heap/sweeper.h", - "src/heap/third-party/heap-api.h", - "src/heap/third-party/heap-api-stub.cc", "src/heap/traced-handles-marking-visitor.cc", "src/heap/traced-handles-marking-visitor.h", "src/heap/weak-object-worklists.cc", @@ -2284,6 +2332,7 @@ filegroup( "src/runtime/runtime-test.cc", "src/runtime/runtime-trace.cc", "src/runtime/runtime-typedarray.cc", + "src/runtime/runtime-utils.cc", "src/runtime/runtime-utils.h", "src/runtime/runtime-weak-refs.cc", "src/sandbox/bounded-size.h", @@ -2505,6 +2554,8 @@ filegroup( "src/codegen/x64/assembler-x64.cc", "src/codegen/x64/assembler-x64.h", "src/codegen/x64/assembler-x64-inl.h", + "src/codegen/x64/builtin-jump-table-info-x64.cc", + "src/codegen/x64/builtin-jump-table-info-x64.h", "src/codegen/x64/constants-x64.h", "src/codegen/x64/cpu-x64.cc", "src/codegen/x64/fma-instr.h", @@ -2837,7 +2888,6 @@ filegroup( "src/wasm/leb-helper.h", "src/wasm/local-decl-encoder.cc", "src/wasm/local-decl-encoder.h", - "src/wasm/memory-tracing.cc", "src/wasm/memory-tracing.h", "src/wasm/module-compiler.cc", "src/wasm/module-compiler.h", @@ -2872,6 +2922,9 @@ filegroup( "src/wasm/wasm-builtin-list.h", "src/wasm/wasm-code-manager.cc", "src/wasm/wasm-code-manager.h", + "src/wasm/wasm-code-pointer-table.cc", + "src/wasm/wasm-code-pointer-table.h", + "src/wasm/wasm-code-pointer-table-inl.h", "src/wasm/wasm-debug.cc", "src/wasm/wasm-debug.h", "src/wasm/wasm-deopt-data.cc", @@ -2916,6 +2969,21 @@ filegroup( "src/wasm/wrappers.cc", ], "//conditions:default": [], + }) + select({ + ":is_v8_enable_drumbrake": [ + "src/wasm/interpreter/instruction-handlers.h", + "src/wasm/interpreter/wasm-interpreter.cc", + "src/wasm/interpreter/wasm-interpreter.h", + "src/wasm/interpreter/wasm-interpreter-inl.h", + "src/wasm/interpreter/wasm-interpreter-objects.cc", + "src/wasm/interpreter/wasm-interpreter-objects-inl.h", + "src/wasm/interpreter/wasm-interpreter-objects.h", + "src/wasm/interpreter/wasm-interpreter-runtime.cc", + "src/wasm/interpreter/wasm-interpreter-runtime-inl.h", + "src/wasm/interpreter/wasm-interpreter-runtime.h", + "src/wasm/interpreter/wasm-interpreter-simd.cc", + ], + "//conditions:default": [], }), ) @@ -3215,6 +3283,8 @@ filegroup( "src/compiler/turboshaft/build-graph-phase.cc", "src/compiler/turboshaft/build-graph-phase.h", "src/compiler/turboshaft/builtin-call-descriptors.h", + "src/compiler/turboshaft/builtin-compiler.cc", + "src/compiler/turboshaft/builtin-compiler.h", "src/compiler/turboshaft/csa-optimize-phase.cc", "src/compiler/turboshaft/csa-optimize-phase.h", "src/compiler/turboshaft/dataview-lowering-reducer.h", @@ -3236,6 +3306,7 @@ filegroup( "src/compiler/turboshaft/explicit-truncation-reducer.h", "src/compiler/turboshaft/fast-api-call-lowering-reducer.h", "src/compiler/turboshaft/fast-hash.h", + "src/compiler/turboshaft/field-macro.inc", "src/compiler/turboshaft/graph.cc", "src/compiler/turboshaft/graph.h", "src/compiler/turboshaft/graph-builder.cc", @@ -3307,6 +3378,7 @@ filegroup( "src/compiler/turboshaft/store-store-elimination-phase.cc", "src/compiler/turboshaft/store-store-elimination-phase.h", "src/compiler/turboshaft/store-store-elimination-reducer-inl.h", + "src/compiler/turboshaft/string-view.h", "src/compiler/turboshaft/structural-optimization-reducer.h", "src/compiler/turboshaft/tracing.h", "src/compiler/turboshaft/type-assertions-phase.cc", @@ -3416,6 +3488,9 @@ filegroup( "src/compiler/turboshaft/wasm-gc-typed-optimization-reducer.cc", "src/compiler/turboshaft/wasm-gc-typed-optimization-reducer.h", "src/compiler/turboshaft/wasm-load-elimination-reducer.h", + "src/compiler/turboshaft/wasm-in-js-inlining-phase.cc", + "src/compiler/turboshaft/wasm-in-js-inlining-phase.h", + "src/compiler/turboshaft/wasm-in-js-inlining-reducer-inl.h", "src/compiler/turboshaft/wasm-lowering-phase.cc", "src/compiler/turboshaft/wasm-lowering-phase.h", "src/compiler/turboshaft/wasm-lowering-reducer.h", @@ -3520,6 +3595,7 @@ filegroup( "src/builtins/builtins-lazy-gen.h", "src/builtins/builtins-microtask-queue-gen.cc", "src/builtins/builtins-number-gen.cc", + "src/builtins/builtins-number-tsa.cc", "src/builtins/builtins-object-gen.cc", "src/builtins/builtins-object-gen.h", "src/builtins/builtins-promise-gen.cc", @@ -3539,6 +3615,7 @@ filegroup( "src/builtins/builtins-utils-gen.h", "src/builtins/growable-fixed-array-gen.cc", "src/builtins/growable-fixed-array-gen.h", + "src/builtins/number-builtins-reducer-inl.h", "src/builtins/profile-data-reader.cc", "src/builtins/profile-data-reader.h", "src/builtins/setup-builtins-internal.cc", @@ -3548,6 +3625,8 @@ filegroup( "third_party/v8/codegen/fp16-inl.h", "src/codegen/code-stub-assembler-inl.h", "src/codegen/code-stub-assembler.h", + "src/codegen/define-code-stub-assembler-macros.inc", + "src/codegen/undef-code-stub-assembler-macros.inc", "src/heap/setup-heap-internal.cc", "src/ic/accessor-assembler.cc", "src/ic/accessor-assembler.h", @@ -3561,6 +3640,8 @@ filegroup( "src/interpreter/interpreter-assembler.h", "src/interpreter/interpreter-generator.cc", "src/interpreter/interpreter-generator.h", + "src/interpreter/interpreter-generator-tsa.cc", + "src/interpreter/interpreter-generator-tsa.h", "src/interpreter/interpreter-intrinsics-generator.cc", "src/interpreter/interpreter-intrinsics-generator.h", "src/numbers/integer-literal.h", @@ -3579,6 +3660,14 @@ filegroup( "src/builtins/builtins-wasm-gen.h", ], "//conditions:default": [], + }) + select({ + ":enable_drumbrake_x64": [ + "src/wasm/interpreter/x64/interpreter-builtins-x64.cc" + ], + ":enable_drumbrake_arm64": [ + "src/wasm/interpreter/arm64/interpreter-builtins-arm64.cc" + ], + "//conditions:default": [], }), ) @@ -3720,6 +3809,25 @@ filegroup( }), ) +v8_library( + name = "lib_fast_float", + srcs = [ + "third_party/fast_float/src/include/fast_float/ascii_number.h", + "third_party/fast_float/src/include/fast_float/bigint.h", + "third_party/fast_float/src/include/fast_float/constexpr_feature_detect.h", + "third_party/fast_float/src/include/fast_float/decimal_to_binary.h", + "third_party/fast_float/src/include/fast_float/digit_comparison.h", + "third_party/fast_float/src/include/fast_float/fast_float.h", + "third_party/fast_float/src/include/fast_float/fast_table.h", + "third_party/fast_float/src/include/fast_float/float_common.h", + "third_party/fast_float/src/include/fast_float/parse_number.h", + ], + hdrs = [ "third_party/fast_float/src/include/fast_float/fast_float.h" ], + includes = [ + "third_party/fast_float/src/include", + ], +) + v8_library( name = "lib_fp16", srcs = ["third_party/fp16/src/include/fp16.h"], @@ -4223,6 +4331,7 @@ v8_library( ":noicu/generated_torque_definitions", ], deps = [ + ":lib_fast_float", ":lib_fp16", ":v8_libbase", "//external:absl_btree", diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 92e85419513..a4d05c835ab 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -11,6 +11,7 @@ import("//build/config/mips.gni") import("//build/config/riscv.gni") import("//build/config/sanitizers/sanitizers.gni") import("//build_overrides/build.gni") +import("//third_party/icu/config.gni") import("gni/snapshot_toolchain.gni") import("gni/v8.gni") @@ -141,11 +142,6 @@ declare_args() { # Enable code-generation-time checking of types in the CodeStubAssembler. v8_enable_verify_csa = false - # Enable pointer compression (sets -dV8_COMPRESS_POINTERS). - v8_enable_pointer_compression = "" - v8_enable_pointer_compression_shared_cage = "" - v8_enable_31bit_smis_on_64bit_arch = false - # Sets -dOBJECT_PRINT. v8_enable_object_print = "" @@ -270,15 +266,6 @@ declare_args() { # Enable lazy source positions by default. v8_enable_lazy_source_positions = true - # Enable third party HEAP library - v8_enable_third_party_heap = false - - # Libaries used by third party heap - v8_third_party_heap_libs = [] - - # Source code used by third party heap - v8_third_party_heap_files = [] - # Disable write barriers when GCs are non-incremental and # heap has single generation. v8_disable_write_barriers = false @@ -339,6 +326,9 @@ declare_args() { # Sets -DV8_ENABLE_SANDBOX. v8_enable_sandbox = "" + # Explicitly disable leaptiering (on builds where it would otherwise be enabled). + v8_disable_leaptiering = "" + # Enable the memory corruption API. Useful for testing the sandbox. # The memory corruption API is only exposed to JavaScript if sandbox testing # mode is enabled at runtime, for example via --sandbox-fuzzing. @@ -391,6 +381,19 @@ declare_args() { # This is only used by nodejs. v8_scriptormodule_legacy_lifetime = false + # WebAssembly interpreter (DrumBrake) build flag. + v8_enable_drumbrake = false + + # Enable Wasm interpreter tracing. + v8_enable_drumbrake_tracing = false + + # On non-Desktop platforms, enable explicit bounds checks in the Wasm + # interpreter, where the bounds checking is done in the instruction handler, + # not using an unhandled exception filter (which also doesn't work with Win-ASAN). + v8_drumbrake_bounds_checks = + (is_win && (is_asan || is_ubsan || is_msan || is_tsan)) || + !(is_win || is_linux || is_mac) || v8_current_cpu != "x64" + # Enables pointer compression for 8GB heaps. # Sets -DV8_COMPRESS_POINTERS_8GB. v8_enable_pointer_compression_8gb = "" @@ -429,6 +432,9 @@ declare_args() { # ReadOnlySpace. v8_enable_extensible_ro_snapshot = true + # Enable Turboshaft CSA pipeline. + v8_enable_turboshaft_csa = false + # Use sticky mark-bits for separating object generations. v8_enable_sticky_mark_bits = false @@ -436,6 +442,12 @@ declare_args() { v8_enable_experimental_tsa_builtins = false v8_dcheck_always_on = dcheck_always_on + + # Remote builds require an explicit dependency on icudat, but + # this breaks locally building V8 with ICU support when the file + # isn't present, which some embedders rely on. This option controls + # the explicit dependency and allows the build to complete. + v8_depend_on_icu_data_file = icu_use_data_file } # Derived defaults. @@ -477,9 +489,11 @@ if (v8_enable_debug_code == "") { if (v8_enable_snapshot_native_code_counters == "") { v8_enable_snapshot_native_code_counters = v8_enable_debugging_features } -if (v8_enable_pointer_compression == "") { - v8_enable_pointer_compression = - v8_current_cpu == "arm64" || v8_current_cpu == "x64" + +if (v8_enable_drumbrake && v8_enable_webassembly) { + assert( + is_drumbrake_supported, + "DrumBrake is only available on x64, arm64 on Windows, Linux and MacOS.") } # Toggle pointer compression for correctness fuzzing when building the @@ -539,14 +553,6 @@ if (v8_enable_single_generation == "") { if (v8_enable_atomic_object_field_writes == "") { v8_enable_atomic_object_field_writes = v8_enable_concurrent_marking } -if (v8_enable_third_party_heap) { - v8_disable_write_barriers = true - v8_enable_single_generation = true - v8_enable_shared_ro_heap = false - v8_enable_pointer_compression = false - v8_enable_pointer_compression_shared_cage = false - v8_enable_allocation_folding = false -} if (v8_enable_single_generation) { v8_allocation_site_tracking = false } @@ -573,8 +579,7 @@ if (v8_enable_short_builtin_calls && v8_enable_short_builtin_calls = false } if (v8_enable_shared_ro_heap == "") { - v8_enable_shared_ro_heap = !v8_enable_pointer_compression || - v8_enable_pointer_compression_shared_cage + v8_enable_shared_ro_heap = true } if (v8_enable_sandbox == "") { @@ -586,6 +591,10 @@ if (v8_enable_sandbox == "") { v8_enable_external_code_space && target_os != "fuchsia" } +if (v8_disable_leaptiering == "") { + v8_disable_leaptiering = false +} + if (v8_enable_static_roots == "") { # Static roots are only valid for builds with pointer compression and a # shared read-only heap. @@ -664,13 +673,6 @@ assert(!v8_disable_write_barriers || v8_enable_single_generation, assert(v8_current_cpu == "arm64" || !v8_control_flow_integrity, "Control-flow integrity is only supported on arm64") -if (v8_enable_shared_ro_heap && v8_enable_pointer_compression && - !v8_enable_pointer_compression_shared_cage) { - assert( - is_linux || is_chromeos || is_android, - "Sharing read-only heap with pointer compression is only supported on Linux or Android") -} - assert(!v8_enable_map_packing || !v8_enable_pointer_compression, "Map packing does not support pointer compression") @@ -689,9 +691,6 @@ assert(!v8_enable_sandbox || v8_enable_pointer_compression_shared_cage, assert(!v8_enable_sandbox || v8_enable_external_code_space, "The sandbox requires the external code space") -assert(!v8_enable_sandbox || !v8_enable_third_party_heap, - "The sandbox is incompatible with the third-party heap") - assert(!v8_enable_memory_corruption_api || v8_enable_sandbox, "The Memory Corruption API requires the sandbox") @@ -729,6 +728,10 @@ if (v8_enable_single_generation == true) { assert(!v8_enable_snapshot_compression || v8_use_zlib, "Snapshot compression requires zlib") +assert(!v8_enable_cet_shadow_stack || + (v8_target_cpu == "x64" && target_os == "win"), + "CET shadow stack is supported only on x64 Windows") + if (v8_expose_public_symbols == "") { v8_expose_public_symbols = v8_expose_symbols } @@ -886,7 +889,7 @@ external_v8_defines = [ "V8_MAP_PACKING", "V8_IS_TSAN", "V8_ENABLE_CONSERVATIVE_STACK_SCANNING", - "V8_ENABLE_DIRECT_LOCAL", + "V8_ENABLE_DIRECT_HANDLE", "V8_MINORMS_STRING_SHORTCUTTING", "V8_HAVE_TARGET_OS", "V8_TARGET_OS_ANDROID", @@ -940,8 +943,8 @@ if (is_tsan) { if (v8_enable_conservative_stack_scanning) { enabled_external_v8_defines += [ "V8_ENABLE_CONSERVATIVE_STACK_SCANNING" ] } -if (v8_enable_direct_local) { - enabled_external_v8_defines += [ "V8_ENABLE_DIRECT_LOCAL" ] +if (v8_enable_direct_handle) { + enabled_external_v8_defines += [ "V8_ENABLE_DIRECT_HANDLE" ] } if (v8_shortcut_strings_in_minor_ms) { enabled_external_v8_defines += [ "V8_MINORMS_STRING_SHORTCUTTING" ] @@ -1153,9 +1156,6 @@ config("features") { if (v8_disable_write_barriers) { defines += [ "V8_DISABLE_WRITE_BARRIERS" ] } - if (v8_enable_third_party_heap) { - defines += [ "V8_ENABLE_THIRD_PARTY_HEAP" ] - } if (v8_use_external_startup_data) { defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ] } @@ -1192,6 +1192,9 @@ config("features") { if (v8_enable_cet_ibt) { defines += [ "V8_ENABLE_CET_IBT" ] } + if (v8_enable_memory_sealing) { + defines += [ "V8_ENABLE_MEMORY_SEALING" ] + } if (v8_enable_wasm_gdb_remote_debugging) { defines += [ "V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING" ] } @@ -1258,6 +1261,15 @@ config("features") { if (v8_advanced_bigint_algorithms) { defines += [ "V8_ADVANCED_BIGINT_ALGORITHMS" ] } + if (v8_enable_drumbrake) { + defines += [ "V8_ENABLE_DRUMBRAKE" ] + if (v8_enable_drumbrake_tracing) { + defines += [ "V8_ENABLE_DRUMBRAKE_TRACING" ] + } + if (v8_drumbrake_bounds_checks) { + defines += [ "V8_DRUMBRAKE_BOUNDS_CHECKS" ] + } + } if (v8_enable_memory_corruption_api) { defines += [ "V8_ENABLE_MEMORY_CORRUPTION_API" ] } @@ -1291,9 +1303,6 @@ config("features") { if (v8_enable_builtin_jump_table_switch) { defines += [ "V8_ENABLE_BUILTIN_JUMP_TABLE_SWITCH" ] } - if (v8_enable_direct_handle) { - defines += [ "V8_ENABLE_DIRECT_HANDLE" ] - } if (v8_enable_extensible_ro_snapshot) { defines += [ "V8_ENABLE_EXTENSIBLE_RO_SNAPSHOT" ] } @@ -1306,6 +1315,9 @@ config("features") { if (v8_enable_experimental_tsa_builtins) { defines += [ "V8_ENABLE_EXPERIMENTAL_TSA_BUILTINS" ] } + if (v8_disable_leaptiering) { + defines += [ "V8_DISABLE_LEAPTIERING" ] + } } config("toolchain") { @@ -1396,39 +1408,27 @@ config("toolchain") { defines += [ "V8_TARGET_ARCH_LOONG64" ] } - if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { - defines += [ "V8_TARGET_ARCH_S390" ] + if (v8_current_cpu == "s390x") { cflags += [ "-ffp-contract=off" ] - if (v8_current_cpu == "s390x") { - defines += [ "V8_TARGET_ARCH_S390X" ] - } + defines += [ "V8_TARGET_ARCH_S390X" ] if (host_byteorder == "little") { - defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ] + defines += [ "V8_TARGET_ARCH_S390X_LE_SIM" ] } else if (current_os != "zos") { cflags += [ "-march=z196" ] } } - if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") { - if (v8_current_cpu == "ppc") { - defines += [ "V8_TARGET_ARCH_PPC" ] - } else if (v8_current_cpu == "ppc64") { - defines += [ "V8_TARGET_ARCH_PPC64" ] - cflags += [ "-ffp-contract=off" ] - } - if (host_byteorder == "little") { - defines += [ "V8_TARGET_ARCH_PPC_LE" ] - } else if (host_byteorder == "big") { - defines += [ "V8_TARGET_ARCH_PPC_BE" ] - if (current_os == "aix") { - cflags += [ - # Work around AIX ceil, trunc and round oddities. - "-mcpu=power5+", - "-mfprnd", - - # Work around AIX assembler popcntb bug. - "-mno-popcntb", - ] - } + if (v8_current_cpu == "ppc64") { + defines += [ "V8_TARGET_ARCH_PPC64" ] + cflags += [ "-ffp-contract=off" ] + if (current_os == "aix") { + cflags += [ + # Work around AIX ceil, trunc and round oddities. + "-mcpu=power5+", + "-mfprnd", + + # Work around AIX assembler popcntb bug. + "-mno-popcntb", + ] } } @@ -1445,6 +1445,9 @@ config("toolchain") { if (!is_clang) { cflags += [ "-ffp-contract=off" ] } + if (riscv_use_sv39) { + defines += [ "RISCV_USE_SV39" ] + } } if (v8_current_cpu == "riscv32") { @@ -2415,11 +2418,25 @@ template("run_mksnapshot") { } action("run_mksnapshot_" + name) { deps = [ ":mksnapshot($v8_snapshot_toolchain)" ] + if (v8_verify_deterministic_mksnapshot) { + # We archive the snapshot executable when verifying snapshot + # determinism to ease debugging. + data_deps = [ ":mksnapshot($v8_snapshot_toolchain)" ] + } script = "tools/run.py" sources = [] + if (v8_depend_on_icu_data_file) { + deps += [ "//third_party/icu:copy_icudata" ] + if (host_byteorder == "big") { + sources += [ "$root_out_dir/icudtb.dat" ] + } else { + sources += [ "$root_out_dir/icudtl.dat" ] + } + } + outputs = [] data = [] @@ -2430,7 +2447,20 @@ template("run_mksnapshot") { ext = "s" } - args = [ + args = [] + + if (v8_verify_deterministic_mksnapshot) { + # Output redirection must be the first argument to run.py. We capture + # output when verifying snapshot determinism for debugging. + args += [ + "--redirect-stdout", + rebase_path("$root_out_dir/mksnapshot_output${suffix}.log", + root_build_dir), + ] + data += [ "$root_out_dir/mksnapshot_output${suffix}.log" ] + } + + args += [ "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)", "root_out_dir") + "/mksnapshot", root_build_dir), @@ -2446,8 +2476,25 @@ template("run_mksnapshot") { "--embedded_src", rebase_path("$target_gen_dir/embedded${suffix}.${ext}", root_build_dir), + + # mksnapshot runs in predictable mode to create deterministic snapshots. + # Note this flag is also set implicitly by mksnapshot itself (see + # mksnapshot.cc). We set it here as well for clarity. + "--predictable", + + # Disable ICs globally in mksnapshot to avoid problems with Code handlers. + # See https://crbug.com/345280736. + # TODO(jgruber): Re-enable once a better fix is available. + # Note this flag is also set implicitly by mksnapshot itself (see + # mksnapshot.cc). We set it here as well for clarity. + "--no-use-ic", ] + if (v8_verify_deterministic_mksnapshot) { + # Flags that help debugging snapshot determinism. + args += [ "--trace-read-only-promotion" ] + } + if (v8_log_builtins_block_count_input != "") { args += [ "--trace-turbo", @@ -2479,6 +2526,10 @@ template("run_mksnapshot") { } } + if (v8_enable_turboshaft_csa) { + args += [ "--turboshaft-csa" ] + } + # This is needed to distinguish between generating code for the simulator # and cross-compiling. The latter may need to run code on the host with the # simulator but cannot use simulator-specific instructions. @@ -2589,11 +2640,15 @@ if (v8_verify_deterministic_mksnapshot) { } } - action("verify_deterministic_mksnapshot") { - deps = [] + group("snapshot_set") { + data_deps = [] foreach(i, runs) { - deps += [ ":run_mksnapshot_$i" ] + data_deps += [ ":run_mksnapshot_$i" ] } + } + + action("verify_deterministic_mksnapshot") { + deps = [ ":snapshot_set" ] report_file = "$target_gen_dir/mksnapshot_comparison.txt" script = "tools/snapshot/compare_mksnapshot_output.py" args = [ @@ -2682,17 +2737,18 @@ action("v8_dump_build_config") { mips_use_msa_var = mips_use_msa } - js_shared_memory = - v8_enable_shared_ro_heap && (!v8_enable_pointer_compression || - v8_enable_pointer_compression_shared_cage) && - !v8_disable_write_barriers + js_shared_memory = v8_enable_shared_ro_heap && !v8_disable_write_barriers simd_mips = mips_arch_variant_var == "r6" && mips_use_msa simulator_run = target_cpu != v8_target_cpu use_sanitizer = is_asan || is_cfi || is_msan || is_tsan || is_ubsan + use_leaptiering = v8_enable_sandbox && !v8_disable_leaptiering + # This lists all build-time switches consumed by the test framework. All # switches can be used automatically in the status files as is - no # further files need to be modified. + # However, the switch also has to be entered in `build_config_content` in + # `bazel/defs.bzl` so that the switch also works for tests triggered by bazel. # # Naming conventions: Keep switch names short and remove unnecessary # qualifiers. Drop v8_enable_, v8_, is_ where possible. @@ -2720,7 +2776,6 @@ action("v8_dump_build_config") { "debugging_features=$v8_enable_debugging_features", "dict_property_const_tracking=$v8_dict_property_const_tracking", "direct_handle=$v8_enable_direct_handle", - "direct_local=$v8_enable_direct_local", "disassembler=$v8_enable_disassembler", "full_debug=$is_full_debug", "gdbjit=$v8_enable_gdbjit", @@ -2728,6 +2783,7 @@ action("v8_dump_build_config") { "has_maglev=$v8_enable_maglev", "has_turbofan=$v8_enable_turbofan", "has_webassembly=$v8_enable_webassembly", + "has_wasm_interpreter=$v8_enable_drumbrake", "i18n=$v8_enable_i18n_support", "is_android=$is_android", "is_ios=$is_ios", @@ -2748,7 +2804,6 @@ action("v8_dump_build_config") { "single_generation=$v8_enable_single_generation", "slow_dchecks=$v8_enable_slow_dchecks", "target_cpu=\"$target_cpu\"", - "third_party_heap=$v8_enable_third_party_heap", "tsan=$is_tsan", "ubsan=$is_ubsan", "use_sanitizer=$use_sanitizer", @@ -2759,6 +2814,10 @@ action("v8_dump_build_config") { "verify_heap=$v8_enable_verify_heap", "verify_predictable=$v8_enable_verify_predictable", "memory_corruption_api=$v8_enable_memory_corruption_api", + "leaptiering=$use_leaptiering", + + # Please add new switches also in `build_config_content` in `bazel/defs.bzl` + # so that the switches also work for tests triggered by bazel. ] } @@ -2777,7 +2836,6 @@ generated_file("v8_generate_features_json") { v8_enable_conservative_stack_scanning = v8_enable_conservative_stack_scanning v8_enable_direct_handle = v8_enable_direct_handle - v8_enable_direct_local = v8_enable_direct_local v8_enable_extensible_ro_snapshot = v8_enable_extensible_ro_snapshot v8_enable_gdbjit = v8_enable_gdbjit v8_enable_hugepage = v8_enable_hugepage @@ -2907,6 +2965,7 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-lazy-gen.h", "src/builtins/builtins-microtask-queue-gen.cc", "src/builtins/builtins-number-gen.cc", + "src/builtins/builtins-number-tsa.cc", "src/builtins/builtins-object-gen.cc", "src/builtins/builtins-object-gen.h", "src/builtins/builtins-promise-gen.cc", @@ -2926,6 +2985,7 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-utils-gen.h", "src/builtins/growable-fixed-array-gen.cc", "src/builtins/growable-fixed-array-gen.h", + "src/builtins/number-builtins-reducer-inl.h", "src/builtins/profile-data-reader.cc", "src/builtins/profile-data-reader.h", "src/builtins/setup-builtins-internal.cc", @@ -2933,8 +2993,12 @@ v8_source_set("v8_initializers") { "src/codegen/code-stub-assembler-inl.h", "src/codegen/code-stub-assembler.cc", "src/codegen/code-stub-assembler.h", + "src/codegen/define-code-stub-assembler-macros.inc", "src/codegen/heap-object-list.h", "src/codegen/turboshaft-builtins-assembler-inl.h", + "src/codegen/undef-code-stub-assembler-macros.inc", + "src/compiler/turboshaft/builtin-compiler.cc", + "src/compiler/turboshaft/builtin-compiler.h", "src/heap/setup-heap-internal.cc", "src/ic/accessor-assembler.cc", "src/ic/accessor-assembler.h", @@ -2946,6 +3010,8 @@ v8_source_set("v8_initializers") { "src/ic/unary-op-assembler.h", "src/interpreter/interpreter-assembler.cc", "src/interpreter/interpreter-assembler.h", + "src/interpreter/interpreter-generator-tsa.cc", + "src/interpreter/interpreter-generator-tsa.h", "src/interpreter/interpreter-generator.cc", "src/interpreter/interpreter-generator.h", "src/interpreter/interpreter-intrinsics-generator.cc", @@ -2960,6 +3026,15 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-wasm-gen.cc", "src/builtins/builtins-wasm-gen.h", ] + + if (v8_enable_drumbrake) { + if (v8_current_cpu == "x64") { + sources += [ "src/wasm/interpreter/x64/interpreter-builtins-x64.cc" ] + } else if (v8_current_cpu == "arm64") { + sources += + [ "src/wasm/interpreter/arm64/interpreter-builtins-arm64.cc" ] + } + } } if (v8_current_cpu == "x86") { @@ -2992,17 +3067,12 @@ v8_source_set("v8_initializers") { ### gcmole(loong64) ### "src/builtins/loong64/builtins-loong64.cc", ] - } else if (v8_current_cpu == "ppc") { - sources += [ - ### gcmole(ppc) ### - "src/builtins/ppc/builtins-ppc.cc", - ] } else if (v8_current_cpu == "ppc64") { sources += [ ### gcmole(ppc64) ### "src/builtins/ppc/builtins-ppc.cc", ] - } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { + } else if (v8_current_cpu == "s390x") { sources += [ ### gcmole(s390) ### "src/builtins/s390/builtins-s390.cc", @@ -3324,6 +3394,8 @@ v8_header_set("v8_internal_headers") { "src/common/operation.h", "src/common/ptr-compr-inl.h", "src/common/ptr-compr.h", + "src/common/segmented-table-inl.h", + "src/common/segmented-table.h", "src/common/simd128.h", "src/compiler-dispatcher/lazy-compile-dispatcher.h", "src/compiler-dispatcher/optimizing-compile-dispatcher.h", @@ -3475,6 +3547,7 @@ v8_header_set("v8_internal_headers") { "src/compiler/turboshaft/explicit-truncation-reducer.h", "src/compiler/turboshaft/fast-api-call-lowering-reducer.h", "src/compiler/turboshaft/fast-hash.h", + "src/compiler/turboshaft/field-macro.inc", "src/compiler/turboshaft/graph-builder.h", "src/compiler/turboshaft/graph-visualizer.h", "src/compiler/turboshaft/graph.h", @@ -3521,6 +3594,7 @@ v8_header_set("v8_internal_headers") { "src/compiler/turboshaft/stack-check-lowering-reducer.h", "src/compiler/turboshaft/store-store-elimination-phase.h", "src/compiler/turboshaft/store-store-elimination-reducer-inl.h", + "src/compiler/turboshaft/string-view.h", "src/compiler/turboshaft/structural-optimization-reducer.h", "src/compiler/turboshaft/tracing.h", "src/compiler/turboshaft/type-assertions-phase.h", @@ -3670,7 +3744,9 @@ v8_header_set("v8_internal_headers") { "src/heap/heap-allocator.h", "src/heap/heap-controller.h", "src/heap/heap-inl.h", + "src/heap/heap-layout-inl.h", "src/heap/heap-layout-tracer.h", + "src/heap/heap-layout.h", "src/heap/heap-write-barrier-inl.h", "src/heap/heap-write-barrier.h", "src/heap/heap.h", @@ -4297,6 +4373,8 @@ v8_header_set("v8_internal_headers") { "src/compiler/turboshaft/wasm-assembler-helpers.h", "src/compiler/turboshaft/wasm-gc-optimize-phase.h", "src/compiler/turboshaft/wasm-gc-typed-optimization-reducer.h", + "src/compiler/turboshaft/wasm-in-js-inlining-phase.h", + "src/compiler/turboshaft/wasm-in-js-inlining-reducer-inl.h", "src/compiler/turboshaft/wasm-js-lowering-reducer.h", "src/compiler/turboshaft/wasm-load-elimination-reducer.h", "src/compiler/turboshaft/wasm-lowering-phase.h", @@ -4369,6 +4447,8 @@ v8_header_set("v8_internal_headers") { "src/wasm/wasm-arguments.h", "src/wasm/wasm-builtin-list.h", "src/wasm/wasm-code-manager.h", + "src/wasm/wasm-code-pointer-table-inl.h", + "src/wasm/wasm-code-pointer-table.h", "src/wasm/wasm-debug.h", "src/wasm/wasm-deopt-data.h", "src/wasm/wasm-disassembler-impl.h", @@ -4395,6 +4475,18 @@ v8_header_set("v8_internal_headers") { "src/wasm/wasm-value.h", "src/wasm/well-known-imports.h", ] + + if (v8_enable_drumbrake) { + sources += [ + "src/wasm/interpreter/instruction-handlers.h", + "src/wasm/interpreter/wasm-interpreter-inl.h", + "src/wasm/interpreter/wasm-interpreter-objects-inl.h", + "src/wasm/interpreter/wasm-interpreter-objects.h", + "src/wasm/interpreter/wasm-interpreter-runtime-inl.h", + "src/wasm/interpreter/wasm-interpreter-runtime.h", + "src/wasm/interpreter/wasm-interpreter.h", + ] + } } if (v8_enable_wasm_simd256_revec) { @@ -4406,12 +4498,6 @@ v8_header_set("v8_internal_headers") { ] } - if (!v8_enable_third_party_heap) { - sources += filter_include(v8_third_party_heap_files, [ "*.h" ]) - } else { - sources += [ "src/heap/third-party/heap-api.h" ] - } - if (v8_enable_i18n_support) { sources += [ "src/objects/intl-objects.h", @@ -4498,6 +4584,7 @@ v8_header_set("v8_internal_headers") { "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.h", "src/codegen/x64/assembler-x64-inl.h", "src/codegen/x64/assembler-x64.h", + "src/codegen/x64/builtin-jump-table-info-x64.h", "src/codegen/x64/constants-x64.h", "src/codegen/x64/fma-instr.h", "src/codegen/x64/interface-descriptors-x64-inl.h", @@ -4659,23 +4746,6 @@ v8_header_set("v8_internal_headers") { sources += [ "src/trap-handler/trap-handler-simulator.h" ] } } - } else if (v8_current_cpu == "ppc") { - sources += [ - ### gcmole(ppc) ### - "src/codegen/ppc/assembler-ppc-inl.h", - "src/codegen/ppc/assembler-ppc.h", - "src/codegen/ppc/constants-ppc.h", - "src/codegen/ppc/interface-descriptors-ppc-inl.h", - "src/codegen/ppc/macro-assembler-ppc.h", - "src/codegen/ppc/register-ppc.h", - "src/codegen/ppc/reglist-ppc.h", - "src/compiler/backend/ppc/instruction-codes-ppc.h", - "src/compiler/backend/ppc/unwinding-info-writer-ppc.h", - "src/execution/ppc/frame-constants-ppc.h", - "src/execution/ppc/simulator-ppc.h", - "src/regexp/ppc/regexp-macro-assembler-ppc.h", - "src/wasm/baseline/ppc/liftoff-assembler-ppc-inl.h", - ] } else if (v8_current_cpu == "ppc64") { sources += [ ### gcmole(ppc64) ### @@ -4699,7 +4769,7 @@ v8_header_set("v8_internal_headers") { "src/baseline/ppc/baseline-compiler-ppc-inl.h", ] } - } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { + } else if (v8_current_cpu == "s390x") { sources += [ ### gcmole(s390) ### "src/codegen/s390/assembler-s390-inl.h", @@ -4739,6 +4809,7 @@ v8_header_set("v8_internal_headers") { "src/codegen/riscv/constant-riscv-f.h", "src/codegen/riscv/constant-riscv-m.h", "src/codegen/riscv/constant-riscv-v.h", + "src/codegen/riscv/constant-riscv-zicond.h", "src/codegen/riscv/constant-riscv-zicsr.h", "src/codegen/riscv/constant-riscv-zifencei.h", "src/codegen/riscv/constants-riscv.h", @@ -4750,6 +4821,7 @@ v8_header_set("v8_internal_headers") { "src/codegen/riscv/extension-riscv-inl.h", "src/codegen/riscv/extension-riscv-m.h", "src/codegen/riscv/extension-riscv-v.h", + "src/codegen/riscv/extension-riscv-zicond.h", "src/codegen/riscv/extension-riscv-zicsr.h", "src/codegen/riscv/extension-riscv-zifencei.h", "src/codegen/riscv/interface-descriptors-riscv-inl.h", @@ -5011,14 +5083,6 @@ if (v8_current_cpu == "x86") { "src/compiler/backend/loong64/instruction-scheduler-loong64.cc", "src/compiler/backend/loong64/instruction-selector-loong64.cc", ] -} else if (v8_current_cpu == "ppc") { - v8_compiler_sources += [ - ### gcmole(ppc) ### - "src/compiler/backend/ppc/code-generator-ppc.cc", - "src/compiler/backend/ppc/instruction-scheduler-ppc.cc", - "src/compiler/backend/ppc/instruction-selector-ppc.cc", - "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc", - ] } else if (v8_current_cpu == "ppc64") { v8_compiler_sources += [ ### gcmole(ppc64) ### @@ -5027,7 +5091,7 @@ if (v8_current_cpu == "x86") { "src/compiler/backend/ppc/instruction-selector-ppc.cc", "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc", ] -} else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { +} else if (v8_current_cpu == "s390x") { v8_compiler_sources += [ ### gcmole(s390) ### "src/compiler/backend/s390/code-generator-s390.cc", @@ -5057,6 +5121,7 @@ if (v8_enable_webassembly) { "src/compiler/turboshaft/int64-lowering-phase.cc", "src/compiler/turboshaft/wasm-gc-optimize-phase.cc", "src/compiler/turboshaft/wasm-gc-typed-optimization-reducer.cc", + "src/compiler/turboshaft/wasm-in-js-inlining-phase.cc", "src/compiler/turboshaft/wasm-lowering-phase.cc", "src/compiler/turboshaft/wasm-optimize-phase.cc", "src/compiler/turboshaft/wasm-turboshaft-compiler.cc", @@ -5284,6 +5349,7 @@ v8_source_set("v8_base_without_compiler") { "src/baseline/baseline.cc", "src/baseline/bytecode-offset-iterator.cc", "src/builtins/accessors.cc", + "src/builtins/builtins-abstract-module-source.cc", "src/builtins/builtins-api.cc", "src/builtins/builtins-array.cc", "src/builtins/builtins-arraybuffer.cc", @@ -5675,6 +5741,7 @@ v8_source_set("v8_base_without_compiler") { "src/runtime/runtime-test.cc", "src/runtime/runtime-trace.cc", "src/runtime/runtime-typedarray.cc", + "src/runtime/runtime-utils.cc", "src/runtime/runtime-weak-refs.cc", "src/runtime/runtime.cc", "src/sandbox/code-pointer-table.cc", @@ -5823,7 +5890,6 @@ v8_source_set("v8_base_without_compiler") { "src/wasm/graph-builder-interface.cc", "src/wasm/jump-table-assembler.cc", "src/wasm/local-decl-encoder.cc", - "src/wasm/memory-tracing.cc", "src/wasm/module-compiler.cc", "src/wasm/module-decoder.cc", "src/wasm/module-instantiate.cc", @@ -5836,6 +5902,7 @@ v8_source_set("v8_base_without_compiler") { "src/wasm/turboshaft-graph-interface.cc", "src/wasm/value-type.cc", "src/wasm/wasm-code-manager.cc", + "src/wasm/wasm-code-pointer-table.cc", "src/wasm/wasm-debug.cc", "src/wasm/wasm-deopt-data.cc", "src/wasm/wasm-disassembler.cc", @@ -5861,12 +5928,15 @@ v8_source_set("v8_base_without_compiler") { "src/wasm/fuzzing/random-module-generation.cc", ] } - } - if (v8_enable_third_party_heap) { - sources += filter_exclude(v8_third_party_heap_files, [ "*.h" ]) - } else { - sources += [ "src/heap/third-party/heap-api-stub.cc" ] + if (v8_enable_drumbrake) { + sources += [ + "src/wasm/interpreter/wasm-interpreter-objects.cc", + "src/wasm/interpreter/wasm-interpreter-runtime.cc", + "src/wasm/interpreter/wasm-interpreter-simd.cc", + "src/wasm/interpreter/wasm-interpreter.cc", + ] + } } if (v8_enable_conservative_stack_scanning) { @@ -5908,6 +5978,7 @@ v8_source_set("v8_base_without_compiler") { ### gcmole(x64) ### "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.cc", "src/codegen/x64/assembler-x64.cc", + "src/codegen/x64/builtin-jump-table-info-x64.cc", "src/codegen/x64/cpu-x64.cc", "src/codegen/x64/macro-assembler-x64.cc", "src/deoptimizer/x64/deoptimizer-x64.cc", @@ -6041,21 +6112,6 @@ v8_source_set("v8_base_without_compiler") { sources += [ "src/trap-handler/handler-outside-simulator.cc" ] } } - } else if (v8_current_cpu == "ppc") { - sources += [ - ### gcmole(ppc) ### - "src/codegen/ppc/assembler-ppc.cc", - "src/codegen/ppc/constants-ppc.cc", - "src/codegen/ppc/cpu-ppc.cc", - "src/codegen/ppc/macro-assembler-ppc.cc", - "src/deoptimizer/ppc/deoptimizer-ppc.cc", - "src/diagnostics/ppc/disasm-ppc.cc", - "src/diagnostics/ppc/eh-frame-ppc.cc", - "src/diagnostics/ppc/unwinder-ppc.cc", - "src/execution/ppc/frame-constants-ppc.cc", - "src/execution/ppc/simulator-ppc.cc", - "src/regexp/ppc/regexp-macro-assembler-ppc.cc", - ] } else if (v8_current_cpu == "ppc64") { sources += [ ### gcmole(ppc64) ### @@ -6071,7 +6127,7 @@ v8_source_set("v8_base_without_compiler") { "src/execution/ppc/simulator-ppc.cc", "src/regexp/ppc/regexp-macro-assembler-ppc.cc", ] - } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { + } else if (v8_current_cpu == "s390x") { sources += [ ### gcmole(s390) ### "src/codegen/s390/assembler-s390.cc", @@ -6101,6 +6157,7 @@ v8_source_set("v8_base_without_compiler") { "src/codegen/riscv/extension-riscv-f.cc", "src/codegen/riscv/extension-riscv-m.cc", "src/codegen/riscv/extension-riscv-v.cc", + "src/codegen/riscv/extension-riscv-zicond.cc", "src/codegen/riscv/extension-riscv-zicsr.cc", "src/codegen/riscv/extension-riscv-zifencei.cc", "src/codegen/riscv/macro-assembler-riscv.cc", @@ -6140,6 +6197,7 @@ v8_source_set("v8_base_without_compiler") { "src/codegen/riscv/extension-riscv-f.cc", "src/codegen/riscv/extension-riscv-m.cc", "src/codegen/riscv/extension-riscv-v.cc", + "src/codegen/riscv/extension-riscv-zicond.cc", "src/codegen/riscv/extension-riscv-zicsr.cc", "src/codegen/riscv/extension-riscv-zifencei.cc", "src/codegen/riscv/macro-assembler-riscv.cc", @@ -6177,6 +6235,7 @@ v8_source_set("v8_base_without_compiler") { ":v8_tracing", ":v8_version", "src/inspector:inspector", + "//third_party/fast_float", ] public_deps = [ @@ -6240,16 +6299,11 @@ v8_source_set("v8_base_without_compiler") { libs = [] - if (v8_enable_third_party_heap) { - libs += v8_third_party_heap_libs - } - # Platforms that don't have CAS support need to link atomic library # to implement atomic memory access if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el" || - v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" || - (current_os != "zos" && - (v8_current_cpu == "s390" || v8_current_cpu == "s390x")) || + v8_current_cpu == "ppc64" || + (current_os != "zos" && v8_current_cpu == "s390x") || v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") { if (!is_clang) { libs += [ "atomic" ] @@ -6462,7 +6516,6 @@ v8_component("v8_libbase") { "src/base/numbers/strtod.h", "src/base/once.cc", "src/base/once.h", - "src/base/optional.h", "src/base/overflowing-math.h", "src/base/page-allocator.cc", "src/base/page-allocator.h", diff --git a/deps/v8/COMMON_OWNERS b/deps/v8/COMMON_OWNERS index 5d4e99dec54..acd008e3360 100644 --- a/deps/v8/COMMON_OWNERS +++ b/deps/v8/COMMON_OWNERS @@ -11,8 +11,8 @@ dlehmann@chromium.org dmercadier@chromium.org ecmziegler@chromium.org evih@chromium.org +fgm@chromium.org gdeepti@chromium.org -hablich@chromium.org hpayer@chromium.org ishell@chromium.org jgruber@chromium.org @@ -22,7 +22,6 @@ liviurau@chromium.org machenbach@chromium.org manoskouk@chromium.org marja@chromium.org -mathias@chromium.org mliedtke@chromium.org mlippautz@chromium.org nicohartmann@chromium.org diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 6b06081f88e..8716dc6b693 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -39,6 +39,9 @@ vars = { # Fetch clang-tidy into the same bin/ directory as our clang binary. 'checkout_clang_tidy': False, + # Fetch clangd into the same bin/ directory as our clang binary. + 'checkout_clangd': False, + # Fetch and build V8 builtins with PGO profiles 'checkout_v8_builtins_pgo_profiles': False, @@ -57,7 +60,7 @@ vars = { 'checkout_fuchsia_no_hooks': False, # reclient CIPD package version - 'reclient_version': 're_client_version:0.150.1.d9707319-gomaip', + 'reclient_version': 're_client_version:0.163.0.d27158ab-gomaip', # Fetch configuration files required for the 'use_remoteexec' gn arg 'download_remoteexec_cfg': False, @@ -73,22 +76,22 @@ vars = { 'build_with_chromium': False, # GN CIPD package version. - 'gn_version': 'git_revision:b2afae122eeb6ce09c52d63f67dc53fc517dbdc8', + 'gn_version': 'git_revision:20806f79c6b4ba295274e3a589d85db41a02fdaa', # ninja CIPD package version - # https://chrome-infra-packages.appspot.com/p/infra/3pp/build_support/ninja-1_11_1/ - 'ninja_version': 'version:2@1.11.1.chromium.2', + # https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/ninja + 'ninja_version': 'version:2@1.12.1.chromium.4', # siso CIPD package version - 'siso_version': 'git_revision:50a6db5dae3978d2d2e8dce29f6df024dde48d1b', + 'siso_version': 'git_revision:b013f2413d36c465216bb4a6fd2a2f9075c07dd7', # luci-go CIPD package version. - 'luci_go': 'git_revision:771ea9a614a104c71655f699ef82219a2a474817', + 'luci_go': 'git_revision:f395cad73f6f75b2298697b5da01d7505e3116e9', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Fuchsia sdk # and whatever else without interference from each other. - 'fuchsia_version': 'version:22.20240717.4.1', + 'fuchsia_version': 'version:24.20240913.4.1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_build-tools_version @@ -121,14 +124,14 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_tools-lint_version # and whatever else without interference from each other. - 'android_sdk_cmdline-tools_version': 'mU9jm4LkManzjSzRquV1UIA7fHBZ2pK7NtbCXxoVnVUC', + 'android_sdk_cmdline-tools_version': 'B4p95sDPpm34K8Cf4JcfTM-iYSglWko9qjWgbT9dxWQC', } deps = { 'build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + '7a8285c06acd753e6228263f48e5595e20ca1577', + Var('chromium_url') + '/chromium/src/build.git' + '@' + 'd26b9feb99c4f0bb93e1123a20bd411ea4546fe4', 'buildtools': - Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '3ef44a2b92d5dd1faa5189a06f3a5febe6db2d58', + Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + 'e796a7e40dafb8572f517080436b516597e1e466', 'buildtools/linux64': { 'packages': [ { @@ -174,7 +177,7 @@ deps = { 'test/mozilla/data': Var('chromium_url') + '/v8/deps/third_party/mozilla-tests.git' + '@' + 'f6c578a10ea707b1a8ab0b88943fe5115ce2b9be', 'test/test262/data': - Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'b01075d87cf48f69a468d75a0eb7c372902965c7', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'd62fa93c8f9ce5e687c0bbaa5d2b59670ab2ff60', 'third_party/android_platform': { 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '6337c445f9963ec3914e7e0c5787941d07b46509', 'condition': 'checkout_android', @@ -221,22 +224,22 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_toolchain/android_toolchain', - 'version': 'h9HeidXTeHQ-oskldbqCZx26-7VrVvXpLfqOI87uy4QC', + 'version': 'Idl-vYnWGnM8K3XJhM3h6zjYVDXlnljVz3FE00V9IM8C', }, ], 'condition': 'checkout_android', 'dep_type': 'cipd', }, 'third_party/boringssl': { - 'url': Var('chromium_url') + '/chromium/src/third_party/boringssl.git' + '@' + '35f4fcbdeae229a56fd50320dc03ae6de407aca4', + 'url': Var('chromium_url') + '/chromium/src/third_party/boringssl.git' + '@' + 'c79987a83ceaf2cf911f7d21bec621ddc90c45cc', 'condition': "checkout_centipede_deps", }, 'third_party/boringssl/src': { - 'url': Var('boringssl_url') + '/boringssl.git' + '@' + 'f01108e4761e1d4189cb134322c3cb01dc71ef87', + 'url': Var('boringssl_url') + '/boringssl.git' + '@' + '2958490127dbe0df3adb72bc8ffb04ebca1f4bbf', 'condition': "checkout_centipede_deps", }, 'third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '16999365265c9850d7b5c46e53ddd52aca56f8dc', + 'url': Var('chromium_url') + '/catapult.git' + '@' + '8283581340dbfb515f697d17a8492bbe2acdbaed', 'condition': 'checkout_android', }, 'third_party/clang-format/script': @@ -250,11 +253,13 @@ deps = { 'condition': 'checkout_android', }, 'third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'cdcdd6efeec145eb246eeac20c78f2c55c9d393e', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '6e9a3df972e3cdaf364868b565d514120a6da0d7', 'third_party/fp16/src': Var('chromium_url') + '/external/github.com/Maratyszcza/FP16.git' + '@' + '0a92994d729ff76a58f692d3028ca1b64b145d91', + 'third_party/fast_float/src': + Var('chromium_url') + '/external/github.com/fastfloat/fast_float.git' + '@' + '3e57d8dcfb0a04b5a8a26b486b54490a2e9b310f', 'third_party/fuchsia-gn-sdk': { - 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-gn-sdk.git' + '@' + '30fee7b68b3675e351fa47303c3b6ef322941ccd', + 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-gn-sdk.git' + '@' + '5086f6c9e4c6d3295a76fdb5d27209f2d6449c6a', 'condition': 'checkout_fuchsia', }, # Exists for rolling the Fuchsia SDK. Check out of the SDK should always @@ -280,7 +285,7 @@ deps = { 'third_party/fuzztest/src': Var('chromium_url') + '/external/github.com/google/fuzztest.git' + '@' + '32eb84a95951fa3a0148fb3e6a1a02f830ded136', 'third_party/googletest/src': - Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'cee1ba1f24fb12b9ae8f31e70dca3f73dbb12cc2', + Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '6dae7eb4a5c3a169f3e298392bff4680224aa94a', 'third_party/highway/src': Var('chromium_url') + '/external/github.com/google/highway.git' + '@' + '8295336dd70f1201d42c22ab5b0861de38cf8fbf', 'third_party/icu': @@ -300,125 +305,153 @@ deps = { 'third_party/jsoncpp/source': Var('chromium_url') + '/external/github.com/open-source-parsers/jsoncpp.git'+ '@' + '42e892d96e47b1f6e29844cc705e148ec4856448', 'third_party/libc++/src': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '6bb75caa139ee1e686d2205910454cf6ea212e58', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '1fe5dc4dbb07fa54613a5d2aa63db25e1ba9d20b', 'third_party/libc++abi/src': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + 'a3c7d3e2f3e1e724b4651891b1a71257cbd88acc', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '29b2e9a0f48688da116692cb04758393053d269c', 'third_party/libunwind/src': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'd09db732ff68f40fd3581306c650b17ea1955b4e', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'dc70138c3e68e2f946585f134e20815851e26263', 'third_party/llvm-build/Release+Asserts': { 'dep_type': 'gcs', 'bucket': 'chromium-browser-clang', 'objects': [ { - 'object_name': 'Linux_x64/clang-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': '2c48fb44f408328f59482a1dafb2143bb8b6b04be23f407600117e6f6d4fa437', - 'size_bytes': 51489572, - 'generation': 1721105679311662, + 'object_name': 'Linux_x64/clang-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '6a30f7bc7c5f0eac02a40a4ec9a1ab906ddff2adacf2c9ff065916047c79f0fb', + 'size_bytes': 52892060, + 'generation': 1726118358890940, 'condition': 'host_os == "linux"', }, { - 'object_name': 'Linux_x64/clang-tidy-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': '3570497c3c507be0f8f4c0aa149a57fc600ed49252da42676996ea651df05e60', - 'size_bytes': 13081104, - 'generation': 1721105679453016, + 'object_name': 'Linux_x64/clang-tidy-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '35e00fc8f58cf7cd30f0ad27c2fdef56b677e287030072c46c0f024d23363ae4', + 'size_bytes': 13283180, + 'generation': 1726118359291453, 'condition': 'host_os == "linux" and checkout_clang_tidy', }, { - 'object_name': 'Linux_x64/llvm-code-coverage-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': 'dd6f1c05d5fe244b4524af86e6aa20de2d730f7d7e01fe4002b5aa72347b7658', - 'size_bytes': 2357488, - 'generation': 1721105679795112, + 'object_name': 'Linux_x64/clangd-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '33e2276976dfeaf387f5ea16651ea591eebe3570a12469f3884c74f8079e88bf', + 'size_bytes': 26305668, + 'generation': 1726118359489734, + 'condition': 'host_os == "linux" and checkout_clangd', + }, + { + 'object_name': 'Linux_x64/llvm-code-coverage-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '426c6bd378848de0817a7695fee821bece9efb51e3ed1d7b750a75bc17bf00eb', + 'size_bytes': 2370472, + 'generation': 1726118360237343, 'condition': 'host_os == "linux" and checkout_clang_coverage_tools', }, { - 'object_name': 'Linux_x64/llvmobjdump-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': 'a93d8b39ac573376a2db77b04f014d8751375de8c70ee16ca4713e5da467c5ec', - 'size_bytes': 5387304, - 'generation': 1721105679641287, + 'object_name': 'Linux_x64/llvmobjdump-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': 'e11c3043e76c7c79fe7905861a11c78433c6d796d049f837eda0a2ce118f0793', + 'size_bytes': 5410724, + 'generation': 1726118359908897, 'condition': '(checkout_linux or checkout_mac or checkout_android and host_os != "mac")', }, { - 'object_name': 'Mac/clang-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': '04956a3db535f4cf1ab0a6e40383cbb5db7d6ee09721e31a706d230af206eaa0', - 'size_bytes': 46446976, - 'generation': 1721105680965575, + 'object_name': 'Mac/clang-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': 'cabfc7ca792ef13d3e665c3a7811f9a76cc39094059c11606cea1724f0394bbc', + 'size_bytes': 47551968, + 'generation': 1726118361528729, 'condition': 'host_os == "mac" and host_cpu == "x64"', }, { - 'object_name': 'Mac/clang-mac-runtime-library-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': 'c684d46962bd39f785a143c2b28a0400c6e6d41a610a04ad6982f7513b930a35', - 'size_bytes': 865444, - 'generation': 1721105687851327, + 'object_name': 'Mac/clang-mac-runtime-library-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '50a618246d7fd23645640fc50ccb0d4684c1895def378b90963a289f920ea88a', + 'size_bytes': 879508, + 'generation': 1726118377526206, 'condition': 'checkout_mac and not host_os == "mac"', }, { - 'object_name': 'Mac/clang-tidy-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': '1bcfd396959c5f0e835e33f7bd15f29b2a1b1b27c619480dab767d034da48098', - 'size_bytes': 12650532, - 'generation': 1721105681146275, + 'object_name': 'Mac/clang-tidy-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '2c325505ea43a8d8a14770890d62aba9af37b397e3063e3fb622cfd51d4706f6', + 'size_bytes': 12884412, + 'generation': 1726118361811669, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clang_tidy', }, { - 'object_name': 'Mac/llvm-code-coverage-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': 'dbaf0d0bc4d19be0a9bd033b94033a2e9f826f8ed4ec3e9e6fa732ca3b4f1b6f', - 'size_bytes': 2234200, - 'generation': 1721105681470376, + 'object_name': 'Mac/clangd-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '1c1a0965cc95053dec8c649a7b3bb627ad2300ad230eed97b52ee70a8a8edd85', + 'size_bytes': 26553148, + 'generation': 1726118361978146, + 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clangd', + }, + { + 'object_name': 'Mac/llvm-code-coverage-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '9259bd27c19ca9662c70ffc2b42c10afb584e7c584470d6e656e164643614b50', + 'size_bytes': 2247028, + 'generation': 1726118362377026, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clang_coverage_tools', }, { - 'object_name': 'Mac_arm64/clang-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': '3d8d0a32604b9c8f9add4865d4e2b4950607d2a201bcd1c3de9e67e2998f1a84', - 'size_bytes': 42076344, - 'generation': 1721105689042846, + 'object_name': 'Mac_arm64/clang-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': 'e87eb4caa95c98ef36c40aec5b8cd07a6c4fb8959d3c7e7d452f6ed860c8c2bf', + 'size_bytes': 41352592, + 'generation': 1726118378868177, 'condition': 'host_os == "mac" and host_cpu == "arm64"', }, { - 'object_name': 'Mac_arm64/clang-tidy-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': '12524e94777f1d78489f58bcd966a341c8a61dca56175c7d6e8835240b2dcade', - 'size_bytes': 11612984, - 'generation': 1721105689155910, + 'object_name': 'Mac_arm64/clang-tidy-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': 'fcf8f25a8461db90686d0455bd8f195750a2cdc425cb03c48debe4d3e8bb9299', + 'size_bytes': 11476316, + 'generation': 1726118379144738, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clang_tidy', }, { - 'object_name': 'Mac_arm64/llvm-code-coverage-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': '85db7e11d059902cd2c3d04e1d0380524d0ef4bf6ec3c93f0afdfd663d8b2a64', - 'size_bytes': 2005884, - 'generation': 1721105689448152, + 'object_name': 'Mac_arm64/clangd-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': 'cca4049d3362528511ebc603db05189c9bef406a80ae4fead22b1db0a4de83e6', + 'size_bytes': 22679568, + 'generation': 1726118379283835, + 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clangd', + }, + { + 'object_name': 'Mac_arm64/llvm-code-coverage-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '001e8582de4bc7c434f321b5bacd2b0b45e553f3134cb7d78e1a4f62e2b97ac6', + 'size_bytes': 1969844, + 'generation': 1726118379757221, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clang_coverage_tools', }, { - 'object_name': 'Win/clang-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': '34ba04b75548fdce4b3d2ba9dc8320a11afb0cad8622d537c1cf37f1c5587bab', - 'size_bytes': 41800448, - 'generation': 1721105697679553, + 'object_name': 'Win/clang-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': 'cb416511e6379b7fd3f362f637ebb8a28957d0d2ff2dc6e2d9f4484a381f2885', + 'size_bytes': 44655000, + 'generation': 1726118399720986, 'condition': 'host_os == "win"', }, { - 'object_name': 'Win/clang-tidy-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': '41fe89c54964a6a8efb66c398dbf763e8a4aca6a675c6f4d15a94c5236ba1ab7', - 'size_bytes': 12869556, - 'generation': 1721105697770165, + 'object_name': 'Win/clang-tidy-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '15af2ae61dabdfe0ddbdd48f467b996855ba51d0ef633c5c0ac3c74cdc0d8f2c', + 'size_bytes': 13114928, + 'generation': 1726118400057660, 'condition': 'host_os == "win" and checkout_clang_tidy', }, { - 'object_name': 'Win/clang-win-runtime-library-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': 'ce7886ecbfb129660a14cc11c4eacd6a2ef6488b36a88a7afb71a8cd22277da0', - 'size_bytes': 2842872, - 'generation': 1721105704724295, + 'object_name': 'Win/clang-win-runtime-library-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '81d66840357d83ca1a2c85ebca5259a7a86d9e99c77b37727fbaee87ccacf675', + 'size_bytes': 2897452, + 'generation': 1726118416326356, 'condition': 'checkout_win and not host_os == "win"', }, { - 'object_name': 'Win/llvm-code-coverage-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': 'e5778f9a2fa59936676579b01b3b576d8c545b72e5261c47a36751d4f1f6b61a', - 'size_bytes': 2357104, - 'generation': 1721105698068261, + 'object_name': 'Win/clangd-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '1304718c221543b16465a4b6108572fa1ba9f2b75c4e4398bdb01fb983428c10', + 'size_bytes': 25169688, + 'generation': 1726118400193324, + 'condition': 'host_os == "win" and checkout_clangd', + }, + { + 'object_name': 'Win/llvm-code-coverage-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': 'e01b8fbca72fc1cca6988e359d9a0eea8fa5ccbaff8d41deffd62970c7f4fed5', + 'size_bytes': 2382756, + 'generation': 1726118400642803, 'condition': 'host_os == "win" and checkout_clang_coverage_tools', }, { - 'object_name': 'Win/llvmobjdump-llvmorg-19-init-14561-gecea8371-3.tar.xz', - 'sha256sum': 'ad7d9162e1632b5c64188f95362318f0d31e09002be0615df847f2c23cddef4c', - 'size_bytes': 5362484, - 'generation': 1721105697937832, + 'object_name': 'Win/llvmobjdump-llvmorg-20-init-3847-g69c43468-28.tar.xz', + 'sha256sum': '2f837a21d910ad748666282d0c1da15a438d9aae4fc1bc85dab7313da6dfeb7b', + 'size_bytes': 5439736, + 'generation': 1726118400404099, 'condition': 'checkout_linux or checkout_mac or checkout_android and host_os == "win"', }, ], @@ -430,7 +463,7 @@ deps = { 'third_party/ninja': { 'packages': [ { - 'package': 'infra/3pp/build_support/ninja-1_11_1/${{platform}}', + 'package': 'infra/3pp/tools/ninja/${{platform}}', 'version': Var('ninja_version'), } ], @@ -439,8 +472,8 @@ deps = { }, 'third_party/perfetto': Var('android_url') + '/platform/external/perfetto.git' + '@' + '6fc824d618d2f06b5d9cd8655ba0419b6b3b366e', - 'third_party/protobuf_chrome': - Var('chromium_url') + '/chromium/src/third_party/protobuf.git' + '@' + 'da2fe725b80ac0ba646fbf77d0ce5b4ac236f823', + 'third_party/protobuf': + Var('chromium_url') + '/chromium/src/third_party/protobuf.git' + '@' + '37bbf271c62d6c01c58c66505b17c7dcf086371a', 'third_party/re2/src': Var('chromium_url') + '/external/github.com/google/re2.git' + '@' + '6dcd83d60f7944926bfd308cc13979fc53dd69ca', 'third_party/requests': { @@ -458,9 +491,9 @@ deps = { 'condition': 'not build_with_chromium and host_cpu != "s390" and host_os != "zos" and host_cpu != "ppc"', }, 'third_party/zlib': - Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + 'c2469fdd73f192383d2d94288da0ff5b9a3869f5', + Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + 'fa9f14143c7938e6a1d18443900efee7a1e5e669', 'tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '4dc76da47b1145e53e508a23c1bf2204cf5ee7ee', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '4f1bc3a6bc1727c11e5d8ebc71aa05fb8bb7c548', 'tools/luci-go': { 'packages': [ { @@ -478,7 +511,7 @@ deps = { 'tools/protoc_wrapper': Var('chromium_url') + '/chromium/src/tools/protoc_wrapper.git' + '@' + 'dbcbea90c20ae1ece442d8ef64e61c7b10e2b013', 'third_party/abseil-cpp': { - 'url': Var('chromium_url') + '/chromium/src/third_party/abseil-cpp.git' + '@' + '9d1552f25c3d9e9114b7d7aed55790570a99bc4d', + 'url': Var('chromium_url') + '/chromium/src/third_party/abseil-cpp.git' + '@' + '20f7b28b4e7582095d74ad5b3c7051290e906ec0', 'condition': 'not build_with_chromium', }, 'third_party/zoslib': { @@ -493,6 +526,7 @@ include_rules = [ '+unicode', '+third_party/fdlibm', '+third_party/ittapi/include', + '+third_party/fast_float/src/include', '+third_party/fp16/src/include', '+third_party/v8/codegen', '+third_party/fuzztest', diff --git a/deps/v8/WATCHLISTS b/deps/v8/WATCHLISTS index 6850defb79d..efde42b36b0 100644 --- a/deps/v8/WATCHLISTS +++ b/deps/v8/WATCHLISTS @@ -129,7 +129,6 @@ 'verwaest+watch@chromium.org', ], 'feature_shipping_status': [ - 'hablich@chromium.org', 'saelo+watch@chromium.org', ], 'heap_changes': [ diff --git a/deps/v8/bazel/defs.bzl b/deps/v8/bazel/defs.bzl index 520a311595e..b7353fff30c 100644 --- a/deps/v8/bazel/defs.bzl +++ b/deps/v8/bazel/defs.bzl @@ -432,7 +432,7 @@ def _v8_target_cpu_transition_impl(settings, "armeabi-v7a": "arm32", "s390x": "s390x", "riscv64": "riscv64", - "ppc": "ppc64le", + "ppc64": "ppc64le", } v8_target_cpu = mapping[settings["//command_line_option:cpu"]] return {"@v8//bazel/config:v8_target_cpu": v8_target_cpu} @@ -549,7 +549,6 @@ def build_config_content(cpu, icu): ("debugging_features", "false"), ("dict_property_const_tracking", "false"), ("direct_handle", "false"), - ("direct_local", "false"), ("disassembler", "false"), ("full_debug", "false"), ("gdbjit", "false"), @@ -557,10 +556,12 @@ def build_config_content(cpu, icu): ("has_maglev", "true"), ("has_turbofan", "true"), ("has_webassembly", "false"), + ("has_wasm_interpreter", "false"), ("i18n", icu), ("is_android", "false"), ("is_ios", "false"), ("js_shared_memory", "false"), + ("leaptiering", "true"), ("lite_mode", "false"), ("local_off_stack_check", "false"), ("memory_corruption_api", "false"), @@ -578,7 +579,6 @@ def build_config_content(cpu, icu): ("single_generation", "false"), ("slow_dchecks", "false"), ("target_cpu", cpu), - ("third_party_heap", "false"), ("tsan", "false"), ("ubsan", "false"), ("use_sanitizer", "false"), diff --git a/deps/v8/build_overrides/build.gni b/deps/v8/build_overrides/build.gni index 0a1fc3c46d2..29acce40046 100644 --- a/deps/v8/build_overrides/build.gni +++ b/deps/v8/build_overrides/build.gni @@ -17,15 +17,6 @@ build_with_node = false # chromium build. perfetto_build_with_embedder = true -# TODO(https://crbug.com/337736622): Perfetto and FuzzTest need to know the -# path to protobuf targets. V8 stores them in a different location than Chrome -# until M129. Thereafter, it can move to //third_party/protobuf and these -# variables can be removed. -protobuf_target_prefix = "//third_party/protobuf_chrome/" -perfetto_protobuf_target_prefix = protobuf_target_prefix -perfetto_protobuf_gni = "//third_party/protobuf_chrome/proto_library.gni" -perfetto_protobuf_src_dir = "//third_party/protobuf_chrome/src" - # We use Perfetto's Trace Processor to convert traces to the legacy JSON # format. enable_perfetto_trace_processor = true diff --git a/deps/v8/docs/OWNERS b/deps/v8/docs/OWNERS index 39b706f0cc5..07428b275bb 100644 --- a/deps/v8/docs/OWNERS +++ b/deps/v8/docs/OWNERS @@ -1,2 +1 @@ -hablich@chromium.org -mathias@chromium.org +hpayer@chromium.org diff --git a/deps/v8/gni/release_branch_toggle.gni b/deps/v8/gni/release_branch_toggle.gni index da60c2433bc..a595b85ef9c 100644 --- a/deps/v8/gni/release_branch_toggle.gni +++ b/deps/v8/gni/release_branch_toggle.gni @@ -6,5 +6,5 @@ declare_args() { # TODO(liviurau): Remove old name after Chromium config update # https://crbug.com/1476977. is_on_release_branch = false - v8_is_on_release_branch = true + v8_is_on_release_branch = false } \ No newline at end of file diff --git a/deps/v8/gni/v8.gni b/deps/v8/gni/v8.gni index 9ee57a49806..09c3e7adec4 100644 --- a/deps/v8/gni/v8.gni +++ b/deps/v8/gni/v8.gni @@ -118,12 +118,9 @@ declare_args() { # Scan the call stack conservatively during garbage collection. v8_enable_conservative_stack_scanning = false - # Use direct pointers in internal (direct) handles. + # Use direct pointers in handles (v8::internal::Handle and v8::Local). v8_enable_direct_handle = "" - # Use direct pointers in local handles. - v8_enable_direct_local = "" - # Check for off-stack allocated local handles. v8_enable_local_off_stack_check = false @@ -166,12 +163,22 @@ declare_args() { # Location of zlib. v8_zlib_path = "//third_party/zlib" + # Enable pointer compression (sets -dV8_COMPRESS_POINTERS). + v8_enable_pointer_compression = "" + v8_enable_pointer_compression_shared_cage = "" + v8_enable_31bit_smis_on_64bit_arch = false + # Change code emission and runtime features to be CET shadow-stack compliant # (incomplete and experimental). v8_enable_cet_shadow_stack = false # Emit CET IBT landing pad instructions in JIT generated code (experimental). v8_enable_cet_ibt = false + + # Use memory sealing to protect various global memory mappings for CFI + # (experimental). + # TODO(sroettger): enable by default once we have bot support for testing. + v8_enable_memory_sealing = false } if (v8_use_external_startup_data == "") { @@ -209,6 +216,18 @@ if (v8_enable_webassembly == "") { assert(!(v8_enable_webassembly && v8_enable_lite_mode), "Webassembly is not available in lite mode.") +if (v8_enable_pointer_compression == "") { + v8_enable_pointer_compression = + v8_current_cpu == "arm64" || v8_current_cpu == "x64" +} + +# The Wasm interpreter is currently supported only on arm64 and x64, on +# Windows, Linux and MacOS. +is_drumbrake_supported = + v8_enable_webassembly && v8_enable_pointer_compression && + (v8_current_cpu == "x64" || v8_current_cpu == "arm64") && + (target_os == "win" || target_os == "linux" || target_os == "mac") + # Turbofan is enabled by default, except in lite mode. if (v8_enable_turbofan == "") { v8_enable_turbofan = !v8_enable_lite_mode @@ -221,9 +240,6 @@ assert(v8_enable_turbofan || !v8_enable_webassembly, if (v8_enable_direct_handle == "") { v8_enable_direct_handle = v8_enable_conservative_stack_scanning } -if (v8_enable_direct_local == "") { - v8_enable_direct_local = v8_enable_conservative_stack_scanning -} # Points to // in v8 stand-alone or to //v8/ in chromium. We need absolute # paths for all configs in templates as they are shared in different diff --git a/deps/v8/include/OWNERS b/deps/v8/include/OWNERS index 535040c539a..9a2d99e8758 100644 --- a/deps/v8/include/OWNERS +++ b/deps/v8/include/OWNERS @@ -19,5 +19,4 @@ per-file v8-version.h=v8-ci-autoroll-builder@chops-service-accounts.iam.gservice # For branch updates: per-file v8-version.h=file:../INFRA_OWNERS -per-file v8-version.h=hablich@chromium.org per-file v8-version.h=vahl@chromium.org diff --git a/deps/v8/include/cppgc/default-platform.h b/deps/v8/include/cppgc/default-platform.h index a27871cc37e..07ce55bbf42 100644 --- a/deps/v8/include/cppgc/default-platform.h +++ b/deps/v8/include/cppgc/default-platform.h @@ -37,11 +37,12 @@ class V8_EXPORT DefaultPlatform : public Platform { return v8_platform_->MonotonicallyIncreasingTime(); } - std::shared_ptr GetForegroundTaskRunner() override { + std::shared_ptr GetForegroundTaskRunner( + TaskPriority priority) override { // V8's default platform creates a new task runner when passed the // `v8::Isolate` pointer the first time. For non-default platforms this will // require getting the appropriate task runner. - return v8_platform_->GetForegroundTaskRunner(kNoIsolate); + return v8_platform_->GetForegroundTaskRunner(kNoIsolate, priority); } std::unique_ptr PostJob( diff --git a/deps/v8/include/cppgc/garbage-collected.h b/deps/v8/include/cppgc/garbage-collected.h index 6737c8be49a..dfd758a35cf 100644 --- a/deps/v8/include/cppgc/garbage-collected.h +++ b/deps/v8/include/cppgc/garbage-collected.h @@ -94,6 +94,14 @@ class GarbageCollectedMixin { public: using IsGarbageCollectedMixinTypeMarker = void; + // Must use MakeGarbageCollected. + void* operator new(size_t) = delete; + void* operator new[](size_t) = delete; + // The garbage collector is taking care of reclaiming the object. + // Not override the non-array varaint of `delete` to not conflict with the + // operator in GarbageCollected above. + void operator delete[](void*) = delete; + /** * This Trace method must be overriden by objects inheriting from * GarbageCollectedMixin. diff --git a/deps/v8/include/cppgc/heap-consistency.h b/deps/v8/include/cppgc/heap-consistency.h index eb7fdaee8c3..23b5d909945 100644 --- a/deps/v8/include/cppgc/heap-consistency.h +++ b/deps/v8/include/cppgc/heap-consistency.h @@ -114,7 +114,7 @@ class HeapConsistency final { * has not yet been processed. * * \param params The parameters retrieved from `GetWriteBarrierType()`. - * \param object The pointer to the object. May be an interior pointer to a + * \param object The pointer to the object. May be an interior pointer to * an interface of the actual object. */ static V8_INLINE void DijkstraWriteBarrier(const WriteBarrierParams& params, diff --git a/deps/v8/include/cppgc/internal/compiler-specific.h b/deps/v8/include/cppgc/internal/compiler-specific.h index 595b6398cb7..175156ca6cb 100644 --- a/deps/v8/include/cppgc/internal/compiler-specific.h +++ b/deps/v8/include/cppgc/internal/compiler-specific.h @@ -5,6 +5,8 @@ #ifndef INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_ #define INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_ +#include "v8config.h" // NOLINT(build/include_directory) + namespace cppgc { #if defined(__has_attribute) @@ -21,7 +23,13 @@ namespace cppgc { // [[no_unique_address]] comes in C++20 but supported in clang with -std >= // c++11. -#if CPPGC_HAS_CPP_ATTRIBUTE(no_unique_address) +#if defined(V8_CC_MSVC) && CPPGC_HAS_CPP_ATTRIBUTE(msvc::no_unique_address) +// Unfortunately MSVC ignores [[no_unique_address]] (see +// https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/#msvc-extensions-and-abi), +// and clang-cl matches it for ABI compatibility reasons. We need to prefer +// [[msvc::no_unique_address]] when available if we actually want any effect. +#define CPPGC_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]] +#elif CPPGC_HAS_CPP_ATTRIBUTE(no_unique_address) #define CPPGC_NO_UNIQUE_ADDRESS [[no_unique_address]] #else #define CPPGC_NO_UNIQUE_ADDRESS diff --git a/deps/v8/include/cppgc/internal/persistent-node.h b/deps/v8/include/cppgc/internal/persistent-node.h index d22692a768c..ee9701c1b06 100644 --- a/deps/v8/include/cppgc/internal/persistent-node.h +++ b/deps/v8/include/cppgc/internal/persistent-node.h @@ -158,6 +158,12 @@ class V8_EXPORT PersistentRegion final : public PersistentRegionBase { PersistentRegionBase::FreeNode(node); } + // During GC, nodes can be freed from a concurrent thread, so no thread check + // takes place here. + V8_INLINE void FreeNodeFromGC(PersistentNode* node) { + PersistentRegionBase::FreeNode(node); + } + private: bool IsCreationThread(); diff --git a/deps/v8/include/cppgc/persistent.h b/deps/v8/include/cppgc/persistent.h index 6eb1c659267..9ba590143a4 100644 --- a/deps/v8/include/cppgc/persistent.h +++ b/deps/v8/include/cppgc/persistent.h @@ -256,7 +256,7 @@ class BasicPersistent final : public PersistentBase, void ClearFromGC() const { if (IsValid()) { - WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode()); + WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNodeFromGC(GetNode()); PersistentBase::ClearFromGC(); } } diff --git a/deps/v8/include/cppgc/platform.h b/deps/v8/include/cppgc/platform.h index ae96579dd64..a5eccfa80fe 100644 --- a/deps/v8/include/cppgc/platform.h +++ b/deps/v8/include/cppgc/platform.h @@ -52,6 +52,15 @@ class V8_EXPORT Platform { * Foreground task runner that should be used by a Heap. */ virtual std::shared_ptr GetForegroundTaskRunner() { + return GetForegroundTaskRunner(TaskPriority::kUserBlocking); + } + + /** + * Returns a TaskRunner with a specific |priority| which can be used to post a + * task on the foreground thread. + */ + virtual std::shared_ptr GetForegroundTaskRunner( + TaskPriority priority) { return nullptr; } diff --git a/deps/v8/include/v8-callbacks.h b/deps/v8/include/v8-callbacks.h index 60963012587..567b36faf63 100644 --- a/deps/v8/include/v8-callbacks.h +++ b/deps/v8/include/v8-callbacks.h @@ -254,15 +254,7 @@ using AddCrashKeyCallback = void (*)(CrashKeyId id, const std::string& value); using BeforeCallEnteredCallback = void (*)(Isolate*); using CallCompletedCallback = void (*)(Isolate*); -// --- AllowCodeGenerationFromStrings callbacks --- - -/** - * Callback to check if code generation from strings is allowed. See - * Context::AllowCodeGenerationFromStrings. - */ -using AllowCodeGenerationFromStringsCallback = bool (*)(Local context, - Local source); - +// --- Modify Code Generation From Strings Callback --- struct ModifyCodeGenerationFromStringsResult { // If true, proceed with the codegen algorithm. Otherwise, block it. bool codegen_allowed = false; @@ -272,6 +264,20 @@ struct ModifyCodeGenerationFromStringsResult { MaybeLocal modified_source; }; +/** + * Callback to check if codegen is allowed from a source object, and convert + * the source to string if necessary. See: ModifyCodeGenerationFromStrings. + */ +using ModifyCodeGenerationFromStringsCallback = + ModifyCodeGenerationFromStringsResult (*)(Local context, + Local source); +using ModifyCodeGenerationFromStringsCallback2 = + ModifyCodeGenerationFromStringsResult (*)(Local context, + Local source, + bool is_code_like); + +// --- Failed Access Check Callback --- + /** * Access type specification. */ @@ -283,23 +289,9 @@ enum AccessType { ACCESS_KEYS }; -// --- Failed Access Check Callback --- - using FailedAccessCheckCallback = void (*)(Local target, AccessType type, Local data); -/** - * Callback to check if codegen is allowed from a source object, and convert - * the source to string if necessary. See: ModifyCodeGenerationFromStrings. - */ -using ModifyCodeGenerationFromStringsCallback = - ModifyCodeGenerationFromStringsResult (*)(Local context, - Local source); -using ModifyCodeGenerationFromStringsCallback2 = - ModifyCodeGenerationFromStringsResult (*)(Local context, - Local source, - bool is_code_like); - // --- WebAssembly compilation callbacks --- using ExtensionCallback = bool (*)(const FunctionCallbackInfo&); @@ -359,7 +351,7 @@ enum class ModuleImportPhase { * The import_attributes are import attributes for this request in the form: * [key1, value1, key2, value2, ...] where the keys and values are of type * v8::String. Note, unlike the FixedArray passed to ResolveModuleCallback and - * returned from ModuleRequest::GetImportAssertions(), this array does not + * returned from ModuleRequest::GetImportAttributes(), this array does not * contain the source Locations of the attributes. * * The embedder must compile, instantiate, evaluate the Module, and diff --git a/deps/v8/include/v8-context.h b/deps/v8/include/v8-context.h index f432ff67f70..0861d66493b 100644 --- a/deps/v8/include/v8-context.h +++ b/deps/v8/include/v8-context.h @@ -320,7 +320,7 @@ class V8_EXPORT Context : public Data { * 'Function' constructor are used an exception will be thrown. * * If code generation from strings is not allowed the - * V8::AllowCodeGenerationFromStrings callback will be invoked if + * V8::ModifyCodeGenerationFromStringsCallback callback will be invoked if * set before blocking the call to 'eval' or the 'Function' * constructor. If that callback returns true, the call will be * allowed, otherwise an exception will be thrown. If no callback is diff --git a/deps/v8/include/v8-fast-api-calls.h b/deps/v8/include/v8-fast-api-calls.h index 1cd99cb880f..18466688cf9 100644 --- a/deps/v8/include/v8-fast-api-calls.h +++ b/deps/v8/include/v8-fast-api-calls.h @@ -589,37 +589,10 @@ struct FastApiCallbackOptions { v8::Isolate* isolate = nullptr; - /** - * If the callback wants to signal an error condition or to perform an - * allocation, it must set options.fallback to true and do an early return - * from the fast method. Then V8 checks the value of options.fallback and if - * it's true, falls back to executing the SlowCallback, which is capable of - * reporting the error (either by throwing a JS exception or logging to the - * console) or doing the allocation. It's the embedder's responsibility to - * ensure that the fast callback is idempotent up to the point where error and - * fallback conditions are checked, because otherwise executing the slow - * callback might produce visible side-effects twice. - */ - V8_DEPRECATED( - "It is not necessary to use the `fallback` flag anymore, as it is " - "possible now to trigger GC, throw exceptions, and call back into " - "JavaScript even in API functions called with a fast API call.") - bool fallback = false; - /** * The `data` passed to the FunctionTemplate constructor, or `undefined`. */ v8::Local data; - - /** - * When called from WebAssembly, a view of the calling module's memory. - */ - V8_DEPRECATED( - "The wasm memory should either be provided as a field of the receiver, " - "the data object of the FunctionTemplate, or as a normal parameter of " - "the API function. Since regular API calls don't have this magic " - "`wasm_memory parameter, one of the options above should be possible.") - FastApiTypedArray* const wasm_memory = nullptr; }; namespace internal { diff --git a/deps/v8/include/v8-function-callback.h b/deps/v8/include/v8-function-callback.h index 7208c19ebf6..9ff4c59588d 100644 --- a/deps/v8/include/v8-function-callback.h +++ b/deps/v8/include/v8-function-callback.h @@ -325,7 +325,7 @@ class PropertyCallbackInfo { static constexpr int kSize = kArgsLength * internal::kApiSystemPointerSize; - explicit PropertyCallbackInfo() = default; + PropertyCallbackInfo() = default; mutable internal::Address args_[kArgsLength]; }; diff --git a/deps/v8/include/v8-function.h b/deps/v8/include/v8-function.h index 50f730f3929..d28d4b50087 100644 --- a/deps/v8/include/v8-function.h +++ b/deps/v8/include/v8-function.h @@ -52,6 +52,10 @@ class V8_EXPORT Function : public Object { Local context, int argc, Local argv[], SideEffectType side_effect_type = SideEffectType::kHasSideEffect) const; + V8_WARN_UNUSED_RESULT MaybeLocal Call(v8::Isolate* isolate, + Local context, + Local recv, int argc, + Local argv[]); V8_WARN_UNUSED_RESULT MaybeLocal Call(Local context, Local recv, int argc, Local argv[]); diff --git a/deps/v8/include/v8-handle-base.h b/deps/v8/include/v8-handle-base.h index c2e1947a5db..3075441e997 100644 --- a/deps/v8/include/v8-handle-base.h +++ b/deps/v8/include/v8-handle-base.h @@ -90,7 +90,7 @@ class IndirectHandleBase { internal::Address* location_ = nullptr; }; -#ifdef V8_ENABLE_DIRECT_LOCAL +#ifdef V8_ENABLE_DIRECT_HANDLE /** * A base class for abstract handles containing direct pointers. @@ -130,7 +130,7 @@ class DirectHandleBase { internal::Address ptr_ = internal::ValueHelper::kEmpty; }; -#endif // V8_ENABLE_DIRECT_LOCAL +#endif // V8_ENABLE_DIRECT_HANDLE } // namespace v8::api_internal diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index 8c385aa10a9..759ca14daad 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -18,6 +18,22 @@ #include "v8config.h" // NOLINT(build/include_directory) +// TODO(pkasting): Use /spaceship unconditionally after dropping +// support for old libstdc++ versions. +#if __has_include() +#include +#endif +#if defined(__cpp_lib_three_way_comparison) && \ + __cpp_lib_three_way_comparison >= 201711L && \ + defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L +#include +#include + +#define V8_HAVE_SPACESHIP_OPERATOR 1 +#else +#define V8_HAVE_SPACESHIP_OPERATOR 0 +#endif + namespace v8 { class Array; @@ -295,7 +311,8 @@ constexpr size_t kExternalPointerTableReservationSize = 256 * MB; // The external pointer table indices stored in HeapObjects as external // pointers are shifted to the left by this amount to guarantee that they are -// smaller than the maximum table size. +// smaller than the maximum table size even after the C++ compiler multiplies +// them by 8 to be used as indexes into a table of 64 bit pointers. constexpr uint32_t kExternalPointerIndexShift = 7; #else constexpr size_t kExternalPointerTableReservationSize = 512 * MB; @@ -946,12 +963,10 @@ class Internals { kIsolateCppHeapPointerTableOffset + kExternalPointerTableSize; static const int kIsolateTrustedPointerTableOffset = kIsolateTrustedCageBaseOffset + kApiSystemPointerSize; - static const int kIsolateExternalBufferTableOffset = + static const int kIsolateSharedTrustedPointerTableAddressOffset = kIsolateTrustedPointerTableOffset + kTrustedPointerTableSize; - static const int kIsolateSharedExternalBufferTableAddressOffset = - kIsolateExternalBufferTableOffset + kExternalBufferTableSize; static const int kIsolateApiCallbackThunkArgumentOffset = - kIsolateSharedExternalBufferTableAddressOffset + kApiSystemPointerSize; + kIsolateSharedTrustedPointerTableAddressOffset + kApiSystemPointerSize; #else static const int kIsolateApiCallbackThunkArgumentOffset = kIsolateCppHeapPointerTableOffset + kExternalPointerTableSize; @@ -978,7 +993,7 @@ class Internals { V(TrueValue, 0xc9) \ V(FalseValue, 0xad) \ V(EmptyString, 0xa1) \ - V(TheHoleValue, 0x741) + V(TheHoleValue, 0x791) using Tagged_t = uint32_t; struct StaticReadOnlyRoot { @@ -986,8 +1001,9 @@ class Internals { EXPORTED_STATIC_ROOTS_PTR_LIST(DEF_ROOT) #undef DEF_ROOT - static constexpr Tagged_t kFirstStringMap = 0xe5; - static constexpr Tagged_t kLastStringMap = 0x47d; + // Use 0 for kStringMapLowerBound since string maps are the first maps. + static constexpr Tagged_t kStringMapLowerBound = 0; + static constexpr Tagged_t kStringMapUpperBound = 0x47d; #define PLUSONE(...) +1 static constexpr size_t kNumberOfExportedStaticRoots = @@ -1354,11 +1370,11 @@ class V8_EXPORT StrongRootAllocatorBase { public: Heap* heap() const { return heap_; } - bool operator==(const StrongRootAllocatorBase& other) const { - return heap_ == other.heap_; - } - bool operator!=(const StrongRootAllocatorBase& other) const { - return heap_ != other.heap_; + friend bool operator==(const StrongRootAllocatorBase& a, + const StrongRootAllocatorBase& b) { + // TODO(pkasting): Replace this body with `= default` after dropping support + // for old gcc versions. + return a.heap_ == b.heap_; } protected: @@ -1393,22 +1409,60 @@ class StrongRootAllocator : private std::allocator { using std::allocator::deallocate; }; +// TODO(pkasting): Replace with `requires` clauses after dropping support for +// old gcc versions. +template +inline constexpr bool kHaveIteratorConcept = false; +template +inline constexpr bool kHaveIteratorConcept< + Iterator, std::void_t> = true; + +template +inline constexpr bool kHaveIteratorCategory = false; +template +inline constexpr bool kHaveIteratorCategory< + Iterator, std::void_t> = true; + +// Helper struct that contains an `iterator_concept` type alias only when either +// `Iterator` or `std::iterator_traits` do. +// Default: no alias. +template +struct MaybeDefineIteratorConcept {}; +// Use `Iterator::iterator_concept` if available. +template +struct MaybeDefineIteratorConcept< + Iterator, std::enable_if_t>> { + using iterator_concept = Iterator::iterator_concept; +}; +// Otherwise fall back to `std::iterator_traits` if possible. +template +struct MaybeDefineIteratorConcept< + Iterator, std::enable_if_t && + !kHaveIteratorConcept>> { + // There seems to be no feature-test macro covering this, so use the + // presence of `` as a crude proxy, since it was added to the + // standard as part of the Ranges papers. + // TODO(pkasting): Add this unconditionally after dropping support for old + // libstdc++ versions. +#if __has_include() + using iterator_concept = std::iterator_traits::iterator_concept; +#endif +}; + // A class of iterators that wrap some different iterator type. // If specified, ElementType is the type of element accessed by the wrapper // iterator; in this case, the actual reference and pointer types of Iterator // must be convertible to ElementType& and ElementType*, respectively. template -class WrappedIterator { +class WrappedIterator : public MaybeDefineIteratorConcept { public: static_assert( - !std::is_void_v || + std::is_void_v || (std::is_convertible_v::pointer, - ElementType*> && + std::add_pointer_t> && std::is_convertible_v::reference, - ElementType&>)); + std::add_lvalue_reference_t>)); - using iterator_category = - typename std::iterator_traits::iterator_category; using difference_type = typename std::iterator_traits::difference_type; using value_type = @@ -1418,24 +1472,96 @@ class WrappedIterator { using pointer = std::conditional_t, typename std::iterator_traits::pointer, - ElementType*>; + std::add_pointer_t>; using reference = std::conditional_t, typename std::iterator_traits::reference, - ElementType&>; + std::add_lvalue_reference_t>; + using iterator_category = + typename std::iterator_traits::iterator_category; - constexpr WrappedIterator() noexcept : it_() {} + constexpr WrappedIterator() noexcept = default; constexpr explicit WrappedIterator(Iterator it) noexcept : it_(it) {} + // TODO(pkasting): Switch to `requires` and concepts after dropping support + // for old gcc and libstdc++ versions. template , - bool> = true> + typename = std::enable_if_t< + std::is_convertible_v>> constexpr WrappedIterator( - const WrappedIterator& it) noexcept - : it_(it.base()) {} + const WrappedIterator& other) noexcept + : it_(other.base()) {} - constexpr reference operator*() const noexcept { return *it_; } - constexpr pointer operator->() const noexcept { return it_.operator->(); } + [[nodiscard]] constexpr reference operator*() const noexcept { return *it_; } + [[nodiscard]] constexpr pointer operator->() const noexcept { + return it_.operator->(); + } + + template + [[nodiscard]] constexpr bool operator==( + const WrappedIterator& other) + const noexcept { + return it_ == other.base(); + } +#if V8_HAVE_SPACESHIP_OPERATOR + template + [[nodiscard]] constexpr auto operator<=>( + const WrappedIterator& other) + const noexcept { + if constexpr (std::three_way_comparable_with) { + return it_ <=> other.base(); + } else if constexpr (std::totally_ordered_with) { + if (it_ < other.base()) { + return std::strong_ordering::less; + } + return (it_ > other.base()) ? std::strong_ordering::greater + : std::strong_ordering::equal; + } else { + if (it_ < other.base()) { + return std::partial_ordering::less; + } + if (other.base() < it_) { + return std::partial_ordering::greater; + } + return (it_ == other.base()) ? std::partial_ordering::equivalent + : std::partial_ordering::unordered; + } + } +#else + // Assume that if spaceship isn't present, operator rewriting might not be + // either. + template + [[nodiscard]] constexpr bool operator!=( + const WrappedIterator& other) + const noexcept { + return it_ != other.base(); + } + + template + [[nodiscard]] constexpr bool operator<( + const WrappedIterator& other) + const noexcept { + return it_ < other.base(); + } + template + [[nodiscard]] constexpr bool operator<=( + const WrappedIterator& other) + const noexcept { + return it_ <= other.base(); + } + template + [[nodiscard]] constexpr bool operator>( + const WrappedIterator& other) + const noexcept { + return it_ > other.base(); + } + template + [[nodiscard]] constexpr bool operator>=( + const WrappedIterator& other) + const noexcept { + return it_ >= other.base(); + } +#endif constexpr WrappedIterator& operator++() noexcept { ++it_; @@ -1456,112 +1582,55 @@ class WrappedIterator { --(*this); return result; } - constexpr WrappedIterator operator+(difference_type n) const noexcept { + [[nodiscard]] constexpr WrappedIterator operator+( + difference_type n) const noexcept { WrappedIterator result(*this); result += n; return result; } + [[nodiscard]] friend constexpr WrappedIterator operator+( + difference_type n, const WrappedIterator& x) noexcept { + return x + n; + } constexpr WrappedIterator& operator+=(difference_type n) noexcept { it_ += n; return *this; } - constexpr WrappedIterator operator-(difference_type n) const noexcept { - return *this + (-n); + [[nodiscard]] constexpr WrappedIterator operator-( + difference_type n) const noexcept { + return *this + -n; } constexpr WrappedIterator& operator-=(difference_type n) noexcept { - *this += -n; - return *this; + return *this += -n; } - constexpr reference operator[](difference_type n) const noexcept { + template + [[nodiscard]] constexpr auto operator-( + const WrappedIterator& other) + const noexcept { + return it_ - other.base(); + } + [[nodiscard]] constexpr reference operator[]( + difference_type n) const noexcept { return it_[n]; } - constexpr Iterator base() const noexcept { return it_; } - - private: - template - friend class WrappedIterator; + [[nodiscard]] constexpr const Iterator& base() const noexcept { return it_; } private: Iterator it_; }; -template -constexpr bool operator==( - const WrappedIterator& x, - const WrappedIterator& y) noexcept { - return x.base() == y.base(); -} - -template -constexpr bool operator<( - const WrappedIterator& x, - const WrappedIterator& y) noexcept { - return x.base() < y.base(); -} - -template -constexpr bool operator!=( - const WrappedIterator& x, - const WrappedIterator& y) noexcept { - return !(x == y); -} - -template -constexpr bool operator>( - const WrappedIterator& x, - const WrappedIterator& y) noexcept { - return y < x; -} - -template -constexpr bool operator>=( - const WrappedIterator& x, - const WrappedIterator& y) noexcept { - return !(x < y); -} - -template -constexpr bool operator<=( - const WrappedIterator& x, - const WrappedIterator& y) noexcept { - return !(y < x); -} - -template -constexpr auto operator-( - const WrappedIterator& x, - const WrappedIterator& y) noexcept - -> decltype(x.base() - y.base()) { - return x.base() - y.base(); -} - -template -constexpr WrappedIterator operator+( - typename WrappedIterator::difference_type n, - const WrappedIterator& x) noexcept { - x += n; - return x; -} - // Helper functions about values contained in handles. // A value is either an indirect pointer or a direct pointer, depending on // whether direct local support is enabled. class ValueHelper final { public: -#ifdef V8_ENABLE_DIRECT_LOCAL +#ifdef V8_ENABLE_DIRECT_HANDLE static constexpr Address kTaggedNullAddress = 1; static constexpr Address kEmpty = kTaggedNullAddress; #else static constexpr Address kEmpty = kNullAddress; -#endif // V8_ENABLE_DIRECT_LOCAL +#endif // V8_ENABLE_DIRECT_HANDLE template V8_INLINE static bool IsEmpty(T* value) { @@ -1577,7 +1646,7 @@ class ValueHelper final { return handle.template value(); } -#ifdef V8_ENABLE_DIRECT_LOCAL +#ifdef V8_ENABLE_DIRECT_HANDLE template V8_INLINE static Address ValueAsAddress(const T* value) { @@ -1592,7 +1661,7 @@ class ValueHelper final { return *reinterpret_cast(slot); } -#else // !V8_ENABLE_DIRECT_LOCAL +#else // !V8_ENABLE_DIRECT_HANDLE template V8_INLINE static Address ValueAsAddress(const T* value) { @@ -1604,7 +1673,7 @@ class ValueHelper final { return reinterpret_cast(slot); } -#endif // V8_ENABLE_DIRECT_LOCAL +#endif // V8_ENABLE_DIRECT_HANDLE }; /** diff --git a/deps/v8/include/v8-isolate.h b/deps/v8/include/v8-isolate.h index bef9ebbd556..54571391fb8 100644 --- a/deps/v8/include/v8-isolate.h +++ b/deps/v8/include/v8-isolate.h @@ -548,6 +548,7 @@ class V8_EXPORT Isolate { kDocumentAllLegacyCall = 141, kDocumentAllLegacyConstruct = 142, kConsoleContext = 143, + kWasmImportedStringsUtf8 = 144, // If you add new values here, you'll also need to update Chromium's: // web_feature.mojom, use_counter_callback.cc, and enums.xml. V8 changes to @@ -937,6 +938,12 @@ class V8_EXPORT Isolate { */ Local GetIncumbentContext(); + /** + * Returns the host defined options set for currently running script or + * module, if available. + */ + MaybeLocal GetCurrentHostDefinedOptions(); + /** * Schedules a v8::Exception::Error with the given message. * See ThrowException for more details. Templatized to provide compile-time @@ -1740,7 +1747,7 @@ class V8_EXPORT Isolate { friend class PersistentValueMapBase; internal::Address* GetDataFromSnapshotOnce(size_t index); - void ReportExternalAllocationLimitReached(); + void HandleExternalMemoryInterrupt(); }; void Isolate::SetData(uint32_t slot, void* data) { diff --git a/deps/v8/include/v8-local-handle.h b/deps/v8/include/v8-local-handle.h index 98feeeba76d..ef110a083dc 100644 --- a/deps/v8/include/v8-local-handle.h +++ b/deps/v8/include/v8-local-handle.h @@ -150,11 +150,11 @@ class V8_EXPORT V8_NODISCARD HandleScope { /** * A base class for local handles. - * Its implementation depends on whether direct local support is enabled. + * Its implementation depends on whether direct handle support is enabled. * When it is, a local handle contains a direct pointer to the referenced * object, otherwise it contains an indirect pointer. */ -#ifdef V8_ENABLE_DIRECT_LOCAL +#ifdef V8_ENABLE_DIRECT_HANDLE template class LocalBase : public api_internal::DirectHandleBase { @@ -183,7 +183,7 @@ class LocalBase : public api_internal::DirectHandleBase { } }; -#else // !V8_ENABLE_DIRECT_LOCAL +#else // !V8_ENABLE_DIRECT_HANDLE template class LocalBase : public api_internal::IndirectHandleBase { @@ -215,7 +215,7 @@ class LocalBase : public api_internal::IndirectHandleBase { } }; -#endif // V8_ENABLE_DIRECT_LOCAL +#endif // V8_ENABLE_DIRECT_HANDLE /** * An object reference managed by the v8 garbage collector. @@ -400,13 +400,13 @@ class V8_TRIVIAL_ABI Local : public LocalBase, return Local(LocalBase::FromSlot(slot)); } -#ifdef V8_ENABLE_DIRECT_LOCAL +#ifdef V8_ENABLE_DIRECT_HANDLE friend class TypecheckWitness; V8_INLINE static Local FromAddress(internal::Address ptr) { return Local(LocalBase(ptr)); } -#endif // V8_ENABLE_DIRECT_LOCAL +#endif // V8_ENABLE_DIRECT_HANDLE V8_INLINE static Local New(Isolate* isolate, internal::Address value) { return Local(LocalBase::New(isolate, value)); @@ -444,7 +444,7 @@ class V8_TRIVIAL_ABI LocalUnchecked : public Local { : Local(other, Local::do_not_check) {} }; -#ifdef V8_ENABLE_DIRECT_LOCAL +#ifdef V8_ENABLE_DIRECT_HANDLE // Off-stack allocated direct locals must be registered as strong roots. // For off-stack indirect locals, this is not necessary. @@ -471,7 +471,7 @@ class StrongRootAllocator> : public StrongRootAllocatorBase { return deallocate_impl(reinterpret_cast(p), n); } }; -#endif // V8_ENABLE_DIRECT_LOCAL +#endif // V8_ENABLE_DIRECT_HANDLE } // namespace internal template @@ -479,7 +479,7 @@ class LocalVector { private: using element_type = internal::LocalUnchecked; -#ifdef V8_ENABLE_DIRECT_LOCAL +#ifdef V8_ENABLE_DIRECT_HANDLE using allocator_type = internal::StrongRootAllocator; static allocator_type make_allocator(Isolate* isolate) noexcept { @@ -491,7 +491,7 @@ class LocalVector { static allocator_type make_allocator(Isolate* isolate) noexcept { return allocator_type(); } -#endif // V8_ENABLE_DIRECT_LOCAL +#endif // V8_ENABLE_DIRECT_HANDLE using vector_type = std::vector; @@ -715,7 +715,7 @@ class V8_EXPORT V8_NODISCARD EscapableHandleScope V8_INLINE ~EscapableHandleScope() = default; template V8_INLINE Local Escape(Local value) { -#ifdef V8_ENABLE_DIRECT_LOCAL +#ifdef V8_ENABLE_DIRECT_HANDLE return value; #else if (value.IsEmpty()) return value; diff --git a/deps/v8/include/v8-memory-span.h b/deps/v8/include/v8-memory-span.h index a7614cf7987..7556b20fa94 100644 --- a/deps/v8/include/v8-memory-span.h +++ b/deps/v8/include/v8-memory-span.h @@ -13,6 +13,40 @@ #include "v8config.h" // NOLINT(build/include_directory) +// TODO(pkasting): Use /spaceship unconditionally after dropping +// support for old libstdc++ versions. +#if __has_include() +#include +#endif +#if defined(__cpp_lib_three_way_comparison) && \ + __cpp_lib_three_way_comparison >= 201711L +#define V8_HAVE_SPACESHIP_OPERATOR 1 +#else +#define V8_HAVE_SPACESHIP_OPERATOR 0 +#endif + +// TODO(pkasting): Make this block unconditional after dropping support for old +// libstdc++ versions. +#if __has_include() +#include + +namespace v8 { + +template +class V8_EXPORT MemorySpan; + +} // namespace v8 + +// Mark `MemorySpan` as satisfying the `view` and `borrowed_range` concepts. +// This should be done before the definition of `MemorySpan`, so that any +// inlined calls to range functionality use the correct specializations. +template +inline constexpr bool std::ranges::enable_view> = true; +template +inline constexpr bool std::ranges::enable_borrowed_range> = + true; +#endif + namespace v8 { /** @@ -53,13 +87,13 @@ class V8_EXPORT MemorySpan { is_compatible_iterator::value; template - static constexpr U* to_address(U* p) noexcept { + [[nodiscard]] static constexpr U* to_address(U* p) noexcept { return p; } template ().operator->())>> - static constexpr auto to_address(It it) noexcept { + [[nodiscard]] static constexpr auto to_address(It it) noexcept { return it.operator->(); } @@ -108,50 +142,139 @@ class V8_EXPORT MemorySpan { : data_(a.data()), size_{N} {} /** Returns a pointer to the beginning of the buffer. */ - constexpr T* data() const { return data_; } + [[nodiscard]] constexpr T* data() const { return data_; } /** Returns the number of elements that the buffer holds. */ - constexpr size_t size() const { return size_; } + [[nodiscard]] constexpr size_t size() const { return size_; } - constexpr T& operator[](size_t i) const { return data_[i]; } + [[nodiscard]] constexpr T& operator[](size_t i) const { return data_[i]; } /** Returns true if the buffer is empty. */ - constexpr bool empty() const { return size() == 0; } + [[nodiscard]] constexpr bool empty() const { return size() == 0; } class Iterator { public: - using iterator_category = std::forward_iterator_tag; - using value_type = T; using difference_type = std::ptrdiff_t; + using value_type = T; using pointer = value_type*; using reference = value_type&; + using iterator_category = std::random_access_iterator_tag; + // There seems to be no feature-test macro covering this, so use the + // presence of `` as a crude proxy, since it was added to the + // standard as part of the Ranges papers. + // TODO(pkasting): Add this unconditionally after dropping support for old + // libstdc++ versions. +#if __has_include() + using iterator_concept = std::contiguous_iterator_tag; +#endif + + // Required to satisfy `std::semiregular<>`. + constexpr Iterator() = default; + + [[nodiscard]] friend constexpr bool operator==(const Iterator& a, + const Iterator& b) { + // TODO(pkasting): Replace this body with `= default` after dropping + // support for old gcc versions. + return a.ptr_ == b.ptr_; + } +#if V8_HAVE_SPACESHIP_OPERATOR + [[nodiscard]] friend constexpr auto operator<=>(const Iterator&, + const Iterator&) = default; +#else + // Assume that if spaceship isn't present, operator rewriting might not be + // either. + [[nodiscard]] friend constexpr bool operator!=(const Iterator& a, + const Iterator& b) { + return a.ptr_ != b.ptr_; + } - T& operator*() const { return *ptr_; } - T* operator->() const { return ptr_; } - - bool operator==(Iterator other) const { return ptr_ == other.ptr_; } - bool operator!=(Iterator other) const { return !(*this == other); } + [[nodiscard]] friend constexpr bool operator<(const Iterator& a, + const Iterator& b) { + return a.ptr_ < b.ptr_; + } + [[nodiscard]] friend constexpr bool operator<=(const Iterator& a, + const Iterator& b) { + return a.ptr_ <= b.ptr_; + } + [[nodiscard]] friend constexpr bool operator>(const Iterator& a, + const Iterator& b) { + return a.ptr_ > b.ptr_; + } + [[nodiscard]] friend constexpr bool operator>=(const Iterator& a, + const Iterator& b) { + return a.ptr_ >= b.ptr_; + } +#endif - Iterator& operator++() { + constexpr Iterator& operator++() { ++ptr_; return *this; } - Iterator operator++(int) { - Iterator temp(*this); - ++(*this); + constexpr Iterator operator++(int) { + Iterator temp = *this; + ++*this; return temp; } + constexpr Iterator& operator--() { + --ptr_; + return *this; + } + + constexpr Iterator operator--(int) { + Iterator temp = *this; + --*this; + return temp; + } + + constexpr Iterator& operator+=(difference_type rhs) { + ptr_ += rhs; + return this; + } + + [[nodiscard]] friend constexpr Iterator operator+(Iterator lhs, + difference_type rhs) { + lhs += rhs; + return lhs; + } + + [[nodiscard]] friend constexpr Iterator operator+(difference_type lhs, + const Iterator& rhs) { + return rhs + lhs; + } + + constexpr Iterator& operator-=(difference_type rhs) { + ptr_ -= rhs; + return this; + } + + [[nodiscard]] friend constexpr Iterator operator-(Iterator lhs, + difference_type rhs) { + lhs -= rhs; + return lhs; + } + + [[nodiscard]] friend constexpr difference_type operator-( + const Iterator& lhs, const Iterator& rhs) { + return lhs.ptr_ - rhs.ptr_; + } + + [[nodiscard]] constexpr reference operator*() const { return *ptr_; } + [[nodiscard]] constexpr pointer operator->() const { return ptr_; } + [[nodiscard]] constexpr reference operator[](size_t offset) const { + return ptr_[offset]; + } + private: friend class MemorySpan; - explicit Iterator(T* ptr) : ptr_(ptr) {} + constexpr explicit Iterator(T* ptr) : ptr_(ptr) {} T* ptr_ = nullptr; }; - Iterator begin() const { return Iterator(data_); } - Iterator end() const { return Iterator(data_ + size_); } + [[nodiscard]] Iterator begin() const { return Iterator(data_); } + [[nodiscard]] Iterator end() const { return Iterator(data_ + size_); } private: T* data_ = nullptr; @@ -171,25 +294,26 @@ class V8_EXPORT MemorySpan { namespace detail { template -constexpr std::array, N> to_array_lvalue_impl( +[[nodiscard]] constexpr std::array, N> to_array_lvalue_impl( T (&a)[N], std::index_sequence) { return {{a[I]...}}; } template -constexpr std::array, N> to_array_rvalue_impl( +[[nodiscard]] constexpr std::array, N> to_array_rvalue_impl( T (&&a)[N], std::index_sequence) { return {{std::move(a[I])...}}; } } // namespace detail template -constexpr std::array, N> to_array(T (&a)[N]) { +[[nodiscard]] constexpr std::array, N> to_array(T (&a)[N]) { return detail::to_array_lvalue_impl(a, std::make_index_sequence{}); } template -constexpr std::array, N> to_array(T (&&a)[N]) { +[[nodiscard]] constexpr std::array, N> to_array( + T (&&a)[N]) { return detail::to_array_rvalue_impl(std::move(a), std::make_index_sequence{}); } diff --git a/deps/v8/include/v8-object.h b/deps/v8/include/v8-object.h index d03b33acd7c..71a6c2c9c14 100644 --- a/deps/v8/include/v8-object.h +++ b/deps/v8/include/v8-object.h @@ -690,14 +690,17 @@ class V8_EXPORT Object : public Value { int GetIdentityHash(); /** - * Clone this object with a fast but shallow copy. Values will point - * to the same values as the original object. + * Clone this object with a fast but shallow copy. Values will point to the + * same values as the original object. + * + * Prefer using version with Isolate parameter. */ - // TODO(dcarney): take an isolate and optionally bail out? + Local Clone(v8::Isolate* isolate); Local Clone(); /** * Returns the context in which the object was created. + * * Prefer using version with Isolate parameter. */ MaybeLocal GetCreationContext(v8::Isolate* isolate); @@ -705,6 +708,7 @@ class V8_EXPORT Object : public Value { /** * Shortcut for GetCreationContext(...).ToLocalChecked(). + * * Prefer using version with Isolate parameter. **/ Local GetCreationContextChecked(v8::Isolate* isolate); diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 56bfd727482..a3a939729c9 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -14,7 +14,7 @@ #include #include "v8-source-location.h" // NOLINT(build/include_directory) -#include "v8config.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { @@ -79,9 +79,8 @@ class TaskRunner { * * Embedders should override PostTaskImpl instead of this. */ - void PostTask( - std::unique_ptr task, - const SourceLocation& location = SourceLocation::Current()) { + void PostTask(std::unique_ptr task, + const SourceLocation& location = SourceLocation::Current()) { PostTaskImpl(std::move(task), location); } @@ -553,6 +552,19 @@ class PageAllocator { */ virtual bool DecommitPages(void* address, size_t size) = 0; + /** + * Block any modifications to the given mapping such as changing permissions + * or unmapping the pages on supported platforms. + * The address space reservation will exist until the process ends, but it's + * possible to release the memory using DiscardSystemPages. Note that this + * might require write permissions to the page as e.g. on Linux, mseal will + * block discarding sealed anonymous memory. + */ + virtual bool SealPages(void* address, size_t length) { + // TODO(360048056): make it pure once it's implemented on Chromium side. + return false; + } + /** * INTERNAL ONLY: This interface has not been stabilised and may change * without notice from one release to another without being deprecated first. @@ -1027,18 +1039,6 @@ class VirtualAddressSpace { const PagePermissions max_page_permissions_; }; -/** - * V8 Allocator used for allocating zone backings. - */ -class ZoneBackingAllocator { - public: - using MallocFn = void* (*)(size_t); - using FreeFn = void (*)(void*); - - virtual MallocFn GetMallocFn() const { return ::malloc; } - virtual FreeFn GetFreeFn() const { return ::free; } -}; - /** * Observer used by V8 to notify the embedder about entering/leaving sections * with high throughput of malloc/free operations. @@ -1075,14 +1075,6 @@ class Platform { return nullptr; } - /** - * Allows the embedder to specify a custom allocator used for zones. - */ - virtual ZoneBackingAllocator* GetZoneBackingAllocator() { - static ZoneBackingAllocator default_allocator; - return &default_allocator; - } - /** * Enables the embedder to respond in cases where V8 can't allocate large * blocks of memory. V8 retries the failed allocation once after calling this @@ -1106,11 +1098,8 @@ class Platform { * Returns a TaskRunner which can be used to post a task on the foreground. * The TaskRunner's NonNestableTasksEnabled() must be true. This function * should only be called from a foreground thread. - * TODO(chromium:1448758): Deprecate once |GetForegroundTaskRunner(Isolate*, - * TaskPriority)| is ready. */ - virtual std::shared_ptr GetForegroundTaskRunner( - Isolate* isolate) { + std::shared_ptr GetForegroundTaskRunner(Isolate* isolate) { return GetForegroundTaskRunner(isolate, TaskPriority::kUserBlocking); } @@ -1118,12 +1107,9 @@ class Platform { * Returns a TaskRunner with a specific |priority| which can be used to post a * task on the foreground thread. The TaskRunner's NonNestableTasksEnabled() * must be true. This function should only be called from a foreground thread. - * TODO(chromium:1448758): Make pure virtual once embedders implement it. */ virtual std::shared_ptr GetForegroundTaskRunner( - Isolate* isolate, TaskPriority priority) { - return nullptr; - } + Isolate* isolate, TaskPriority priority) = 0; /** * Schedules a task to be invoked on a worker thread. diff --git a/deps/v8/include/v8-primitive.h b/deps/v8/include/v8-primitive.h index 1adb9cbcb22..426bb379099 100644 --- a/deps/v8/include/v8-primitive.h +++ b/deps/v8/include/v8-primitive.h @@ -388,6 +388,8 @@ class V8_EXPORT String : public Name { * regardless of the encoding, otherwise return NULL. The encoding of the * string is returned in encoding_out. */ + V8_INLINE ExternalStringResourceBase* GetExternalStringResourceBase( + v8::Isolate* isolate, Encoding* encoding_out) const; V8_INLINE ExternalStringResourceBase* GetExternalStringResourceBase( Encoding* encoding_out) const; @@ -878,6 +880,28 @@ String::ExternalStringResource* String::GetExternalStringResource() const { return result; } +String::ExternalStringResourceBase* String::GetExternalStringResourceBase( + v8::Isolate* isolate, String::Encoding* encoding_out) const { + using A = internal::Address; + using I = internal::Internals; + A obj = internal::ValueHelper::ValueAsAddress(this); + int type = I::GetInstanceType(obj) & I::kStringRepresentationAndEncodingMask; + *encoding_out = static_cast(type & I::kStringEncodingMask); + ExternalStringResourceBase* resource; + if (type == I::kExternalOneByteRepresentationTag || + type == I::kExternalTwoByteRepresentationTag) { + A value = I::ReadExternalPointerField( + isolate, obj, I::kStringResourceOffset); + resource = reinterpret_cast(value); + } else { + resource = GetExternalStringResourceBaseSlow(encoding_out); + } +#ifdef V8_ENABLE_CHECKS + VerifyExternalStringResourceBase(resource, *encoding_out); +#endif + return resource; +} + String::ExternalStringResourceBase* String::GetExternalStringResourceBase( String::Encoding* encoding_out) const { using A = internal::Address; diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 3451da26ba2..d6741aec760 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -1109,6 +1109,12 @@ class V8_EXPORT HeapProfiler { ObjectNameResolver* global_object_name_resolver = nullptr, bool hide_internals = true, bool capture_numeric_value = false); + /** + * Obtains list of Detached JS Wrapper Objects. This functon calls garbage + * collection, then iterates over traced handles in the isolate + */ + std::vector> GetDetachedJSWrapperObjects(); + /** * Starts tracking of heap objects population statistics. After calling * this method, all heap objects relocations done by the garbage collector diff --git a/deps/v8/include/v8-script.h b/deps/v8/include/v8-script.h index f4c7412c5bf..0c81aae0118 100644 --- a/deps/v8/include/v8-script.h +++ b/deps/v8/include/v8-script.h @@ -129,6 +129,11 @@ class V8_EXPORT ModuleRequest : public Data { */ Local GetSpecifier() const; + /** + * Returns the module import phase for this ModuleRequest. + */ + ModuleImportPhase GetPhase() const; + /** * Returns the source code offset of this module request. * Use Module::SourceOffsetToLocation to convert this to line/column numbers. @@ -210,7 +215,10 @@ class V8_EXPORT Module : public Data { using ResolveModuleCallback = MaybeLocal (*)( Local context, Local specifier, - Local import_assertions, Local referrer); + Local import_attributes, Local referrer); + using ResolveSourceCallback = MaybeLocal (*)( + Local context, Local specifier, + Local import_attributes, Local referrer); /** * Instantiates the module and its dependencies. @@ -220,7 +228,8 @@ class V8_EXPORT Module : public Data { * exception is propagated.) */ V8_WARN_UNUSED_RESULT Maybe InstantiateModule( - Local context, ResolveModuleCallback callback); + Local context, ResolveModuleCallback module_callback, + ResolveSourceCallback source_callback = nullptr); /** * Evaluates the module and its dependencies. @@ -264,6 +273,13 @@ class V8_EXPORT Module : public Data { */ bool IsGraphAsync() const; + /** + * Returns whether this module is individually asynchronous (for example, + * if it's a Source Text Module Record containing a top-level await). + * See [[HasTLA]] in https://tc39.es/ecma262/#sec-cyclic-module-records + */ + bool HasTopLevelAwait() const; + /** * Returns whether the module is a SourceTextModule. */ diff --git a/deps/v8/include/v8-template.h b/deps/v8/include/v8-template.h index ba5ff7bff5a..93b94285726 100644 --- a/deps/v8/include/v8-template.h +++ b/deps/v8/include/v8-template.h @@ -9,6 +9,7 @@ #include #include "v8-data.h" // NOLINT(build/include_directory) +#include "v8-exception.h" // NOLINT(build/include_directory) #include "v8-function-callback.h" // NOLINT(build/include_directory) #include "v8-local-handle.h" // NOLINT(build/include_directory) #include "v8-memory-span.h" // NOLINT(build/include_directory) @@ -71,8 +72,6 @@ class V8_EXPORT Template : public Data { * \param name The name of the property for which an accessor is added. * \param getter The callback to invoke when getting the property. * \param setter The callback to invoke when setting the property. - * \param data A piece of data that will be passed to the getter and setter - * callbacks whenever they are invoked. * \param attribute The attributes of the property for which an accessor * is added. */ @@ -657,6 +656,18 @@ class V8_EXPORT FunctionTemplate : public Template { */ void SetClassName(Local name); + /** + * Set the interface name of the FunctionTemplate. This is provided as + * contextual information in an ExceptionPropagationMessage to the embedder. + */ + void SetInterfaceName(Local name); + + /** + * Provides information on the type of FunctionTemplate for embedder + * exception handling. + */ + void SetExceptionContext(ExceptionContext context); + /** * When set to true, no access check will be performed on the receiver of a * function call. Currently defaults to true, but this is subject to change. diff --git a/deps/v8/include/v8-traced-handle.h b/deps/v8/include/v8-traced-handle.h index 04752c4f2ae..28fe6cf5ae3 100644 --- a/deps/v8/include/v8-traced-handle.h +++ b/deps/v8/include/v8-traced-handle.h @@ -37,15 +37,13 @@ enum class TracedReferenceHandling { kDroppable }; -V8_EXPORT internal::Address* GlobalizeTracedReference( - internal::Isolate* isolate, internal::Address value, - internal::Address* slot, TracedReferenceStoreMode store_mode, - internal::TracedReferenceHandling reference_handling); -V8_EXPORT void MoveTracedReference(internal::Address** from, - internal::Address** to); -V8_EXPORT void CopyTracedReference(const internal::Address* const* from, - internal::Address** to); -V8_EXPORT void DisposeTracedReference(internal::Address* global_handle); +V8_EXPORT Address* GlobalizeTracedReference( + Isolate* isolate, Address value, Address* slot, + TracedReferenceStoreMode store_mode, + TracedReferenceHandling reference_handling); +V8_EXPORT void MoveTracedReference(Address** from, Address** to); +V8_EXPORT void CopyTracedReference(const Address* const* from, Address** to); +V8_EXPORT void DisposeTracedReference(Address* global_handle); } // namespace internal @@ -55,6 +53,9 @@ V8_EXPORT void DisposeTracedReference(internal::Address* global_handle); */ class TracedReferenceBase : public api_internal::IndirectHandleBase { public: + static_assert(sizeof(std::atomic) == + sizeof(internal::Address*)); + /** * If non-empty, destroy the underlying storage cell. |IsEmpty| will return * true after this call. @@ -73,9 +74,7 @@ class TracedReferenceBase : public api_internal::IndirectHandleBase { * Returns true if this TracedReference is empty, i.e., has not been * assigned an object. This version of IsEmpty is thread-safe. */ - bool IsEmptyThreadSafe() const { - return this->GetSlotThreadSafe() == nullptr; - } + bool IsEmptyThreadSafe() const { return GetSlotThreadSafe() == nullptr; } protected: V8_INLINE TracedReferenceBase() = default; @@ -83,17 +82,17 @@ class TracedReferenceBase : public api_internal::IndirectHandleBase { /** * Update this reference in a thread-safe way. */ - void SetSlotThreadSafe(void* new_val) { - reinterpret_cast*>(&slot())->store( + void SetSlotThreadSafe(internal::Address* new_val) { + reinterpret_cast*>(&slot())->store( new_val, std::memory_order_relaxed); } /** * Get this reference in a thread-safe way */ - const void* GetSlotThreadSafe() const { - return reinterpret_cast const*>(&slot())->load( - std::memory_order_relaxed); + const internal::Address* GetSlotThreadSafe() const { + return reinterpret_cast*>(&slot()) + ->load(std::memory_order_relaxed); } V8_EXPORT void CheckValue() const; diff --git a/deps/v8/include/v8-unwinder-state.h b/deps/v8/include/v8-unwinder-state.h index 18bb410d2b1..084692f3a4d 100644 --- a/deps/v8/include/v8-unwinder-state.h +++ b/deps/v8/include/v8-unwinder-state.h @@ -18,9 +18,8 @@ struct CalleeSavedRegisters { void* arm_r10; }; #elif V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM64 || \ - V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64 || \ - V8_TARGET_ARCH_RISCV64 || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_LOONG64 || \ - V8_TARGET_ARCH_RISCV32 + V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || V8_TARGET_ARCH_RISCV64 || \ + V8_TARGET_ARCH_S390X || V8_TARGET_ARCH_LOONG64 || V8_TARGET_ARCH_RISCV32 struct CalleeSavedRegisters {}; #else #error Target architecture was not detected as supported by v8 diff --git a/deps/v8/include/v8-util.h b/deps/v8/include/v8-util.h index b7d53f14f75..05ade0a3dd5 100644 --- a/deps/v8/include/v8-util.h +++ b/deps/v8/include/v8-util.h @@ -182,7 +182,7 @@ class PersistentValueMapBase { */ Local Get(const K& key) { V* p = FromVal(Traits::Get(&impl_, key)); -#ifdef V8_ENABLE_DIRECT_LOCAL +#ifdef V8_ENABLE_DIRECT_HANDLE if (p == nullptr) return Local(); #endif return Local::New(isolate_, p); diff --git a/deps/v8/include/v8-value.h b/deps/v8/include/v8-value.h index ac04525d86d..656b5719eff 100644 --- a/deps/v8/include/v8-value.h +++ b/deps/v8/include/v8-value.h @@ -635,8 +635,9 @@ bool Value::QuickIsString() const { A obj = internal::ValueHelper::ValueAsAddress(this); if (!I::HasHeapObjectTag(obj)) return false; #if V8_STATIC_ROOTS_BOOL && !V8_MAP_PACKING - return I::CheckInstanceMapRange(obj, I::StaticReadOnlyRoot::kFirstStringMap, - I::StaticReadOnlyRoot::kLastStringMap); + return I::CheckInstanceMapRange(obj, + I::StaticReadOnlyRoot::kStringMapLowerBound, + I::StaticReadOnlyRoot::kStringMapUpperBound); #else return (I::GetInstanceType(obj) < I::kFirstNonstringType); #endif // V8_STATIC_ROOTS_BOOL diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index ac33d3075e4..50f092dfde3 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -8,10 +8,10 @@ // These macros define the version number for the current version. // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. -#define V8_MAJOR_VERSION 12 -#define V8_MINOR_VERSION 8 -#define V8_BUILD_NUMBER 374 -#define V8_PATCH_LEVEL 33 +#define V8_MAJOR_VERSION 13 +#define V8_MINOR_VERSION 1 +#define V8_BUILD_NUMBER 24 +#define V8_PATCH_LEVEL 0 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/include/v8config.h b/deps/v8/include/v8config.h index 86b41a5b3cf..6bd24e71bc1 100644 --- a/deps/v8/include/v8config.h +++ b/deps/v8/include/v8config.h @@ -392,8 +392,14 @@ path. Add it with -I to the command line # define V8_HAS_ATTRIBUTE_WEAK (__has_attribute(weak)) # define V8_HAS_CPP_ATTRIBUTE_NODISCARD (V8_HAS_CPP_ATTRIBUTE(nodiscard)) +#if defined(V8_CC_MSVC) +# define V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS \ + (V8_HAS_CPP_ATTRIBUTE(msvc::no_unique_address) || \ + V8_HAS_CPP_ATTRIBUTE(no_unique_address)) +#else # define V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS \ (V8_HAS_CPP_ATTRIBUTE(no_unique_address)) +#endif # define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow)) # define V8_HAS_BUILTIN_ASSUME (__has_builtin(__builtin_assume)) @@ -692,7 +698,15 @@ path. Add it with -I to the command line // [[no_unique_address]] comes in C++20 but supported in clang with // -std >= c++11. #if V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS +#if defined(V8_CC_MSVC) && V8_HAS_CPP_ATTRIBUTE(msvc::no_unique_address) +// Unfortunately MSVC ignores [[no_unique_address]] (see +// https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/#msvc-extensions-and-abi), +// and clang-cl matches it for ABI compatibility reasons. We need to prefer +// [[msvc::no_unique_address]] when available if we actually want any effect. +#define V8_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]] +#else #define V8_NO_UNIQUE_ADDRESS [[no_unique_address]] +#endif #else #define V8_NO_UNIQUE_ADDRESS /* NOT SUPPORTED */ #endif @@ -815,16 +829,9 @@ V8 shared library set USING_V8_SHARED. #elif defined(__PPC64__) || defined(_ARCH_PPC64) #define V8_HOST_ARCH_PPC64 1 #define V8_HOST_ARCH_64_BIT 1 -#elif defined(__PPC__) || defined(_ARCH_PPC) -#define V8_HOST_ARCH_PPC 1 -#define V8_HOST_ARCH_32_BIT 1 -#elif defined(__s390__) || defined(__s390x__) -#define V8_HOST_ARCH_S390 1 -#if defined(__s390x__) +#elif defined(__s390x__) +#define V8_HOST_ARCH_S390X 1 #define V8_HOST_ARCH_64_BIT 1 -#else -#define V8_HOST_ARCH_32_BIT 1 -#endif #elif defined(__riscv) || defined(__riscv__) #if __riscv_xlen == 64 #define V8_HOST_ARCH_RISCV64 1 @@ -844,10 +851,10 @@ V8 shared library set USING_V8_SHARED. // The macros may be set externally. If not, detect in the same way as the host // architecture, that is, target the native environment as presented by the // compiler. -#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && \ - !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_PPC && \ - !V8_TARGET_ARCH_PPC64 && !V8_TARGET_ARCH_S390 && \ - !V8_TARGET_ARCH_RISCV64 && !V8_TARGET_ARCH_LOONG64 && \ +#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && \ + !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS64 && \ + !V8_TARGET_ARCH_PPC64 && !V8_TARGET_ARCH_S390X && \ + !V8_TARGET_ARCH_RISCV64 && !V8_TARGET_ARCH_LOONG64 && \ !V8_TARGET_ARCH_RISCV32 #if defined(_M_X64) || defined(__x86_64__) #define V8_TARGET_ARCH_X64 1 @@ -863,13 +870,8 @@ V8 shared library set USING_V8_SHARED. #define V8_TARGET_ARCH_LOONG64 1 #elif defined(_ARCH_PPC64) #define V8_TARGET_ARCH_PPC64 1 -#elif defined(_ARCH_PPC) -#define V8_TARGET_ARCH_PPC 1 -#elif defined(__s390__) -#define V8_TARGET_ARCH_S390 1 -#if defined(__s390x__) +#elif defined(__s390x__) #define V8_TARGET_ARCH_S390X 1 -#endif #elif defined(__riscv) || defined(__riscv__) #if __riscv_xlen == 64 #define V8_TARGET_ARCH_RISCV64 1 @@ -902,16 +904,10 @@ V8 shared library set USING_V8_SHARED. #define V8_TARGET_ARCH_64_BIT 1 #elif V8_TARGET_ARCH_LOONG64 #define V8_TARGET_ARCH_64_BIT 1 -#elif V8_TARGET_ARCH_PPC -#define V8_TARGET_ARCH_32_BIT 1 #elif V8_TARGET_ARCH_PPC64 #define V8_TARGET_ARCH_64_BIT 1 -#elif V8_TARGET_ARCH_S390 -#if V8_TARGET_ARCH_S390X +#elif V8_TARGET_ARCH_S390X #define V8_TARGET_ARCH_64_BIT 1 -#else -#define V8_TARGET_ARCH_32_BIT 1 -#endif #elif V8_TARGET_ARCH_RISCV64 #define V8_TARGET_ARCH_64_BIT 1 #elif V8_TARGET_ARCH_RISCV32 @@ -968,14 +964,14 @@ V8 shared library set USING_V8_SHARED. #else #define V8_TARGET_LITTLE_ENDIAN 1 #endif -#elif defined(__BIG_ENDIAN__) // FOR PPCGR on AIX +#elif V8_TARGET_ARCH_PPC64 +#if V8_OS_AIX #define V8_TARGET_BIG_ENDIAN 1 -#elif V8_TARGET_ARCH_PPC_LE +#else #define V8_TARGET_LITTLE_ENDIAN 1 -#elif V8_TARGET_ARCH_PPC_BE -#define V8_TARGET_BIG_ENDIAN 1 -#elif V8_TARGET_ARCH_S390 -#if V8_TARGET_ARCH_S390_LE_SIM +#endif +#elif V8_TARGET_ARCH_S390X +#if V8_TARGET_ARCH_S390X_LE_SIM #define V8_TARGET_LITTLE_ENDIAN 1 #else #define V8_TARGET_BIG_ENDIAN 1 @@ -999,5 +995,10 @@ V8 shared library set USING_V8_SHARED. #else #define V8_STATIC_ROOTS_BOOL true #endif +#ifdef V8_TARGET_BIG_ENDIAN +#define V8_TARGET_BIG_ENDIAN_BOOL true +#else +#define V8_TARGET_BIG_ENDIAN_BOOL false +#endif #endif // V8CONFIG_H_ diff --git a/deps/v8/infra/mb/gn_isolate_map.pyl b/deps/v8/infra/mb/gn_isolate_map.pyl index 40df0f013f7..924bba4adff 100644 --- a/deps/v8/infra/mb/gn_isolate_map.pyl +++ b/deps/v8/infra/mb/gn_isolate_map.pyl @@ -71,6 +71,10 @@ "label": "//test:v8_run_num_fuzzer", "type": "script", }, + "snapshot_set": { + "label": "//:snapshot_set", + "type": "script", + }, "test262": { "label": "//test/test262:v8_test262", "type": "script", diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index 838e65812fa..ce26b4df0a1 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -70,6 +70,7 @@ 'V8 Linux64 - builder (reclient compare)': 'release_x64_reclient', 'V8 Linux64 - official - builder': 'official_x64_on_release_branch', 'V8 Linux64 - debug builder': 'debug_x64', + 'V8 Linux64 - no leaptiering - debug builder': 'debug_x64_no_leaptiering', 'V8 Linux64 - no shared cage - debug builder': 'debug_x64_no_shared_cage', 'V8 Linux64 - external code space - debug - builder': 'debug_x64_external_code_space', 'V8 Linux64 - custom snapshot - debug builder': 'debug_x64_custom', @@ -154,43 +155,43 @@ 'V8 Centipede Linux64 ASAN - release builder': 'release_x64_asan_centipede', 'V8 Clusterfuzz Win64 ASAN - release builder': - 'release_x64_asan_no_lsan_verify_heap', + 'release_x64_asan_no_lsan_verify_heap_turboshaft_csa', # Note this is called a debug builder, but it uses a release build # configuration with dchecks (which enables DEBUG in V8), since win-asan # debug is not supported. 'V8 Clusterfuzz Win64 ASAN - debug builder': - 'release_x64_asan_no_lsan_verify_heap_dchecks', + 'release_x64_asan_no_lsan_verify_heap_dchecks_turboshaft_csa', 'V8 Clusterfuzz Mac64 ASAN - release builder': - 'release_x64_asan_no_lsan_verify_heap', + 'release_x64_asan_no_lsan_verify_heap_turboshaft_csa', 'V8 Clusterfuzz Mac64 ASAN - debug builder': - 'debug_x64_asan_no_lsan_static', + 'debug_x64_asan_no_lsan_static_turboshaft_csa', 'V8 Clusterfuzz Linux64 - release builder': - 'release_x64_correctness_fuzzer', - 'V8 Clusterfuzz Linux64 - debug builder': 'debug_x64', + 'release_x64_correctness_fuzzer_turboshaft_csa', + 'V8 Clusterfuzz Linux64 - debug builder': 'debug_x64_turboshaft_csa', 'V8 Clusterfuzz Linux64 ASAN no inline - release builder': - 'release_x64_asan_symbolized_verify_heap', + 'release_x64_asan_symbolized_verify_heap_turboshaft_csa', 'V8 Clusterfuzz Linux ASAN no inline - release builder': - 'release_x86_asan_symbolized_verify_heap', - 'V8 Clusterfuzz Linux64 ASAN - debug builder': 'debug_x64_asan', - 'V8 Clusterfuzz Linux ASAN - debug builder': 'debug_x86_asan', + 'release_x86_asan_symbolized_verify_heap_turboshaft_csa', + 'V8 Clusterfuzz Linux64 ASAN - debug builder': 'debug_x64_asan_turboshaft_csa', + 'V8 Clusterfuzz Linux ASAN - debug builder': 'debug_x86_asan_turboshaft_csa', 'V8 Clusterfuzz Linux64 ASAN arm64 - debug builder': - 'debug_simulate_arm64_asan', - 'V8 Clusterfuzz Linux - debug builder': 'debug_x86', + 'debug_simulate_arm64_asan_turboshaft_csa', + 'V8 Clusterfuzz Linux - debug builder': 'debug_x86_turboshaft_csa', 'V8 Clusterfuzz Linux ASAN arm - debug builder': - 'debug_simulate_arm_asan', + 'debug_simulate_arm_asan_turboshaft_csa', 'V8 Clusterfuzz Linux64 CFI - release builder': - 'release_x64_cfi_clusterfuzz', + 'release_x64_cfi_clusterfuzz_turboshaft_csa', 'V8 Clusterfuzz Linux MSAN no origins': - 'release_simulate_arm64_msan_no_origins', + 'release_simulate_arm64_msan_no_origins_turboshaft_csa', 'V8 Clusterfuzz Linux MSAN chained origins': - 'release_simulate_arm64_msan', - 'V8 Clusterfuzz Linux64 TSAN - release builder': 'release_x64_tsan', + 'release_simulate_arm64_msan_turboshaft_csa', + 'V8 Clusterfuzz Linux64 TSAN - release builder': 'release_x64_tsan_turboshaft_csa', 'V8 Clusterfuzz Linux64 UBSan - release builder': - 'release_x64_ubsan_recover', + 'release_x64_ubsan_recover_turboshaft_csa', 'V8 Clusterfuzz Linux64 sandbox testing - release builder': - 'release_x64_sandbox_testing', + 'release_x64_sandbox_testing_turboshaft_csa', 'V8 Clusterfuzz Linux64 ASAN sandbox testing - release builder': - 'release_x64_asan_sandbox_testing', + 'release_x64_asan_sandbox_testing_turboshaft_csa', }, 'client.v8.perf' : { # Arm @@ -273,6 +274,7 @@ 'v8_linux64_asan_centipede_compile_rel': 'release_x64_asan_centipede', 'v8_linux64_cppgc_non_default_compile_dbg': 'debug_x64_non_default_cppgc', 'v8_linux64_compile_dbg': 'debug_x64_trybot', + 'v8_linux64_no_leaptiering_compile_dbg': 'debug_x64_no_leaptiering', 'v8_linux64_no_shared_cage_compile_dbg': 'debug_x64_no_shared_cage', 'v8_linux64_coverage_dbg': 'debug_x64_coverage', 'v8_linux64_coverage_rel': 'release_x64_coverage', @@ -305,8 +307,8 @@ 'v8_linux64_arm64_no_wasm_compile_dbg': 'debug_arm64_webassembly_disabled', 'v8_linux64_verify_csa_compile_rel': 'release_x64_verify_csa', 'v8_linux64_asan_compile_rel': 'release_x64_asan_minimal_symbols', - 'v8_linux64_sandbox_testing_compile_rel': 'release_x64_sandbox_testing', - 'v8_linux64_asan_sandbox_testing_compile_rel': 'release_x64_asan_sandbox_testing', + 'v8_linux64_sandbox_testing_compile_rel': 'release_x64_sandbox_testing_turboshaft_csa', + 'v8_linux64_asan_sandbox_testing_compile_rel': 'release_x64_asan_sandbox_testing_turboshaft_csa', 'v8_linux64_cfi_compile_rel': 'release_x64_cfi', 'v8_linux64_fuzzilli_compile_rel': 'release_x64_fuzzilli', 'v8_linux64_loong64_compile_rel': 'release_simulate_loong64', @@ -454,14 +456,15 @@ # Debug configs for simulators. 'debug_simulate_arm': [ 'debug_bot', 'simulate_arm'], - 'debug_simulate_arm_asan': [ - 'debug_bot', 'simulate_arm', 'asan'], + 'debug_simulate_arm_asan_turboshaft_csa': [ + 'debug_bot', 'simulate_arm', 'asan', 'v8_enable_turboshaft_csa'], 'debug_simulate_arm_lite': [ 'debug_bot', 'simulate_arm', 'v8_enable_lite_mode'], 'debug_simulate_arm64': [ 'debug_bot', 'simulate_arm64'], - 'debug_simulate_arm64_asan': [ - 'debug_bot', 'simulate_arm64', 'asan', 'lsan'], + 'debug_simulate_arm64_asan_turboshaft_csa': [ + 'debug_bot', 'simulate_arm64', 'asan', 'lsan', + 'v8_enable_turboshaft_csa'], # Release configs for simulators. 'release_simulate_arm_gcmole': [ @@ -487,10 +490,11 @@ 'release_bot', 'simulate_arm64', 'msan'], 'release_simulate_arm64_msan_minimal_symbols': [ 'release_bot', 'simulate_arm64', 'msan', 'minimal_symbols'], - 'release_simulate_arm64_msan': [ - 'release_bot', 'simulate_arm64', 'msan'], - 'release_simulate_arm64_msan_no_origins': [ - 'release_bot', 'simulate_arm64', 'msan_no_origins'], + 'release_simulate_arm64_msan_no_origins_turboshaft_csa': [ + 'release_bot', 'simulate_arm64', 'msan_no_origins', + 'v8_enable_turboshaft_csa'], + 'release_simulate_arm64_msan_turboshaft_csa': [ + 'release_bot', 'simulate_arm64', 'msan', 'v8_enable_turboshaft_csa'], 'release_simulate_loong64': [ 'release_bot', 'simulate_loong64'], 'release_simulate_mips64el': [ @@ -582,25 +586,25 @@ 'release_bot', 'x64', 'asan', 'lsan', 'minimal_symbols'], 'release_x64_asan_no_lsan': [ 'release_bot', 'x64', 'asan'], - 'release_x64_asan_no_lsan_verify_heap': [ - 'release_bot', 'x64', 'asan', 'v8_verify_heap'], - 'release_x64_asan_no_lsan_verify_heap': [ - 'release_bot', 'x64', 'asan', 'v8_verify_heap'], - 'release_x64_asan_no_lsan_verify_heap_dchecks': [ + 'release_x64_asan_no_lsan_verify_heap_turboshaft_csa': [ + 'release_bot', 'x64', 'asan', 'v8_verify_heap', + 'v8_enable_turboshaft_csa'], + 'release_x64_asan_no_lsan_verify_heap_dchecks_turboshaft_csa': [ 'release_bot', 'x64', 'asan', 'dcheck_always_on', - 'v8_enable_slow_dchecks', 'v8_verify_heap'], - 'release_x64_sandbox_testing': [ - 'release_bot', 'x64', 'symbolized', 'v8_enable_memory_corruption_api'], - 'release_x64_asan_sandbox_testing': [ + 'v8_enable_slow_dchecks', 'v8_verify_heap', 'v8_enable_turboshaft_csa'], + 'release_x64_sandbox_testing_turboshaft_csa': [ + 'release_bot', 'x64', 'symbolized', 'v8_enable_memory_corruption_api', + 'v8_enable_turboshaft_csa'], + 'release_x64_asan_sandbox_testing_turboshaft_csa': [ 'release_bot', 'x64', 'asan', 'symbolized', - 'v8_enable_memory_corruption_api'], - 'release_x64_asan_symbolized_verify_heap': [ + 'v8_enable_memory_corruption_api', 'v8_enable_turboshaft_csa'], + 'release_x64_asan_symbolized_verify_heap_turboshaft_csa': [ 'release_bot', 'x64', 'asan', 'lsan', 'symbolized', - 'v8_verify_heap'], + 'v8_verify_heap', 'v8_enable_turboshaft_csa'], 'release_x64_cfi': [ 'release_bot', 'x64', 'cfi'], - 'release_x64_cfi_clusterfuzz': [ - 'release_bot', 'x64', 'cfi_clusterfuzz'], + 'release_x64_cfi_clusterfuzz_turboshaft_csa': [ + 'release_bot', 'x64', 'cfi_clusterfuzz', 'v8_enable_turboshaft_csa'], 'release_x64_coverage': [ 'release_bot', 'x64', 'clang_coverage'], 'release_x64_fuzzilli': [ @@ -610,8 +614,9 @@ 'release_bot', 'x64', 'gcmole'], 'release_x64_msvc': [ 'release_bot_no_reclient', 'x64', 'minimal_symbols', 'msvc'], - 'release_x64_correctness_fuzzer' : [ - 'release_bot', 'x64', 'v8_correctness_fuzzer'], + 'release_x64_correctness_fuzzer_turboshaft_csa' : [ + 'release_bot', 'x64', 'v8_correctness_fuzzer', + 'v8_enable_turboshaft_csa'], 'release_x64_disable_runtime_call_stats': [ 'release_bot', 'x64', 'v8_disable_runtime_call_stats'], 'release_x64_fuchsia': [ @@ -647,12 +652,14 @@ 'release_bot', 'x64', 'tsan', 'disable_concurrent_marking'], 'release_x64_tsan_minimal_symbols': [ 'release_bot', 'x64', 'tsan', 'minimal_symbols'], + 'release_x64_tsan_turboshaft_csa': [ + 'release_bot', 'x64', 'tsan', 'v8_enable_turboshaft_csa'], 'release_x64_ubsan': [ 'release_bot', 'x64', 'ubsan'], 'release_x64_ubsan_minimal_symbols': [ 'release_bot', 'x64', 'ubsan', 'minimal_symbols'], - 'release_x64_ubsan_recover': [ - 'release_bot', 'x64', 'ubsan_recover'], + 'release_x64_ubsan_recover_turboshaft_csa': [ + 'release_bot', 'x64', 'ubsan_recover', 'v8_enable_turboshaft_csa'], 'release_x64_shared_verify_heap': [ 'release_bot', 'x64', 'shared', 'v8_verify_heap'], 'release_x64_verify_builtins': [ @@ -678,13 +685,13 @@ # Debug configs for x64. 'debug_x64': [ 'debug_bot', 'x64'], - 'debug_x64_asan': [ - 'debug_bot', 'x64', 'asan', 'lsan'], + 'debug_x64_asan_turboshaft_csa': [ + 'debug_bot', 'x64', 'asan', 'lsan', 'v8_enable_turboshaft_csa'], 'debug_x64_asan_centipede': [ 'debug_bot', 'x64', 'asan', 'use_centipede'], - 'debug_x64_asan_no_lsan_static': [ - 'debug', 'static', 'reclient', 'v8_enable_slow_dchecks', 'v8_optimized_debug', - 'x64', 'asan'], + 'debug_x64_asan_no_lsan_static_turboshaft_csa': [ + 'debug', 'static', 'reclient', 'v8_enable_slow_dchecks', + 'v8_optimized_debug', 'x64', 'asan', 'v8_enable_turboshaft_csa'], 'debug_x64_conservative_stack_scanning': [ 'debug_bot', 'x64', 'conservative_stack_scanning'], 'debug_x64_coverage': [ @@ -701,6 +708,8 @@ 'debug_bot_no_reclient', 'x64', 'gcc', 'lld', 'no_custom_libcxx'], 'debug_x64_header_includes': [ 'debug_bot', 'x64', 'v8_check_header_includes'], + 'debug_x64_no_leaptiering': [ + 'debug_bot', 'x64', 'v8_disable_leaptiering'], 'debug_x64_no_shared_cage': [ 'debug_bot', 'x64', 'v8_disable_pointer_compression_shared_cage'], 'debug_x64_minimal_symbols': [ @@ -717,6 +726,8 @@ 'debug_bot', 'x64', 'v8_enable_sticky_mark_bits'], 'debug_x64_trybot': [ 'debug_trybot', 'x64'], + 'debug_x64_turboshaft_csa': [ + 'debug_bot', 'x64', 'v8_enable_turboshaft_csa'], 'debug_x64_dict_tracking_trybot': [ 'debug_trybot', 'x64', 'v8_enable_dict_property_const_tracking'], 'debug_x64_trybot_custom': [ @@ -730,8 +741,8 @@ # Debug configs for x86. 'debug_x86': [ 'debug_bot', 'x86'], - 'debug_x86_asan': [ - 'debug_bot', 'x86', 'asan', 'lsan'], + 'debug_x86_asan_turboshaft_csa': [ + 'debug_bot', 'x86', 'asan', 'lsan', 'v8_enable_turboshaft_csa'], 'debug_x86_minimal_symbols': [ 'debug_bot', 'x86', 'minimal_symbols'], 'debug_x86_msvc': [ @@ -740,15 +751,17 @@ 'debug_bot', 'x86', 'v8_no_i18n'], 'debug_x86_trybot': [ 'debug_trybot', 'x86'], + 'debug_x86_turboshaft_csa': [ + 'debug_bot', 'x86', 'v8_enable_turboshaft_csa'], 'debug_x86_vtunejit': [ 'debug_bot', 'x86', 'v8_enable_vtunejit'], 'full_debug_x86': [ 'debug', 'x86', 'reclient', 'v8_enable_slow_dchecks', 'v8_full_debug'], # Release configs for x86. - 'release_x86_asan_symbolized_verify_heap': [ + 'release_x86_asan_symbolized_verify_heap_turboshaft_csa': [ 'release_bot', 'x86', 'asan', 'lsan', 'symbolized', - 'v8_verify_heap'], + 'v8_verify_heap', 'v8_enable_turboshaft_csa'], 'release_x86_gcmole': [ 'release_bot', 'x86', 'gcmole'], 'release_x86_gcmole_trybot': [ @@ -1068,6 +1081,10 @@ 'gn_args': 'v8_control_flow_integrity=true', }, + 'v8_disable_leaptiering': { + 'gn_args': 'v8_disable_leaptiering=true', + }, + 'v8_disable_runtime_call_stats': { 'gn_args': 'v8_enable_runtime_call_stats=false', }, @@ -1132,6 +1149,10 @@ 'gn_args': 'v8_enable_test_features=true', }, + 'v8_enable_turboshaft_csa': { + 'gn_args': 'v8_enable_turboshaft_csa=true', + }, + 'v8_enable_verify_predictable': { 'gn_args': 'v8_enable_verify_predictable=true', }, diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl index 194928d3598..1afe45582fe 100644 --- a/deps/v8/infra/testing/builders.pyl +++ b/deps/v8/infra/testing/builders.pyl @@ -621,6 +621,14 @@ {'name': 'v8testing', 'shards': 3}, ], }, + 'v8_linux64_no_leaptiering_dbg': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-22.04', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 3}, + ], + }, 'v8_linux64_no_shared_cage_dbg': { 'swarming_dimensions' : { 'os': 'Ubuntu-22.04', @@ -1694,6 +1702,14 @@ {'name': 'v8testing'}, ], }, + 'V8 Linux64 - no leaptiering - debug': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-22.04', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 2}, + ], + }, 'V8 Linux64 - no shared cage - debug': { 'swarming_dimensions' : { 'os': 'Ubuntu-22.04', diff --git a/deps/v8/samples/OWNERS b/deps/v8/samples/OWNERS index 6df8720dc57..904e7d11f04 100644 --- a/deps/v8/samples/OWNERS +++ b/deps/v8/samples/OWNERS @@ -1,2 +1,2 @@ -mathias@chromium.org +ahaas@chromium.org cbruni@chromium.org diff --git a/deps/v8/src/DEPS b/deps/v8/src/DEPS index 8cd950b5d1f..6cf85f8cc18 100644 --- a/deps/v8/src/DEPS +++ b/deps/v8/src/DEPS @@ -18,6 +18,7 @@ include_rules = [ "-src/heap", "+src/heap/memory-chunk-metadata.h", "+src/heap/code-range.h", + "+src/heap/read-only-spaces.h", "+src/heap/trusted-range.h", "+src/heap/combined-heap.h", "+src/heap/factory.h", @@ -29,6 +30,8 @@ include_rules = [ "+src/heap/heap.h", "+src/heap/heap-verifier.h", "+src/heap/heap-inl.h", + "+src/heap/heap-layout-inl.h", + "+src/heap/heap-layout.h", "+src/heap/heap-write-barrier-inl.h", "+src/heap/heap-write-barrier.h", "+src/heap/local-factory-inl.h", diff --git a/deps/v8/src/api/api-arguments-inl.h b/deps/v8/src/api/api-arguments-inl.h index 3ebc8a185f1..651c13dcf2c 100644 --- a/deps/v8/src/api/api-arguments-inl.h +++ b/deps/v8/src/api/api-arguments-inl.h @@ -166,7 +166,7 @@ Handle PropertyCallbackArguments::CallNamedQuery( slot_at(kReturnValueIndex).store(Smi::FromInt(v8::None)); NamedPropertyQueryCallback f = ToCData( - interceptor->query()); + isolate, interceptor->query()); PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, v8::Integer, interceptor, ExceptionContext::kNamedQuery); v8::Intercepted intercepted = f(v8::Utils::ToLocal(name), callback_info); @@ -183,7 +183,7 @@ Handle PropertyCallbackArguments::CallNamedGetter( slot_at(kReturnValueIndex).store(ReadOnlyRoots(isolate).undefined_value()); NamedPropertyGetterCallback f = ToCData( - interceptor->getter()); + isolate, interceptor->getter()); PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, v8::Value, interceptor, ExceptionContext::kNamedGetter); v8::Intercepted intercepted = f(v8::Utils::ToLocal(name), callback_info); @@ -201,7 +201,7 @@ Handle PropertyCallbackArguments::CallNamedDescriptor( NamedPropertyDescriptorCallback f = ToCData( - interceptor->descriptor()); + isolate, interceptor->descriptor()); PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, v8::Value, interceptor, ExceptionContext::kNamedDescriptor); v8::Intercepted intercepted = f(v8::Utils::ToLocal(name), callback_info); @@ -219,7 +219,7 @@ v8::Intercepted PropertyCallbackArguments::CallNamedSetter( slot_at(kReturnValueIndex).store(ReadOnlyRoots(isolate).true_value()); NamedPropertySetterCallback f = ToCData( - interceptor->setter()); + isolate, interceptor->setter()); Handle has_side_effects; PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, void, has_side_effects, ExceptionContext::kNamedSetter); @@ -236,9 +236,9 @@ v8::Intercepted PropertyCallbackArguments::CallNamedDefiner( RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedDefinerCallback); slot_at(kPropertyKeyIndex).store(*name); slot_at(kReturnValueIndex).store(ReadOnlyRoots(isolate).true_value()); - NamedPropertyDefinerCallback f = - ToCData(interceptor->definer()); + NamedPropertyDefinerCallback f = ToCData( + isolate, interceptor->definer()); Handle has_side_effects; PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, void, has_side_effects, ExceptionContext::kNamedDefiner); @@ -254,9 +254,9 @@ v8::Intercepted PropertyCallbackArguments::CallNamedDeleter( RCS_SCOPE(isolate, RuntimeCallCounterId::kNamedDeleterCallback); slot_at(kPropertyKeyIndex).store(*name); slot_at(kReturnValueIndex).store(ReadOnlyRoots(isolate).true_value()); - NamedPropertyDeleterCallback f = - ToCData(interceptor->deleter()); + NamedPropertyDeleterCallback f = ToCData( + isolate, interceptor->deleter()); Handle has_side_effects; PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, v8::Boolean, has_side_effects, ExceptionContext::kNamedDeleter); @@ -285,7 +285,8 @@ Handle PropertyCallbackArguments::CallIndexedQuery( slot_at(kReturnValueIndex).store(Smi::FromInt(v8::None)); IndexedPropertyQueryCallbackV2 f = ToCData(interceptor->query()); + kApiIndexedPropertyQueryCallbackTag>(isolate, + interceptor->query()); PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, v8::Integer, interceptor, ExceptionContext::kIndexedQuery); v8::Intercepted intercepted = f(index, callback_info); @@ -303,7 +304,8 @@ Handle PropertyCallbackArguments::CallIndexedGetter( slot_at(kReturnValueIndex).store(ReadOnlyRoots(isolate).undefined_value()); IndexedPropertyGetterCallbackV2 f = ToCData(interceptor->getter()); + kApiIndexedPropertyGetterCallbackTag>(isolate, + interceptor->getter()); PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, v8::Value, interceptor, ExceptionContext::kIndexedGetter); v8::Intercepted intercepted = f(index, callback_info); @@ -322,7 +324,7 @@ Handle PropertyCallbackArguments::CallIndexedDescriptor( IndexedPropertyDescriptorCallbackV2 f = ToCData( - interceptor->descriptor()); + isolate, interceptor->descriptor()); PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, v8::Value, interceptor, ExceptionContext::kIndexedDescriptor); v8::Intercepted intercepted = f(index, callback_info); @@ -341,7 +343,8 @@ v8::Intercepted PropertyCallbackArguments::CallIndexedSetter( slot_at(kReturnValueIndex).store(ReadOnlyRoots(isolate).true_value()); IndexedPropertySetterCallbackV2 f = ToCData(interceptor->setter()); + kApiIndexedPropertySetterCallbackTag>(isolate, + interceptor->setter()); Handle has_side_effects; PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, void, has_side_effects, ExceptionContext::kIndexedSetter); @@ -361,7 +364,8 @@ v8::Intercepted PropertyCallbackArguments::CallIndexedDefiner( slot_at(kReturnValueIndex).store(ReadOnlyRoots(isolate).true_value()); IndexedPropertyDefinerCallbackV2 f = ToCData(interceptor->definer()); + kApiIndexedPropertyDefinerCallbackTag>(isolate, + interceptor->definer()); Handle has_side_effects; PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, void, has_side_effects, ExceptionContext::kIndexedDefiner); @@ -379,7 +383,8 @@ v8::Intercepted PropertyCallbackArguments::CallIndexedDeleter( slot_at(kReturnValueIndex).store(ReadOnlyRoots(isolate).true_value()); IndexedPropertyDeleterCallbackV2 f = ToCData(interceptor->deleter()); + kApiIndexedPropertyDeleterCallbackTag>(isolate, + interceptor->deleter()); PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, v8::Boolean, interceptor, ExceptionContext::kIndexedDeleter); v8::Intercepted intercepted = f(index, callback_info); @@ -401,7 +406,7 @@ Handle PropertyCallbackArguments::CallPropertyEnumerator( IndexedPropertyEnumeratorCallback f = v8::ToCData( - interceptor->enumerator()); + isolate, interceptor->enumerator()); PREPARE_CALLBACK_INFO_INTERCEPTOR(isolate, f, v8::Array, interceptor, ExceptionContext::kNamedEnumerator); f(callback_info); @@ -470,7 +475,7 @@ bool PropertyCallbackArguments::CallAccessorSetter( // v8::AccessorNameSetterCallback or AccessorNameBooleanSetterCallback // the result is guaranteed to be v8::Boolean value indicating success or // failure. - Handle result = GetReturnValue(isolate); + DirectHandle result = GetReturnValue(isolate); return IsTrue(*result, isolate); } diff --git a/deps/v8/src/api/api-inl.h b/deps/v8/src/api/api-inl.h index c7be6489469..32e3e476826 100644 --- a/deps/v8/src/api/api-inl.h +++ b/deps/v8/src/api/api-inl.h @@ -18,18 +18,21 @@ namespace v8 { template -inline T ToCData(v8::internal::Tagged obj) { +inline T ToCData(i::Isolate* isolate, + v8::internal::Tagged obj) { static_assert(sizeof(T) == sizeof(v8::internal::Address)); if (obj == v8::internal::Smi::zero()) return nullptr; return reinterpret_cast( - v8::internal::Cast(obj)->foreign_address()); + v8::internal::Cast(obj)->foreign_address( + isolate)); } template inline v8::internal::Address ToCData( - v8::internal::Tagged obj) { + i::Isolate* isolate, v8::internal::Tagged obj) { if (obj == v8::internal::Smi::zero()) return v8::internal::kNullAddress; - return v8::internal::Cast(obj)->foreign_address(); + return v8::internal::Cast(obj)->foreign_address( + isolate); } template @@ -51,66 +54,51 @@ inline v8::internal::Handle> FromCData( } template -inline Local Utils::Convert(v8::internal::Handle obj) { - DCHECK(obj.is_null() || (IsSmi(*obj) || !IsTheHole(*obj))); -#ifdef V8_ENABLE_DIRECT_LOCAL +inline Local Utils::Convert(v8::internal::DirectHandle obj) { + DCHECK(obj.is_null() || IsSmi(*obj) || !IsTheHole(*obj)); +#ifdef V8_ENABLE_DIRECT_HANDLE if (obj.is_null()) return Local(); -#endif - return Local::FromSlot(obj.location()); -} - -template -inline Local Utils::Convert(v8::internal::DirectHandle obj, - v8::internal::Isolate* isolate) { -#if defined(V8_ENABLE_DIRECT_LOCAL) - DCHECK(obj.is_null() || (IsSmi(*obj) || !IsTheHole(*obj))); return Local::FromAddress(obj.address()); -#elif defined(V8_ENABLE_DIRECT_HANDLE) - if (obj.is_null()) return Local(); - return Convert(v8::internal::Handle(*obj, isolate)); #else - return Convert(obj); + return Local::FromSlot(obj.location()); #endif } // Implementations of ToLocal -#define MAKE_TO_LOCAL(Name, From, To) \ - Local Utils::Name(v8::internal::Handle obj) { \ - return Convert(obj); \ - } \ - \ - Local Utils::Name( \ - v8::internal::DirectHandle obj, \ - i::Isolate* isolate) { \ - return Convert(obj, isolate); \ +#define MAKE_TO_LOCAL(Name) \ + template