diff --git a/deps/v8/.ycm_extra_conf.py b/deps/v8/.ycm_extra_conf.py index 25d01c1881797f..6d79c46245eb4e 100644 --- a/deps/v8/.ycm_extra_conf.py +++ b/deps/v8/.ycm_extra_conf.py @@ -114,7 +114,7 @@ def GetClangCommandFromNinjaForFilename(v8_root, filename): # should contain most/all of the interesting flags for other targets too. filename = os.path.join(v8_root, 'src', 'utils', 'utils.cc') - sys.path.append(os.path.join(v8_root, 'tools', 'ninja')) + sys.path.append(os.path.join(v8_root, 'tools', 'vim')) from ninja_output import GetNinjaOutputDirectory out_dir = os.path.realpath(GetNinjaOutputDirectory(v8_root)) @@ -133,7 +133,7 @@ def GetClangCommandFromNinjaForFilename(v8_root, filename): # Ninja might execute several commands to build something. We want the last # clang command. clang_line = None - for line in reversed(stdout.split('\n')): + for line in reversed(stdout.decode('utf-8').splitlines()): if 'clang' in line: clang_line = line break diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index ea786ddea4c085..d9eb05985c555c 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -86,7 +86,6 @@ Daniel Andersson Daniel Bevenius Daniel Dromboski Daniel James -Darshan Sen David Carlier David Manouchehri Deepak Mohan diff --git a/deps/v8/BUILD.bazel b/deps/v8/BUILD.bazel index e0d5ce713852ca..c5b4a94f911a7b 100644 --- a/deps/v8/BUILD.bazel +++ b/deps/v8/BUILD.bazel @@ -6,6 +6,7 @@ load("@bazel_skylib//lib:selects.bzl", "selects") load( "@v8//:bazel/defs.bzl", "v8_binary", + "v8_build_config", "v8_config", "v8_custom_config", "v8_raw_flag", @@ -358,6 +359,7 @@ filegroup( srcs = [ "include/cppgc/allocation.h", "include/cppgc/common.h", + "include/cppgc/cross-thread-persistent.h", "include/cppgc/custom-space.h", "include/cppgc/default-platform.h", "include/cppgc/ephemeron-pair.h", @@ -610,11 +612,14 @@ filegroup( srcs = [ "src/builtins/aggregate-error.tq", "src/builtins/array-at.tq", + "src/builtins/array-concat.tq", "src/builtins/array-copywithin.tq", "src/builtins/array-every.tq", "src/builtins/array-filter.tq", "src/builtins/array-find.tq", "src/builtins/array-findindex.tq", + "src/builtins/array-findlast.tq", + "src/builtins/array-findlastindex.tq", "src/builtins/array-foreach.tq", "src/builtins/array-from.tq", "src/builtins/array-isarray.tq", @@ -716,6 +721,8 @@ filegroup( "src/builtins/typed-array-filter.tq", "src/builtins/typed-array-find.tq", "src/builtins/typed-array-findindex.tq", + "src/builtins/typed-array-findlast.tq", + "src/builtins/typed-array-findlastindex.tq", "src/builtins/typed-array-foreach.tq", "src/builtins/typed-array-from.tq", "src/builtins/typed-array-keys.tq", @@ -1018,6 +1025,7 @@ filegroup( "src/codegen/reloc-info.h", "src/codegen/safepoint-table.cc", "src/codegen/safepoint-table.h", + "src/codegen/script-details.h", "src/codegen/signature.h", "src/codegen/source-position-table.cc", "src/codegen/source-position-table.h", @@ -1041,8 +1049,8 @@ filegroup( "src/common/message-template.h", "src/common/ptr-compr-inl.h", "src/common/ptr-compr.h", - "src/compiler-dispatcher/compiler-dispatcher.cc", - "src/compiler-dispatcher/compiler-dispatcher.h", + "src/compiler-dispatcher/lazy-compile-dispatcher.cc", + "src/compiler-dispatcher/lazy-compile-dispatcher.h", "src/compiler-dispatcher/optimizing-compile-dispatcher.cc", "src/compiler-dispatcher/optimizing-compile-dispatcher.h", "src/date/date.cc", @@ -1253,6 +1261,7 @@ filegroup( "src/heap/invalidated-slots.h", "src/heap/large-spaces.cc", "src/heap/large-spaces.h", + "src/heap/linear-allocation-area.h", "src/heap/list.h", "src/heap/local-allocator-inl.h", "src/heap/local-allocator.h", @@ -1403,6 +1412,7 @@ filegroup( "src/logging/counters-definitions.h", "src/logging/counters.cc", "src/logging/counters.h", + "src/logging/counters-scopes.h", "src/logging/local-logger.cc", "src/logging/local-logger.h", "src/logging/log-inl.h", @@ -1591,6 +1601,7 @@ filegroup( "src/objects/prototype-info.h", "src/objects/prototype.h", "src/objects/prototype-inl.h", + "src/objects/regexp-match-info-inl.h", "src/objects/regexp-match-info.h", "src/objects/scope-info-inl.h", "src/objects/scope-info.cc", @@ -2433,9 +2444,6 @@ filegroup( "src/compiler/scheduler.h", "src/compiler/select-lowering.cc", "src/compiler/select-lowering.h", - "src/compiler/serializer-for-background-compilation.cc", - "src/compiler/serializer-for-background-compilation.h", - "src/compiler/serializer-hints.h", "src/compiler/simplified-lowering.cc", "src/compiler/simplified-lowering.h", "src/compiler/simplified-operator.cc", @@ -2672,10 +2680,12 @@ filegroup( "src/bigint/bigint-internal.h", "src/bigint/bigint.h", "src/bigint/digit-arithmetic.h", + "src/bigint/div-barrett.cc", "src/bigint/div-burnikel.cc", "src/bigint/div-helpers.cc", "src/bigint/div-helpers.h", "src/bigint/div-schoolbook.cc", + "src/bigint/fromstring.cc", "src/bigint/mul-fft.cc", "src/bigint/mul-karatsuba.cc", "src/bigint/mul-schoolbook.cc", @@ -3050,3 +3060,42 @@ v8_binary( ], deps = [ ":v8" ], ) + +# ================================================= +# Tests +# ================================================= + +v8_build_config( + name = "v8_build_config", +) + +# Runs mjunit with d8. +py_test( + name = "mjsunit", + size = "medium", + srcs = [ + "test/mjsunit/testcfg.py", + "tools/predictable_wrapper.py", + "tools/run-tests.py", + ] + glob(["tools/testrunner/**/*.py"]), + args = [ + "--no-sorting", + "--nopresubmit", + # TODO(victorgomes): Create a flag to pass the variant in the cmdline. + "--variant=default", + "--outdir bazel-bin", + "mjsunit", + ], + data = [ + ":v8_build_config", + ":d8", + "test", + ] + glob(["test/**"]) + glob(["tools/**/*.js"]) + glob(["tools/**/*.mjs"]), + main = "tools/run-tests.py", + # TODO(victorgomes): Move this to PY3. + python_version = "PY2", + tags = [ + # Disable sanitizers, as they don't work in general in V8. + "nosan", + ], +) diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 17bab98e8faba5..3e48fb11bff9f9 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -452,6 +452,12 @@ if (v8_enable_shared_ro_heap == "") { v8_enable_pointer_compression_shared_cage } +# Check if it is a Chromium build and activate PAC/BTI if needed. +if (build_with_chromium && v8_current_cpu == "arm64" && + arm_control_flow_integrity == "standard") { + v8_control_flow_integrity = true +} + assert(!v8_disable_write_barriers || v8_enable_single_generation, "Disabling write barriers works only with single generation") @@ -548,6 +554,10 @@ config("internal_config") { if (is_component_build) { defines += [ "BUILDING_V8_SHARED" ] } + + if (v8_current_cpu == "riscv64") { + libs = [ "atomic" ] + } } # Should be applied to all targets that write trace events. @@ -616,6 +626,10 @@ config("external_config") { if (is_component_build) { defines += [ "USING_V8_SHARED" ] } + + if (current_cpu == "riscv64") { + libs = [ "atomic" ] + } } # This config should only be applied to code that needs to be explicitly @@ -918,6 +932,9 @@ config("features") { if (v8_allocation_site_tracking) { defines += [ "V8_ALLOCATION_SITE_TRACKING" ] } + if (v8_advanced_bigint_algorithms) { + defines += [ "V8_ADVANCED_BIGINT_ALGORITHMS" ] + } } config("toolchain") { @@ -1396,11 +1413,14 @@ action("postmortem-metadata") { torque_files = [ "src/builtins/aggregate-error.tq", "src/builtins/array-at.tq", + "src/builtins/array-concat.tq", "src/builtins/array-copywithin.tq", "src/builtins/array-every.tq", "src/builtins/array-filter.tq", "src/builtins/array-find.tq", "src/builtins/array-findindex.tq", + "src/builtins/array-findlast.tq", + "src/builtins/array-findlastindex.tq", "src/builtins/array-foreach.tq", "src/builtins/array-from.tq", "src/builtins/array-isarray.tq", @@ -1502,6 +1522,8 @@ torque_files = [ "src/builtins/typed-array-filter.tq", "src/builtins/typed-array-find.tq", "src/builtins/typed-array-findindex.tq", + "src/builtins/typed-array-findlast.tq", + "src/builtins/typed-array-findlastindex.tq", "src/builtins/typed-array-foreach.tq", "src/builtins/typed-array-from.tq", "src/builtins/typed-array-keys.tq", @@ -2113,6 +2135,7 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-call-gen.cc", "src/builtins/builtins-call-gen.h", "src/builtins/builtins-collections-gen.cc", + "src/builtins/builtins-collections-gen.h", "src/builtins/builtins-constructor-gen.cc", "src/builtins/builtins-constructor-gen.h", "src/builtins/builtins-constructor.h", @@ -2457,6 +2480,7 @@ v8_header_set("v8_internal_headers") { "src/codegen/reglist.h", "src/codegen/reloc-info.h", "src/codegen/safepoint-table.h", + "src/codegen/script-details.h", "src/codegen/signature.h", "src/codegen/source-position-table.h", "src/codegen/source-position.h", @@ -2472,8 +2496,11 @@ v8_header_set("v8_internal_headers") { "src/common/message-template.h", "src/common/ptr-compr-inl.h", "src/common/ptr-compr.h", - "src/compiler-dispatcher/compiler-dispatcher.h", + "src/compiler-dispatcher/lazy-compile-dispatcher.h", "src/compiler-dispatcher/optimizing-compile-dispatcher.h", + "src/compiler/access-builder.h", + "src/compiler/access-info.h", + "src/compiler/add-type-assertions-reducer.h", "src/compiler/all-nodes.h", "src/compiler/allocation-builder-inl.h", "src/compiler/allocation-builder.h", @@ -2529,6 +2556,7 @@ v8_header_set("v8_internal_headers") { "src/compiler/graph-visualizer.h", "src/compiler/graph-zone-traits.h", "src/compiler/graph.h", + "src/compiler/heap-refs.h", "src/compiler/js-call-reducer.h", "src/compiler/js-context-specialization.h", "src/compiler/js-create-lowering.h", @@ -2582,8 +2610,6 @@ v8_header_set("v8_internal_headers") { "src/compiler/schedule.h", "src/compiler/scheduler.h", "src/compiler/select-lowering.h", - "src/compiler/serializer-for-background-compilation.h", - "src/compiler/serializer-hints.h", "src/compiler/simplified-lowering.h", "src/compiler/simplified-operator-reducer.h", "src/compiler/simplified-operator.h", @@ -2695,6 +2721,7 @@ v8_header_set("v8_internal_headers") { "src/heap/cppgc-js/unified-heap-marking-verifier.h", "src/heap/cppgc-js/unified-heap-marking-visitor.h", "src/heap/embedder-tracing.h", + "src/heap/factory-base-inl.h", "src/heap/factory-base.h", "src/heap/factory-inl.h", "src/heap/factory.h", @@ -2715,6 +2742,7 @@ v8_header_set("v8_internal_headers") { "src/heap/invalidated-slots-inl.h", "src/heap/invalidated-slots.h", "src/heap/large-spaces.h", + "src/heap/linear-allocation-area.h", "src/heap/list.h", "src/heap/local-allocator-inl.h", "src/heap/local-allocator.h", @@ -2807,6 +2835,7 @@ v8_header_set("v8_internal_headers") { "src/libsampler/sampler.h", "src/logging/code-events.h", "src/logging/counters-definitions.h", + "src/logging/counters-scopes.h", "src/logging/counters.h", "src/logging/local-logger.h", "src/logging/log-inl.h", @@ -2872,6 +2901,7 @@ v8_header_set("v8_internal_headers") { "src/objects/free-space-inl.h", "src/objects/free-space.h", "src/objects/function-kind.h", + "src/objects/function-syntax-kind.h", "src/objects/hash-table-inl.h", "src/objects/hash-table.h", "src/objects/heap-number-inl.h", @@ -2934,6 +2964,7 @@ v8_header_set("v8_internal_headers") { "src/objects/object-type.h", "src/objects/objects-body-descriptors-inl.h", "src/objects/objects-body-descriptors.h", + "src/objects/objects-definitions.h", "src/objects/objects-inl.h", "src/objects/objects.h", "src/objects/oddball-inl.h", @@ -2969,6 +3000,8 @@ v8_header_set("v8_internal_headers") { "src/objects/slots-atomic-inl.h", "src/objects/slots-inl.h", "src/objects/slots.h", + "src/objects/smi-inl.h", + "src/objects/smi.h", "src/objects/source-text-module-inl.h", "src/objects/source-text-module.h", "src/objects/stack-frame-info-inl.h", @@ -3149,6 +3182,7 @@ v8_header_set("v8_internal_headers") { if (v8_enable_webassembly) { sources += [ "src/asmjs/asm-js.h", + "src/asmjs/asm-names.h", "src/asmjs/asm-parser.h", "src/asmjs/asm-scanner.h", "src/asmjs/asm-types.h", @@ -3364,8 +3398,16 @@ v8_header_set("v8_internal_headers") { if (v8_control_flow_integrity) { sources += [ "src/execution/arm64/pointer-authentication-arm64.h" ] } - if (v8_enable_webassembly && current_cpu == "arm64" && is_mac) { - sources += [ "src/trap-handler/handler-inside-posix.h" ] + if (v8_enable_webassembly) { + # Trap handling is enabled on arm64 Mac and in simulators on x64 on Linux + # and Mac. + if ((current_cpu == "arm64" && is_mac) || + (current_cpu == "x64" && (is_linux || is_chromeos || is_mac))) { + sources += [ "src/trap-handler/handler-inside-posix.h" ] + } + if (current_cpu == "x64" && (is_linux || is_chromeos || is_mac)) { + sources += [ "src/trap-handler/trap-handler-simulator.h" ] + } } if (is_win) { sources += [ "src/diagnostics/unwinding-info-win64.h" ] @@ -3449,6 +3491,8 @@ v8_header_set("v8_internal_headers") { ] } else if (v8_current_cpu == "riscv64") { sources += [ ### gcmole(arch:riscv64) ### + "src/baseline/riscv64/baseline-assembler-riscv64-inl.h", + "src/baseline/riscv64/baseline-compiler-riscv64-inl.h", "src/codegen/riscv64/assembler-riscv64-inl.h", "src/codegen/riscv64/assembler-riscv64.h", "src/codegen/riscv64/constants-riscv64.h", @@ -3576,7 +3620,6 @@ v8_compiler_sources = [ "src/compiler/schedule.cc", "src/compiler/scheduler.cc", "src/compiler/select-lowering.cc", - "src/compiler/serializer-for-background-compilation.cc", "src/compiler/simplified-lowering.cc", "src/compiler/simplified-operator-reducer.cc", "src/compiler/simplified-operator.cc", @@ -3756,7 +3799,7 @@ v8_source_set("v8_base_without_compiler") { "src/codegen/turbo-assembler.cc", "src/codegen/unoptimized-compilation-info.cc", "src/common/assert-scope.cc", - "src/compiler-dispatcher/compiler-dispatcher.cc", + "src/compiler-dispatcher/lazy-compile-dispatcher.cc", "src/compiler-dispatcher/optimizing-compile-dispatcher.cc", "src/date/date.cc", "src/date/dateparser.cc", @@ -4265,11 +4308,19 @@ v8_source_set("v8_base_without_compiler") { "src/execution/arm64/simulator-logic-arm64.cc", "src/regexp/arm64/regexp-macro-assembler-arm64.cc", ] - if (v8_enable_webassembly && current_cpu == "arm64" && is_mac) { - sources += [ - "src/trap-handler/handler-inside-posix.cc", - "src/trap-handler/handler-outside-posix.cc", - ] + if (v8_enable_webassembly) { + # Trap handling is enabled on arm64 Mac and in simulators on x64 on Linux + # and Mac. + if ((current_cpu == "arm64" && is_mac) || + (current_cpu == "x64" && (is_linux || is_chromeos || is_mac))) { + sources += [ + "src/trap-handler/handler-inside-posix.cc", + "src/trap-handler/handler-outside-posix.cc", + ] + } + if (current_cpu == "x64" && (is_linux || is_chromeos || is_mac)) { + sources += [ "src/trap-handler/handler-outside-simulator.cc" ] + } } if (is_win) { sources += [ "src/diagnostics/unwinding-info-win64.cc" ] @@ -4712,10 +4763,12 @@ v8_component("v8_libbase") { "src/base/sys-info.cc", "src/base/sys-info.h", "src/base/template-utils.h", + "src/base/threaded-list.h", "src/base/timezone-cache.h", "src/base/type-traits.h", "src/base/utils/random-number-generator.cc", "src/base/utils/random-number-generator.h", + "src/base/v8-fallthrough.h", "src/base/vector.h", "src/base/vlq-base64.cc", "src/base/vlq-base64.h", @@ -4927,6 +4980,10 @@ v8_component("v8_libplatform") { sources += [ "src/libplatform/tracing/recorder-win.cc" ] } } + + if (v8_current_cpu == "riscv64") { + libs = [ "atomic" ] + } } v8_source_set("fuzzer_support") { @@ -4957,6 +5014,7 @@ v8_source_set("v8_bigint") { "src/bigint/div-helpers.cc", "src/bigint/div-helpers.h", "src/bigint/div-schoolbook.cc", + "src/bigint/fromstring.cc", "src/bigint/mul-karatsuba.cc", "src/bigint/mul-schoolbook.cc", "src/bigint/tostring.cc", @@ -4967,11 +5025,10 @@ v8_source_set("v8_bigint") { if (v8_advanced_bigint_algorithms) { sources += [ + "src/bigint/div-barrett.cc", "src/bigint/mul-fft.cc", "src/bigint/mul-toom.cc", ] - - defines = [ "V8_ADVANCED_BIGINT_ALGORITHMS" ] } configs = [ ":internal_config" ] @@ -4983,6 +5040,7 @@ v8_source_set("v8_cppgc_shared") { "src/heap/base/stack.h", "src/heap/base/worklist.cc", "src/heap/base/worklist.h", + "src/heap/cppgc/globals.h", ] if (is_clang || !is_win) { @@ -5017,7 +5075,10 @@ v8_source_set("v8_cppgc_shared") { configs = [ ":internal_config" ] - public_deps = [ ":v8_libbase" ] + public_deps = [ + ":cppgc_headers", + ":v8_libbase", + ] } # This is split out to be a non-code containing target that the Chromium browser @@ -5075,7 +5136,10 @@ v8_header_set("cppgc_headers") { sources += [ "include/cppgc/internal/caged-heap-local-data.h" ] } - deps = [ ":v8_libplatform" ] + deps = [ + ":v8_libbase", + ":v8_libplatform", + ] public_deps = [ ":v8_config_headers" ] } @@ -5171,6 +5235,7 @@ v8_source_set("cppgc_base") { "src/heap/cppgc/virtual-memory.cc", "src/heap/cppgc/virtual-memory.h", "src/heap/cppgc/visitor.cc", + "src/heap/cppgc/visitor.h", "src/heap/cppgc/write-barrier.cc", "src/heap/cppgc/write-barrier.h", ] diff --git a/deps/v8/DEPS b/deps/v8/DEPS index b1e297b106f44c..439f45ca583385 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -49,19 +49,19 @@ vars = { 'reclient_version': 're_client_version:0.33.0.3e223d5', # GN CIPD package version. - 'gn_version': 'git_revision:24e2f7df92641de0351a96096fb2c490b2436bb8', + 'gn_version': 'git_revision:eea3906f0e2a8d3622080127d2005ff214d51383', # luci-go CIPD package version. - 'luci_go': 'git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd', + 'luci_go': 'git_revision:1120f810b7ab7eb71bd618c4c57fe82a60d4f2fe', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_build-tools_version # and whatever else without interference from each other. - 'android_sdk_build-tools_version': '8LZujEmLjSh0g3JciDA3cslSptxKs9HOa_iUPXkOeYQC', + 'android_sdk_build-tools_version': 'tRoD45SCi7UleQqSV7MrMQO1_e5P8ysphkCcj6z_cCQC', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_emulator_version # and whatever else without interference from each other. - 'android_sdk_emulator_version': 'A4EvXZUIuQho0QRDJopMUpgyp6NA3aiDQjGKPUKbowMC', + 'android_sdk_emulator_version': 'gMHhUuoQRKfxr-MBn3fNNXZtkAVXtOwMwT7kfx8jkIgC', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_extras_version # and whatever else without interference from each other. @@ -73,28 +73,28 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_platform-tools_version # and whatever else without interference from each other. - 'android_sdk_platform-tools_version': '8tF0AOj7Dwlv4j7_nfkhxWB0jzrvWWYjEIpirt8FIWYC', + 'android_sdk_platform-tools_version': 'qi_k82nm6j9nz4dQosOoqXew4_TFAy8rcGOHDLptx1sC', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_platforms_version # and whatever else without interference from each other. - 'android_sdk_platforms_version': 'YMUu9EHNZ__2Xcxl-KsaSf-dI5TMt_P62IseUVsxktMC', + 'android_sdk_platforms_version': 'lL3IGexKjYlwjO_1Ga-xwxgwbE_w-lmi2Zi1uOlWUIAC', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_sources_version # and whatever else without interference from each other. - 'android_sdk_sources_version': '4gxhM8E62bvZpQs7Q3d0DinQaW0RLCIefhXrQBFkNy8C', + 'android_sdk_sources_version': 'n7svc8KYah-i4s8zwkVa85SI3_H0WFOniP0mpwNdFO0C', # 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': 'V__2Ycej-H2-6AcXX5A3gi7sIk74SuN44PBm2uC_N1sC', + 'android_sdk_cmdline-tools_version': 'ZT3JmI6GMG4YVcZ1OtECRVMOLLJAWAdPbi-OclubJLMC', } deps = { 'base/trace_event/common': - Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + 'd5bb24e5d9802c8c917fcaa4375d5239a586c168', + Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '3da1e2fcf66acd5c7194497b4285ac163f32e239', 'build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + '2d999384c270a340f592cce0a0fb3f8f94c15290', + Var('chromium_url') + '/chromium/src/build.git' + '@' + 'bbf7f0ed65548c4df862d2a2748e3a9b908a3217', 'buildtools': - Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '2500c1d8f3a20a66a7cbafe3f69079a2edb742dd', + Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '37dc929ecb351687006a61744b116cda601753d7', 'buildtools/clang_format/script': Var('chromium_url') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + '99803d74e35962f63a775f29477882afd4d57d94', 'buildtools/linux64': { @@ -110,7 +110,7 @@ deps = { 'buildtools/mac': { 'packages': [ { - 'package': 'gn/gn/mac-amd64', + 'package': 'gn/gn/mac-${{arch}}', 'version': Var('gn_version'), } ], @@ -120,9 +120,9 @@ deps = { 'buildtools/third_party/libc++/trunk': Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '79a2e924d96e2fc1e4b937c42efd08898fa472d7', 'buildtools/third_party/libc++abi/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '6803464b0f46df0a51862347d39e0791b59cf568', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '24e92c2beed59b76ddabe7ceb5ee4b40f09e0712', 'buildtools/third_party/libunwind/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'a5feaf61658af4453e282142a76aeb6f9c045311', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'b825591df326b2725e6b88bdf74fdc88fefdf460', 'buildtools/win': { 'packages': [ { @@ -148,14 +148,14 @@ 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' + '@' + 'ebb6c34fa5dd76a6bea01c54ed7b182596492176', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'ab353c6e732b9e175d3ad6779e3acf3ea82d3761', 'test/test262/harness': Var('chromium_url') + '/external/github.com/test262-utils/test262-harness-py.git' + '@' + '278bcfaed0dcaa13936831fb1769d15e7c1e3b2b', 'third_party/aemu-linux-x64': { 'packages': [ { 'package': 'fuchsia/third_party/aemu/linux-amd64', - 'version': 'm4sM10idq7LeFHXpoLKLBtaOZsQzuj63Usa3Cl9af1YC' + 'version': 'qWiGSH8A_xdaUVO-GsDJsJ5HCkIRwZqb-HDyxsLiuWwC' }, ], 'condition': 'host_os == "linux" and checkout_fuchsia', @@ -176,13 +176,13 @@ deps = { 'condition': 'checkout_android', }, 'third_party/android_platform': { - 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + 'b291e88d8e3e6774d6d46151e11dc3189ddeeb09', + 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + 'e98c753917587d320f4e7a24f1c7474535adac3f', 'condition': 'checkout_android', }, 'third_party/android_sdk/public': { 'packages': [ { - 'package': 'chromium/third_party/android_sdk/public/build-tools/30.0.1', + 'package': 'chromium/third_party/android_sdk/public/build-tools/31.0.0', 'version': Var('android_sdk_build-tools_version'), }, { @@ -202,11 +202,11 @@ deps = { 'version': Var('android_sdk_platform-tools_version'), }, { - 'package': 'chromium/third_party/android_sdk/public/platforms/android-30', + 'package': 'chromium/third_party/android_sdk/public/platforms/android-31', 'version': Var('android_sdk_platforms_version'), }, { - 'package': 'chromium/third_party/android_sdk/public/sources/android-29', + 'package': 'chromium/third_party/android_sdk/public/sources/android-30', 'version': Var('android_sdk_sources_version'), }, { @@ -218,7 +218,7 @@ deps = { 'dep_type': 'cipd', }, 'third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '2814ff3716a8512518bee705a0f91425ce06b27b', + 'url': Var('chromium_url') + '/catapult.git' + '@' + 'abc7ba7d871fe3c25b0a1bec7fc84fb309034cb7', 'condition': 'checkout_android', }, 'third_party/colorama/src': { @@ -226,24 +226,24 @@ deps = { 'condition': 'checkout_android', }, 'third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'a806594b95a39141fdbf1f359087a44ffb2deaaf', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '49a703f3d915b140c9f373107e1ba17f30e2487d', 'third_party/fuchsia-sdk': { 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + '18896843130c33372c455c153ad07d2217bd2085', 'condition': 'checkout_fuchsia', }, 'third_party/google_benchmark/src': { - 'url': Var('chromium_url') + '/external/github.com/google/benchmark.git' + '@' + 'e451e50e9b8af453f076dec10bd6890847f1624e', + 'url': Var('chromium_url') + '/external/github.com/google/benchmark.git' + '@' + '4124223bf5303d1d65fe2c40f33e28372bbb986c', }, 'third_party/googletest/src': - Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '4ec4cd23f486bf70efcc5d2caa40f24368f752e3', + Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '47f819c3ca54fb602f432904443e00a0a1fe2f42', 'third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'b9dfc58bf9b02ea0365509244aca13841322feb0', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '75e34bcccea0be165c31fdb278b3712c516c5876', 'third_party/instrumented_libraries': - Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + '4ae2535e8e894c3cd81d46aacdaf151b5df30709', + Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + '9a8087bbbf43a355950fc1667575d1a753f8aaa4', 'third_party/ittapi': { # Force checkout ittapi libraries to pass v8 header includes check on # bots that has check_v8_header_includes enabled. - 'url': Var('chromium_url') + '/external/github.com/intel/ittapi' + '@' + 'b4ae0122ba749163096058b4f1bb065bf4a7de94', + 'url': Var('chromium_url') + '/external/github.com/intel/ittapi' + '@' + 'a3911fff01a775023a06af8754f9ec1e5977dd97', 'condition': "checkout_ittapi or check_v8_header_includes", }, 'third_party/jinja2': @@ -251,7 +251,7 @@ deps = { 'third_party/jsoncpp/source': Var('chromium_url') + '/external/github.com/open-source-parsers/jsoncpp.git'+ '@' + '9059f5cad030ba11d37818847443a53918c327b1', 'third_party/logdog/logdog': - Var('chromium_url') + '/infra/luci/luci-py/client/libs/logdog' + '@' + '794d09a24c10401953880c253d0c7e267234ab75', + Var('chromium_url') + '/infra/luci/luci-py/client/libs/logdog' + '@' + '17ec234f823f7bff6ada6584fdbbee9d54b8fc58', 'third_party/markupsafe': Var('chromium_url') + '/chromium/src/third_party/markupsafe.git' + '@' + '1b882ef6372b58bfd55a3285f37ed801be9137cd', 'third_party/perfetto': @@ -283,9 +283,9 @@ deps = { 'condition': 'checkout_android', }, 'third_party/zlib': - Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + 'dfbc590f5855bc2765256a743cad0abc56330a30', + Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '563140dd9c24f84bf40919196e9e7666d351cc0d', 'tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '9d0a403e85d25b5b0d3016a342d4b83b12941fd5', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '6a8e571efd68de48d226950d1e10cb8982e71496', 'tools/clang/dsymutil': { 'packages': [ { diff --git a/deps/v8/OWNERS b/deps/v8/OWNERS index 6f0ac017208f5c..f9b23f237f546e 100644 --- a/deps/v8/OWNERS +++ b/deps/v8/OWNERS @@ -27,8 +27,8 @@ per-file codereview.settings=file:INFRA_OWNERS per-file AUTHORS=file:COMMON_OWNERS per-file WATCHLISTS=file:COMMON_OWNERS -per-file *-mips*=file:MIPS_OWNERS -per-file *-mips64*=file:MIPS_OWNERS -per-file *-ppc*=file:PPC_OWNERS -per-file *-riscv64*=file:RISCV_OWNERS -per-file *-s390*=file:S390_OWNERS +per-file ...-mips*=file:MIPS_OWNERS +per-file ...-mips64*=file:MIPS_OWNERS +per-file ...-ppc*=file:PPC_OWNERS +per-file ...-riscv64*=file:RISCV_OWNERS +per-file ...-s390*=file:S390_OWNERS diff --git a/deps/v8/WATCHLISTS b/deps/v8/WATCHLISTS index f691d88e921606..b8b7eac99a22b7 100644 --- a/deps/v8/WATCHLISTS +++ b/deps/v8/WATCHLISTS @@ -33,6 +33,9 @@ { 'WATCHLIST_DEFINITIONS': { + 'api': { + 'filepath': 'include/', + }, 'snapshot': { 'filepath': 'src/snapshot/', }, @@ -52,7 +55,7 @@ '|test/unittests/interpreter/', }, 'baseline': { - 'filepath': 'src/baseline/' + 'filepath': 'src/baseline/', }, 'feature_shipping_status': { 'filepath': 'src/flags/flag-definitions.h', @@ -67,9 +70,6 @@ 'filepath': 'src/codegen/code-stub-assembler\.(cc|h)$' \ '|src/builtins/.*-gen.(cc|h)$', }, - 'ia32': { - 'filepath': '/ia32/', - }, 'merges': { 'filepath': '.', }, @@ -102,7 +102,7 @@ 'filepath': 'BUILD.gn' \ '|BUILD.bazel' \ '|WORKSPACE' \ - '|bazel/' + '|bazel/', }, }, @@ -153,17 +153,21 @@ 'alph+watch@chromium.org', 'lpy+v8tracing@chromium.org', 'fmeawad@chromium.org', + 'cbruni+watch@chromium.org', ], 'ieee754': [ 'rtoy+watch@chromium.org', - 'hongchan+watch@chromium.org' + 'hongchan+watch@chromium.org', ], 'regexp': [ 'jgruber+watch@chromium.org', - 'pthier+watch@chromium.org' + 'pthier+watch@chromium.org', + ], + 'bazel': [ + 'victorgomes+watch@chromium.org', ], - 'bazel' : [ - 'victorgomes+watch@chromium.org' + 'api': [ + 'cbruni+watch@chromium.org', ], }, } diff --git a/deps/v8/base/trace_event/common/trace_event_common.h b/deps/v8/base/trace_event/common/trace_event_common.h index dff2f9b2773c68..76391985c1af4e 100644 --- a/deps/v8/base/trace_event/common/trace_event_common.h +++ b/deps/v8/base/trace_event/common/trace_event_common.h @@ -56,12 +56,12 @@ // static int send_count = 0; // ++send_count; // TRACE_EVENT_NESTABLE_ASYNC_BEGIN0( -// "ipc", "message", TRACE_ID_LOCAL(send_count)); +// "ipc", "message", TRACE_ID_WITH_SCOPE("message", send_count)); // Send(new MyMessage(send_count)); // [receive code] // void OnMyMessage(send_count) { // TRACE_NESTABLE_EVENT_ASYNC_END0( -// "ipc", "message", TRACE_ID_LOCAL(send_count)); +// "ipc", "message", TRACE_ID_WITH_SCOPE("message", send_count)); // } // The third parameter is a unique ID to match NESTABLE_ASYNC_BEGIN/ASYNC_END // pairs. NESTABLE_ASYNC_BEGIN and ASYNC_END can occur on any thread of any @@ -71,10 +71,12 @@ // class MyTracedClass { // public: // MyTracedClass() { -// TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("category", "MyTracedClass", this); +// TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("category", "MyTracedClass", +// TRACE_ID_LOCAL(this)); // } // ~MyTracedClass() { -// TRACE_EVENT_NESTABLE_ASYNC_END0("category", "MyTracedClass", this); +// TRACE_EVENT_NESTABLE_ASYNC_END0("category", "MyTracedClass", +// TRACE_ID_LOCAL(this)); // } // } // @@ -390,12 +392,15 @@ struct BASE_EXPORT TraceTimestampTraits<::base::TimeTicks> { TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ arg2_name, arg2_val) -// Similar to TRACE_EVENT_BEGINx but with a custom |at| timestamp provided. +// Similar to TRACE_EVENT_BEGINx but with a custom |timestamp| provided. // - |id| is used to match the _BEGIN event with the _END event. // Events are considered to match if their category_group, name and id values // all match. |id| must either be a pointer or an integer value up to 64 bits. // If it's a pointer, the bits will be xored with a hash of the process ID so // that the same pointer on two different processes will not collide. +// - |timestamp| must be non-null or it crashes. Use DCHECK(timestamp) before +// calling this to detect an invalid timestamp even when tracing is not +// enabled, as the commit queue doesn't run all tests with tracing enabled. #define TRACE_EVENT_BEGIN_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \ thread_id, timestamp) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ @@ -446,6 +451,10 @@ struct BASE_EXPORT TraceTimestampTraits<::base::TimeTicks> { TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ arg2_name, arg2_val) +// Adds a trace event with the given |name| and |timestamp|. |timestamp| must be +// non-null or it crashes. Use DCHECK(timestamp) before calling this to detect +// an invalid timestamp even when tracing is not enabled, as the commit queue +// doesn't run all tests with tracing enabled. #define TRACE_EVENT_MARK_WITH_TIMESTAMP0(category_group, name, timestamp) \ INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \ @@ -476,12 +485,15 @@ struct BASE_EXPORT TraceTimestampTraits<::base::TimeTicks> { TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \ TRACE_EVENT_FLAG_COPY) -// Similar to TRACE_EVENT_ENDx but with a custom |at| timestamp provided. +// Similar to TRACE_EVENT_ENDx but with a custom |timestamp| provided. // - |id| is used to match the _BEGIN event with the _END event. // Events are considered to match if their category_group, name and id values // all match. |id| must either be a pointer or an integer value up to 64 bits. // If it's a pointer, the bits will be xored with a hash of the process ID so // that the same pointer on two different processes will not collide. +// - |timestamp| must be non-null or it crashes. Use DCHECK(timestamp) before +// calling this to detect an invalid timestamp even when tracing is not +// enabled, as the commit queue doesn't run all tests with tracing enabled. #define TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \ thread_id, timestamp) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ @@ -540,6 +552,9 @@ struct BASE_EXPORT TraceTimestampTraits<::base::TimeTicks> { static_cast(value2_val)) // Similar to TRACE_COUNTERx, but with a custom |timestamp| provided. +// - |timestamp| must be non-null or it crashes. Use DCHECK(timestamp) before +// calling this to detect an invalid timestamp even when tracing is not +// enabled, as the commit queue doesn't run all tests with tracing enabled. #define TRACE_COUNTER_WITH_TIMESTAMP1(category_group, name, timestamp, value) \ INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp, \ @@ -925,6 +940,16 @@ struct BASE_EXPORT TraceTimestampTraits<::base::TimeTicks> { INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ category_group, name, id, \ TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN1(category_group, name, id, \ + arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ + category_group, name, id, \ + TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) +#define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ + TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \ + TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val) #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END0(category_group, name, id) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ category_group, name, id, \ @@ -934,6 +959,12 @@ struct BASE_EXPORT TraceTimestampTraits<::base::TimeTicks> { INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \ TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP1( \ + category_group, name, id, timestamp, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY, \ + arg1_name, arg1_val) #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0( \ category_group, name, id, timestamp) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ @@ -1088,9 +1119,6 @@ struct BASE_EXPORT TraceTimestampTraits<::base::TimeTicks> { #define TRACE_EVENT_FLAG_HAS_PROCESS_ID (static_cast(1 << 10)) #define TRACE_EVENT_FLAG_HAS_LOCAL_ID (static_cast(1 << 11)) #define TRACE_EVENT_FLAG_HAS_GLOBAL_ID (static_cast(1 << 12)) -// TODO(eseckler): Remove once we have native support for typed proto events in -// TRACE_EVENT macros. -#define TRACE_EVENT_FLAG_TYPED_PROTO_ARGS (static_cast(1 << 15)) #define TRACE_EVENT_FLAG_JAVA_STRING_LITERALS \ (static_cast(1 << 16)) diff --git a/deps/v8/bazel/defs.bzl b/deps/v8/bazel/defs.bzl index fbd1830ecb1e35..58fd53ed607e12 100644 --- a/deps/v8/bazel/defs.bzl +++ b/deps/v8/bazel/defs.bzl @@ -237,3 +237,62 @@ v8_mksnapshot = rule( ), } ) + +def _quote(val): + if val[0] == '"' and val[-1] == '"': + fail("String", val, "already quoted") + return '"' + val + '"' + +def _kv_bool_pair(k, v): + return _quote(k) + ": " + v + +def _json(kv_pairs): + content = "{" + for (k, v) in kv_pairs[:-1]: + content += _kv_bool_pair(k, v) + ", " + (k, v) = kv_pairs[-1] + content += _kv_bool_pair(k, v) + content += "}\n" + return content + +# TODO(victorgomes): Create a rule (instead of a macro), that can +# dynamically populate the build config. +def v8_build_config(name): + cpu = _quote("x64") + content = _json([ + ("current_cpu", cpu), + ("dcheck_always_on", "false"), + ("is_android", "false"), + ("is_asan", "false"), + ("is_cfi", "false"), + ("is_clang", "true"), + ("is_component_build", "false"), + ("is_debug", "false"), + ("is_full_debug", "false"), + ("is_gcov_coverage", "false"), + ("is_msan", "false"), + ("is_tsan", "false"), + ("is_ubsan_vptr", "false"), + ("target_cpu", cpu), + ("v8_current_cpu", cpu), + ("v8_enable_atomic_marking_state", "false"), + ("v8_enable_atomic_object_field_writes", "false"), + ("v8_enable_concurrent_marking", "false"), + ("v8_enable_i18n_support", "true"), + ("v8_enable_verify_predictable", "false"), + ("v8_enable_verify_csa", "false"), + ("v8_enable_lite_mode", "false"), + ("v8_enable_runtime_call_stats", "false"), + ("v8_enable_pointer_compression", "true"), + ("v8_enable_pointer_compression_shared_cage", "false"), + ("v8_enable_third_party_heap", "false"), + ("v8_enable_webassembly", "false"), + ("v8_control_flow_integrity", "false"), + ("v8_enable_single_generation", "false"), + ("v8_target_cpu", cpu), + ]) + native.genrule( + name = name, + outs = [name + ".json"], + cmd = "echo '" + content + "' > \"$@\"", + ) diff --git a/deps/v8/include/cppgc/allocation.h b/deps/v8/include/cppgc/allocation.h index b06d9d70206409..d75f1a9729624f 100644 --- a/deps/v8/include/cppgc/allocation.h +++ b/deps/v8/include/cppgc/allocation.h @@ -10,6 +10,7 @@ #include #include #include +#include #include "cppgc/custom-space.h" #include "cppgc/internal/api-constants.h" diff --git a/deps/v8/include/cppgc/cross-thread-persistent.h b/deps/v8/include/cppgc/cross-thread-persistent.h index fe61e9acbc3815..0a9afdcd2bd3cc 100644 --- a/deps/v8/include/cppgc/cross-thread-persistent.h +++ b/deps/v8/include/cppgc/cross-thread-persistent.h @@ -13,12 +13,34 @@ #include "cppgc/visitor.h" namespace cppgc { - namespace internal { +// Wrapper around PersistentBase that allows accessing poisoned memory when +// using ASAN. This is needed as the GC of the heap that owns the value +// of a CTP, may clear it (heap termination, weakness) while the object +// holding the CTP may be poisoned as itself may be deemed dead. +class CrossThreadPersistentBase : public PersistentBase { + public: + CrossThreadPersistentBase() = default; + explicit CrossThreadPersistentBase(const void* raw) : PersistentBase(raw) {} + + V8_CLANG_NO_SANITIZE("address") const void* GetValueFromGC() const { + return raw_; + } + + V8_CLANG_NO_SANITIZE("address") + PersistentNode* GetNodeFromGC() const { return node_; } + + V8_CLANG_NO_SANITIZE("address") + void ClearFromGC() const { + raw_ = nullptr; + node_ = nullptr; + } +}; + template -class BasicCrossThreadPersistent final : public PersistentBase, +class BasicCrossThreadPersistent final : public CrossThreadPersistentBase, public LocationPolicy, private WeaknessPolicy, private CheckingPolicy { @@ -38,11 +60,11 @@ class BasicCrossThreadPersistent final : public PersistentBase, BasicCrossThreadPersistent( SentinelPointer s, const SourceLocation& loc = SourceLocation::Current()) - : PersistentBase(s), LocationPolicy(loc) {} + : CrossThreadPersistentBase(s), LocationPolicy(loc) {} BasicCrossThreadPersistent( T* raw, const SourceLocation& loc = SourceLocation::Current()) - : PersistentBase(raw), LocationPolicy(loc) { + : CrossThreadPersistentBase(raw), LocationPolicy(loc) { if (!IsValid(raw)) return; PersistentRegionLock guard; CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw); @@ -61,7 +83,7 @@ class BasicCrossThreadPersistent final : public PersistentBase, BasicCrossThreadPersistent( UnsafeCtorTag, T* raw, const SourceLocation& loc = SourceLocation::Current()) - : PersistentBase(raw), LocationPolicy(loc) { + : CrossThreadPersistentBase(raw), LocationPolicy(loc) { if (!IsValid(raw)) return; CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw); SetNode(region.AllocateNode(this, &Trace)); @@ -329,12 +351,19 @@ class BasicCrossThreadPersistent final : public PersistentBase, } void ClearFromGC() const { - if (IsValid(GetValue())) { - WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode()); - PersistentBase::ClearFromGC(); + if (IsValid(GetValueFromGC())) { + WeaknessPolicy::GetPersistentRegion(GetValueFromGC()) + .FreeNode(GetNodeFromGC()); + CrossThreadPersistentBase::ClearFromGC(); } } + // See Get() for details. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") + T* GetFromGC() const { + return static_cast(const_cast(GetValueFromGC())); + } + friend class cppgc::Visitor; }; diff --git a/deps/v8/include/cppgc/heap-consistency.h b/deps/v8/include/cppgc/heap-consistency.h index 47caea18470a0c..8e603d5d8af2de 100644 --- a/deps/v8/include/cppgc/heap-consistency.h +++ b/deps/v8/include/cppgc/heap-consistency.h @@ -68,6 +68,23 @@ class HeapConsistency final { return internal::WriteBarrier::GetWriteBarrierType(slot, params, callback); } + /** + * Gets the required write barrier type for a specific write. + * This version is meant to be used in conjunction with with a marking write + * barrier barrier which doesn't consider the slot. + * + * \param value The pointer to the object. May be an interior pointer to an + * interface of the actual object. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + static V8_INLINE WriteBarrierType + GetWriteBarrierType(const void* value, WriteBarrierParams& params) { + return internal::WriteBarrier::GetWriteBarrierType(value, params); + } + /** * Conservative Dijkstra-style write barrier that processes an object if it * has not yet been processed. diff --git a/deps/v8/include/cppgc/internal/persistent-node.h b/deps/v8/include/cppgc/internal/persistent-node.h index 5626b17820b190..b5dba476a47900 100644 --- a/deps/v8/include/cppgc/internal/persistent-node.h +++ b/deps/v8/include/cppgc/internal/persistent-node.h @@ -75,7 +75,7 @@ class PersistentNode final { TraceCallback trace_ = nullptr; }; -class V8_EXPORT PersistentRegion final { +class V8_EXPORT PersistentRegion { using PersistentNodeSlots = std::array; public: @@ -116,6 +116,9 @@ class V8_EXPORT PersistentRegion final { private: void EnsureNodeSlots(); + template + void ClearAllUsedNodes(); + std::vector> nodes_; PersistentNode* free_list_head_ = nullptr; size_t nodes_in_use_ = 0; @@ -135,7 +138,7 @@ class V8_EXPORT PersistentRegionLock final { // Variant of PersistentRegion that checks whether the PersistentRegionLock is // locked. -class V8_EXPORT CrossThreadPersistentRegion final { +class V8_EXPORT CrossThreadPersistentRegion final : protected PersistentRegion { public: CrossThreadPersistentRegion() = default; // Clears Persistent fields to avoid stale pointers after heap teardown. @@ -147,12 +150,12 @@ class V8_EXPORT CrossThreadPersistentRegion final { V8_INLINE PersistentNode* AllocateNode(void* owner, TraceCallback trace) { PersistentRegionLock::AssertLocked(); - return persistent_region_.AllocateNode(owner, trace); + return PersistentRegion::AllocateNode(owner, trace); } V8_INLINE void FreeNode(PersistentNode* node) { PersistentRegionLock::AssertLocked(); - persistent_region_.FreeNode(node); + PersistentRegion::FreeNode(node); } void Trace(Visitor*); @@ -160,9 +163,6 @@ class V8_EXPORT CrossThreadPersistentRegion final { size_t NodesInUse() const; void ClearAllUsedNodes(); - - private: - PersistentRegion persistent_region_; }; } // namespace internal diff --git a/deps/v8/include/cppgc/internal/write-barrier.h b/deps/v8/include/cppgc/internal/write-barrier.h index c1b3b3e34d056a..28184dc9c83078 100644 --- a/deps/v8/include/cppgc/internal/write-barrier.h +++ b/deps/v8/include/cppgc/internal/write-barrier.h @@ -11,6 +11,7 @@ #include "cppgc/heap-state.h" #include "cppgc/internal/api-constants.h" #include "cppgc/internal/atomic-entry-flag.h" +#include "cppgc/platform.h" #include "cppgc/sentinel-pointer.h" #include "cppgc/trace-trait.h" #include "v8config.h" // NOLINT(build/include_directory) @@ -66,6 +67,8 @@ class V8_EXPORT WriteBarrier final { template static V8_INLINE Type GetWriteBarrierType(const void* slot, Params& params, HeapHandleCallback callback); + // Returns the required write barrier for a given `value`. + static V8_INLINE Type GetWriteBarrierType(const void* value, Params& params); template static V8_INLINE Type GetWriteBarrierTypeForExternallyReferencedObject( @@ -147,9 +150,27 @@ class V8_EXPORT WriteBarrierTypeForCagedHeapPolicy final { return ValueModeDispatch::Get(slot, value, params, callback); } + template + static V8_INLINE WriteBarrier::Type Get(const void* value, + WriteBarrier::Params& params, + HeapHandleCallback callback) { + return GetNoSlot(value, params, callback); + } + template static V8_INLINE WriteBarrier::Type GetForExternallyReferenced( - const void* value, WriteBarrier::Params& params, HeapHandleCallback) { + const void* value, WriteBarrier::Params& params, + HeapHandleCallback callback) { + return GetNoSlot(value, params, callback); + } + + private: + WriteBarrierTypeForCagedHeapPolicy() = delete; + + template + static V8_INLINE WriteBarrier::Type GetNoSlot(const void* value, + WriteBarrier::Params& params, + HeapHandleCallback) { if (!TryGetCagedHeap(value, value, params)) { return WriteBarrier::Type::kNone; } @@ -159,14 +180,14 @@ class V8_EXPORT WriteBarrierTypeForCagedHeapPolicy final { return SetAndReturnType(params); } - private: - WriteBarrierTypeForCagedHeapPolicy() = delete; - template struct ValueModeDispatch; static V8_INLINE bool TryGetCagedHeap(const void* slot, const void* value, WriteBarrier::Params& params) { + // TODO(chromium:1056170): Check if the null check can be folded in with + // the rest of the write barrier. + if (!value) return false; params.start = reinterpret_cast(value) & ~(api_constants::kCagedHeapReservationAlignment - 1); const uintptr_t slot_offset = @@ -257,6 +278,15 @@ class V8_EXPORT WriteBarrierTypeForNonCagedHeapPolicy final { return ValueModeDispatch::Get(slot, value, params, callback); } + template + static V8_INLINE WriteBarrier::Type Get(const void* value, + WriteBarrier::Params& params, + HeapHandleCallback callback) { + // The slot will never be used in `Get()` below. + return Get(nullptr, value, params, + callback); + } + template static V8_INLINE WriteBarrier::Type GetForExternallyReferenced( const void* value, WriteBarrier::Params& params, @@ -330,6 +360,13 @@ WriteBarrier::Type WriteBarrier::GetWriteBarrierType( slot, nullptr, params, callback); } +// static +WriteBarrier::Type WriteBarrier::GetWriteBarrierType( + const void* value, WriteBarrier::Params& params) { + return WriteBarrierTypePolicy::Get(value, params, + []() {}); +} + // static template WriteBarrier::Type diff --git a/deps/v8/include/cppgc/liveness-broker.h b/deps/v8/include/cppgc/liveness-broker.h index e449091280d9d7..c94eef0d4acdad 100644 --- a/deps/v8/include/cppgc/liveness-broker.h +++ b/deps/v8/include/cppgc/liveness-broker.h @@ -44,7 +44,10 @@ class V8_EXPORT LivenessBroker final { public: template bool IsHeapObjectAlive(const T* object) const { - return object && + // nullptr objects are considered alive to allow weakness to be used from + // stack while running into a conservative GC. Treating nullptr as dead + // would mean that e.g. custom collectins could not be strongified on stack. + return !object || IsHeapObjectAliveImpl( TraceTrait::GetTraceDescriptor(object).base_object_payload); } diff --git a/deps/v8/include/cppgc/member.h b/deps/v8/include/cppgc/member.h index d0bf414c69d7f5..38105b8e4323b9 100644 --- a/deps/v8/include/cppgc/member.h +++ b/deps/v8/include/cppgc/member.h @@ -218,6 +218,8 @@ class BasicMember final : private MemberBase, private CheckingPolicy { void ClearFromGC() const { MemberBase::ClearFromGC(); } + T* GetFromGC() const { return Get(); } + friend class cppgc::Visitor; template friend struct cppgc::TraceTrait; diff --git a/deps/v8/include/cppgc/persistent.h b/deps/v8/include/cppgc/persistent.h index 03b5e5b06b5e28..b83a464576e78c 100644 --- a/deps/v8/include/cppgc/persistent.h +++ b/deps/v8/include/cppgc/persistent.h @@ -41,7 +41,7 @@ class PersistentBase { node_ = nullptr; } - private: + protected: mutable const void* raw_ = nullptr; mutable PersistentNode* node_ = nullptr; @@ -259,6 +259,12 @@ class BasicPersistent final : public PersistentBase, } } + // Set Get() for details. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") + T* GetFromGC() const { + return static_cast(const_cast(GetValue())); + } + friend class cppgc::Visitor; }; diff --git a/deps/v8/include/cppgc/platform.h b/deps/v8/include/cppgc/platform.h index 2d933d620dc011..3276a26b6520b6 100644 --- a/deps/v8/include/cppgc/platform.h +++ b/deps/v8/include/cppgc/platform.h @@ -148,6 +148,7 @@ namespace internal { V8_EXPORT void Abort(); } // namespace internal + } // namespace cppgc #endif // INCLUDE_CPPGC_PLATFORM_H_ diff --git a/deps/v8/include/cppgc/visitor.h b/deps/v8/include/cppgc/visitor.h index 98de9957bd66ac..57e2ce3963af1e 100644 --- a/deps/v8/include/cppgc/visitor.h +++ b/deps/v8/include/cppgc/visitor.h @@ -12,6 +12,7 @@ #include "cppgc/internal/pointer-policies.h" #include "cppgc/liveness-broker.h" #include "cppgc/member.h" +#include "cppgc/sentinel-pointer.h" #include "cppgc/source-location.h" #include "cppgc/trace-trait.h" #include "cppgc/type-traits.h" @@ -318,10 +319,10 @@ class V8_EXPORT Visitor { template static void HandleWeak(const LivenessBroker& info, const void* object) { const PointerType* weak = static_cast(object); + auto* raw_ptr = weak->GetFromGC(); // Sentinel values are preserved for weak pointers. - if (*weak == kSentinelPointer) return; - const auto* raw = weak->Get(); - if (!info.IsHeapObjectAlive(raw)) { + if (raw_ptr == kSentinelPointer) return; + if (!info.IsHeapObjectAlive(raw_ptr)) { weak->ClearFromGC(); } } @@ -335,11 +336,11 @@ class V8_EXPORT Visitor { static_assert(internal::IsGarbageCollectedOrMixinType::value, "Persistent's pointee type must be GarbageCollected or " "GarbageCollectedMixin"); - if (!p.Get()) { + auto* ptr = p.GetFromGC(); + if (!ptr) { return; } - VisitRoot(p.Get(), TraceTrait::GetTraceDescriptor(p.Get()), - loc); + VisitRoot(ptr, TraceTrait::GetTraceDescriptor(ptr), loc); } template < @@ -354,7 +355,8 @@ class V8_EXPORT Visitor { "GarbageCollectedMixin"); static_assert(!internal::IsAllocatedOnCompactableSpace::value, "Weak references to compactable objects are not allowed"); - VisitWeakRoot(p.Get(), TraceTrait::GetTraceDescriptor(p.Get()), + auto* ptr = p.GetFromGC(); + VisitWeakRoot(ptr, TraceTrait::GetTraceDescriptor(ptr), &HandleWeak, &p, loc); } diff --git a/deps/v8/include/js_protocol.pdl b/deps/v8/include/js_protocol.pdl index 63baa3da13b843..ebf9eb7fe82b14 100644 --- a/deps/v8/include/js_protocol.pdl +++ b/deps/v8/include/js_protocol.pdl @@ -1672,6 +1672,8 @@ domain Runtime parameters RemoteObject object object hints + # Identifier of the context where the call was made. + experimental optional ExecutionContextId executionContextId # This domain is deprecated. deprecated domain Schema diff --git a/deps/v8/include/v8-fast-api-calls.h b/deps/v8/include/v8-fast-api-calls.h index 1848800b488683..8c9d02769ee9e0 100644 --- a/deps/v8/include/v8-fast-api-calls.h +++ b/deps/v8/include/v8-fast-api-calls.h @@ -225,8 +225,9 @@ #include #include -#include "v8.h" // NOLINT(build/include_directory) -#include "v8config.h" // NOLINT(build/include_directory) +#include "v8-internal.h" // NOLINT(build/include_directory) +#include "v8.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { @@ -298,10 +299,36 @@ class CTypeInfo { Flags flags_; }; +struct FastApiTypedArrayBase { + public: + // Returns the length in number of elements. + size_t V8_EXPORT length() const { return length_; } + // Checks whether the given index is within the bounds of the collection. + void V8_EXPORT ValidateIndex(size_t index) const; + + protected: + size_t length_ = 0; +}; + template -struct FastApiTypedArray { - T* data; // should include the typed array offset applied - size_t length; // length in number of elements +struct FastApiTypedArray : public FastApiTypedArrayBase { + public: + V8_INLINE T get(size_t index) const { +#ifdef DEBUG + ValidateIndex(index); +#endif // DEBUG + T tmp; + memcpy(&tmp, reinterpret_cast(data_) + index, sizeof(T)); + return tmp; + } + + private: + // This pointer should include the typed array offset applied. + // It's not guaranteed that it's aligned to sizeof(T), it's only + // guaranteed that it's 4-byte aligned, so for 8-byte types we need to + // provide a special implementation for reading from it, which hides + // the possibly unaligned read in the `get` method. + void* data_; }; // Any TypedArray. It uses kTypedArrayBit with base type void @@ -437,7 +464,7 @@ class V8_EXPORT CFunction { }; }; -struct ApiObject { +struct V8_DEPRECATE_SOON("Use v8::Local instead.") ApiObject { uintptr_t address; }; @@ -578,7 +605,7 @@ PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS) #define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA(T, Enum) \ template <> \ - struct TypeInfoHelper> { \ + struct TypeInfoHelper&> { \ static constexpr CTypeInfo::Flags Flags() { \ return CTypeInfo::Flags::kNone; \ } \ @@ -770,6 +797,10 @@ CFunction CFunction::ArgUnwrap::Make(R (*func)(Args...)) { using CFunctionBuilder = internal::CFunctionBuilder; +static constexpr CTypeInfo kTypeInfoInt32 = CTypeInfo(CTypeInfo::Type::kInt32); +static constexpr CTypeInfo kTypeInfoFloat64 = + CTypeInfo(CTypeInfo::Type::kFloat64); + /** * Copies the contents of this JavaScript array to a C++ buffer with * a given max_length. A CTypeInfo is passed as an argument, @@ -783,8 +814,22 @@ using CFunctionBuilder = internal::CFunctionBuilder; * returns true on success. `type_info` will be used for conversions. */ template -bool CopyAndConvertArrayToCppBuffer(Local src, T* dst, - uint32_t max_length); +bool V8_EXPORT V8_WARN_UNUSED_RESULT TryCopyAndConvertArrayToCppBuffer( + Local src, T* dst, uint32_t max_length); + +template <> +inline bool V8_WARN_UNUSED_RESULT +TryCopyAndConvertArrayToCppBuffer<&kTypeInfoInt32, int32_t>( + Local src, int32_t* dst, uint32_t max_length) { + return CopyAndConvertArrayToCppBufferInt32(src, dst, max_length); +} + +template <> +inline bool V8_WARN_UNUSED_RESULT +TryCopyAndConvertArrayToCppBuffer<&kTypeInfoFloat64, double>( + Local src, double* dst, uint32_t max_length) { + return CopyAndConvertArrayToCppBufferFloat64(src, dst, max_length); +} } // namespace v8 diff --git a/deps/v8/include/v8-inspector.h b/deps/v8/include/v8-inspector.h index 0c19104a3774ab..e6621ccd75c591 100644 --- a/deps/v8/include/v8-inspector.h +++ b/deps/v8/include/v8-inspector.h @@ -194,9 +194,6 @@ class V8_EXPORT V8InspectorClient { v8::Local, v8::Local) { return nullptr; } - virtual bool formatAccessorsAsProperties(v8::Local) { - return false; - } virtual bool isInspectableHeapObject(v8::Local) { return true; } virtual v8::Local ensureDefaultContextInGroup( diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index 85471960006a08..0222ab2f7e1199 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -15,9 +15,12 @@ namespace v8 { +class Array; class Context; class Data; class Isolate; +template +class Local; namespace internal { @@ -33,6 +36,7 @@ const int kApiSystemPointerSize = sizeof(void*); const int kApiDoubleSize = sizeof(double); const int kApiInt32Size = sizeof(int32_t); const int kApiInt64Size = sizeof(int64_t); +const int kApiSizetSize = sizeof(size_t); // Tag information for HeapObject. const int kHeapObjectTag = 1; @@ -184,6 +188,8 @@ V8_EXPORT internal::Isolate* IsolateFromNeverReadOnlySpaceObject(Address obj); // language mode is strict. V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate* isolate); +V8_EXPORT bool CanHaveInternalField(int instance_type); + /** * This class exports constants and functionality from within v8 that * is necessary to implement inline functions in the v8 api. Don't @@ -230,8 +236,12 @@ class Internals { kIsolateFastCCallCallerFpOffset + kApiSystemPointerSize; static const int kIsolateFastApiCallTargetOffset = kIsolateFastCCallCallerPcOffset + kApiSystemPointerSize; - static const int kIsolateStackGuardOffset = + static const int kIsolateCageBaseOffset = kIsolateFastApiCallTargetOffset + kApiSystemPointerSize; + static const int kIsolateLongTaskStatsCounterOffset = + kIsolateCageBaseOffset + kApiSystemPointerSize; + static const int kIsolateStackGuardOffset = + kIsolateLongTaskStatsCounterOffset + kApiSizetSize; static const int kIsolateRootsOffset = kIsolateStackGuardOffset + 7 * kApiSystemPointerSize; @@ -258,8 +268,9 @@ class Internals { static const int kOddballType = 0x43; static const int kForeignType = 0x46; static const int kJSSpecialApiObjectType = 0x410; - static const int kJSApiObjectType = 0x420; static const int kJSObjectType = 0x421; + static const int kFirstJSApiObjectType = 0x422; + static const int kLastJSApiObjectType = 0x80A; static const int kUndefinedOddballKind = 5; static const int kNullOddballKind = 3; @@ -364,6 +375,12 @@ class Internals { return *reinterpret_cast(addr); } + V8_INLINE static void IncrementLongTasksStatsCounter(v8::Isolate* isolate) { + internal::Address addr = reinterpret_cast(isolate) + + kIsolateLongTaskStatsCounterOffset; + ++(*reinterpret_cast(addr)); + } + V8_INLINE static internal::Address* GetRoot(v8::Isolate* isolate, int index) { internal::Address addr = reinterpret_cast(isolate) + kIsolateRootsOffset + @@ -494,6 +511,15 @@ V8_INLINE void PerformCastCheck(T* data) { class BackingStoreBase {}; } // namespace internal + +V8_EXPORT bool CopyAndConvertArrayToCppBufferInt32(Local src, + int32_t* dst, + uint32_t max_length); + +V8_EXPORT bool CopyAndConvertArrayToCppBufferFloat64(Local src, + double* dst, + uint32_t max_length); + } // namespace v8 #endif // INCLUDE_V8_INTERNAL_H_ diff --git a/deps/v8/include/v8-metrics.h b/deps/v8/include/v8-metrics.h index 498ee25f6d25c3..a6eea6a8645d0c 100644 --- a/deps/v8/include/v8-metrics.h +++ b/deps/v8/include/v8-metrics.h @@ -5,7 +5,8 @@ #ifndef V8_METRICS_H_ #define V8_METRICS_H_ -#include "v8.h" // NOLINT(build/include_directory) +#include "v8-internal.h" // NOLINT(build/include_directory) +#include "v8.h" // NOLINT(build/include_directory) namespace v8 { namespace metrics { @@ -196,6 +197,32 @@ class V8_EXPORT Recorder { static ContextId GetContextId(Local context); }; +/** + * Experimental API intended for the LongTasks UKM (crbug.com/1173527). + * The Reset() method should be called at the start of a potential + * long task. The Get() method returns durations of V8 work that + * happened during the task. + * + * This API is experimental and may be removed/changed in the future. + */ +struct V8_EXPORT LongTaskStats { + /** + * Resets durations of V8 work for the new task. + */ + V8_INLINE static void Reset(Isolate* isolate) { + v8::internal::Internals::IncrementLongTasksStatsCounter(isolate); + } + + /** + * Returns durations of V8 work that happened since the last Reset(). + */ + static LongTaskStats Get(Isolate* isolate); + + int64_t gc_full_atomic_wall_clock_duration_us = 0; + int64_t gc_full_incremental_wall_clock_duration_us = 0; + int64_t gc_young_wall_clock_duration_us = 0; +}; + } // namespace metrics } // namespace v8 diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 4c94d7fd392c0c..fc9a357feb66cb 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -181,9 +181,8 @@ class JobDelegate { /** * Returns true if the current task is called from the thread currently * running JobHandle::Join(). - * TODO(etiennep): Make pure virtual once custom embedders implement it. */ - virtual bool IsJoiningThread() const { return false; } + virtual bool IsJoiningThread() const = 0; }; /** @@ -220,19 +219,14 @@ class JobHandle { * Forces all existing workers to yield ASAP but doesn’t wait for them. * Warning, this is dangerous if the Job's callback is bound to or has access * to state which may be deleted after this call. - * TODO(etiennep): Cleanup once implemented by all embedders. */ - virtual void CancelAndDetach() { Cancel(); } + virtual void CancelAndDetach() = 0; /** * Returns true if there's any work pending or any worker running. */ virtual bool IsActive() = 0; - // TODO(etiennep): Clean up once all overrides are removed. - V8_DEPRECATED("Use !IsActive() instead.") - virtual bool IsCompleted() { return !IsActive(); } - /** * Returns true if associated with a Job and other methods may be called. * Returns false after Join() or Cancel() was called. This may return true @@ -240,10 +234,6 @@ class JobHandle { */ virtual bool IsValid() = 0; - // TODO(etiennep): Clean up once all overrides are removed. - V8_DEPRECATED("Use IsValid() instead.") - virtual bool IsRunning() { return IsValid(); } - /** * Returns true if job priority can be changed. */ @@ -272,10 +262,6 @@ class JobTask { * it must not call back any JobHandle methods. */ virtual size_t GetMaxConcurrency(size_t worker_count) const = 0; - - // TODO(1114823): Clean up once all overrides are removed. - V8_DEPRECATED("Use the version that takes |worker_count|.") - virtual size_t GetMaxConcurrency() const { return 0; } }; /** diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 49ada0a7bf68e5..9a40cfcf307e1d 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -289,8 +289,8 @@ class V8_EXPORT CpuProfilingOptions { * interval, set via SetSamplingInterval(). If * zero, the sampling interval will be equal to * the profiler's sampling interval. - * \param filter_context Deprecated option to filter by context, currently a - * no-op. + * \param filter_context If specified, profiles will only contain frames + * using this context. Other frames will be elided. */ CpuProfilingOptions( CpuProfilingMode mode = kLeafNodeLineNumbers, @@ -304,9 +304,13 @@ class V8_EXPORT CpuProfilingOptions { private: friend class internal::CpuProfile; + bool has_filter_context() const { return !filter_context_.IsEmpty(); } + void* raw_filter_context() const; + CpuProfilingMode mode_; unsigned max_samples_; int sampling_interval_us_; + CopyablePersistentTraits::CopyablePersistent filter_context_; }; /** @@ -896,14 +900,6 @@ class V8_EXPORT HeapProfiler { * Takes a heap snapshot and returns it. */ const HeapSnapshot* TakeHeapSnapshot( - ActivityControl* control = nullptr, - ObjectNameResolver* global_object_name_resolver = nullptr, - bool treat_global_objects_as_roots = true); - - /** - * Takes a heap snapshot and returns it. - */ - const HeapSnapshot* TakeHeapSnapshotV8_92( ActivityControl* control = nullptr, ObjectNameResolver* global_object_name_resolver = nullptr, bool treat_global_objects_as_roots = true, diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 30a4182357505d..2a87785209c619 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -9,8 +9,8 @@ // 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 9 -#define V8_MINOR_VERSION 3 -#define V8_BUILD_NUMBER 345 +#define V8_MINOR_VERSION 4 +#define V8_BUILD_NUMBER 146 #define V8_PATCH_LEVEL 19 // Use 1 for candidates and 0 otherwise. diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 796daba1fb06f5..78c454e334fbc0 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -128,6 +128,7 @@ template class PropertyCallbackInfo; template class ReturnValue; namespace internal { +class BackgroundDeserializeTask; class BasicTracedReferenceExtractor; class ExternalString; class FunctionCallbackArguments; @@ -1440,9 +1441,7 @@ class ScriptOriginOptions { */ class ScriptOrigin { public: -#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */ - V8_DEPRECATE_SOON("Use constructor with primitive C++ types") -#endif + V8_DEPRECATED("Use constructor with primitive C++ types") V8_INLINE explicit ScriptOrigin( Local resource_name, Local resource_line_offset, Local resource_column_offset, @@ -1453,9 +1452,7 @@ class ScriptOrigin { Local is_wasm = Local(), Local is_module = Local(), Local host_defined_options = Local()); -#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */ - V8_DEPRECATE_SOON("Use constructor that takes an isolate") -#endif + V8_DEPRECATED("Use constructor that takes an isolate") V8_INLINE explicit ScriptOrigin( Local resource_name, int resource_line_offset = 0, int resource_column_offset = 0, @@ -1474,11 +1471,11 @@ class ScriptOrigin { Local host_defined_options = Local()); V8_INLINE Local ResourceName() const; - V8_DEPRECATE_SOON("Use getter with primitvie C++ types.") + V8_DEPRECATED("Use getter with primitvie C++ types.") V8_INLINE Local ResourceLineOffset() const; - V8_DEPRECATE_SOON("Use getter with primitvie C++ types.") + V8_DEPRECATED("Use getter with primitvie C++ types.") V8_INLINE Local ResourceColumnOffset() const; - V8_DEPRECATE_SOON("Use getter with primitvie C++ types.") + V8_DEPRECATED("Use getter with primitvie C++ types.") V8_INLINE Local ScriptID() const; V8_INLINE int LineOffset() const; V8_INLINE int ColumnOffset() const; @@ -1508,7 +1505,7 @@ class V8_EXPORT UnboundScript { */ Local