diff --git a/common.gypi b/common.gypi index b2a4cd9d69c95e..56c79543a5c35a 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.9', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/.editorconfig b/deps/v8/.editorconfig index 9d08a1a828a3bd..0a4c9a6c2f0f6d 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 e805b2aabfeacc..62b74b99cae7dc 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -88,8 +88,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 e53a6577c54950..38c0f069211911 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -143,11 +143,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 +170,7 @@ Joel Stanley Johan Bergström Johan Levin John Paul Adrian Glaubitz +Jojo R Jonathan Liu Juan Arboleda Julien Brianceau @@ -205,6 +206,7 @@ Matt Hanselman Matthew Sporleder Maxim Mazurok Maxim Mossienko +Md Hasibul Hasan Meir Shpilraien Michael Lutz Michael Mclaughlin @@ -312,6 +314,7 @@ 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 0718b28b052946..f2b2f4da0f8164 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 @@ -208,6 +207,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, @@ -411,6 +453,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", }, @@ -518,7 +562,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 +807,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 +1317,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 +1452,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", @@ -2916,6 +2968,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": [], }), ) @@ -3307,6 +3374,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", @@ -3579,6 +3647,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": [], }), ) diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 92e8541951384f..19e0d2b584790e 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 = "" @@ -339,6 +335,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 +390,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 +441,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 @@ -477,9 +492,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 @@ -586,6 +603,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. @@ -886,7 +907,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 +961,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" ] @@ -1258,6 +1279,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 +1321,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 +1333,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") { @@ -1445,6 +1475,9 @@ config("toolchain") { if (!is_clang) { cflags += [ "-ffp-contract=off" ] } + if (riscv_use_sv39) { + defines += [ "RISCV_USE_SV39" ] + } } if (v8_current_cpu == "riscv32") { @@ -2420,6 +2453,15 @@ template("run_mksnapshot") { sources = [] + if (icu_use_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 = [] @@ -2479,6 +2521,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. @@ -2720,7 +2766,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 +2773,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", @@ -2777,7 +2823,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 @@ -2960,6 +3005,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") { @@ -3324,6 +3378,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", @@ -3521,6 +3577,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", @@ -4395,6 +4452,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) { @@ -4739,6 +4808,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 +4820,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", @@ -5284,6 +5355,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", @@ -5861,6 +5933,15 @@ v8_source_set("v8_base_without_compiler") { "src/wasm/fuzzing/random-module-generation.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_third_party_heap) { @@ -6101,6 +6182,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 +6222,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", @@ -6462,7 +6545,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/DEPS b/deps/v8/DEPS index 6b06081f88e887..4208189f466a67 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.157.0.d2566cec-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:54f5b539df8c4e460b18c62a11132d77b5601136', # 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:87262779ecc3482c8c60b070404b225107212d0d', # luci-go CIPD package version. - 'luci_go': 'git_revision:771ea9a614a104c71655f699ef82219a2a474817', + 'luci_go': 'git_revision:ad7b787aa0ee53a81bc88fb4f7fee7a3ff1e8c29', # 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:23.20240815.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': 'fv6JzkTqfxfIbmsRC8u1b2y0EQO7yQDMDzY3-g0NVu4C', } deps = { 'build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + '7a8285c06acd753e6228263f48e5595e20ca1577', + Var('chromium_url') + '/chromium/src/build.git' + '@' + '7a468ed1849454cffabf4a64110c24e6f1da2c51', 'buildtools': - Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '3ef44a2b92d5dd1faa5189a06f3a5febe6db2d58', + Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '60a590902cf146c282f15242401bd8543256e2a2', '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' + '@' + 'bcb42e339dbac06f2f9902046b1fbf62562e0cd3', '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' + '@' + '4d98a91cde88f349b96f4018c00053b6699ffd88', 'condition': "checkout_centipede_deps", }, 'third_party/boringssl/src': { - 'url': Var('boringssl_url') + '/boringssl.git' + '@' + 'f01108e4761e1d4189cb134322c3cb01dc71ef87', + 'url': Var('boringssl_url') + '/boringssl.git' + '@' + '11f334121fd0d13830fefdf08041183da2d30ef3', 'condition': "checkout_centipede_deps", }, 'third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '16999365265c9850d7b5c46e53ddd52aca56f8dc', + 'url': Var('chromium_url') + '/catapult.git' + '@' + '799e21b232f23f6c1391abfd44fe8ab1dd95bd9b', 'condition': 'checkout_android', }, 'third_party/clang-format/script': @@ -250,7 +253,7 @@ 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' + '@' + '0bc7c4832e4f2d453e4826c9a2e1197e11bd6ec7', 'third_party/fp16/src': Var('chromium_url') + '/external/github.com/Maratyszcza/FP16.git' + '@' + '0a92994d729ff76a58f692d3028ca1b64b145d91', 'third_party/fuchsia-gn-sdk': { @@ -280,7 +283,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' + '@' + 'ff233bdd4cac0a0bf6e5cd45bda3406814cb2796', 'third_party/highway/src': Var('chromium_url') + '/external/github.com/google/highway.git' + '@' + '8295336dd70f1201d42c22ab5b0861de38cf8fbf', 'third_party/icu': @@ -300,125 +303,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' + '@' + 'f801c947082a3e0a4b48780303526b73905f6ecd', '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' + '@' + 'eb6567388e89d9730c76dee71d68ac82e4a1abf6', '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' + '@' + '116c20dae60d84a77005697cf29f72783f81b0f9', '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': '32ac9d9864a6bd99242f1a97778b3a074ac1151ce3eca369903f2ef5337c787a', + 'size_bytes': 52250752, + 'generation': 1723267014378582, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': '5fd3fb73ceef73593fa09f8228283aec9f7798b648bf450e87f071a097be213b', + 'size_bytes': 13217676, + 'generation': 1723267014627839, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': '6e1fe97f8b7131591233d8a2df1ff289ffb878c3fc6834c978a86273f7c00b6b', + 'size_bytes': 26125984, + 'generation': 1723267014767012, + 'condition': 'host_os == "linux" and checkout_clangd', + }, + { + 'object_name': 'Linux_x64/llvm-code-coverage-llvmorg-20-init-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'ef317481472926d3e2a82e2d2a02cde78685002b4c9923df476108906022d792', + 'size_bytes': 2374748, + 'generation': 1723267015213805, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': '02be68f7c7c7bf679e1abff2745306b8385275017c89b2b13f638a941785f8c5', + 'size_bytes': 5386480, + 'generation': 1723267014930087, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': '5df8a609a7d2511343fbc20af1de3ed1682c3703fc074f21af1bf8bc2f58e491', + 'size_bytes': 47200408, + 'generation': 1723267016534642, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'ffc72ff3fca85f31340c164aab480bd2babfaa6219ff12e93b81f0056309da55', + 'size_bytes': 869616, + 'generation': 1723267034708598, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'd02b9a39491d2ff3a291778de87b2a72f5885d01a8093518cb5612b97353ac2a', + 'size_bytes': 12805336, + 'generation': 1723267016822831, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'ce09141be75350f0f932fcda14d8b906d2869674d79ef5a10a3e60a9a8d3ccee', + 'size_bytes': 26372428, + 'generation': 1723267016957114, + 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clangd', + }, + { + 'object_name': 'Mac/llvm-code-coverage-llvmorg-20-init-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'c0ac62ff01f1ce6e5d30134cb0f83fd8eabf858dfb33d07209a6b40d8f1ae789', + 'size_bytes': 2248664, + 'generation': 1723267017743181, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'f4a384ecdaa051ba4786c9e6c46f9101a751b1a5c5ad4bf0d217c4ba71e0ff30', + 'size_bytes': 42737720, + 'generation': 1723267036349494, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': '2769378fd2891af945f8d29b5eaf05b4ab0450b2d086539df1c78c684e64be14', + 'size_bytes': 11740656, + 'generation': 1723267036269250, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'a35dfb99903a487e06d685712e461125978c76ba8eaa99e9f5742e63d3e67444', + 'size_bytes': 23470088, + 'generation': 1723267036383208, + 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clangd', + }, + { + 'object_name': 'Mac_arm64/llvm-code-coverage-llvmorg-20-init-1009-g7088a5ed-10.tar.xz', + 'sha256sum': '574a0d7c560aae964d8bdcd85f0145077b1324e79eee4a3dd1636ab7aefc59e5', + 'size_bytes': 2010540, + 'generation': 1723267036758678, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'e255af29c29a741cf39c3000b612466ff805a99766d26ac86ec2afcb4ca0c922', + 'size_bytes': 44019080, + 'generation': 1723267056892790, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'a86aa579fc90a053b94874a8c79daeb7f3bbd77107fb460c6d0a7959cefb7e61', + 'size_bytes': 13055812, + 'generation': 1723267057185720, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': '6d89f358769ef50d008194e0ab9e8d4d80b8d6ffc0095ed44aef925d900aa743', + 'size_bytes': 2873772, + 'generation': 1723267074433695, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'e2b69a726f794005a333ae66a0ef5c0258872a19bc4506eff23f23fdee75ba5c', + 'size_bytes': 25053884, + 'generation': 1723267057351794, + 'condition': 'host_os == "win" and checkout_clangd', + }, + { + 'object_name': 'Win/llvm-code-coverage-llvmorg-20-init-1009-g7088a5ed-10.tar.xz', + 'sha256sum': 'e68e7c7ecbc7b2fc4f7ec3e97565a7f12bab1d195d22bc76959f3a88b1462ac1', + 'size_bytes': 2376020, + 'generation': 1723267057803475, '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-1009-g7088a5ed-10.tar.xz', + 'sha256sum': '801714415847b8efea7252b1072b8647f92ba0e946480b3db9b156900e42ab55', + 'size_bytes': 5392812, + 'generation': 1723267057506056, 'condition': 'checkout_linux or checkout_mac or checkout_android and host_os == "win"', }, ], @@ -430,7 +461,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,7 +470,7 @@ deps = { }, 'third_party/perfetto': Var('android_url') + '/platform/external/perfetto.git' + '@' + '6fc824d618d2f06b5d9cd8655ba0419b6b3b366e', - 'third_party/protobuf_chrome': + 'third_party/protobuf': Var('chromium_url') + '/chromium/src/third_party/protobuf.git' + '@' + 'da2fe725b80ac0ba646fbf77d0ce5b4ac236f823', 'third_party/re2/src': Var('chromium_url') + '/external/github.com/google/re2.git' + '@' + '6dcd83d60f7944926bfd308cc13979fc53dd69ca', @@ -458,9 +489,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'+ '@' + 'd3aea2341cdeaf7e717bc257a59aa7a9407d318a', 'tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '4dc76da47b1145e53e508a23c1bf2204cf5ee7ee', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '63b7be17f8981d716ea9a0d65bb04654d79548a8', 'tools/luci-go': { 'packages': [ { @@ -478,7 +509,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' + '@' + 'ed3733b91e472a1e7a641c1f0c1e6c0ea698e958', 'condition': 'not build_with_chromium', }, 'third_party/zoslib': { diff --git a/deps/v8/bazel/defs.bzl b/deps/v8/bazel/defs.bzl index 520a311595e488..6a3c868b002142 100644 --- a/deps/v8/bazel/defs.bzl +++ b/deps/v8/bazel/defs.bzl @@ -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,6 +556,7 @@ 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"), diff --git a/deps/v8/build_overrides/build.gni b/deps/v8/build_overrides/build.gni index 0a1fc3c46d23a6..29acce40046bdf 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/gni/v8.gni b/deps/v8/gni/v8.gni index 9ee57a49806c1b..b606c1b85b06a4 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,6 +163,11 @@ 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 @@ -209,6 +211,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 +235,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/cppgc/garbage-collected.h b/deps/v8/include/cppgc/garbage-collected.h index 6737c8be49aca4..dfd758a35cfd95 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/internal/compiler-specific.h b/deps/v8/include/cppgc/internal/compiler-specific.h index 595b6398cb720a..175156ca6cbc89 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/v8-callbacks.h b/deps/v8/include/v8-callbacks.h index 6096301258719e..7a8f8abeb402d9 100644 --- a/deps/v8/include/v8-callbacks.h +++ b/deps/v8/include/v8-callbacks.h @@ -359,7 +359,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-fast-api-calls.h b/deps/v8/include/v8-fast-api-calls.h index 1cd99cb880f023..18466688cf90cb 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 7208c19ebf62c6..9ff4c59588df8a 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 50f730f3929fe5..d28d4b50087c13 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 c2e1947a5dbd61..3075441e997910 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 8c385aa10a915b..e53c20253b2aff 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -946,12 +946,8 @@ class Internals { kIsolateCppHeapPointerTableOffset + kExternalPointerTableSize; static const int kIsolateTrustedPointerTableOffset = kIsolateTrustedCageBaseOffset + kApiSystemPointerSize; - static const int kIsolateExternalBufferTableOffset = - kIsolateTrustedPointerTableOffset + kTrustedPointerTableSize; - static const int kIsolateSharedExternalBufferTableAddressOffset = - kIsolateExternalBufferTableOffset + kExternalBufferTableSize; static const int kIsolateApiCallbackThunkArgumentOffset = - kIsolateSharedExternalBufferTableAddressOffset + kApiSystemPointerSize; + kIsolateTrustedPointerTableOffset + kTrustedPointerTableSize; #else static const int kIsolateApiCallbackThunkArgumentOffset = kIsolateCppHeapPointerTableOffset + kExternalPointerTableSize; @@ -978,7 +974,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 +982,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 = @@ -1556,12 +1553,12 @@ constexpr WrappedIterator operator+( // 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 +1574,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 +1589,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 +1601,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 bef9ebbd5568b7..08fcfc40f1f46e 100644 --- a/deps/v8/include/v8-isolate.h +++ b/deps/v8/include/v8-isolate.h @@ -937,6 +937,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 diff --git a/deps/v8/include/v8-local-handle.h b/deps/v8/include/v8-local-handle.h index 98feeeba76d47a..ef110a083dc3d6 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-object.h b/deps/v8/include/v8-object.h index d03b33acd7c83e..71a6c2c9c14911 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 56bfd7274826c0..5110f432077dce 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -1027,18 +1027,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 +1063,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 diff --git a/deps/v8/include/v8-primitive.h b/deps/v8/include/v8-primitive.h index 1adb9cbcb22515..426bb379099e26 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 3451da26ba2d6b..d6741aec760827 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 f4c7412c5bf6e5..c30d42502769c1 100644 --- a/deps/v8/include/v8-script.h +++ b/deps/v8/include/v8-script.h @@ -210,7 +210,7 @@ class V8_EXPORT Module : public Data { using ResolveModuleCallback = MaybeLocal (*)( Local context, Local specifier, - Local import_assertions, Local referrer); + Local import_attributes, Local referrer); /** * Instantiates the module and its dependencies. diff --git a/deps/v8/include/v8-template.h b/deps/v8/include/v8-template.h index ba5ff7bff5ada9..7b47c3b6282d24 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) @@ -657,6 +658,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-util.h b/deps/v8/include/v8-util.h index b7d53f14f75fe4..05ade0a3dd5b44 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 ac04525d86d759..656b5719eff748 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 ac33d3075e472c..2f396c1c7a6d10 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -9,9 +9,9 @@ // 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_MINOR_VERSION 9 +#define V8_BUILD_NUMBER 202 +#define V8_PATCH_LEVEL 18 // 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 86b41a5b3cf7d3..b6d087b958edc1 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 diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index 838e65812faa3a..ce26b4df0a1c91 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 194928d35984e0..1afe45582fefbb 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/src/api/api-arguments-inl.h b/deps/v8/src/api/api-arguments-inl.h index 3ebc8a185f1237..651c13dcf2caf5 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 c7be6489469700..32e3e476826de3 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