diff --git a/deps/v8/.ycm_extra_conf.py b/deps/v8/.ycm_extra_conf.py index 6d79c46245eb4e..793beda7955990 100644 --- a/deps/v8/.ycm_extra_conf.py +++ b/deps/v8/.ycm_extra_conf.py @@ -42,7 +42,6 @@ # Flags from YCM's default config. flags = [ '-DUSE_CLANG_COMPLETER', -'-std=gnu++14', '-x', 'c++', ] @@ -143,25 +142,27 @@ def GetClangCommandFromNinjaForFilename(v8_root, filename): # Parse flags that are important for YCM's purposes. for flag in clang_line.split(' '): if flag.startswith('-I'): - # Relative paths need to be resolved, because they're relative to the - # output dir, not the source. - if flag[2] == '/': - v8_flags.append(flag) - else: - abs_path = os.path.normpath(os.path.join(out_dir, flag[2:])) - v8_flags.append('-I' + abs_path) - elif flag.startswith('-std'): + v8_flags.append(MakeIncludePathAbsolute(flag, "-I", out_dir)) + elif flag.startswith('-isystem'): + v8_flags.append(MakeIncludePathAbsolute(flag, "-isystem", out_dir)) + elif flag.startswith('-std') or flag.startswith( + '-pthread') or flag.startswith('-no'): v8_flags.append(flag) - elif flag.startswith('-') and flag[1] in 'DWFfmO': - if flag == '-Wno-deprecated-register' or flag == '-Wno-header-guard': - # These flags causes libclang (3.3) to crash. Remove it until things - # are fixed. - continue + elif flag.startswith('-') and flag[1] in 'DWFfmgOX': v8_flags.append(flag) - return v8_flags +def MakeIncludePathAbsolute(flag, prefix, out_dir): + # Relative paths need to be resolved, because they're relative to the + # output dir, not the source. + if flag[len(prefix)] == '/': + return flag + else: + abs_path = os.path.normpath(os.path.join(out_dir, flag[len(prefix):])) + return prefix + abs_path + + def FlagsForFile(filename): """This is the main entry point for YCM. Its interface is fixed. @@ -180,3 +181,9 @@ def FlagsForFile(filename): 'flags': final_flags, 'do_cache': True } + + +def Settings(**kwargs): + if kwargs['language'] == 'cfamily': + return FlagsForFile(kwargs['filename']) + return {} diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index af37f8db25121e..9696fc61d54d8f 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -114,6 +114,7 @@ Fedor Indutny Felix Geisendörfer Feng Yu Filipe David Manana +Frank Lemanschik Franziska Hinkelmann Gao Sheng Geoffrey Garside @@ -152,6 +153,7 @@ Jiaxun Yang Joel Stanley Johan Bergström Jonathan Liu +Juan Arboleda Julien Brianceau JunHo Seo Junha Park diff --git a/deps/v8/BUILD.bazel b/deps/v8/BUILD.bazel index f216a1811da852..3be7da8f3bb11f 100644 --- a/deps/v8/BUILD.bazel +++ b/deps/v8/BUILD.bazel @@ -39,6 +39,7 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression # v8_enable_trace_baseline_exec # v8_enable_trace_feedback_updates # v8_enable_atomic_object_field_writes +# v8_enable_conservative_stack_scanning # v8_enable_concurrent_marking # v8_enable_ignition_dispatch_counting # v8_enable_builtins_profiling @@ -1381,6 +1382,8 @@ filegroup( "src/handles/global-handles-inl.h", "src/handles/global-handles.cc", "src/handles/global-handles.h", + "src/handles/traced-handles.cc", + "src/handles/traced-handles.h", "src/handles/handles-inl.h", "src/handles/handles.cc", "src/handles/handles.h", @@ -1963,6 +1966,7 @@ filegroup( "src/profiler/heap-snapshot-generator-inl.h", "src/profiler/heap-snapshot-generator.cc", "src/profiler/heap-snapshot-generator.h", + "src/profiler/output-stream-writer.h", "src/profiler/profile-generator-inl.h", "src/profiler/profile-generator.cc", "src/profiler/profile-generator.h", @@ -2664,6 +2668,8 @@ filegroup( "src/compiler/all-nodes.h", "src/compiler/allocation-builder.h", "src/compiler/allocation-builder-inl.h", + "src/compiler/backend/bitcast-elider.cc", + "src/compiler/backend/bitcast-elider.h", "src/compiler/backend/code-generator.cc", "src/compiler/backend/code-generator.h", "src/compiler/backend/code-generator-impl.h", @@ -2887,7 +2893,7 @@ filegroup( "src/compiler/turboshaft/graph.h", "src/compiler/turboshaft/graph-visualizer.cc", "src/compiler/turboshaft/graph-visualizer.h", - "src/compiler/turboshaft/machine-optimization-assembler.h", + "src/compiler/turboshaft/machine-optimization-reducer.h", "src/compiler/turboshaft/operations.cc", "src/compiler/turboshaft/operations.h", "src/compiler/turboshaft/operation-matching.h", @@ -2897,12 +2903,14 @@ filegroup( "src/compiler/turboshaft/recreate-schedule.h", "src/compiler/turboshaft/representations.cc", "src/compiler/turboshaft/representations.h", + "src/compiler/turboshaft/select-lowering-reducer.h", "src/compiler/turboshaft/sidetable.h", "src/compiler/turboshaft/simplify-tf-loops.cc", "src/compiler/turboshaft/simplify-tf-loops.h", + "src/compiler/turboshaft/snapshot-table.h", "src/compiler/turboshaft/utils.cc", "src/compiler/turboshaft/utils.h", - "src/compiler/turboshaft/value-numbering-assembler.h", + "src/compiler/turboshaft/value-numbering-reducer.h", "src/compiler/type-cache.cc", "src/compiler/type-cache.h", "src/compiler/type-narrowing-reducer.cc", @@ -3152,16 +3160,16 @@ filegroup( # Note these cannot be v8_target_is_* selects because these contain # inline assembly that runs inside the executable. Since these are # linked directly into mksnapshot, they must use the actual target cpu. - "@v8//bazel/config:is_inline_asm_ia32": ["src/heap/base/asm/ia32/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_x64": ["src/heap/base/asm/x64/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_arm": ["src/heap/base/asm/arm/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_arm64": ["src/heap/base/asm/arm64/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_s390x": ["src/heap/base/asm/s390/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_riscv64": ["src/heap/base/asm/riscv64/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_ppc64le": ["src/heap/base/asm/ppc/push_registers_asm.cc"], - "@v8//bazel/config:is_msvc_asm_ia32": ["src/heap/base/asm/ia32/push_registers_masm.asm"], - "@v8//bazel/config:is_msvc_asm_x64": ["src/heap/base/asm/x64/push_registers_masm.asm"], - "@v8//bazel/config:is_msvc_asm_arm64": ["src/heap/base/asm/arm64/push_registers_masm.S"], + "@v8//bazel/config:is_inline_asm_ia32": ["src/heap/base/asm/ia32/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_x64": ["src/heap/base/asm/x64/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_arm": ["src/heap/base/asm/arm/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_arm64": ["src/heap/base/asm/arm64/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_s390x": ["src/heap/base/asm/s390/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_riscv64": ["src/heap/base/asm/riscv64/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_ppc64le": ["src/heap/base/asm/ppc/save_registers_asm.cc"], + "@v8//bazel/config:is_msvc_asm_ia32": ["src/heap/base/asm/ia32/save_registers_masm.asm"], + "@v8//bazel/config:is_msvc_asm_x64": ["src/heap/base/asm/x64/save_registers_masm.asm"], + "@v8//bazel/config:is_msvc_asm_arm64": ["src/heap/base/asm/arm64/save_registers_masm.S"], }), ) diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 61187af3053a02..78fd8cd2d38790 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -1460,6 +1460,10 @@ config("toolchain") { "/wd4715", # 'function' : not all control paths return a value' # MSVC does not analyze switch (enum) for completeness. ] + + # TODO(https://crbug.com/1377771): Keep MSVC on C++17 until source code is + # made compatible with C++20. + cflags_cc = [ "/std:c++17" ] } if (!is_clang && !is_win) { @@ -1476,6 +1480,11 @@ config("toolchain") { # Disable gcc warnings for using enum constant in boolean context. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97266 "-Wno-int-in-bool-context", + + # Disable gcc deprecation warnings, which are firing on implicit capture + # of `this` in capture-by-value lambdas and preventing a build roll which + # enables C++20 (see https://crbug.com/1374227). + "-Wno-deprecated", ] } @@ -2268,6 +2277,8 @@ action("v8_dump_build_config") { "v8_current_cpu=\"$v8_current_cpu\"", "v8_enable_atomic_object_field_writes=" + "$v8_enable_atomic_object_field_writes", + "v8_enable_conservative_stack_scanning=" + + "$v8_enable_conservative_stack_scanning", "v8_enable_concurrent_marking=$v8_enable_concurrent_marking", "v8_enable_single_generation=$v8_enable_single_generation", "v8_enable_i18n_support=$v8_enable_i18n_support", @@ -2803,6 +2814,7 @@ v8_header_set("v8_internal_headers") { "src/compiler/all-nodes.h", "src/compiler/allocation-builder-inl.h", "src/compiler/allocation-builder.h", + "src/compiler/backend/bitcast-elider.h", "src/compiler/backend/code-generator-impl.h", "src/compiler/backend/code-generator.h", "src/compiler/backend/frame-elider.h", @@ -2923,16 +2935,18 @@ v8_header_set("v8_internal_headers") { "src/compiler/turboshaft/graph-builder.h", "src/compiler/turboshaft/graph-visualizer.h", "src/compiler/turboshaft/graph.h", - "src/compiler/turboshaft/machine-optimization-assembler.h", + "src/compiler/turboshaft/machine-optimization-reducer.h", "src/compiler/turboshaft/operation-matching.h", "src/compiler/turboshaft/operations.h", "src/compiler/turboshaft/optimization-phase.h", "src/compiler/turboshaft/recreate-schedule.h", "src/compiler/turboshaft/representations.h", + "src/compiler/turboshaft/select-lowering-reducer.h", "src/compiler/turboshaft/sidetable.h", "src/compiler/turboshaft/simplify-tf-loops.h", + "src/compiler/turboshaft/snapshot-table.h", "src/compiler/turboshaft/utils.h", - "src/compiler/turboshaft/value-numbering-assembler.h", + "src/compiler/turboshaft/value-numbering-reducer.h", "src/compiler/type-cache.h", "src/compiler/type-narrowing-reducer.h", "src/compiler/typed-optimization.h", @@ -3024,6 +3038,7 @@ v8_header_set("v8_internal_headers") { "src/handles/maybe-handles.h", "src/handles/persistent-handles.h", "src/handles/shared-object-conveyor-handles.h", + "src/handles/traced-handles.h", "src/heap/allocation-observer.h", "src/heap/allocation-result.h", "src/heap/allocation-stats.h", @@ -3422,6 +3437,7 @@ v8_header_set("v8_internal_headers") { "src/profiler/heap-profiler.h", "src/profiler/heap-snapshot-generator-inl.h", "src/profiler/heap-snapshot-generator.h", + "src/profiler/output-stream-writer.h", "src/profiler/profile-generator-inl.h", "src/profiler/profile-generator.h", "src/profiler/profiler-listener.h", @@ -4041,6 +4057,7 @@ v8_compiler_sources = [ "src/compiler/access-info.cc", "src/compiler/add-type-assertions-reducer.cc", "src/compiler/all-nodes.cc", + "src/compiler/backend/bitcast-elider.cc", "src/compiler/backend/code-generator.cc", "src/compiler/backend/frame-elider.cc", "src/compiler/backend/gap-resolver.cc", @@ -4429,6 +4446,7 @@ v8_source_set("v8_base_without_compiler") { "src/handles/local-handles.cc", "src/handles/persistent-handles.cc", "src/handles/shared-object-conveyor-handles.cc", + "src/handles/traced-handles.cc", "src/heap/allocation-observer.cc", "src/heap/array-buffer-sweeper.cc", "src/heap/base-space.cc", @@ -4737,6 +4755,7 @@ v8_source_set("v8_base_without_compiler") { if (v8_enable_maglev) { sources += [ + "src/maglev/maglev-assembler.cc", "src/maglev/maglev-code-generator.cc", "src/maglev/maglev-compilation-info.cc", "src/maglev/maglev-compilation-unit.cc", @@ -5745,31 +5764,31 @@ v8_source_set("v8_heap_base") { if (is_clang || !is_win) { if (current_cpu == "x64") { - sources += [ "src/heap/base/asm/x64/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/x64/save_registers_asm.cc" ] } else if (current_cpu == "x86") { - sources += [ "src/heap/base/asm/ia32/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/ia32/save_registers_asm.cc" ] } else if (current_cpu == "arm") { - sources += [ "src/heap/base/asm/arm/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/arm/save_registers_asm.cc" ] } else if (current_cpu == "arm64") { - sources += [ "src/heap/base/asm/arm64/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/arm64/save_registers_asm.cc" ] } else if (current_cpu == "ppc64") { - sources += [ "src/heap/base/asm/ppc/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/ppc/save_registers_asm.cc" ] } else if (current_cpu == "s390x") { - sources += [ "src/heap/base/asm/s390/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/s390/save_registers_asm.cc" ] } else if (current_cpu == "mips64el") { - sources += [ "src/heap/base/asm/mips64/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/mips64/save_registers_asm.cc" ] } else if (current_cpu == "loong64") { - sources += [ "src/heap/base/asm/loong64/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/loong64/save_registers_asm.cc" ] } else if (current_cpu == "riscv64" || current_cpu == "riscv32") { - sources += [ "src/heap/base/asm/riscv/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/riscv/save_registers_asm.cc" ] } } else if (is_win) { if (current_cpu == "x64") { - sources += [ "src/heap/base/asm/x64/push_registers_masm.asm" ] + sources += [ "src/heap/base/asm/x64/save_registers_masm.asm" ] } else if (current_cpu == "x86") { - sources += [ "src/heap/base/asm/ia32/push_registers_masm.asm" ] + sources += [ "src/heap/base/asm/ia32/save_registers_masm.asm" ] } else if (current_cpu == "arm64") { - sources += [ "src/heap/base/asm/arm64/push_registers_masm.S" ] + sources += [ "src/heap/base/asm/arm64/save_registers_masm.S" ] } } diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 6304c386414450..ab0a9bf5431112 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -26,6 +26,7 @@ vars = { # most commonly useful for developers. Bots and developers that need to use # other images (e.g., qemu.arm64) can override this with additional images. 'checkout_fuchsia_boot_images': "qemu.x64", + 'checkout_fuchsia_product_bundles': '"{checkout_fuchsia_boot_images}" != ""', 'checkout_instrumented_libraries': False, 'checkout_ittapi': False, @@ -42,22 +43,22 @@ vars = { 'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/gn/', # reclient CIPD package version - 'reclient_version': 're_client_version:0.69.0.458df98-gomaip', + 'reclient_version': 're_client_version:0.83.0.da55f4f-gomaip', # GN CIPD package version. - 'gn_version': 'git_revision:cc28efe62ef0c2fb32455f414a29c4a55bb7fbc4', + 'gn_version': 'git_revision:a4d67be044b42963de801001e7146f9657c7fad4', # ninja CIPD package version # https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/ninja 'ninja_version': 'version:2@1.8.2.chromium.3', # luci-go CIPD package version. - 'luci_go': 'git_revision:20c50aa39686d91330c2daceccaa4ef1a0a72ee4', + 'luci_go': 'git_revision:f8f64a8c560d2bf68a3ad1137979d17cffb36d30', # 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:9.20220919.2.1', + 'fuchsia_version': 'version:10.20221109.1.1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_build-tools_version @@ -97,9 +98,9 @@ deps = { 'base/trace_event/common': Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '521ac34ebd795939c7e16b37d9d3ddb40e8ed556', 'build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + '7e7c21a9ac34c4fc2b255aa44d639efec9c33b90', + Var('chromium_url') + '/chromium/src/build.git' + '@' + '875cb19167f2e0d7b1eca89a4d5b5693421424c6', 'buildtools': - Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '9174abb6ac087b46f22248dc713b6c0328b8f774', + Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '49ac7cf34ab2e59a10629a7a722cfb94348c4996', 'buildtools/clang_format/script': Var('chromium_url') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + '8b525d2747f2584fc35d8c7e612e66f377858df7', 'buildtools/linux64': { @@ -123,11 +124,11 @@ deps = { 'condition': 'host_os == "mac"', }, 'buildtools/third_party/libc++/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '2e919977e0030ce61bd19c40cefe31b995f1e2d4', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '4218f3525ad438b22b0e173d963515a09d143398', 'buildtools/third_party/libc++abi/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + 'db2a783a7d1ef0f0ef31da4b6e3de0c31fcfd93f', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '1a32724f721e1c3b6c590a07fe4a954344f15e48', 'buildtools/third_party/libunwind/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '08ebcbe7b672a04e341cb3a88d8bf4276f96ac6e', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'a318d6a4c283a9d342d2a1e20292c1496fe12997', 'buildtools/win': { 'packages': [ { @@ -153,13 +154,13 @@ 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' + '@' + '58b7a2358286b918efd38eac4b2facbc8ada1206', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'ade328d530525333751e8a3b58f02e18624da085', 'third_party/android_ndk': { 'url': Var('chromium_url') + '/android_ndk.git' + '@' + '8388a2be5421311dc75c5f937aae13d821a27f3d', 'condition': 'checkout_android', }, 'third_party/android_platform': { - 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '04b33506bfd9d0e866bd8bd62f4cbf323d84dc79', + 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '1bf9b932433ebb78828bf3c8cd0ccc86b9ef4787', 'condition': 'checkout_android', }, 'third_party/android_sdk/public': { @@ -201,7 +202,7 @@ deps = { 'dep_type': 'cipd', }, 'third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + 'ff03621a71c01a6f2b0f3bf2677cf815291a9e85', + 'url': Var('chromium_url') + '/catapult.git' + '@' + 'f0b11967c94cba8f7cca91d2da20c98d4420fc25', 'condition': 'checkout_android', }, 'third_party/colorama/src': { @@ -209,7 +210,7 @@ deps = { 'condition': 'checkout_android', }, 'third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'a724859f7a9b3531c0373d86886a42314e772532', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'ae1a70891738fb14f64fbb884e00b87ac663aa15', 'third_party/fuchsia-sdk/sdk': { 'packages': [ { @@ -226,9 +227,9 @@ deps = { 'third_party/googletest/src': Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'af29db7ec28d6df1c7f0f745186884091e602e07', 'third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '20f8ac695af59b6c830def7d4e95bfeb13dd7be5', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'da07448619763d1cde255b361324242646f5b268', 'third_party/instrumented_libraries': - Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + 'e09c4b66b6e87116eb190651421f1a6e2f3b9c52', + Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + '7bb87a375ffc3effd17a50f690099dcfb9ee280b', 'third_party/ittapi': { # Force checkout ittapi libraries to pass v8 header includes check on # bots that has check_v8_header_includes enabled. @@ -236,13 +237,13 @@ deps = { 'condition': "checkout_ittapi or check_v8_header_includes", }, 'third_party/jinja2': - Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + 'ee69aa00ee8536f61db6a451f3858745cf587de6', + Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + '4633bf431193690c3491244f5a0acbe9ac776233', 'third_party/jsoncpp/source': Var('chromium_url') + '/external/github.com/open-source-parsers/jsoncpp.git'+ '@' + '42e892d96e47b1f6e29844cc705e148ec4856448', 'third_party/logdog/logdog': Var('chromium_url') + '/infra/luci/luci-py/client/libs/logdog' + '@' + '0b2078a90f7a638d576b3a7c407d136f2fb62399', 'third_party/markupsafe': - Var('chromium_url') + '/chromium/src/third_party/markupsafe.git' + '@' + '1b882ef6372b58bfd55a3285f37ed801be9137cd', + Var('chromium_url') + '/chromium/src/third_party/markupsafe.git' + '@' + '13f4e8c9e206567eeb13bf585406ddc574005748', 'third_party/ninja': { 'packages': [ { @@ -262,9 +263,9 @@ deps = { 'condition': 'checkout_android', }, 'third_party/zlib': - Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + 'd689fca54d7b43154f7cf77f785d19f2628fa133', + Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '8bbd6c3129b5146489f2321f054e855c347857f4', 'tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'a5e0d72349d028a4023927d6d166a8478355fac3', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'd3df9cc5362e0af4cda798b0612dde39783b3dc0', 'tools/luci-go': { 'packages': [ { @@ -573,11 +574,11 @@ hooks = [ { 'name': 'Download Fuchsia system images', 'pattern': '.', - 'condition': 'checkout_fuchsia', + 'condition': 'checkout_fuchsia and checkout_fuchsia_product_bundles', 'action': [ 'python3', - 'build/fuchsia/update_images.py', - '--boot-images={checkout_fuchsia_boot_images}', + 'build/fuchsia/update_product_bundles.py', + '{checkout_fuchsia_boot_images}', ], }, { diff --git a/deps/v8/OWNERS b/deps/v8/OWNERS index db579fb0e6a2d3..cd95b48bac3eba 100644 --- a/deps/v8/OWNERS +++ b/deps/v8/OWNERS @@ -5,6 +5,7 @@ file:ENG_REVIEW_OWNERS per-file .*=file:INFRA_OWNERS per-file .bazelrc=file:COMMON_OWNERS per-file .mailmap=file:COMMON_OWNERS +per-file .ycm_extra_conf.py=file:COMMON_OWNERS per-file codereview.settings=file:INFRA_OWNERS per-file AUTHORS=file:COMMON_OWNERS per-file BUILD.bazel=file:COMMON_OWNERS diff --git a/deps/v8/bazel/defs.bzl b/deps/v8/bazel/defs.bzl index d8db3fe8ba9a62..77e86ef6f2e646 100644 --- a/deps/v8/bazel/defs.bzl +++ b/deps/v8/bazel/defs.bzl @@ -151,14 +151,6 @@ def _default_args(): "-fno-integrated-as", ], "//conditions:default": [], - }) + select({ - "@v8//bazel/config:is_debug":[ - "-fvisibility=default", - ], - "//conditions:default": [ - "-fvisibility=hidden", - "-fvisibility-inlines-hidden", - ], }), includes = ["include"], linkopts = select({ @@ -518,6 +510,7 @@ def build_config_content(cpu, icu): ("v8_current_cpu", cpu), ("v8_dict_property_const_tracking", "false"), ("v8_enable_atomic_object_field_writes", "false"), + ("v8_enable_conservative_stack_scanning", "false"), ("v8_enable_concurrent_marking", "false"), ("v8_enable_i18n_support", icu), ("v8_enable_verify_predictable", "false"), diff --git a/deps/v8/gni/snapshot_toolchain.gni b/deps/v8/gni/snapshot_toolchain.gni index 5f5e53a30d0789..99de816372bf9c 100644 --- a/deps/v8/gni/snapshot_toolchain.gni +++ b/deps/v8/gni/snapshot_toolchain.gni @@ -44,10 +44,6 @@ declare_args() { # # There are test cases for this code posted as an attachment to # https://crbug.com/625353. -# -# TODO(GYP): Currently only regular (non-cross) compiles, and cross-compiles -# from x64 hosts to Intel, ARM, or MIPS targets, are implemented. Add support -# for the other supported configurations. if (v8_snapshot_toolchain == "") { if (current_os == host_os && current_cpu == host_cpu) { @@ -69,22 +65,21 @@ if (v8_snapshot_toolchain == "") { # therefore snapshots will need to be built using native mksnapshot # in combination with qemu v8_snapshot_toolchain = current_toolchain + } else if (host_cpu == current_cpu) { + # Cross-build from same ISA on one OS to another. For example: + # * targeting win/x64 on a linux/x64 host + # * targeting win/arm64 on a mac/arm64 host + v8_snapshot_toolchain = host_toolchain } else if (host_cpu == "arm64" && current_cpu == "x64") { # Cross-build from arm64 to intel (likely on an Apple Silicon mac). v8_snapshot_toolchain = "//build/toolchain/${host_os}:clang_arm64_v8_$v8_current_cpu" } else if (host_cpu == "x64") { # This is a cross-compile from an x64 host to either a non-Intel target - # cpu or a different target OS. Clang will always be used by default on the - # host, unless this is a ChromeOS build, in which case the same toolchain - # (Clang or GCC) will be used for target and host by default. - if (is_chromeos && !is_clang) { - _clang = "" - } else { - _clang = "clang_" - } + # cpu or to 32-bit x86 on a different target OS. - if (v8_current_cpu == "x64" || v8_current_cpu == "x86") { + assert(v8_current_cpu != "x64", "handled by host_cpu == current_cpu branch") + if (v8_current_cpu == "x86") { _cpus = v8_current_cpu } else if (v8_current_cpu == "arm64" || v8_current_cpu == "mips64el" || v8_current_cpu == "riscv64" || v8_current_cpu == "loong64") { @@ -104,7 +99,7 @@ if (v8_snapshot_toolchain == "") { } if (_cpus != "") { - v8_snapshot_toolchain = "//build/toolchain/${host_os}:${_clang}${_cpus}" + v8_snapshot_toolchain = "//build/toolchain/${host_os}:clang_${_cpus}" } else if (is_win && v8_current_cpu == "arm64") { # cross compile Windows arm64 with host toolchain. v8_snapshot_toolchain = host_toolchain diff --git a/deps/v8/include/cppgc/README.md b/deps/v8/include/cppgc/README.md index a7d08f86b32a39..d825ea5bd5ba9b 100644 --- a/deps/v8/include/cppgc/README.md +++ b/deps/v8/include/cppgc/README.md @@ -26,6 +26,8 @@ This allows Oilpan to run garbage collection in parallel with mutators running i References to objects belonging to another thread's heap are modeled using cross-thread roots. This is even true for on-heap to on-heap references. +Oilpan heaps may generally not be accessed from different threads unless otherwise noted. + ## Heap partitioning Oilpan's heaps are partitioned into spaces. diff --git a/deps/v8/include/cppgc/heap-handle.h b/deps/v8/include/cppgc/heap-handle.h index 8d825133b065d6..0d1d21e65daafd 100644 --- a/deps/v8/include/cppgc/heap-handle.h +++ b/deps/v8/include/cppgc/heap-handle.h @@ -19,6 +19,11 @@ class WriteBarrierTypeForNonCagedHeapPolicy; * Opaque handle used for additional heap APIs. */ class HeapHandle { + public: + // Deleted copy ctor to avoid treating the type by value. + HeapHandle(const HeapHandle&) = delete; + HeapHandle& operator=(const HeapHandle&) = delete; + private: HeapHandle() = default; diff --git a/deps/v8/include/cppgc/platform.h b/deps/v8/include/cppgc/platform.h index d2fe7b124c99fb..5a0a40ec8c0eb0 100644 --- a/deps/v8/include/cppgc/platform.h +++ b/deps/v8/include/cppgc/platform.h @@ -33,8 +33,9 @@ class V8_EXPORT Platform { virtual ~Platform() = default; /** - * Returns the allocator used by cppgc to allocate its heap and various - * support structures. + * \returns the allocator used by cppgc to allocate its heap and various + * support structures. Returning nullptr results in using the `PageAllocator` + * provided by `cppgc::InitializeProcess()` instead. */ virtual PageAllocator* GetPageAllocator() = 0; @@ -133,9 +134,10 @@ class V8_EXPORT Platform { * Can be called multiple times when paired with `ShutdownProcess()`. * * \param page_allocator The allocator used for maintaining meta data. Must stay - * always alive and not change between multiple calls to InitializeProcess. + * always alive and not change between multiple calls to InitializeProcess. If + * no allocator is provided, a default internal version will be used. */ -V8_EXPORT void InitializeProcess(PageAllocator* page_allocator); +V8_EXPORT void InitializeProcess(PageAllocator* page_allocator = nullptr); /** * Must be called after destroying the last used heap. Some process-global diff --git a/deps/v8/include/js_protocol.pdl b/deps/v8/include/js_protocol.pdl index b3b97fa11768e6..6efcf787854dac 100644 --- a/deps/v8/include/js_protocol.pdl +++ b/deps/v8/include/js_protocol.pdl @@ -458,13 +458,14 @@ domain Debugger # New value for breakpoints active state. boolean active - # Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or - # no exceptions. Initial pause on exceptions state is `none`. + # Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions, + # or caught exceptions, no exceptions. Initial pause on exceptions state is `none`. command setPauseOnExceptions parameters # Pause on exceptions mode. enum state none + caught uncaught all diff --git a/deps/v8/include/v8-array-buffer.h b/deps/v8/include/v8-array-buffer.h index cc5d2d4323000a..841bd02a793333 100644 --- a/deps/v8/include/v8-array-buffer.h +++ b/deps/v8/include/v8-array-buffer.h @@ -251,8 +251,26 @@ class V8_EXPORT ArrayBuffer : public Object { * preventing JavaScript from ever accessing underlying backing store. * ArrayBuffer should have been externalized and must be detachable. */ + V8_DEPRECATE_SOON( + "Use the version which takes a key parameter (passing a null handle is " + "ok).") void Detach(); + /** + * Detaches this ArrayBuffer and all its views (typed arrays). + * Detaching sets the byte length of the buffer and all typed arrays to zero, + * preventing JavaScript from ever accessing underlying backing store. + * ArrayBuffer should have been externalized and must be detachable. Returns + * Nothing if the key didn't pass the [[ArrayBufferDetachKey]] check, + * Just(true) otherwise. + */ + V8_WARN_UNUSED_RESULT Maybe Detach(v8::Local key); + + /** + * Sets the ArrayBufferDetachKey. + */ + void SetDetachKey(v8::Local key); + /** * Get a shared pointer to the backing store of this array buffer. This * pointer coordinates the lifetime management of the internal storage diff --git a/deps/v8/include/v8-callbacks.h b/deps/v8/include/v8-callbacks.h index c02059a5891a74..0ffdfb6656fc64 100644 --- a/deps/v8/include/v8-callbacks.h +++ b/deps/v8/include/v8-callbacks.h @@ -237,7 +237,8 @@ using LogEventCallback = void (*)(const char* name, enum class CrashKeyId { kIsolateAddress, kReadonlySpaceFirstPageAddress, - kMapSpaceFirstPageAddress, + kMapSpaceFirstPageAddress V8_ENUM_DEPRECATE_SOON("Map space got removed"), + kOldSpaceFirstPageAddress, kCodeRangeBaseAddress, kCodeSpaceFirstPageAddress, kDumpType, diff --git a/deps/v8/include/v8-context.h b/deps/v8/include/v8-context.h index 427f3a738607bb..3ce0eb0af38c67 100644 --- a/deps/v8/include/v8-context.h +++ b/deps/v8/include/v8-context.h @@ -169,6 +169,9 @@ class V8_EXPORT Context : public Data { /** Returns the microtask queue associated with a current context. */ MicrotaskQueue* GetMicrotaskQueue(); + /** Sets the microtask queue associated with the current context. */ + void SetMicrotaskQueue(MicrotaskQueue* queue); + /** * The field at kDebugIdIndex used to be reserved for the inspector. * It now serves no purpose. diff --git a/deps/v8/include/v8-cppgc.h b/deps/v8/include/v8-cppgc.h index 00ea5c5ae502ef..139af8fdac26c3 100644 --- a/deps/v8/include/v8-cppgc.h +++ b/deps/v8/include/v8-cppgc.h @@ -77,9 +77,6 @@ struct WrapperDescriptor final { }; struct V8_EXPORT CppHeapCreateParams { - CppHeapCreateParams(const CppHeapCreateParams&) = delete; - CppHeapCreateParams& operator=(const CppHeapCreateParams&) = delete; - std::vector> custom_spaces; WrapperDescriptor wrapper_descriptor; /** @@ -98,6 +95,10 @@ struct V8_EXPORT CppHeapCreateParams { /** * A heap for allocating managed C++ objects. + * + * Similar to v8::Isolate, the heap may only be accessed from one thread at a + * time. The heap may be used from different threads using the + * v8::Locker/v8::Unlocker APIs which is different from generic Oilpan. */ class V8_EXPORT CppHeap { public: diff --git a/deps/v8/include/v8-data.h b/deps/v8/include/v8-data.h index cc51fefe105bbe..fc4dea92f3d8cc 100644 --- a/deps/v8/include/v8-data.h +++ b/deps/v8/include/v8-data.h @@ -53,7 +53,7 @@ class V8_EXPORT Data { bool IsContext() const; private: - Data(); + Data() = delete; }; /** diff --git a/deps/v8/include/v8-embedder-heap.h b/deps/v8/include/v8-embedder-heap.h index d3920c5f3b5580..f994cdfdf34376 100644 --- a/deps/v8/include/v8-embedder-heap.h +++ b/deps/v8/include/v8-embedder-heap.h @@ -72,7 +72,7 @@ class V8_EXPORT EmbedderRootsHandler { class V8_EXPORT // GCC doesn't like combining __attribute__(()) with [[deprecated]]. #ifdef __clang__ -V8_DEPRECATE_SOON("Use CppHeap when working with v8::TracedReference.") +V8_DEPRECATED("Use CppHeap when working with v8::TracedReference.") #endif // __clang__ EmbedderHeapTracer { public: diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index a52d066c835e2d..704e89e2dc27b6 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -581,6 +581,8 @@ class Internals { static const int kNodeStateMask = 0x3; static const int kNodeStateIsWeakValue = 2; + static const int kTracedNodeClassIdOffset = kApiSystemPointerSize; + static const int kFirstNonstringType = 0x80; static const int kOddballType = 0x83; static const int kForeignType = 0xcc; diff --git a/deps/v8/include/v8-isolate.h b/deps/v8/include/v8-isolate.h index 2f8acc88682e38..e9f531973b2eef 100644 --- a/deps/v8/include/v8-isolate.h +++ b/deps/v8/include/v8-isolate.h @@ -954,22 +954,20 @@ class V8_EXPORT Isolate { * Attaches a managed C++ heap as an extension to the JavaScript heap. The * embedder maintains ownership of the CppHeap. At most one C++ heap can be * attached to V8. + * * AttachCppHeap cannot be used simultaneously with SetEmbedderHeapTracer. * - * This is an experimental feature and may still change significantly. + * Multi-threaded use requires the use of v8::Locker/v8::Unlocker, see + * CppHeap. */ void AttachCppHeap(CppHeap*); /** * Detaches a managed C++ heap if one was attached using `AttachCppHeap()`. - * - * This is an experimental feature and may still change significantly. */ void DetachCppHeap(); /** - * This is an experimental feature and may still change significantly. - * \returns the C++ heap managed by V8. Only available if such a heap has been * attached using `AttachCppHeap()`. */ @@ -1526,8 +1524,10 @@ class V8_EXPORT Isolate { void SetWasmLoadSourceMapCallback(WasmLoadSourceMapCallback callback); + V8_DEPRECATED("Wasm SIMD is always enabled") void SetWasmSimdEnabledCallback(WasmSimdEnabledCallback callback); + V8_DEPRECATED("Wasm exceptions are always enabled") void SetWasmExceptionsEnabledCallback(WasmExceptionsEnabledCallback callback); void SetSharedArrayBufferConstructorEnabledCallback( diff --git a/deps/v8/include/v8-microtask-queue.h b/deps/v8/include/v8-microtask-queue.h index f1624b903b13c1..85d227fa3fdce6 100644 --- a/deps/v8/include/v8-microtask-queue.h +++ b/deps/v8/include/v8-microtask-queue.h @@ -118,7 +118,12 @@ class V8_EXPORT V8_NODISCARD MicrotasksScope { public: enum Type { kRunMicrotasks, kDoNotRunMicrotasks }; + V8_DEPRECATE_SOON( + "May be incorrect if context was created with non-default microtask " + "queue") MicrotasksScope(Isolate* isolate, Type type); + + MicrotasksScope(Local context, Type type); MicrotasksScope(Isolate* isolate, MicrotaskQueue* microtask_queue, Type type); ~MicrotasksScope(); diff --git a/deps/v8/include/v8-persistent-handle.h b/deps/v8/include/v8-persistent-handle.h index dbda4edb9baf4e..4fe79862e400f9 100644 --- a/deps/v8/include/v8-persistent-handle.h +++ b/deps/v8/include/v8-persistent-handle.h @@ -252,7 +252,7 @@ class NonCopyablePersistentTraits { * This will clone the contents of storage cell, but not any of the flags, etc. */ template -struct CopyablePersistentTraits { +struct V8_DEPRECATED("Use v8::Global instead") CopyablePersistentTraits { using CopyablePersistent = Persistent>; static const bool kResetInDestructor = true; template diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 7b2c81d136401c..32a82f881e7f93 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -923,6 +923,7 @@ class Platform { /** * Allows the embedder to manage memory page allocations. + * Returning nullptr will cause V8 to use the default page allocator. */ virtual PageAllocator* GetPageAllocator() = 0; diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 6145a2257ad05b..6b73fc60bf2c21 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -175,6 +175,32 @@ class V8_EXPORT CpuProfileNode { static const int kNoColumnNumberInfo = Message::kNoColumnInfo; }; +/** + * An interface for exporting data from V8, using "push" model. + */ +class V8_EXPORT OutputStream { + public: + enum WriteResult { kContinue = 0, kAbort = 1 }; + virtual ~OutputStream() = default; + /** Notify about the end of stream. */ + virtual void EndOfStream() = 0; + /** Get preferred output chunk size. Called only once. */ + virtual int GetChunkSize() { return 1024; } + /** + * Writes the next chunk of snapshot data into the stream. Writing + * can be stopped by returning kAbort as function result. EndOfStream + * will not be called in case writing was aborted. + */ + virtual WriteResult WriteAsciiChunk(char* data, int size) = 0; + /** + * Writes the next chunk of heap stats data into the stream. Writing + * can be stopped by returning kAbort as function result. EndOfStream + * will not be called in case writing was aborted. + */ + virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) { + return kAbort; + } +}; /** * CpuProfile contains a CPU profile in a form of top-down call tree @@ -182,6 +208,9 @@ class V8_EXPORT CpuProfileNode { */ class V8_EXPORT CpuProfile { public: + enum SerializationFormat { + kJSON = 0 // See format description near 'Serialize' method. + }; /** Returns CPU profile title. */ Local GetTitle() const; @@ -235,6 +264,25 @@ class V8_EXPORT CpuProfile { * All pointers to nodes previously returned become invalid. */ void Delete(); + + /** + * Prepare a serialized representation of the profile. The result + * is written into the stream provided in chunks of specified size. + * + * For the JSON format, heap contents are represented as an object + * with the following structure: + * + * { + * nodes: [nodes array], + * startTime: number, + * endTime: number + * samples: [strings array] + * timeDeltas: [numbers array] + * } + * + */ + void Serialize(OutputStream* stream, + SerializationFormat format = kJSON) const; }; enum CpuProfilingMode { @@ -576,37 +624,6 @@ class V8_EXPORT HeapGraphNode { const HeapGraphEdge* GetChild(int index) const; }; - -/** - * An interface for exporting data from V8, using "push" model. - */ -class V8_EXPORT OutputStream { - public: - enum WriteResult { - kContinue = 0, - kAbort = 1 - }; - virtual ~OutputStream() = default; - /** Notify about the end of stream. */ - virtual void EndOfStream() = 0; - /** Get preferred output chunk size. Called only once. */ - virtual int GetChunkSize() { return 1024; } - /** - * Writes the next chunk of snapshot data into the stream. Writing - * can be stopped by returning kAbort as function result. EndOfStream - * will not be called in case writing was aborted. - */ - virtual WriteResult WriteAsciiChunk(char* data, int size) = 0; - /** - * Writes the next chunk of heap stats data into the stream. Writing - * can be stopped by returning kAbort as function result. EndOfStream - * will not be called in case writing was aborted. - */ - virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) { - return kAbort; - } -}; - /** * HeapSnapshots record the state of the JS heap at some moment. */ diff --git a/deps/v8/include/v8-traced-handle.h b/deps/v8/include/v8-traced-handle.h index 7719b9bc0167f2..e0fd57c49d4c55 100644 --- a/deps/v8/include/v8-traced-handle.h +++ b/deps/v8/include/v8-traced-handle.h @@ -403,7 +403,7 @@ void TracedReferenceBase::SetWrapperClassId(uint16_t class_id) { using I = internal::Internals; if (IsEmpty()) return; internal::Address* obj = reinterpret_cast(val_); - uint8_t* addr = reinterpret_cast(obj) + I::kNodeClassIdOffset; + uint8_t* addr = reinterpret_cast(obj) + I::kTracedNodeClassIdOffset; *reinterpret_cast(addr) = class_id; } @@ -411,7 +411,7 @@ uint16_t TracedReferenceBase::WrapperClassId() const { using I = internal::Internals; if (IsEmpty()) return 0; internal::Address* obj = reinterpret_cast(val_); - uint8_t* addr = reinterpret_cast(obj) + I::kNodeClassIdOffset; + uint8_t* addr = reinterpret_cast(obj) + I::kTracedNodeClassIdOffset; return *reinterpret_cast(addr); } diff --git a/deps/v8/include/v8-value.h b/deps/v8/include/v8-value.h index adca989e0022d1..866da201245877 100644 --- a/deps/v8/include/v8-value.h +++ b/deps/v8/include/v8-value.h @@ -244,6 +244,11 @@ class V8_EXPORT Value : public Data { */ bool IsWeakSet() const; + /** + * Returns true if this value is a WeakRef. + */ + bool IsWeakRef() const; + /** * Returns true if this value is an ArrayBuffer. */ diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 027a13a3b239bc..a7552d91e1807f 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 10 -#define V8_MINOR_VERSION 8 -#define V8_BUILD_NUMBER 168 -#define V8_PATCH_LEVEL 20 +#define V8_MINOR_VERSION 9 +#define V8_BUILD_NUMBER 194 +#define V8_PATCH_LEVEL 4 // 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 a959be130d5319..2ac27b36b47ee3 100644 --- a/deps/v8/include/v8config.h +++ b/deps/v8/include/v8config.h @@ -288,6 +288,9 @@ path. Add it with -I to the command line // // V8_HAS_ATTRIBUTE_ALWAYS_INLINE - __attribute__((always_inline)) // supported +// V8_HAS_ATTRIBUTE_CONSTINIT - __attribute__((require_constant_ +// initialization)) +// supported // V8_HAS_ATTRIBUTE_NONNULL - __attribute__((nonnull)) supported // V8_HAS_ATTRIBUTE_NOINLINE - __attribute__((noinline)) supported // V8_HAS_ATTRIBUTE_UNUSED - __attribute__((unused)) supported @@ -334,6 +337,8 @@ path. Add it with -I to the command line #endif # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline)) +# define V8_HAS_ATTRIBUTE_CONSTINIT \ + (__has_attribute(require_constant_initialization)) # define V8_HAS_ATTRIBUTE_NONNULL (__has_attribute(nonnull)) # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline)) # define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused)) @@ -450,6 +455,16 @@ path. Add it with -I to the command line #endif +// A macro to mark a declaration as requiring constant initialization. +// Use like: +// int* foo V8_CONSTINIT; +#if V8_HAS_ATTRIBUTE_CONSTINIT +# define V8_CONSTINIT __attribute__((require_constant_initialization)) +#else +# define V8_CONSTINIT +#endif + + // A macro to mark specific arguments as non-null. // Use like: // int add(int* x, int y, int* z) V8_NONNULL(1, 3) { return *x + y + *z; } diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl index 516905539cf72c..19d5e1845249ec 100644 --- a/deps/v8/infra/testing/builders.pyl +++ b/deps/v8/infra/testing/builders.pyl @@ -161,7 +161,6 @@ 'tests': [ {'name': 'benchmarks'}, {'name': 'benchmarks', 'variant': 'extra'}, - {'name': 'gcmole'}, {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, {'name': 'mozilla', 'variant': 'extra'}, @@ -180,6 +179,7 @@ ], 'shards': 4, }, + {'name': 'gcmole'}, ], }, 'v8_linux_optional_rel': { @@ -847,7 +847,7 @@ {'name': 'mozilla'}, {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 2}, - {'name': 'v8testing', 'variant': 'extra'}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, ], }, ############################################################################## @@ -989,7 +989,6 @@ 'tests': [ {'name': 'benchmarks'}, {'name': 'benchmarks', 'variant': 'extra'}, - {'name': 'gcmole'}, {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, {'name': 'mozilla', 'variant': 'extra'}, @@ -1051,6 +1050,7 @@ 'test_args': ['--extra-flags', '--noenable-avx'], 'shards': 2 }, + {'name': 'gcmole'}, ], }, 'V8 Linux - arm64 - sim - CFI': { @@ -1807,8 +1807,8 @@ 'tests': [ {'name': 'mozilla'}, {'name': 'test262', 'variant': 'default'}, - {'name': 'v8testing'}, - {'name': 'v8testing', 'variant': 'extra'}, + {'name': 'v8testing', 'shards': 2}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, ], }, 'V8 Win64 - debug': { @@ -1829,7 +1829,7 @@ 'tests': [ {'name': 'mozilla'}, {'name': 'test262', 'variant': 'default'}, - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, ], }, 'V8 Win64 ASAN': { diff --git a/deps/v8/src/api/api-natives.cc b/deps/v8/src/api/api-natives.cc index 8624c279d66e4f..d0b298723423e9 100644 --- a/deps/v8/src/api/api-natives.cc +++ b/deps/v8/src/api/api-natives.cc @@ -83,6 +83,8 @@ MaybeHandle DefineAccessorProperty(Isolate* isolate, InstantiateFunction(isolate, Handle::cast(getter)), Object); + Handle trampoline = BUILTIN_CODE(isolate, DebugBreakTrampoline); + Handle::cast(getter)->set_code(*trampoline); } if (setter->IsFunctionTemplateInfo() && FunctionTemplateInfo::cast(*setter).BreakAtEntry()) { @@ -91,6 +93,8 @@ MaybeHandle DefineAccessorProperty(Isolate* isolate, InstantiateFunction(isolate, Handle::cast(setter)), Object); + Handle trampoline = BUILTIN_CODE(isolate, DebugBreakTrampoline); + Handle::cast(setter)->set_code(*trampoline); } RETURN_ON_EXCEPTION( isolate, diff --git a/deps/v8/src/api/api.cc b/deps/v8/src/api/api.cc index a4a4381614e1fd..da75db119baf10 100644 --- a/deps/v8/src/api/api.cc +++ b/deps/v8/src/api/api.cc @@ -63,6 +63,7 @@ #include "src/handles/global-handles.h" #include "src/handles/persistent-handles.h" #include "src/handles/shared-object-conveyor-handles.h" +#include "src/handles/traced-handles.h" #include "src/heap/embedder-tracing.h" #include "src/heap/heap-inl.h" #include "src/heap/heap-write-barrier.h" @@ -616,7 +617,10 @@ StartupData SnapshotCreator::CreateBlob( i::Snapshot::ClearReconstructableDataForSerialization( i_isolate, function_code_handling == FunctionCodeHandling::kClear); - i::GlobalSafepointScope global_safepoint(i_isolate); + i::SafepointKind safepoint_kind = i_isolate->has_shared_heap() + ? i::SafepointKind::kGlobal + : i::SafepointKind::kIsolate; + i::SafepointScope safepoint_scope(i_isolate, safepoint_kind); i::DisallowGarbageCollection no_gc_from_here_on; // Create a vector with all contexts and clear associated Persistent fields. @@ -654,7 +658,7 @@ StartupData SnapshotCreator::CreateBlob( data->created_ = true; return i::Snapshot::Create(i_isolate, &contexts, embedder_fields_serializers, - global_safepoint, no_gc_from_here_on); + safepoint_scope, no_gc_from_here_on); } bool StartupData::CanBeRehashed() const { @@ -792,8 +796,7 @@ i::Address* GlobalizeTracedReference(i::Isolate* i_isolate, i::Address* obj, Utils::ApiCheck((slot != nullptr), "v8::GlobalizeTracedReference", "the address slot must be not null"); #endif - i::Handle result = - i_isolate->global_handles()->CreateTraced(*obj, slot, store_mode); + auto result = i_isolate->traced_handles()->Create(*obj, slot, store_mode); #ifdef VERIFY_HEAP if (i::v8_flags.verify_heap) { i::Object(*obj).ObjectVerify(i_isolate); @@ -803,16 +806,16 @@ i::Address* GlobalizeTracedReference(i::Isolate* i_isolate, i::Address* obj, } void MoveTracedReference(internal::Address** from, internal::Address** to) { - GlobalHandles::MoveTracedReference(from, to); + TracedHandles::Move(from, to); } void CopyTracedReference(const internal::Address* const* from, internal::Address** to) { - GlobalHandles::CopyTracedReference(from, to); + TracedHandles::Copy(from, to); } void DisposeTracedReference(internal::Address* location) { - GlobalHandles::DestroyTracedReference(location); + TracedHandles::Destroy(location); } } // namespace internal @@ -3732,6 +3735,7 @@ bool Value::IsWasmModuleObject() const { return false; } #endif // V8_ENABLE_WEBASSEMBLY VALUE_IS_SPECIFIC_TYPE(WeakMap, JSWeakMap) VALUE_IS_SPECIFIC_TYPE(WeakSet, JSWeakSet) +VALUE_IS_SPECIFIC_TYPE(WeakRef, JSWeakRef) #undef VALUE_IS_SPECIFIC_TYPE @@ -6611,10 +6615,31 @@ v8::Isolate* Context::GetIsolate() { v8::MicrotaskQueue* Context::GetMicrotaskQueue() { i::Handle env = Utils::OpenHandle(this); Utils::ApiCheck(env->IsNativeContext(), "v8::Context::GetMicrotaskQueue", - "Must be calld on a native context"); + "Must be called on a native context"); return i::Handle::cast(env)->microtask_queue(); } +void Context::SetMicrotaskQueue(v8::MicrotaskQueue* queue) { + i::Handle context = Utils::OpenHandle(this); + i::Isolate* i_isolate = context->GetIsolate(); + Utils::ApiCheck(context->IsNativeContext(), "v8::Context::SetMicrotaskQueue", + "Must be called on a native context"); + i::Handle native_context = + i::Handle::cast(context); + i::HandleScopeImplementer* impl = i_isolate->handle_scope_implementer(); + Utils::ApiCheck(!native_context->microtask_queue()->IsRunningMicrotasks(), + "v8::Context::SetMicrotaskQueue", + "Must not be running microtasks"); + Utils::ApiCheck( + native_context->microtask_queue()->GetMicrotasksScopeDepth() == 0, + "v8::Context::SetMicrotaskQueue", "Must not have microtask scope pushed"); + Utils::ApiCheck(impl->EnteredContextCount() == 0, + "v8::Context::SetMicrotaskQueue()", + "Cannot set Microtask Queue with an entered context"); + native_context->set_microtask_queue( + i_isolate, static_cast(queue)); +} + v8::Local Context::Global() { i::Handle context = Utils::OpenHandle(this); i::Isolate* i_isolate = context->GetIsolate(); @@ -8086,14 +8111,32 @@ std::shared_ptr ToInternal( } } // namespace -void v8::ArrayBuffer::Detach() { +Maybe v8::ArrayBuffer::Detach(v8::Local key) { i::Handle obj = Utils::OpenHandle(this); i::Isolate* i_isolate = obj->GetIsolate(); Utils::ApiCheck(obj->is_detachable(), "v8::ArrayBuffer::Detach", "Only detachable ArrayBuffers can be detached"); - API_RCS_SCOPE(i_isolate, ArrayBuffer, Detach); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); - obj->Detach(); + ENTER_V8_NO_SCRIPT( + i_isolate, reinterpret_cast(i_isolate)->GetCurrentContext(), + ArrayBuffer, Detach, Nothing(), i::HandleScope); + if (!key.IsEmpty()) { + i::Handle i_key = Utils::OpenHandle(*key); + constexpr bool kForceForWasmMemory = false; + has_pending_exception = + i::JSArrayBuffer::Detach(obj, kForceForWasmMemory, i_key).IsNothing(); + } else { + has_pending_exception = i::JSArrayBuffer::Detach(obj).IsNothing(); + } + RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); + return Just(true); +} + +void v8::ArrayBuffer::Detach() { Detach(Local()).Check(); } + +void v8::ArrayBuffer::SetDetachKey(v8::Local key) { + i::Handle obj = Utils::OpenHandle(this); + i::Handle i_key = Utils::OpenHandle(*key); + obj->set_detach_key(*i_key); } size_t v8::ArrayBuffer::ByteLength() const { @@ -9557,16 +9600,19 @@ CALLBACK_SETTER(WasmAsyncResolvePromiseCallback, CALLBACK_SETTER(WasmLoadSourceMapCallback, WasmLoadSourceMapCallback, wasm_load_source_map_callback) -CALLBACK_SETTER(WasmSimdEnabledCallback, WasmSimdEnabledCallback, - wasm_simd_enabled_callback) - -CALLBACK_SETTER(WasmExceptionsEnabledCallback, WasmExceptionsEnabledCallback, - wasm_exceptions_enabled_callback) - CALLBACK_SETTER(SharedArrayBufferConstructorEnabledCallback, SharedArrayBufferConstructorEnabledCallback, sharedarraybuffer_constructor_enabled_callback) +void Isolate::SetWasmExceptionsEnabledCallback( + WasmExceptionsEnabledCallback callback) { + // Exceptions are always enabled +} + +void Isolate::SetWasmSimdEnabledCallback(WasmSimdEnabledCallback callback) { + // SIMD is always enabled +} + void Isolate::InstallConditionalFeatures(Local context) { v8::HandleScope handle_scope(this); v8::Context::Scope context_scope(context); @@ -9725,6 +9771,11 @@ MicrotasksScope::MicrotasksScope(Isolate* v8_isolate, MicrotasksScope::Type type) : MicrotasksScope(v8_isolate, nullptr, type) {} +MicrotasksScope::MicrotasksScope(Local v8_context, + MicrotasksScope::Type type) + : MicrotasksScope(v8_context->GetIsolate(), v8_context->GetMicrotaskQueue(), + type) {} + MicrotasksScope::MicrotasksScope(Isolate* v8_isolate, MicrotaskQueue* microtask_queue, MicrotasksScope::Type type) @@ -10046,6 +10097,21 @@ int64_t CpuProfile::GetEndTime() const { return profile->end_time().since_origin().InMicroseconds(); } +static i::CpuProfile* ToInternal(const CpuProfile* profile) { + return const_cast( + reinterpret_cast(profile)); +} + +void CpuProfile::Serialize(OutputStream* stream, + CpuProfile::SerializationFormat format) const { + Utils::ApiCheck(format == kJSON, "v8::CpuProfile::Serialize", + "Unknown serialization format"); + Utils::ApiCheck(stream->GetChunkSize() > 0, "v8::CpuProfile::Serialize", + "Invalid stream chunk size"); + i::CpuProfileJSONSerializer serializer(ToInternal(this)); + serializer.Serialize(stream); +} + int CpuProfile::GetSamplesCount() const { return reinterpret_cast(this)->samples_count(); } @@ -10508,7 +10574,7 @@ void EmbedderHeapTracer::IterateTracedGlobalHandles( TracedGlobalHandleVisitor* visitor) { i::Isolate* i_isolate = reinterpret_cast(v8_isolate_); i::DisallowGarbageCollection no_gc; - i_isolate->global_handles()->IterateTracedNodes(visitor); + i_isolate->traced_handles()->Iterate(visitor); } bool EmbedderHeapTracer::IsRootForNonTracingGC( diff --git a/deps/v8/src/asmjs/asm-js.cc b/deps/v8/src/asmjs/asm-js.cc index a6973bd385c682..cb904a0be0db9a 100644 --- a/deps/v8/src/asmjs/asm-js.cc +++ b/deps/v8/src/asmjs/asm-js.cc @@ -133,7 +133,7 @@ void Report(Handle