diff --git a/common.gypi b/common.gypi index a5588d43e3401f..8abd1be554677e 100644 --- a/common.gypi +++ b/common.gypi @@ -38,7 +38,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.21', + 'v8_embedder_string': '-node.6', ##### V8 defaults for Node.js ##### @@ -83,7 +83,6 @@ 'v8_enable_external_code_space%': 0, 'v8_enable_sandbox%': 0, 'v8_enable_v8_checks%': 0, - 'v8_enable_zone_compression%': 0, 'v8_use_perfetto': 0, 'tsan%': 0, @@ -453,9 +452,6 @@ ['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', { 'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'], }], - ['v8_enable_zone_compression == 1', { - 'defines': ['V8_COMPRESS_ZONES',], - }], ['v8_enable_sandbox == 1', { 'defines': ['V8_ENABLE_SANDBOX',], }], diff --git a/deps/v8/.clang-format b/deps/v8/.clang-format index 066c8d27c657cf..5318292248e28e 100644 --- a/deps/v8/.clang-format +++ b/deps/v8/.clang-format @@ -10,6 +10,8 @@ Macros: # Make clang-format think TurboShaft `ELSE` expands to just `else`, so that # it formats well alongside `if` - ELSE=else + - FOR_WITH_HANDLE_SCOPE(isolate, init, loop_var, limit_check, increment)=for(init; loop_var; increment) + - WHILE_WITH_HANDLE_SCOPE(isolate, limit_check)=while(limit_check) StatementMacros: - DECL_CAST - DECL_VERIFIER diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index dd4a2b839d34e7..31449e0177a224 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -39,6 +39,15 @@ .settings .torquelint-cache .vscode + +# Directories added by standalone gclient setup. +/.cipd +/.gclient +/.gclient_entries +/.gclient_previous_custom_vars +/.gclient_previous_sync_commits +/.gcs_entries + /_* /base /build @@ -68,6 +77,9 @@ /third_party/colorama/src !/third_party/cpu_features /third_party/cpu_features/src +!/third_party/dragonbox +/third_party/dragonbox/src/* +!/third_party/dragonbox/src/include !/third_party/fast_float /third_party/fast_float/src/* !/third_party/fast_float/src/include @@ -89,6 +101,7 @@ /third_party/jsoncpp/source !/third_party/llvm-libc /third_party/llvm-libc/src +!/third_party/rapidhash-v8 !/third_party/re2 /third_party/re2/src !/third_party/siphash @@ -116,6 +129,7 @@ /tools/v8heapconst.py /tools/visual_studio/Debug /tools/visual_studio/Release +/tools/win /v8.log.ll /xcodebuild GPATH diff --git a/deps/v8/.gn b/deps/v8/.gn index d83c69db63f963..e13ae6d5ec82da 100644 --- a/deps/v8/.gn +++ b/deps/v8/.gn @@ -28,11 +28,14 @@ default_args = { # Disable js dependencies like the closure compiler. enable_js_protobuf = false - # Disable rust dependencies. + # Enable rust dependencies. enable_rust = true # Needed only for std::atomic_ref for large Ts http://crbug.com/402171653 use_llvm_libatomic = false + + # Use Siso instead of Ninja. + use_siso = true } # These are the list of GN files that run exec_script. This whitelist exists diff --git a/deps/v8/.ycm_extra_conf.py b/deps/v8/.ycm_extra_conf.py index 793beda7955990..382abaea15d114 100644 --- a/deps/v8/.ycm_extra_conf.py +++ b/deps/v8/.ycm_extra_conf.py @@ -132,7 +132,11 @@ 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.decode('utf-8').splitlines()): + for line in reversed(stdout.splitlines()): + try: + line = line.decode('utf-8') + except UnicodeDecodeError: + continue if 'clang' in line: clang_line = line break diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 280e33e6841cc1..ffce5c6df023ce 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -57,6 +57,7 @@ Alexander Botero-Lowry Alexander Karpinsky Alexander Neville Alexandre Vassalotti +Albert Slepak Alexey Pavlyutkin Alexis Campailla Aliya Minimullina @@ -130,6 +131,7 @@ Fedor Indutny Felix Geisendörfer Feng Yu Filipe David Manana +Florian Loitsch Frank Lemanschik Franziska Hinkelmann Gao Sheng @@ -148,6 +150,7 @@ Helmut Januschka Hirofumi Mako Hisham Muhammad Honggyu Kim +Hood Chatham Huáng Jùnliàng HyeockJin Kim Iain Ireland @@ -183,12 +186,14 @@ Junha Park Junming Huang Kang-Hao (Kenny) Lu Karl Skomski +Kasper Lund Keith Smiley Kevin Gibbons Keyhan Vakil Kris Selden Kyounga Ra Levi Zim +LN Liberda Loo Rong Jie Lu Yahan Ludovic Mermod @@ -270,6 +275,7 @@ Sanjoy Das Sam James Sébastien Doeraene Seo Sanghyeon +Sergey Markelov Shawn Anastasio Shawn Presser Sho Miyamoto @@ -302,6 +308,7 @@ Wael Almattar Wang Chen WANG Xuerui Wei Wu +Weicong Yu Wenlu Wang Wenming Yang Wenyu Zhao @@ -335,3 +342,5 @@ Jing Peiyang magic-akari Ryuhei Shima Domagoj Stolfa +Zhijin Zeng +王家睿 diff --git a/deps/v8/BUILD.bazel b/deps/v8/BUILD.bazel index 96196f13ed008a..3bbb5fd48f8a83 100644 --- a/deps/v8/BUILD.bazel +++ b/deps/v8/BUILD.bazel @@ -3,6 +3,8 @@ # found in the LICENSE file. load("@bazel_skylib//lib:selects.bzl", "selects") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") load("@rules_python//python:defs.bzl", "py_binary", "py_test") load("@v8_python_deps//:requirements.bzl", "requirement") load( @@ -75,7 +77,6 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression # cppgc_enable_slow_api_checks # cppgc_enable_verify_heap # cppgc_enable_young_generation -# v8_enable_zone_compression # v8_enable_precise_zone_stats # v8_enable_swiss_name_dictionary # v8_generate_external_defines_header @@ -138,7 +139,10 @@ v8_flag(name = "v8_enable_snapshot_code_comments") v8_flag(name = "v8_enable_snapshot_native_code_counters") -v8_flag(name = "v8_enable_static_roots") +v8_flag( + name = "v8_enable_static_roots", + default = True, +) v8_flag(name = "v8_enable_trace_maps") @@ -406,6 +410,24 @@ config_setting( }, ) +# Explicity defined v8_enable_static_roots +config_setting( + name = "v8_enable_static_roots_is_true", + flag_values = { + ":v8_enable_static_roots": "True", + }, +) + +# Enable static roots when pointer compression and external code space is enabled +selects.config_setting_group( + name = "enable_static_roots", + match_all = [ + ":v8_enable_static_roots_is_true", + ":is_v8_enable_pointer_compression", + ":enable_external_code_space", + ], +) + # Enable VTune jit profiling v8_flag( name = "v8_enable_vtunejit", @@ -474,7 +496,6 @@ v8_config( "v8_enable_slow_dchecks": "ENABLE_SLOW_DCHECKS", "v8_enable_runtime_call_stats": "V8_RUNTIME_CALL_STATS", "v8_enable_snapshot_native_code_counters": "V8_SNAPSHOT_NATIVE_CODE_COUNTERS", - "v8_enable_static_roots": "V8_STATIC_ROOTS", "v8_enable_trace_maps": "V8_TRACE_MAPS", "v8_enable_turbofan": "V8_ENABLE_TURBOFAN", "v8_enable_v8_checks": "V8_ENABLE_CHECKS", @@ -571,6 +592,11 @@ v8_config( "V8_EXTERNAL_CODE_SPACE", ], "//conditions:default": [], + }) + select({ + ":enable_static_roots": [ + "V8_STATIC_ROOTS", + ], + "//conditions:default": [], }) + select({ ":enable_maglev": [ "V8_ENABLE_MAGLEV", @@ -801,6 +827,8 @@ filegroup( "src/base/flags.h", "src/base/fpu.cc", "src/base/fpu.h", + "src/base/functional/bind-internal.h", + "src/base/functional/function-ref.h", "src/base/free_deleter.h", "src/base/hashing.h", "src/base/hashmap.h", @@ -892,6 +920,7 @@ filegroup( "src/base/template-utils.h", "src/base/threaded-list.h", "src/base/timezone-cache.h", + "src/base/types/is-instantiation.h", "src/base/utils/random-number-generator.cc", "src/base/utils/random-number-generator.h", "src/base/vector.h", @@ -1176,7 +1205,8 @@ filegroup( "src/objects/js-shadow-realm.tq", "src/objects/js-shared-array.tq", "src/objects/js-struct.tq", - "src/objects/js-temporal-objects.tq", + # Temporal is currently gn-only + # "src/objects/js-temporal-objects.tq", "src/objects/js-weak-refs.tq", "src/objects/literal-objects.tq", "src/objects/map.tq", @@ -1318,8 +1348,6 @@ filegroup( "src/api/api-arguments.h", "src/api/api-arguments-inl.h", "src/api/api-inl.h", - "src/api/api-macros.h", - "src/api/api-macros-undef.h", "src/api/api-natives.cc", "src/api/api-natives.h", "src/asmjs/asm-js.h", @@ -1381,6 +1409,8 @@ filegroup( "src/builtins/builtins-definitions.h", "src/builtins/builtins-descriptors.h", "src/builtins/builtins-disposable-stack.cc", + "src/builtins/builtins-effects-analyzer.cc", + "src/builtins/builtins-effects-analyzer.h", "src/builtins/builtins-error.cc", "src/builtins/builtins-function.cc", "src/builtins/builtins-global.cc", @@ -1397,7 +1427,8 @@ filegroup( "src/builtins/builtins-string.cc", "src/builtins/builtins-struct.cc", "src/builtins/builtins-symbol.cc", - "src/builtins/builtins-temporal.cc", + # Temporal is currently gn-only + # "src/builtins/builtins-temporal.cc", "src/builtins/builtins-trace.cc", "src/builtins/builtins-typed-array.cc", "src/builtins/builtins-utils.h", @@ -1502,6 +1533,7 @@ filegroup( "src/common/ptr-compr.h", "src/common/ptr-compr-inl.h", "src/common/thread-local-storage.h", + "src/common/scoped-modification.h", "src/common/segmented-table.h", "src/common/segmented-table-inl.h", "src/common/simd128.h", @@ -1718,6 +1750,7 @@ filegroup( "src/heap/free-list.h", "src/heap/free-list-inl.h", "src/heap/gc-callbacks.h", + "src/heap/gc-callbacks-inl.h", "src/heap/gc-tracer.cc", "src/heap/gc-tracer.h", "src/heap/gc-tracer-inl.h", @@ -1802,6 +1835,8 @@ filegroup( "src/heap/memory-measurement.cc", "src/heap/memory-measurement.h", "src/heap/memory-measurement-inl.h", + "src/heap/memory-pool.cc", + "src/heap/memory-pool.h", "src/heap/memory-reducer.cc", "src/heap/memory-reducer.h", "src/heap/minor-gc-job.cc", @@ -1819,8 +1854,6 @@ filegroup( "src/heap/page-metadata.cc", "src/heap/page-metadata.h", "src/heap/page-metadata-inl.h", - "src/heap/page-pool.cc", - "src/heap/page-pool.h", "src/heap/paged-spaces.cc", "src/heap/paged-spaces.h", "src/heap/paged-spaces-inl.h", @@ -1930,6 +1963,8 @@ filegroup( "src/interpreter/interpreter-generator.h", "src/interpreter/interpreter-intrinsics.cc", "src/interpreter/interpreter-intrinsics.h", + "src/interpreter/prototype-assignment-sequence-builder.cc", + "src/interpreter/prototype-assignment-sequence-builder.h", "src/json/json-parser.cc", "src/json/json-parser.h", "src/json/json-stringifier.cc", @@ -1955,6 +1990,7 @@ filegroup( "src/numbers/conversions.cc", "src/numbers/conversions.h", "src/numbers/conversions-inl.h", + "src/numbers/hash-seed.h", "src/numbers/hash-seed-inl.h", "src/numbers/ieee754.cc", "src/numbers/ieee754.h", @@ -2105,9 +2141,12 @@ filegroup( "src/objects/js-struct.cc", "src/objects/js-struct.h", "src/objects/js-struct-inl.h", - "src/objects/js-temporal-objects.cc", - "src/objects/js-temporal-objects.h", - "src/objects/js-temporal-objects-inl.h", + # Temporal is currently gn-only + # "src/objects/js-temporal-objects.cc", + # "src/objects/js-temporal-objects.h", + # "src/objects/js-temporal-objects-inl.h", + "src/objects/js-temporal-helpers.h", + "src/objects/js-temporal-helpers.cc", "src/objects/js-weak-refs.cc", "src/objects/js-weak-refs.h", "src/objects/js-weak-refs-inl.h", @@ -2141,6 +2180,9 @@ filegroup( "src/objects/module-inl.h", "src/objects/name.h", "src/objects/name-inl.h", + "src/objects/number-string-cache.cc", + "src/objects/number-string-cache.h", + "src/objects/number-string-cache-inl.h", "src/objects/object-list-macros.h", "src/objects/object-macros.h", "src/objects/object-macros-undef.h", @@ -2159,7 +2201,6 @@ filegroup( "src/objects/hole.h", "src/objects/trusted-object.h", "src/objects/trusted-object-inl.h", - "src/objects/hole-inl.h", "src/objects/option-utils.cc", "src/objects/option-utils.h", "src/objects/ordered-hash-table.cc", @@ -2190,6 +2231,7 @@ filegroup( "src/objects/scope-info.cc", "src/objects/scope-info.h", "src/objects/scope-info-inl.h", + "src/objects/script.cc", "src/objects/script.h", "src/objects/script-inl.h", "src/objects/shared-function-info.cc", @@ -2303,6 +2345,7 @@ filegroup( "src/profiler/cpu-profiler-inl.h", "src/profiler/heap-profiler.cc", "src/profiler/heap-profiler.h", + "src/profiler/heap-snapshot-common.h", "src/profiler/heap-snapshot-generator.cc", "src/profiler/heap-snapshot-generator.h", "src/profiler/heap-snapshot-generator-inl.h", @@ -2341,10 +2384,16 @@ filegroup( "src/regexp/regexp-bytecode-generator.cc", "src/regexp/regexp-bytecode-generator.h", "src/regexp/regexp-bytecode-generator-inl.h", + "src/regexp/regexp-bytecode-iterator.cc", + "src/regexp/regexp-bytecode-iterator.h", + "src/regexp/regexp-bytecode-iterator-inl.h", "src/regexp/regexp-bytecode-peephole.cc", "src/regexp/regexp-bytecode-peephole.h", "src/regexp/regexp-bytecodes.cc", "src/regexp/regexp-bytecodes.h", + "src/regexp/regexp-bytecodes-inl.h", + "src/regexp/regexp-code-generator.cc", + "src/regexp/regexp-code-generator.h", "src/regexp/regexp-compiler.cc", "src/regexp/regexp-compiler.h", "src/regexp/regexp-compiler-tonode.cc", @@ -2374,6 +2423,10 @@ filegroup( "src/roots/roots.h", "src/roots/roots-inl.h", "src/roots/static-roots.h", + "src/roots/static-roots-intl-nowasm.h", + "src/roots/static-roots-intl-wasm.h", + "src/roots/static-roots-nointl-nowasm.h", + "src/roots/static-roots-nointl-wasm.h", "src/runtime/runtime.cc", "src/runtime/runtime.h", "src/runtime/runtime-array.cc", @@ -2401,11 +2454,9 @@ filegroup( "src/runtime/runtime-shadow-realm.cc", "src/runtime/runtime-strings.cc", "src/runtime/runtime-symbol.cc", - "src/runtime/runtime-temporal.cc", "src/runtime/runtime-test.cc", "src/runtime/runtime-trace.cc", "src/runtime/runtime-typedarray.cc", - "src/runtime/runtime-utils.cc", "src/runtime/runtime-utils.h", "src/runtime/runtime-weak-refs.cc", "src/sandbox/bounded-size.h", @@ -2434,6 +2485,7 @@ filegroup( "src/sandbox/trusted-pointer-table-inl.h", "src/sandbox/code-pointer.h", "src/sandbox/code-pointer-inl.h", + "src/sandbox/code-sandboxing-mode.h", "src/sandbox/compactible-external-entity-table-inl.h", "src/sandbox/compactible-external-entity-table.h", "src/sandbox/isolate.h", @@ -2448,11 +2500,13 @@ filegroup( "src/sandbox/hardware-support.h", "src/sandbox/sandbox.cc", "src/sandbox/sandbox.h", + "src/sandbox/sandbox-malloc.h", "src/sandbox/sandboxed-pointer.h", "src/sandbox/sandboxed-pointer-inl.h", "src/sandbox/tagged-payload.h", "src/sandbox/testing.cc", "src/sandbox/testing.h", + "src/snapshot/builtins-effects-dummy.cc", "src/snapshot/code-serializer.cc", "src/snapshot/code-serializer.h", "src/snapshot/context-deserializer.cc", @@ -2507,6 +2561,7 @@ filegroup( "src/strings/string-builder-inl.h", "src/strings/string-case.cc", "src/strings/string-case.h", + "src/strings/string-hasher.cc", "src/strings/string-hasher.h", "src/strings/string-hasher-inl.h", "src/strings/string-search.h", @@ -2525,8 +2580,6 @@ filegroup( "src/tasks/operations-barrier.h", "src/tasks/task-utils.cc", "src/tasks/task-utils.h", - "src/temporal/temporal-parser.cc", - "src/temporal/temporal-parser.h", "src/torque/runtime-macro-shims.h", "src/tracing/trace-event.cc", "src/tracing/trace-event.h", @@ -2553,6 +2606,8 @@ filegroup( "src/utils/locked-queue-inl.h", "src/utils/memcopy.cc", "src/utils/memcopy.h", + "src/utils/output-stream.cc", + "src/utils/output-stream.h", "src/utils/ostreams.cc", "src/utils/ostreams.h", "src/utils/scoped-list.h", @@ -2566,7 +2621,6 @@ filegroup( "src/utils/version.h", "src/zone/accounting-allocator.cc", "src/zone/accounting-allocator.h", - "src/zone/compressed-zone-ptr.h", "src/zone/type-stats.cc", "src/zone/type-stats.h", "src/zone/zone.cc", @@ -2574,7 +2628,6 @@ filegroup( "src/zone/zone-allocator.h", "src/zone/zone-chunk-list.h", "src/zone/zone-compact-set.h", - "src/zone/zone-compression.h", "src/zone/zone-containers.h", "src/zone/zone-hashmap.h", "src/zone/zone-list.h", @@ -2583,6 +2636,8 @@ filegroup( "src/zone/zone-segment.h", "src/zone/zone-type-traits.h", "src/zone/zone-utils.h", + "third_party/rapidhash-v8/rapidhash.h", + "third_party/rapidhash-v8/secret.h", "third_party/siphash/halfsiphash.cc", "third_party/siphash/halfsiphash.h", "third_party/utf8-decoder/utf8-decoder.h", @@ -2843,6 +2898,7 @@ filegroup( "src/maglev/maglev-deopt-frame-visitor.h", "src/maglev/maglev-graph-builder.h", "src/maglev/maglev-graph-labeller.h", + "src/maglev/maglev-graph-optimizer.h", "src/maglev/maglev-graph-printer.h", "src/maglev/maglev-graph-processor.h", "src/maglev/maglev-graph-verifier.h", @@ -2852,10 +2908,14 @@ filegroup( "src/maglev/maglev-ir-inl.h", "src/maglev/maglev-ir.h", "src/maglev/maglev-phi-representation-selector.h", + "src/maglev/maglev-truncation.h", "src/maglev/maglev-pipeline-statistics.h", "src/maglev/maglev-post-hoc-optimizations-processors.h", "src/maglev/maglev-pre-regalloc-codegen-processors.h", + "src/maglev/maglev-reducer-inl.h", + "src/maglev/maglev-reducer.h", "src/maglev/maglev-regalloc-data.h", + "src/maglev/maglev-regalloc-node-info.h", "src/maglev/maglev-regalloc.h", "src/maglev/maglev-register-frame-array.h", "src/maglev/maglev.h", @@ -2866,10 +2926,15 @@ filegroup( "src/maglev/maglev-compiler.cc", "src/maglev/maglev-concurrent-dispatcher.cc", "src/maglev/maglev-graph-builder.cc", + "src/maglev/maglev-graph-labeller.cc", + "src/maglev/maglev-graph-optimizer.cc", "src/maglev/maglev-graph-printer.cc", + "src/maglev/maglev-graph.cc", + "src/maglev/maglev-inlining.cc", "src/maglev/maglev-interpreter-frame-state.cc", "src/maglev/maglev-ir.cc", "src/maglev/maglev-phi-representation-selector.cc", + "src/maglev/maglev-truncation.cc", "src/maglev/maglev-pipeline-statistics.cc", "src/maglev/maglev-regalloc.cc", "src/maglev/maglev.cc", @@ -2937,6 +3002,8 @@ filegroup( "src/wasm/baseline/parallel-move.cc", "src/wasm/baseline/parallel-move.h", "src/wasm/baseline/parallel-move-inl.h", + "src/wasm/basic-block-calculator.cc", + "src/wasm/basic-block-calculator.h", "src/wasm/branch-hint-map.h", "src/wasm/canonical-types.cc", "src/wasm/canonical-types.h", @@ -2989,10 +3056,12 @@ filegroup( "src/wasm/sync-streaming-decoder.cc", "src/wasm/turboshaft-graph-interface.cc", "src/wasm/turboshaft-graph-interface.h", + "src/wasm/turboshaft-graph-interface-inl.h", "src/wasm/value-type.cc", "src/wasm/value-type.h", "src/wasm/wasm-arguments.h", "src/wasm/wasm-builtin-list.h", + "src/wasm/wasm-code-coverage.h", "src/wasm/wasm-code-manager.cc", "src/wasm/wasm-code-manager.h", "src/wasm/wasm-code-pointer-table.cc", @@ -3007,6 +3076,8 @@ filegroup( "src/wasm/wasm-disassembler-impl.h", "src/wasm/wasm-engine.cc", "src/wasm/wasm-engine.h", + "src/wasm/wasm-export-wrapper-cache.cc", + "src/wasm/wasm-export-wrapper-cache.h", "src/wasm/wasm-external-refs.cc", "src/wasm/wasm-external-refs.h", "src/wasm/wasm-features.cc", @@ -3040,6 +3111,8 @@ filegroup( "src/wasm/well-known-imports.cc", "src/wasm/well-known-imports.h", "src/wasm/wrappers.cc", + "src/wasm/wrappers.h", + "src/wasm/wrappers-inl.h", "third_party/utf8-decoder/generalized-utf8-decoder.h", ], "//conditions:default": [], @@ -3146,7 +3219,6 @@ filegroup( "src/compiler/backend/instruction-scheduler.h", "src/compiler/backend/instruction-selector.cc", "src/compiler/backend/instruction-selector.h", - "src/compiler/backend/instruction-selector-adapter.h", "src/compiler/backend/instruction-selector-impl.h", "src/compiler/backend/jump-threading.cc", "src/compiler/backend/jump-threading.h", @@ -3182,6 +3254,8 @@ filegroup( "src/compiler/common-operator.h", "src/compiler/common-operator-reducer.cc", "src/compiler/common-operator-reducer.h", + "src/compiler/common-utils.cc", + "src/compiler/common-utils.h", "src/compiler/compilation-dependencies.cc", "src/compiler/compilation-dependencies.h", "src/compiler/compiler-source-position-table.cc", @@ -3362,8 +3436,18 @@ filegroup( "src/compiler/turboshaft/build-graph-phase.h", "src/compiler/turboshaft/builtin-call-descriptors.h", "src/compiler/turboshaft/builtin-compiler.h", - "src/compiler/turboshaft/csa-optimize-phase.cc", - "src/compiler/turboshaft/csa-optimize-phase.h", + "src/compiler/turboshaft/csa-branch-elimination-phase.cc", + "src/compiler/turboshaft/csa-branch-elimination-phase.h", + "src/compiler/turboshaft/csa-early-machine-optimization-phase.cc", + "src/compiler/turboshaft/csa-early-machine-optimization-phase.h", + "src/compiler/turboshaft/csa-effects-computation.cc", + "src/compiler/turboshaft/csa-effects-computation.h", + "src/compiler/turboshaft/csa-late-escape-analysis-phase.cc", + "src/compiler/turboshaft/csa-late-escape-analysis-phase.h", + "src/compiler/turboshaft/csa-load-elimination-phase.cc", + "src/compiler/turboshaft/csa-load-elimination-phase.h", + "src/compiler/turboshaft/csa-memory-optimization-phase.cc", + "src/compiler/turboshaft/csa-memory-optimization-phase.h", "src/compiler/turboshaft/dataview-lowering-reducer.h", "src/compiler/turboshaft/code-elimination-and-simplification-phase.cc", "src/compiler/turboshaft/code-elimination-and-simplification-phase.h", @@ -3391,6 +3475,7 @@ filegroup( "src/compiler/turboshaft/graph-visualizer.cc", "src/compiler/turboshaft/graph-visualizer.h", "src/compiler/turboshaft/js-generic-lowering-reducer.h", + "src/compiler/turboshaft/if-else-cascade-to-switch-reducer.h", "src/compiler/turboshaft/index.h", "src/compiler/turboshaft/instruction-selection-normalization-reducer.h", "src/compiler/turboshaft/instruction-selection-phase.cc", @@ -3413,7 +3498,7 @@ filegroup( "src/compiler/turboshaft/machine-lowering-phase.cc", "src/compiler/turboshaft/machine-lowering-phase.h", "src/compiler/turboshaft/machine-lowering-reducer-inl.h", - "src/compiler/turboshaft/maglev-early-lowering-reducer-inl.h", + "src/compiler/turboshaft/turbolev-early-lowering-reducer-inl.h", "src/compiler/turboshaft/turbolev-graph-builder.cc", "src/compiler/turboshaft/turbolev-graph-builder.h", "src/compiler/turboshaft/machine-optimization-reducer.h", @@ -3451,7 +3536,6 @@ filegroup( "src/compiler/turboshaft/string-escape-analysis-reducer.cc", "src/compiler/turboshaft/string-escape-analysis-reducer.h", "src/compiler/turboshaft/string-view.h", - "src/compiler/turboshaft/structural-optimization-reducer.h", "src/compiler/turboshaft/tracing.h", "src/compiler/turboshaft/type-assertions-phase.cc", "src/compiler/turboshaft/type-assertions-phase.h", @@ -3474,6 +3558,7 @@ filegroup( "src/compiler/turboshaft/utils.h", "src/compiler/turboshaft/value-numbering-reducer.h", "src/compiler/turboshaft/variable-reducer.h", + "src/compiler/turboshaft/wasm-code-coverage-reducer.h", "src/compiler/turboshaft/wasm-js-lowering-reducer.h", "src/compiler/turboshaft/zone-with-name.h", "src/compiler/type-cache.cc", @@ -3612,21 +3697,30 @@ filegroup( "src/maglev/maglev-compilation-unit.h", "src/maglev/maglev-graph-builder.cc", "src/maglev/maglev-graph-builder.h", + "src/maglev/maglev-graph-optimizer.cc", + "src/maglev/maglev-graph-optimizer.h", + "src/maglev/maglev-graph.cc", "src/maglev/maglev-graph.h", "src/maglev/maglev-graph-labeller.h", + "src/maglev/maglev-graph-labeller.cc", "src/maglev/maglev-graph-printer.cc", "src/maglev/maglev-graph-printer.h", "src/maglev/maglev-graph-processor.h", "src/maglev/maglev-graph-verifier.h", + "src/maglev/maglev-inlining.cc", "src/maglev/maglev-inlining.h", "src/maglev/maglev-interpreter-frame-state.cc", "src/maglev/maglev-interpreter-frame-state.h", "src/maglev/maglev-ir.cc", "src/maglev/maglev-ir.h", "src/maglev/maglev-ir-inl.h", + "src/maglev/maglev-reducer-inl.h", + "src/maglev/maglev-reducer.h", "src/maglev/maglev-register-frame-array.h", "src/maglev/maglev-phi-representation-selector.cc", "src/maglev/maglev-phi-representation-selector.h", + "src/maglev/maglev-truncation.cc", + "src/maglev/maglev-truncation.h", "src/maglev/maglev-post-hoc-optimizations-processors.h", "src/maglev/maglev-pre-regalloc-codegen-processors.h", ], @@ -3663,8 +3757,8 @@ filegroup( "src/builtins/builtins-interpreter-gen.cc", "src/builtins/builtins-iterator-gen.cc", "src/builtins/builtins-iterator-gen.h", - "src/builtins/builtins-lazy-gen.cc", - "src/builtins/builtins-lazy-gen.h", + "src/builtins/js-trampoline-assembler.cc", + "src/builtins/js-trampoline-assembler.h", "src/builtins/builtins-microtask-queue-gen.cc", "src/builtins/builtins-number-gen.cc", "src/builtins/builtins-number-tsa.cc", @@ -3681,7 +3775,6 @@ filegroup( "src/builtins/builtins-string-gen.cc", "src/builtins/builtins-string-gen.h", "src/builtins/builtins-string-tsa.cc", - "src/builtins/builtins-temporal-gen.cc", "src/builtins/builtins-typed-array-gen.cc", "src/builtins/builtins-typed-array-gen.h", "src/builtins/builtins-utils-gen.h", @@ -3864,6 +3957,8 @@ filegroup( "src/heap/base/memory-tagging.cc", "src/heap/base/stack.cc", "src/heap/base/stack.h", + "src/heap/base/unsafe-json-emitter.cc", + "src/heap/base/unsafe-json-emitter.h", "src/heap/base/worklist.cc", "src/heap/base/worklist.h", ] + select({ @@ -3883,12 +3978,24 @@ filegroup( }), ) +v8_library( + name = "lib_dragonbox", + srcs = ["third_party/dragonbox/src/include/dragonbox/dragonbox.h"], + hdrs = [ + "third_party/dragonbox/src/include/dragonbox/dragonbox.h", + ], + includes = [ + "third_party/dragonbox/src/include", + ], +) + v8_library( name = "lib_fp16", srcs = ["third_party/fp16/src/include/fp16.h"], hdrs = [ "third_party/fp16/src/include/fp16/fp16.h", "third_party/fp16/src/include/fp16/bitcasts.h", + "third_party/fp16/src/include/fp16/macros.h", ], includes = [ "third_party/fp16/src/include", @@ -4325,7 +4432,11 @@ v8_library( ":v8_shared_internal_headers", ], copts = ["-Wno-implicit-fallthrough"], - deps = ["@abseil-cpp//absl/synchronization", "@abseil-cpp//absl/time"], + deps = [ + "@abseil-cpp//absl/synchronization", + "@abseil-cpp//absl/time", + "@abseil-cpp//absl/functional:overload", + ], ) cc_library( @@ -4359,6 +4470,12 @@ cc_library( name = "simdutf", srcs = ["third_party/simdutf/simdutf.cpp"], hdrs = ["third_party/simdutf/simdutf.h"], + copts = select({ + "@v8//bazel/config:is_clang": ["-std=c++20"], + "@v8//bazel/config:is_gcc": ["-std=gnu++2a"], + "@v8//bazel/config:is_windows": ["/std:c++20"], + "//conditions:default": [], + }), ) v8_library( @@ -4389,6 +4506,7 @@ v8_library( ":noicu/generated_torque_definitions", ], deps = [ + ":lib_dragonbox", "//third_party/fast_float/src:fast_float", ":lib_fp16", ":simdutf", @@ -4396,6 +4514,7 @@ v8_library( "@abseil-cpp//absl/container:btree", "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/container:flat_hash_set", + "@abseil-cpp//absl/functional:overload", "@highway//:hwy", ], ) diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index e565537e080035..487a7466168196 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -47,6 +47,9 @@ declare_args() { # Sets -DVERIFY_HEAP. v8_enable_verify_heap = "" + # Sets -DVERIFY_WRITE_BARRIERS. + v8_enable_verify_write_barriers = "" + # Sets -DVERIFY_PREDICTABLE v8_enable_verify_predictable = false @@ -158,6 +161,9 @@ declare_args() { # Sets -DOBJECT_PRINT. v8_enable_object_print = "" + # Sets -DALWAYS_MAGLEV_GRAPH_LABELLER. + v8_always_enable_maglev_graph_labeller = "" + # Sets -DV8_TRACE_MAPS. v8_enable_trace_maps = "" @@ -234,6 +240,11 @@ declare_args() { # in step 3 or 4. v8_builtins_profiling_log_file = "default" + # Enable gearbox (instruction set extension) for builtins, the gearbox + # feature only supports x64 arch yet. + # Sets -DV8_BUILTINS_GEARBOX + v8_enable_builtins_gearbox = false + # Enables various testing features. v8_enable_test_features = "" @@ -334,14 +345,14 @@ declare_args() { # Enable allocations during prefinalizer invocations. cppgc_allow_allocations_in_prefinalizers = false - # Enable V8 zone compression experimental feature. - # Sets -DV8_COMPRESS_ZONES. - v8_enable_zone_compression = "" - # Enable the V8 sandbox. # Sets -DV8_ENABLE_SANDBOX. v8_enable_sandbox = "" + # Enable experimental hardware support for the V8 sandbox if available. + # Sets -DV8_ENABLE_SANDBOX_HARDWARE_SUPPORT + v8_enable_sandbox_hardware_support = false + # Enable leaptiering v8_enable_leaptiering = true @@ -401,32 +412,6 @@ declare_args() { # This is only used by nodejs. v8_scriptormodule_legacy_lifetime = false - # WebAssembly interpreter (DrumBrake) build flag. - v8_enable_drumbrake = false - - # Enable Wasm interpreter tracing. - v8_enable_drumbrake_tracing = false - - # On non-Desktop platforms, enable explicit bounds checks in the Wasm - # interpreter, where the bounds checking is done in the instruction handler, - # not using an unhandled exception filter (which also doesn't work with - # Win-ASAN). - # Also enables explicit bounds checks on component builds in platforms other - # than Windows because of a problem with function name mangling for vectorcall - # ABI on ELF (The vectorcall calling convention requires a mangling that - # includes @@, but on ELF an @ indicates that the part after it is the version - # of the symbol, with @@ indicating the default symbol version to link against - # when none is specified by the caller and this causes linker errors). As a - # workaround, we need to disable the vectorcall calling convention for - # component builds on Linux and Mac, which means that we cannot use DrumBrake - # builtins for Load/Store instruction handlers, because of the different - # calling convention. - # Windows component builds are also enabled to support cross-compilation. - v8_drumbrake_bounds_checks = - (is_win && (is_asan || is_ubsan || is_msan || is_tsan)) || - !(is_win || is_linux || is_mac) || v8_current_cpu != "x64" || !is_clang || - is_component_build - # Enables pointer compression for 8GB heaps. # Sets -DV8_COMPRESS_POINTERS_8GB. v8_enable_pointer_compression_8gb = "" @@ -457,7 +442,8 @@ declare_args() { v8_enable_slow_tracing = is_debug # Enable jump table switch for built-in. - v8_enable_builtin_jump_table_switch = v8_current_cpu == "x64" + v8_enable_builtin_jump_table_switch = + v8_current_cpu == "x64" || v8_current_cpu == "arm64" v8_shortcut_strings_in_minor_ms = false @@ -465,9 +451,6 @@ declare_args() { # ReadOnlySpace. v8_enable_extensible_ro_snapshot = true - # Enable Turboshaft CSA pipeline. - v8_enable_turboshaft_csa = false - # Black allocate objects on separate pages. v8_enable_black_allocated_pages = "" @@ -488,10 +471,6 @@ declare_args() { # the explicit dependency and allows the build to complete. v8_depend_on_icu_data_file = icu_use_data_file - # Some fuzzers depend on fuzzing functionality linked into the v8 library. - # For binary size reasons this functionality is not always available. - v8_wasm_random_fuzzers = "" - # Experimental testing mode where various limits are artificially set lower. v8_lower_limits_mode = false @@ -514,6 +493,12 @@ declare_args() { # Deinterleaving load support. v8_enable_wasm_deinterleaved_mem_ops = false + + # Expose F.p.caller and .arguments as own properties. + v8_function_arguments_caller_are_own_props = false + + # Use a hard-coded secret value when hashing. + v8_use_default_hasher_secret = true } # Derived defaults. @@ -523,9 +508,16 @@ if (cppgc_enable_verify_heap == "") { if (v8_enable_verify_heap == "") { v8_enable_verify_heap = v8_enable_debugging_features } +if (v8_enable_verify_write_barriers == "") { + v8_enable_verify_write_barriers = + v8_enable_debugging_features && !v8_disable_write_barriers +} if (v8_enable_object_print == "") { v8_enable_object_print = v8_enable_debugging_features } +if (v8_always_enable_maglev_graph_labeller == "") { + v8_always_enable_maglev_graph_labeller = v8_enable_debugging_features +} if (v8_enable_disassembler == "") { v8_enable_disassembler = v8_enable_debugging_features } @@ -576,6 +568,8 @@ if (v8_multi_arch_build && rebase_path(get_label_info(":d8", "root_out_dir"), root_build_dir) == "clang_x64_fuzzer_experiments") { v8_enable_pointer_compression = !v8_enable_pointer_compression + v8_enable_experimental_undefined_double = + !v8_enable_experimental_undefined_double v8_lower_limits_mode = !v8_lower_limits_mode } @@ -602,9 +596,6 @@ if (v8_enable_fast_torque == "") { if (v8_enable_concurrent_mksnapshot == "") { v8_enable_concurrent_mksnapshot = v8_enable_fast_mksnapshot } -if (v8_enable_zone_compression == "") { - v8_enable_zone_compression = false -} if (v8_enable_short_builtin_calls == "") { v8_enable_short_builtin_calls = v8_current_cpu == "x64" || v8_current_cpu == "arm64" || @@ -629,9 +620,14 @@ if (v8_enable_maglev == "") { assert(v8_enable_turbofan || !v8_enable_maglev, "Maglev is not available when Turbofan is disabled.") -assert(!v8_jitless || (!v8_enable_sparkplug && !v8_enable_maglev && - !v8_enable_turbofan && !v8_enable_webassembly), - "Sparkplug, Maglev, Turbofan and Wasm are not available in jitless mode") +is_wasm_interpreter_mode_enabled = + !v8_enable_sparkplug && !v8_enable_maglev && !v8_enable_turbofan && + v8_enable_webassembly && v8_enable_drumbrake +assert( + !v8_jitless || (!v8_enable_sparkplug && !v8_enable_maglev && + !v8_enable_turbofan && !v8_enable_webassembly) || + is_wasm_interpreter_mode_enabled, + "Sparkplug, Maglev, Turbofan and Wasm are not available in jitless mode. But, if the Wasm interpreter mode is on, Wasm can work in jitless mode") if (v8_enable_single_generation == "") { v8_enable_single_generation = v8_disable_write_barriers @@ -677,19 +673,12 @@ if (v8_enable_sandbox == "") { if (v8_enable_static_roots == "") { # Static roots are only valid for builds with pointer compression and a # shared read-only heap. - # TODO(olivf, v8:13466) Some configurations could be supported if we - # introduce different static root files for different build configurations: - # Non-wasm and non-i18n builds have fewer read only roots. Configurations - # without external code space allocate read only roots at a further - # location relative to the cage base. v8_enable_static_roots = - v8_enable_pointer_compression && v8_enable_external_code_space && - v8_enable_webassembly && v8_enable_i18n_support + v8_enable_pointer_compression && v8_enable_external_code_space } assert(!v8_enable_static_roots || - (v8_enable_pointer_compression && v8_enable_external_code_space && - v8_enable_webassembly && v8_enable_i18n_support), + (v8_enable_pointer_compression && v8_enable_external_code_space), "Trying to enable static roots in a configuration that is not supported") assert( @@ -750,6 +739,9 @@ if (v8_enable_webassembly && v8_current_cpu == "arm64") { assert(!v8_disable_write_barriers || v8_enable_single_generation, "Disabling write barriers works only with single generation") +assert(!v8_enable_verify_write_barriers || !v8_disable_write_barriers, + "Write barriers need to be enabled for verification") + assert(v8_current_cpu == "arm64" || !v8_control_flow_integrity, "Control-flow integrity is only supported on arm64") @@ -768,12 +760,16 @@ assert(!v8_enable_pointer_compression_8gb || v8_enable_pointer_compression, assert(!v8_enable_sandbox || v8_enable_external_code_space, "The sandbox requires the external code space") -assert(v8_enable_leaptiering || !v8_enable_sandbox, - "the sandbox requires leaptiering to be enabled") +assert( + v8_enable_leaptiering, + "non-leaptiering is deprecated (see https://groups.google.com/g/v8-dev/c/PYk2_GGP2Wk)") assert(!v8_enable_memory_corruption_api || v8_enable_sandbox, "The Memory Corruption API requires the sandbox") +assert(!v8_enable_sandbox_hardware_support || v8_enable_sandbox, + "The sandbox must be enabled to enable sandbox hardware support") + assert( !v8_enable_pointer_compression_shared_cage || v8_enable_pointer_compression, "Can't share a pointer compression cage if pointers aren't compressed") @@ -824,14 +820,6 @@ if (v8_expose_public_symbols == "") { v8_expose_public_symbols = v8_expose_symbols } -# Some fuzzers depend on fuzzing functionality linked into the v8 library. -# For binary size reasons this functionality is not available for official -# builds, therefore these fuzzers do not function there and should be skipped -# instead. -if (v8_wasm_random_fuzzers == "") { - v8_wasm_random_fuzzers = !is_official_build -} - assert( !build_with_chromium || !v8_enable_partition_alloc, "V8 using partition_alloc from Chromium is not implemented at the moment") @@ -839,6 +827,8 @@ assert( v8_random_seed = "314159265" v8_toolset_for_shell = "host" +is_DEBUG_defined = v8_enable_debugging_features || v8_dcheck_always_on + ############################################################################### # Configurations # @@ -853,6 +843,7 @@ config("internal_config_base") { ".", "include", "$target_gen_dir", + "$target_gen_dir/include", ] } @@ -977,6 +968,7 @@ external_v8_defines = [ "V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT=${v8_array_buffer_internal_field_count}", "V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT=${v8_array_buffer_view_internal_field_count}", "V8_PROMISE_INTERNAL_FIELD_COUNT=${v8_promise_internal_field_count}", + "V8_USE_DEFAULT_HASHER_SECRET=${v8_use_default_hasher_secret}", "V8_ENABLE_CHECKS", "V8_ENABLE_MEMORY_ACCOUNTING_CHECKS", "V8_COMPRESS_POINTERS", @@ -1005,6 +997,7 @@ enabled_external_v8_defines = [ "V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT=${v8_array_buffer_internal_field_count}", "V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT=${v8_array_buffer_view_internal_field_count}", "V8_PROMISE_INTERNAL_FIELD_COUNT=${v8_promise_internal_field_count}", + "V8_USE_DEFAULT_HASHER_SECRET=${v8_use_default_hasher_secret}", ] if (v8_enable_v8_checks) { @@ -1022,9 +1015,6 @@ if (v8_enable_pointer_compression) { if (v8_enable_pointer_compression || v8_enable_31bit_smis_on_64bit_arch) { enabled_external_v8_defines += [ "V8_31BIT_SMIS_ON_64BIT_ARCH" ] } -if (v8_enable_zone_compression) { - enabled_external_v8_defines += [ "V8_COMPRESS_ZONES" ] -} if (v8_enable_sandbox) { enabled_external_v8_defines += [ "V8_ENABLE_SANDBOX" ] } @@ -1222,9 +1212,15 @@ config("features") { if (v8_enable_object_print) { defines += [ "OBJECT_PRINT" ] } + if (v8_always_enable_maglev_graph_labeller) { + defines += [ "ALWAYS_MAGLEV_GRAPH_LABELLER" ] + } if (v8_enable_verify_heap) { defines += [ "VERIFY_HEAP" ] } + if (v8_enable_verify_write_barriers) { + defines += [ "V8_VERIFY_WRITE_BARRIERS" ] + } if (v8_enable_verify_predictable) { defines += [ "VERIFY_PREDICTABLE" ] } @@ -1241,10 +1237,17 @@ config("features") { defines += [ "V8_ENABLE_ALLOCATION_TIMEOUT" ] defines += [ "V8_ENABLE_FORCE_SLOW_PATH" ] defines += [ "V8_ENABLE_DOUBLE_CONST_STORE_CHECK" ] + + # Expose the runtime flag --hashes-collide for fuzzing purposes (to create + # hash collisions all the time). + defines += [ "V8_HASHES_COLLIDE" ] } if (v8_enable_i18n_support) { defines += [ "V8_INTL_SUPPORT" ] } + if (v8_enable_temporal_support) { + defines += [ "V8_TEMPORAL_SUPPORT" ] + } if (v8_enable_local_handle_zapping) { defines += [ "ENABLE_LOCAL_HANDLE_ZAPPING" ] } @@ -1320,6 +1323,15 @@ config("features") { if (v8_enable_fuzztest) { defines += [ "V8_ENABLE_FUZZTEST" ] } + + # TODO(Wenqin): Gearbox didn't work when didn't enable pointer compression, + # it's related to the deserializer, when pointer compression is disable, it + # will not call PostProcessCode method, which is the bottleneck for Gearbox + # try to fix it later. + if (v8_enable_pointer_compression && v8_enable_builtins_gearbox && + v8_current_cpu == "x64") { + defines += [ "V8_BUILTINS_GEARBOX" ] + } if (v8_enable_short_builtin_calls) { defines += [ "V8_SHORT_BUILTIN_CALLS" ] } @@ -1384,6 +1396,9 @@ config("features") { defines += [ "V8_DRUMBRAKE_BOUNDS_CHECKS" ] } } + if (v8_enable_sandbox_hardware_support) { + defines += [ "V8_ENABLE_SANDBOX_HARDWARE_SUPPORT" ] + } if (v8_enable_memory_corruption_api) { defines += [ "V8_ENABLE_MEMORY_CORRUPTION_API" ] } @@ -1441,6 +1456,9 @@ config("features") { if (v8_enable_leaptiering) { defines += [ "V8_ENABLE_LEAPTIERING" ] } + if (v8_enable_partition_alloc) { + defines += [ "V8_ENABLE_PARTITION_ALLOC" ] + } if (v8_wasm_random_fuzzers) { defines += [ "V8_WASM_RANDOM_FUZZERS" ] } @@ -1450,6 +1468,9 @@ config("features") { if (v8_target_is_simulator) { defines += [ "USE_SIMULATOR" ] } + if (v8_function_arguments_caller_are_own_props) { + defines += [ "V8_FUNCTION_ARGUMENTS_CALLER_ARE_OWN_PROPS" ] + } } config("toolchain") { @@ -1751,7 +1772,10 @@ config("strict_warnings") { v8_current_cpu == "mips64el" || v8_current_cpu == "riscv64") { cflags += [ "-Wshorten-64-to-32" ] } - cflags += [ "-Wmissing-field-initializers" ] + cflags += [ + "-Wmissing-field-initializers", + "-Wunnecessary-virtual-specifier", + ] } } @@ -1874,6 +1898,8 @@ if (v8_postmortem_support) { "src/objects/megadom-handler-inl.h", "src/objects/name.h", "src/objects/name-inl.h", + "src/objects/number-string-cache.h", + "src/objects/number-string-cache-inl.h", "src/objects/objects.h", "src/objects/objects-inl.h", "src/objects/oddball.h", @@ -1882,6 +1908,7 @@ if (v8_postmortem_support) { "src/objects/primitive-heap-object-inl.h", "src/objects/scope-info.h", "src/objects/scope-info-inl.h", + "src/objects/script.cc", "src/objects/script.h", "src/objects/script-inl.h", "src/objects/shared-function-info.cc", @@ -2098,7 +2125,6 @@ torque_files = [ "src/objects/js-shadow-realm.tq", "src/objects/js-shared-array.tq", "src/objects/js-struct.tq", - "src/objects/js-temporal-objects.tq", "src/objects/js-weak-refs.tq", "src/objects/literal-objects.tq", "src/objects/map.tq", @@ -2154,6 +2180,10 @@ if (v8_enable_i18n_support) { ] } +if (v8_enable_temporal_support) { + torque_files += [ "src/objects/js-temporal-objects.tq" ] +} + if (v8_enable_webassembly) { torque_files += [ "src/builtins/js-to-js.tq", @@ -2291,6 +2321,12 @@ group("v8_maybe_icu") { } } +group("v8_maybe_temporal") { + if (v8_enable_temporal_support) { + public_deps = [ "//third_party/rust/temporal_capi" ] + } +} + group("v8_abseil") { public_deps = [ "//third_party/abseil-cpp:absl" ] @@ -2321,6 +2357,7 @@ v8_source_set("torque_generated_initializers") { ":generate_bytecode_builtins_list", ":run_torque", ":v8_base_without_compiler", + ":v8_maybe_temporal", ":v8_tracing", ] @@ -2367,6 +2404,7 @@ v8_source_set("torque_generated_definitions") { ":run_torque", ":v8_internal_headers", ":v8_libbase", + ":v8_maybe_temporal", ":v8_tracing", ] @@ -2456,6 +2494,10 @@ template("run_mksnapshot") { outputs = [] + if (is_DEBUG_defined && name == "default") { + outputs += [ "$target_gen_dir/src/builtins/builtins-effects.cc" ] + } + data = [] if (current_os != "zos") { @@ -2507,6 +2549,14 @@ template("run_mksnapshot") { "--no-use-ic", ] + if (is_DEBUG_defined && name == "default") { + args += [ + "--builtins-effects-src", + rebase_path("$target_gen_dir/src/builtins/builtins-effects.cc", + root_build_dir), + ] + } + if (v8_verify_deterministic_mksnapshot) { # Flags that help debugging snapshot determinism. args += [ "--trace-read-only-promotion" ] @@ -2547,10 +2597,6 @@ template("run_mksnapshot") { } } - if (v8_enable_turboshaft_csa) { - args += [ "--turboshaft-csa" ] - } - # This is needed to distinguish between generating code for the simulator # and cross-compiling. The latter may need to run code on the host with the # simulator but cannot use simulator-specific instructions. @@ -2627,7 +2673,10 @@ template("run_mksnapshot") { } } - if (v8_enable_concurrent_mksnapshot) { + # TODO(Wenqin): We have to set the CPU feature when we are compiling ISX + # builtins, therefore it may make TSAN failed when we enable concurrent + # mksnapshot, try to make the CPU feature as thread local later. + if (v8_enable_concurrent_mksnapshot && !v8_enable_builtins_gearbox) { args += [ "--concurrent-builtin-generation", @@ -2752,7 +2801,6 @@ if (v8_verify_builtins_compatibility) { action("v8_dump_build_config") { script = "tools/testrunner/utils/dump_build_config.py" outputs = [ "$root_out_dir/v8_build_config.json" ] - is_DEBUG_defined = v8_enable_debugging_features || v8_dcheck_always_on is_full_debug = v8_enable_debugging_features && !v8_optimized_debug arch = v8_target_cpu @@ -2812,6 +2860,7 @@ action("v8_dump_build_config") { "has_webassembly=$v8_enable_webassembly", "has_wasm_interpreter=$v8_enable_drumbrake", "i18n=$v8_enable_i18n_support", + "temporal=$v8_enable_temporal_support", "is_android=$is_android", "is_ios=$is_ios", "js_shared_memory=$js_shared_memory", @@ -2825,6 +2874,7 @@ action("v8_dump_build_config") { "pointer_compression_shared_cage=$v8_enable_pointer_compression_shared_cage", "runtime_call_stats=$v8_enable_runtime_call_stats", "sandbox=$v8_enable_sandbox", + "sandbox_hardware_support=$v8_enable_sandbox_hardware_support", "simd_mips=$simd_mips", "simulator_run=$simulator_run", "single_generation=$v8_enable_single_generation", @@ -2866,6 +2916,7 @@ generated_file("v8_generate_features_json") { v8_enable_gdbjit = v8_enable_gdbjit v8_enable_hugepage = v8_enable_hugepage v8_enable_i18n_support = v8_enable_i18n_support + v8_enable_temporal_support = v8_enable_temporal_support v8_enable_javascript_promise_hooks = v8_enable_javascript_promise_hooks v8_enable_lite_mode = v8_enable_lite_mode v8_enable_map_packing = v8_enable_map_packing @@ -2878,12 +2929,12 @@ generated_file("v8_generate_features_json") { v8_enable_v8_checks = v8_enable_v8_checks v8_enable_memory_accounting_checks = v8_enable_memory_accounting_checks v8_enable_webassembly = v8_enable_webassembly - v8_enable_zone_compression = v8_enable_zone_compression v8_imminent_deprecation_warnings = v8_imminent_deprecation_warnings v8_optimized_debug = v8_optimized_debug v8_random_seed = v8_random_seed v8_use_perfetto = v8_use_perfetto v8_use_siphash = v8_use_siphash + v8_use_default_hasher_secret = v8_use_default_hasher_secret } } @@ -2900,6 +2951,7 @@ v8_source_set("v8_snapshot") { deps = [ ":v8_internal_headers", ":v8_libbase", + ":v8_maybe_temporal", ":v8_tracing", ] public_deps = [ @@ -2922,6 +2974,9 @@ v8_source_set("v8_snapshot") { sources += [ "$target_gen_dir/embedded.s" ] } } + if (is_DEBUG_defined) { + sources += [ "$target_gen_dir/src/builtins/builtins-effects.cc" ] + } configs = [ ":internal_config" ] @@ -2984,8 +3039,6 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-intl-gen.cc", "src/builtins/builtins-iterator-gen.cc", "src/builtins/builtins-iterator-gen.h", - "src/builtins/builtins-lazy-gen.cc", - "src/builtins/builtins-lazy-gen.h", "src/builtins/builtins-microtask-queue-gen.cc", "src/builtins/builtins-number-gen.cc", "src/builtins/builtins-number-tsa.cc", @@ -3002,12 +3055,13 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-string-gen.cc", "src/builtins/builtins-string-gen.h", "src/builtins/builtins-string-tsa.cc", - "src/builtins/builtins-temporal-gen.cc", "src/builtins/builtins-typed-array-gen.cc", "src/builtins/builtins-typed-array-gen.h", "src/builtins/builtins-utils-gen.h", "src/builtins/growable-fixed-array-gen.cc", "src/builtins/growable-fixed-array-gen.h", + "src/builtins/js-trampoline-assembler.cc", + "src/builtins/js-trampoline-assembler.h", "src/builtins/number-builtins-reducer-inl.h", "src/builtins/profile-data-reader.cc", "src/builtins/profile-data-reader.h", @@ -3125,6 +3179,7 @@ v8_source_set("v8_init") { deps = [ ":v8_base_without_compiler", ":v8_initializers", + ":v8_maybe_temporal", ":v8_tracing", ] @@ -3292,6 +3347,7 @@ v8_header_set("v8_shared_internal_headers") { ] deps = [ + ":cppgc_headers", ":v8_headers", ":v8_libbase", ] @@ -3334,8 +3390,6 @@ v8_header_set("v8_internal_headers") { "src/api/api-arguments-inl.h", "src/api/api-arguments.h", "src/api/api-inl.h", - "src/api/api-macros-undef.h", - "src/api/api-macros.h", "src/api/api-natives.h", "src/api/api.h", "src/ast/ast-function-literal-id-reindexer.h", @@ -3354,6 +3408,7 @@ v8_header_set("v8_internal_headers") { "src/builtins/builtins-constructor.h", "src/builtins/builtins-definitions.h", "src/builtins/builtins-descriptors.h", + "src/builtins/builtins-effects-analyzer.h", "src/builtins/builtins-inl.h", "src/builtins/builtins-promise.h", "src/builtins/builtins-utils-inl.h", @@ -3422,6 +3477,7 @@ v8_header_set("v8_internal_headers") { "src/common/operation.h", "src/common/ptr-compr-inl.h", "src/common/ptr-compr.h", + "src/common/scoped-modification.h", "src/common/segmented-table-inl.h", "src/common/segmented-table.h", "src/common/simd128.h", @@ -3441,7 +3497,6 @@ v8_header_set("v8_internal_headers") { "src/compiler/backend/gap-resolver.h", "src/compiler/backend/instruction-codes.h", "src/compiler/backend/instruction-scheduler.h", - "src/compiler/backend/instruction-selector-adapter.h", "src/compiler/backend/instruction-selector-impl.h", "src/compiler/backend/instruction-selector.h", "src/compiler/backend/instruction.h", @@ -3463,6 +3518,7 @@ v8_header_set("v8_internal_headers") { "src/compiler/common-node-cache.h", "src/compiler/common-operator-reducer.h", "src/compiler/common-operator.h", + "src/compiler/common-utils.h", "src/compiler/compilation-dependencies.h", "src/compiler/compiler-source-position-table.h", "src/compiler/constant-folding-reducer.h", @@ -3563,7 +3619,12 @@ v8_header_set("v8_internal_headers") { "src/compiler/turboshaft/builtin-call-descriptors.h", "src/compiler/turboshaft/code-elimination-and-simplification-phase.h", "src/compiler/turboshaft/copying-phase.h", - "src/compiler/turboshaft/csa-optimize-phase.h", + "src/compiler/turboshaft/csa-branch-elimination-phase.h", + "src/compiler/turboshaft/csa-early-machine-optimization-phase.h", + "src/compiler/turboshaft/csa-effects-computation.h", + "src/compiler/turboshaft/csa-late-escape-analysis-phase.h", + "src/compiler/turboshaft/csa-load-elimination-phase.h", + "src/compiler/turboshaft/csa-memory-optimization-phase.h", "src/compiler/turboshaft/dataview-lowering-reducer.h", "src/compiler/turboshaft/dead-code-elimination-reducer.h", "src/compiler/turboshaft/debug-feature-lowering-phase.h", @@ -3580,6 +3641,7 @@ 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/if-else-cascade-to-switch-reducer.h", "src/compiler/turboshaft/index.h", "src/compiler/turboshaft/instruction-selection-normalization-reducer.h", "src/compiler/turboshaft/instruction-selection-phase.h", @@ -3596,7 +3658,6 @@ v8_header_set("v8_internal_headers") { "src/compiler/turboshaft/machine-lowering-phase.h", "src/compiler/turboshaft/machine-lowering-reducer-inl.h", "src/compiler/turboshaft/machine-optimization-reducer.h", - "src/compiler/turboshaft/maglev-early-lowering-reducer-inl.h", "src/compiler/turboshaft/memory-optimization-reducer.h", "src/compiler/turboshaft/operation-matcher.h", "src/compiler/turboshaft/operations.h", @@ -3620,8 +3681,8 @@ v8_header_set("v8_internal_headers") { "src/compiler/turboshaft/store-store-elimination-reducer-inl.h", "src/compiler/turboshaft/string-escape-analysis-reducer.h", "src/compiler/turboshaft/string-view.h", - "src/compiler/turboshaft/structural-optimization-reducer.h", "src/compiler/turboshaft/tracing.h", + "src/compiler/turboshaft/turbolev-early-lowering-reducer-inl.h", "src/compiler/turboshaft/turbolev-graph-builder.h", "src/compiler/turboshaft/type-assertions-phase.h", "src/compiler/turboshaft/type-inference-analysis.h", @@ -3637,6 +3698,7 @@ v8_header_set("v8_internal_headers") { "src/compiler/turboshaft/utils.h", "src/compiler/turboshaft/value-numbering-reducer.h", "src/compiler/turboshaft/variable-reducer.h", + "src/compiler/turboshaft/wasm-code-coverage-reducer.h", "src/compiler/turboshaft/wasm-dead-code-elimination-phase.h", "src/compiler/turboshaft/zone-with-name.h", "src/compiler/type-cache.h", @@ -3763,6 +3825,7 @@ v8_header_set("v8_internal_headers") { "src/heap/finalization-registry-cleanup-task.h", "src/heap/free-list-inl.h", "src/heap/free-list.h", + "src/heap/gc-callbacks-inl.h", "src/heap/gc-callbacks.h", "src/heap/gc-tracer-inl.h", "src/heap/gc-tracer.h", @@ -3820,6 +3883,7 @@ v8_header_set("v8_internal_headers") { "src/heap/memory-chunk.h", "src/heap/memory-measurement-inl.h", "src/heap/memory-measurement.h", + "src/heap/memory-pool.h", "src/heap/memory-reducer.h", "src/heap/minor-gc-job.h", "src/heap/minor-mark-sweep-inl.h", @@ -3832,7 +3896,6 @@ v8_header_set("v8_internal_headers") { "src/heap/object-lock.h", "src/heap/object-stats.h", "src/heap/page-metadata.h", - "src/heap/page-pool.h", "src/heap/paged-spaces-inl.h", "src/heap/paged-spaces.h", "src/heap/parallel-work-item.h", @@ -3898,6 +3961,7 @@ v8_header_set("v8_internal_headers") { "src/interpreter/interpreter-generator.h", "src/interpreter/interpreter-intrinsics.h", "src/interpreter/interpreter.h", + "src/interpreter/prototype-assignment-sequence-builder.h", "src/json/json-parser.h", "src/json/json-stringifier.h", "src/libsampler/sampler.h", @@ -3916,6 +3980,7 @@ v8_header_set("v8_internal_headers") { "src/numbers/conversions-inl.h", "src/numbers/conversions.h", "src/numbers/hash-seed-inl.h", + "src/numbers/hash-seed.h", "src/numbers/ieee754.h", "src/numbers/math-random.h", "src/objects/all-objects-inl.h", @@ -3983,7 +4048,6 @@ v8_header_set("v8_internal_headers") { "src/objects/heap-number.h", "src/objects/heap-object-inl.h", "src/objects/heap-object.h", - "src/objects/hole-inl.h", "src/objects/hole.h", "src/objects/instance-type-checker.h", "src/objects/instance-type-inl.h", @@ -4027,8 +4091,7 @@ v8_header_set("v8_internal_headers") { "src/objects/js-shared-array.h", "src/objects/js-struct-inl.h", "src/objects/js-struct.h", - "src/objects/js-temporal-objects-inl.h", - "src/objects/js-temporal-objects.h", + "src/objects/js-temporal-helpers.h", "src/objects/js-weak-refs-inl.h", "src/objects/js-weak-refs.h", "src/objects/keys.h", @@ -4170,6 +4233,7 @@ v8_header_set("v8_internal_headers") { "src/profiler/cpu-profiler-inl.h", "src/profiler/cpu-profiler.h", "src/profiler/heap-profiler.h", + "src/profiler/heap-snapshot-common.h", "src/profiler/heap-snapshot-generator-inl.h", "src/profiler/heap-snapshot-generator.h", "src/profiler/output-stream-writer.h", @@ -4190,8 +4254,12 @@ v8_header_set("v8_internal_headers") { "src/regexp/regexp-ast.h", "src/regexp/regexp-bytecode-generator-inl.h", "src/regexp/regexp-bytecode-generator.h", + "src/regexp/regexp-bytecode-iterator-inl.h", + "src/regexp/regexp-bytecode-iterator.h", "src/regexp/regexp-bytecode-peephole.h", + "src/regexp/regexp-bytecodes-inl.h", "src/regexp/regexp-bytecodes.h", + "src/regexp/regexp-code-generator.h", "src/regexp/regexp-compiler.h", "src/regexp/regexp-dotprinter.h", "src/regexp/regexp-error.h", @@ -4209,6 +4277,10 @@ v8_header_set("v8_internal_headers") { "src/regexp/special-case.h", "src/roots/roots-inl.h", "src/roots/roots.h", + "src/roots/static-roots-intl-nowasm.h", + "src/roots/static-roots-intl-wasm.h", + "src/roots/static-roots-nointl-nowasm.h", + "src/roots/static-roots-nointl-wasm.h", "src/roots/static-roots.h", "src/runtime/runtime-utils.h", "src/runtime/runtime.h", @@ -4220,6 +4292,7 @@ v8_header_set("v8_internal_headers") { "src/sandbox/code-pointer-table-inl.h", "src/sandbox/code-pointer-table.h", "src/sandbox/code-pointer.h", + "src/sandbox/code-sandboxing-mode.h", "src/sandbox/compactible-external-entity-table-inl.h", "src/sandbox/compactible-external-entity-table.h", "src/sandbox/cppheap-pointer-inl.h", @@ -4240,6 +4313,7 @@ v8_header_set("v8_internal_headers") { "src/sandbox/isolate.h", "src/sandbox/js-dispatch-table-inl.h", "src/sandbox/js-dispatch-table.h", + "src/sandbox/sandbox-malloc.h", "src/sandbox/sandbox.h", "src/sandbox/sandboxed-pointer-inl.h", "src/sandbox/sandboxed-pointer.h", @@ -4289,7 +4363,6 @@ v8_header_set("v8_internal_headers") { "src/tasks/cancelable-task.h", "src/tasks/operations-barrier.h", "src/tasks/task-utils.h", - "src/temporal/temporal-parser.h", "src/torque/runtime-macro-shims.h", "src/tracing/trace-event-no-perfetto.h", "src/tracing/trace-event.h", @@ -4307,6 +4380,7 @@ v8_header_set("v8_internal_headers") { "src/utils/locked-queue.h", "src/utils/memcopy.h", "src/utils/ostreams.h", + "src/utils/output-stream.h", "src/utils/scoped-list.h", "src/utils/sha-256.h", "src/utils/sparse-bit-vector.h", @@ -4314,12 +4388,10 @@ v8_header_set("v8_internal_headers") { "src/utils/utils.h", "src/utils/version.h", "src/zone/accounting-allocator.h", - "src/zone/compressed-zone-ptr.h", "src/zone/type-stats.h", "src/zone/zone-allocator.h", "src/zone/zone-chunk-list.h", "src/zone/zone-compact-set.h", - "src/zone/zone-compression.h", "src/zone/zone-containers.h", "src/zone/zone-hashmap.h", "src/zone/zone-list-inl.h", @@ -4328,6 +4400,8 @@ v8_header_set("v8_internal_headers") { "src/zone/zone-type-traits.h", "src/zone/zone-utils.h", "src/zone/zone.h", + "third_party/rapidhash-v8/rapidhash.h", + "third_party/rapidhash-v8/secret.h", "third_party/siphash/halfsiphash.h", "third_party/utf8-decoder/utf8-decoder.h", ] @@ -4336,6 +4410,13 @@ v8_header_set("v8_internal_headers") { sources += [ "src/snapshot/snapshot-compression.h" ] } + if (v8_enable_temporal_support) { + sources += [ + "src/objects/js-temporal-objects-inl.h", + "src/objects/js-temporal-objects.h", + ] + } + if (v8_use_perfetto) { sources -= [ "src/tracing/trace-event-no-perfetto.h" ] sources += [ @@ -4370,6 +4451,7 @@ v8_header_set("v8_internal_headers") { "src/maglev/maglev-deopt-frame-visitor.h", "src/maglev/maglev-graph-builder.h", "src/maglev/maglev-graph-labeller.h", + "src/maglev/maglev-graph-optimizer.h", "src/maglev/maglev-graph-printer.h", "src/maglev/maglev-graph-processor.h", "src/maglev/maglev-graph-verifier.h", @@ -4382,9 +4464,12 @@ v8_header_set("v8_internal_headers") { "src/maglev/maglev-pipeline-statistics.h", "src/maglev/maglev-post-hoc-optimizations-processors.h", "src/maglev/maglev-pre-regalloc-codegen-processors.h", + "src/maglev/maglev-reducer-inl.h", + "src/maglev/maglev-reducer.h", "src/maglev/maglev-regalloc-data.h", "src/maglev/maglev-regalloc.h", "src/maglev/maglev-register-frame-array.h", + "src/maglev/maglev-truncation.h", "src/maglev/maglev.h", ] if (v8_current_cpu == "arm") { @@ -4397,6 +4482,8 @@ v8_header_set("v8_internal_headers") { sources += [ "src/maglev/x64/maglev-assembler-x64-inl.h" ] } else if (v8_current_cpu == "s390x") { sources += [ "src/maglev/s390/maglev-assembler-s390-inl.h" ] + } else if (v8_current_cpu == "ppc64") { + sources += [ "src/maglev/ppc64/maglev-assembler-ppc64-inl.h" ] } } @@ -4448,6 +4535,7 @@ v8_header_set("v8_internal_headers") { "src/wasm/baseline/liftoff-varstate.h", "src/wasm/baseline/parallel-move-inl.h", "src/wasm/baseline/parallel-move.h", + "src/wasm/basic-block-calculator.h", "src/wasm/canonical-types.h", "src/wasm/code-space-access.h", "src/wasm/compilation-environment-inl.h", @@ -4480,10 +4568,12 @@ v8_header_set("v8_internal_headers") { "src/wasm/string-builder-multiline.h", "src/wasm/string-builder.h", "src/wasm/struct-types.h", + "src/wasm/turboshaft-graph-interface-inl.h", "src/wasm/turboshaft-graph-interface.h", "src/wasm/value-type.h", "src/wasm/wasm-arguments.h", "src/wasm/wasm-builtin-list.h", + "src/wasm/wasm-code-coverage.h", "src/wasm/wasm-code-manager.h", "src/wasm/wasm-code-pointer-table-inl.h", "src/wasm/wasm-code-pointer-table.h", @@ -4492,6 +4582,7 @@ v8_header_set("v8_internal_headers") { "src/wasm/wasm-disassembler-impl.h", "src/wasm/wasm-disassembler.h", "src/wasm/wasm-engine.h", + "src/wasm/wasm-export-wrapper-cache.h", "src/wasm/wasm-external-refs.h", "src/wasm/wasm-feature-flags.h", "src/wasm/wasm-features.h", @@ -4512,6 +4603,8 @@ v8_header_set("v8_internal_headers") { "src/wasm/wasm-tier.h", "src/wasm/wasm-value.h", "src/wasm/well-known-imports.h", + "src/wasm/wrappers-inl.h", + "src/wasm/wrappers.h", "third_party/utf8-decoder/generalized-utf8-decoder.h", ] @@ -4951,6 +5044,10 @@ v8_header_set("v8_internal_headers") { "//third_party/fp16", ] + if (v8_enable_partition_alloc) { + public_deps += [ "//third_party/partition_alloc" ] + } + deps = [ ":cppgc_headers", ":generate_bytecode_builtins_list", @@ -4958,6 +5055,8 @@ v8_header_set("v8_internal_headers") { ":v8_abseil", ":v8_heap_base_headers", ":v8_libbase", + ":v8_maybe_temporal", + "//third_party/simdutf", ] } @@ -4990,6 +5089,7 @@ v8_compiler_sources = [ "src/compiler/common-node-cache.cc", "src/compiler/common-operator-reducer.cc", "src/compiler/common-operator.cc", + "src/compiler/common-utils.cc", "src/compiler/compilation-dependencies.cc", "src/compiler/compiler-source-position-table.cc", "src/compiler/constant-folding-reducer.cc", @@ -5020,7 +5120,6 @@ v8_compiler_sources = [ "src/compiler/js-type-hint-lowering.cc", "src/compiler/js-typed-lowering.cc", "src/compiler/late-escape-analysis.cc", - "src/compiler/linkage.cc", "src/compiler/load-elimination.cc", "src/compiler/loop-analysis.cc", "src/compiler/loop-peeling.cc", @@ -5073,7 +5172,12 @@ v8_compiler_sources = [ "src/compiler/turboshaft/build-graph-phase.cc", "src/compiler/turboshaft/code-elimination-and-simplification-phase.cc", "src/compiler/turboshaft/copying-phase.cc", - "src/compiler/turboshaft/csa-optimize-phase.cc", + "src/compiler/turboshaft/csa-branch-elimination-phase.cc", + "src/compiler/turboshaft/csa-early-machine-optimization-phase.cc", + "src/compiler/turboshaft/csa-effects-computation.cc", + "src/compiler/turboshaft/csa-late-escape-analysis-phase.cc", + "src/compiler/turboshaft/csa-load-elimination-phase.cc", + "src/compiler/turboshaft/csa-memory-optimization-phase.cc", "src/compiler/turboshaft/debug-feature-lowering-phase.cc", "src/compiler/turboshaft/decompression-optimization-phase.cc", "src/compiler/turboshaft/decompression-optimization.cc", @@ -5121,10 +5225,15 @@ if (!v8_enable_maglev) { "src/maglev/maglev-compilation-info.cc", "src/maglev/maglev-compilation-unit.cc", "src/maglev/maglev-graph-builder.cc", + "src/maglev/maglev-graph-labeller.cc", + "src/maglev/maglev-graph-optimizer.cc", "src/maglev/maglev-graph-printer.cc", + "src/maglev/maglev-graph.cc", + "src/maglev/maglev-inlining.cc", "src/maglev/maglev-interpreter-frame-state.cc", "src/maglev/maglev-ir.cc", "src/maglev/maglev-phi-representation-selector.cc", + "src/maglev/maglev-truncation.cc", ] } @@ -5209,6 +5318,7 @@ if (v8_enable_webassembly) { v8_compiler_sources += [ "src/compiler/int64-lowering.cc", "src/compiler/turboshaft/int64-lowering-phase.cc", + "src/compiler/turboshaft/wasm-dead-code-elimination-phase.cc", "src/compiler/turboshaft/wasm-debug-memory-lowering-phase.cc", "src/compiler/turboshaft/wasm-gc-optimize-phase.cc", "src/compiler/turboshaft/wasm-gc-typed-optimization-reducer.cc", @@ -5220,7 +5330,6 @@ if (v8_enable_webassembly) { "src/compiler/turboshaft/wasm-turboshaft-compiler.cc", "src/compiler/wasm-address-reassociation.cc", "src/compiler/wasm-call-descriptors.cc", - "src/compiler/wasm-compiler-definitions.cc", "src/compiler/wasm-compiler.cc", "src/compiler/wasm-escape-analysis.cc", "src/compiler/wasm-gc-lowering.cc", @@ -5229,6 +5338,8 @@ if (v8_enable_webassembly) { "src/compiler/wasm-inlining-into-js.cc", "src/compiler/wasm-load-elimination.cc", "src/compiler/wasm-typer.cc", + "src/wasm/turboshaft-graph-interface.cc", + "src/wasm/wrappers.cc", ] } @@ -5263,6 +5374,7 @@ v8_source_set("v8_compiler_for_mksnapshot_source_set") { ":v8_base_without_compiler", ":v8_internal_headers", ":v8_libbase", + ":v8_maybe_temporal", ":v8_shared_internal_headers", ] @@ -5301,6 +5413,7 @@ v8_source_set("v8_compiler") { deps = [ ":v8_base_without_compiler", ":v8_libbase", + ":v8_maybe_temporal", ":v8_shared_internal_headers", ] @@ -5373,6 +5486,7 @@ v8_source_set("v8_base_without_compiler") { "src/builtins/builtins-dataview.cc", "src/builtins/builtins-date.cc", "src/builtins/builtins-disposable-stack.cc", + "src/builtins/builtins-effects-analyzer.cc", "src/builtins/builtins-error.cc", "src/builtins/builtins-function.cc", "src/builtins/builtins-global.cc", @@ -5389,7 +5503,6 @@ v8_source_set("v8_base_without_compiler") { "src/builtins/builtins-string.cc", "src/builtins/builtins-struct.cc", "src/builtins/builtins-symbol.cc", - "src/builtins/builtins-temporal.cc", "src/builtins/builtins-trace.cc", "src/builtins/builtins-typed-array.cc", "src/builtins/builtins-weak-refs.cc", @@ -5430,6 +5543,7 @@ v8_source_set("v8_base_without_compiler") { "src/common/ptr-compr.cc", "src/compiler-dispatcher/lazy-compile-dispatcher.cc", "src/compiler-dispatcher/optimizing-compile-dispatcher.cc", + "src/compiler/linkage.cc", "src/date/date.cc", "src/date/dateparser.cc", "src/debug/debug-coverage.cc", @@ -5537,6 +5651,7 @@ v8_source_set("v8_base_without_compiler") { "src/heap/memory-chunk-metadata.cc", "src/heap/memory-chunk.cc", "src/heap/memory-measurement.cc", + "src/heap/memory-pool.cc", "src/heap/memory-reducer.cc", "src/heap/minor-gc-job.cc", "src/heap/minor-mark-sweep.cc", @@ -5544,7 +5659,6 @@ v8_source_set("v8_base_without_compiler") { "src/heap/new-spaces.cc", "src/heap/object-stats.cc", "src/heap/page-metadata.cc", - "src/heap/page-pool.cc", "src/heap/paged-spaces.cc", "src/heap/pretenuring-handler.cc", "src/heap/read-only-heap.cc", @@ -5590,6 +5704,7 @@ v8_source_set("v8_base_without_compiler") { "src/interpreter/handler-table-builder.cc", "src/interpreter/interpreter-intrinsics.cc", "src/interpreter/interpreter.cc", + "src/interpreter/prototype-assignment-sequence-builder.cc", "src/json/json-parser.cc", "src/json/json-stringifier.cc", "src/libsampler/sampler.cc", @@ -5644,7 +5759,7 @@ v8_source_set("v8_base_without_compiler") { "src/objects/js-segmenter.cc", "src/objects/js-segments.cc", "src/objects/js-struct.cc", - "src/objects/js-temporal-objects.cc", + "src/objects/js-temporal-helpers.cc", "src/objects/js-weak-refs.cc", "src/objects/keys.cc", "src/objects/literal-objects.cc", @@ -5654,6 +5769,7 @@ v8_source_set("v8_base_without_compiler") { "src/objects/map-updater.cc", "src/objects/map.cc", "src/objects/module.cc", + "src/objects/number-string-cache.cc", "src/objects/object-type.cc", "src/objects/objects.cc", "src/objects/option-utils.cc", @@ -5662,6 +5778,7 @@ v8_source_set("v8_base_without_compiler") { "src/objects/property.cc", "src/objects/regexp-match-info.cc", "src/objects/scope-info.cc", + "src/objects/script.cc", "src/objects/shared-function-info.cc", "src/objects/simd.cc", "src/objects/source-text-module.cc", @@ -5712,8 +5829,10 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/experimental/experimental.cc", "src/regexp/regexp-ast.cc", "src/regexp/regexp-bytecode-generator.cc", + "src/regexp/regexp-bytecode-iterator.cc", "src/regexp/regexp-bytecode-peephole.cc", "src/regexp/regexp-bytecodes.cc", + "src/regexp/regexp-code-generator.cc", "src/regexp/regexp-compiler-tonode.cc", "src/regexp/regexp-compiler.cc", "src/regexp/regexp-dotprinter.cc", @@ -5753,11 +5872,9 @@ v8_source_set("v8_base_without_compiler") { "src/runtime/runtime-shadow-realm.cc", "src/runtime/runtime-strings.cc", "src/runtime/runtime-symbol.cc", - "src/runtime/runtime-temporal.cc", "src/runtime/runtime-test.cc", "src/runtime/runtime-trace.cc", "src/runtime/runtime-typedarray.cc", - "src/runtime/runtime-utils.cc", "src/runtime/runtime-weak-refs.cc", "src/runtime/runtime.cc", "src/sandbox/code-pointer-table.cc", @@ -5792,6 +5909,7 @@ v8_source_set("v8_base_without_compiler") { "src/strings/char-predicates.cc", "src/strings/string-builder.cc", "src/strings/string-case.cc", + "src/strings/string-hasher.cc", "src/strings/string-stream.cc", "src/strings/unicode-decoder.cc", "src/strings/unicode.cc", @@ -5799,7 +5917,6 @@ v8_source_set("v8_base_without_compiler") { "src/tasks/cancelable-task.cc", "src/tasks/operations-barrier.cc", "src/tasks/task-utils.cc", - "src/temporal/temporal-parser.cc", "src/tracing/trace-event.cc", "src/tracing/traced-value.cc", "src/tracing/tracing-category-observer.cc", @@ -5811,6 +5928,7 @@ v8_source_set("v8_base_without_compiler") { "src/utils/identity-map.cc", "src/utils/memcopy.cc", "src/utils/ostreams.cc", + "src/utils/output-stream.cc", "src/utils/sha-256.cc", "src/utils/utils.cc", "src/utils/version.cc", @@ -5825,6 +5943,13 @@ v8_source_set("v8_base_without_compiler") { sources += [ "src/snapshot/snapshot-compression.cc" ] } + if (v8_enable_temporal_support) { + sources += [ + "src/builtins/builtins-temporal.cc", + "src/objects/js-temporal-objects.cc", + ] + } + if (v8_enable_sparkplug) { sources += [ "src/baseline/baseline-batch-compiler.cc", @@ -5841,12 +5966,17 @@ v8_source_set("v8_base_without_compiler") { "src/maglev/maglev-compiler.cc", "src/maglev/maglev-concurrent-dispatcher.cc", "src/maglev/maglev-graph-builder.cc", + "src/maglev/maglev-graph-labeller.cc", + "src/maglev/maglev-graph-optimizer.cc", "src/maglev/maglev-graph-printer.cc", + "src/maglev/maglev-graph.cc", + "src/maglev/maglev-inlining.cc", "src/maglev/maglev-interpreter-frame-state.cc", "src/maglev/maglev-ir.cc", "src/maglev/maglev-phi-representation-selector.cc", "src/maglev/maglev-pipeline-statistics.cc", "src/maglev/maglev-regalloc.cc", + "src/maglev/maglev-truncation.cc", "src/maglev/maglev.cc", ] if (v8_current_cpu == "arm") { @@ -5874,6 +6004,11 @@ v8_source_set("v8_base_without_compiler") { "src/maglev/s390/maglev-assembler-s390.cc", "src/maglev/s390/maglev-ir-s390.cc", ] + } else if (v8_current_cpu == "ppc64") { + sources += [ + "src/maglev/ppc64/maglev-assembler-ppc64.cc", + "src/maglev/ppc64/maglev-ir-ppc64.cc", + ] } } @@ -5892,7 +6027,7 @@ v8_source_set("v8_base_without_compiler") { "src/asmjs/asm-parser.cc", "src/asmjs/asm-scanner.cc", "src/asmjs/asm-types.cc", - "src/compiler/turboshaft/wasm-dead-code-elimination-phase.cc", + "src/compiler/wasm-compiler-definitions.cc", "src/debug/debug-wasm-objects.cc", "src/runtime/runtime-test-wasm.cc", "src/runtime/runtime-wasm.cc", @@ -5902,6 +6037,7 @@ v8_source_set("v8_base_without_compiler") { "src/wasm/baseline/liftoff-assembler.cc", "src/wasm/baseline/liftoff-compiler.cc", "src/wasm/baseline/parallel-move.cc", + "src/wasm/basic-block-calculator.cc", "src/wasm/canonical-types.cc", "src/wasm/code-space-access.cc", "src/wasm/constant-expression-interface.cc", @@ -5919,7 +6055,6 @@ v8_source_set("v8_base_without_compiler") { "src/wasm/stacks.cc", "src/wasm/streaming-decoder.cc", "src/wasm/sync-streaming-decoder.cc", - "src/wasm/turboshaft-graph-interface.cc", "src/wasm/value-type.cc", "src/wasm/wasm-code-manager.cc", "src/wasm/wasm-code-pointer-table.cc", @@ -5927,6 +6062,7 @@ v8_source_set("v8_base_without_compiler") { "src/wasm/wasm-deopt-data.cc", "src/wasm/wasm-disassembler.cc", "src/wasm/wasm-engine.cc", + "src/wasm/wasm-export-wrapper-cache.cc", "src/wasm/wasm-external-refs.cc", "src/wasm/wasm-features.cc", "src/wasm/wasm-import-wrapper-cache.cc", @@ -5940,7 +6076,6 @@ v8_source_set("v8_base_without_compiler") { "src/wasm/wasm-serialization.cc", "src/wasm/wasm-subtyping.cc", "src/wasm/well-known-imports.cc", - "src/wasm/wrappers.cc", ] if (v8_wasm_random_fuzzers) { sources += [ @@ -6171,6 +6306,7 @@ v8_source_set("v8_base_without_compiler") { "src/codegen/riscv/extension-riscv-f.cc", "src/codegen/riscv/extension-riscv-m.cc", "src/codegen/riscv/extension-riscv-v.cc", + "src/codegen/riscv/extension-riscv-zfh.cc", "src/codegen/riscv/extension-riscv-zicond.cc", "src/codegen/riscv/extension-riscv-zicsr.cc", "src/codegen/riscv/extension-riscv-zifencei.cc", @@ -6211,6 +6347,7 @@ v8_source_set("v8_base_without_compiler") { "src/codegen/riscv/extension-riscv-f.cc", "src/codegen/riscv/extension-riscv-m.cc", "src/codegen/riscv/extension-riscv-v.cc", + "src/codegen/riscv/extension-riscv-zfh.cc", "src/codegen/riscv/extension-riscv-zicond.cc", "src/codegen/riscv/extension-riscv-zicsr.cc", "src/codegen/riscv/extension-riscv-zifencei.cc", @@ -6255,10 +6392,12 @@ v8_source_set("v8_base_without_compiler") { ":v8_headers", ":v8_heap_base", ":v8_libbase", + ":v8_maybe_temporal", ":v8_shared_internal_headers", ":v8_tracing", ":v8_version", - "src/inspector:inspector", + "src/inspector", + "//third_party/dragonbox", "//third_party/fast_float", "//third_party/highway:libhwy", ] @@ -6271,7 +6410,7 @@ v8_source_set("v8_base_without_compiler") { ":v8_headers", ":v8_internal_headers", ":v8_maybe_icu", - "//third_party/simdutf:simdutf", + "//third_party/simdutf", ] if (v8_fuzzilli) { @@ -6508,6 +6647,8 @@ v8_component("v8_libbase") { "src/base/fpu.cc", "src/base/fpu.h", "src/base/free_deleter.h", + "src/base/functional/bind-internal.h", + "src/base/functional/function-ref.h", "src/base/hashing.h", "src/base/hashmap-entry.h", "src/base/hashmap.h", @@ -6606,6 +6747,7 @@ v8_component("v8_libbase") { "src/base/template-utils.h", "src/base/threaded-list.h", "src/base/timezone-cache.h", + "src/base/types/is-instantiation.h", "src/base/utils/random-number-generator.cc", "src/base/utils/random-number-generator.h", "src/base/vector.h", @@ -6621,6 +6763,8 @@ v8_component("v8_libbase") { configs = [ ":internal_config_base" ] public_configs = [ ":libbase_config" ] + v8_add_configs += [ "//build/config/compiler:thinlto_optimize_max" ] + v8_remove_configs += [ "//build/config/compiler:thinlto_optimize_default" ] deps = [ ":v8_config_headers" ] @@ -6738,6 +6882,10 @@ v8_component("v8_libbase") { libs += [ "advapi32.lib" ] # Needed for TraceLoggingProvider.h } + # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and + # enable the diagnostic by removing this line. + configs += [ "//build/config/compiler:no_exit_time_destructors" ] + data_deps += [ "//build/win:runtime_libs" ] } else if (current_os == "zos") { sources += [ @@ -6770,8 +6918,13 @@ v8_component("v8_libbase") { } if (using_sanitizer && !build_with_chromium) { - data_deps += - [ "//build/config/clang:llvm-symbolizer_data($host_toolchain)" ] + if (is_linux && target_cpu == "arm64") { + # TODO(https://crbug.com/396446140): Switch to the symbolizer from our + # bundled toolchain as soon as one is available for linux-arm64. + data += [ "tools/sanitizers/linux/arm64/llvm-symbolizer" ] + } else { + data_deps += [ "//build/config/clang:llvm-symbolizer_data" ] + } } if (v8_use_libm_trig_functions) { @@ -6835,6 +6988,8 @@ v8_component("v8_libplatform") { ] configs = [ ":internal_config_base" ] + v8_add_configs += [ "//build/config/compiler:thinlto_optimize_max" ] + v8_remove_configs += [ "//build/config/compiler:thinlto_optimize_default" ] if (is_component_build) { defines = [ "BUILDING_V8_PLATFORM_SHARED" ] @@ -6894,6 +7049,11 @@ v8_source_set("fuzzer_support") { ":v8_libplatform", ":v8_maybe_icu", ] + deps = [ ":v8_maybe_temporal" ] + + # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and + # enable the diagnostic by removing this line. + configs += [ "//build/config/compiler:no_exit_time_destructors" ] } v8_source_set("v8_bigint") { @@ -6936,6 +7096,7 @@ v8_header_set("v8_heap_base_headers") { "src/heap/base/incremental-marking-schedule.h", "src/heap/base/memory-tagging.h", "src/heap/base/stack.h", + "src/heap/base/unsafe-json-emitter.h", "src/heap/base/worklist.h", ] @@ -6950,6 +7111,7 @@ v8_source_set("v8_heap_base") { "src/heap/base/incremental-marking-schedule.cc", "src/heap/base/memory-tagging.cc", "src/heap/base/stack.cc", + "src/heap/base/unsafe-json-emitter.cc", "src/heap/base/worklist.cc", ] @@ -7219,9 +7381,10 @@ if (v8_check_header_includes) { ":v8_internal_headers", ":v8_libbase", ":v8_maybe_icu", + ":v8_maybe_temporal", ":v8_version", ":wee8", - "src/inspector:inspector", + "src/inspector", "src/inspector:inspector_string_conversions", ] } @@ -7310,6 +7473,7 @@ if (current_toolchain == v8_generator_toolchain) { if (current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { sources = [ + "src/snapshot/builtins-effects-dummy.cc", "src/snapshot/embedded/embedded-empty.cc", "src/snapshot/embedded/embedded-file-writer.cc", "src/snapshot/embedded/embedded-file-writer.h", @@ -7343,6 +7507,7 @@ if (current_toolchain == v8_snapshot_toolchain) { ":v8_libbase", ":v8_libplatform", ":v8_maybe_icu", + ":v8_maybe_temporal", ":v8_shared_internal_headers", ":v8_tracing", "//build/win:default_exe_manifest", @@ -7538,7 +7703,7 @@ group("v8_archive") { if (!is_win) { # On windows, cctest doesn't link with v8_static_library. - deps += [ "test/cctest:cctest" ] + deps += [ "test/cctest" ] } } @@ -7580,13 +7745,19 @@ group("v8_fuzzers") { if (v8_enable_webassembly) { if (v8_wasm_random_fuzzers) { data_deps += [ - ":v8_simple_wasm_compile_all_fuzzer", ":v8_simple_wasm_compile_fuzzer", + ":v8_simple_wasm_compile_revec_fuzzer", ":v8_simple_wasm_compile_simd_fuzzer", - ":v8_simple_wasm_compile_wasmgc_fuzzer", - ":v8_simple_wasm_deopt_fuzzer", ":v8_simple_wasm_init_expr_fuzzer", ] + + if (!v8_disable_write_barriers) { + data_deps += [ + ":v8_simple_wasm_compile_all_fuzzer", + ":v8_simple_wasm_compile_wasmgc_fuzzer", + ":v8_simple_wasm_deopt_fuzzer", + ] + } } data_deps += [ ":v8_simple_multi_return_fuzzer", @@ -7599,6 +7770,7 @@ group("v8_fuzzers") { data_deps += [ ":v8_simple_wasm_fast_interpreter_fuzzer", ":v8_simple_wasm_interpreter_all_fuzzer", + ":v8_simple_wasm_interpreter_all_multiple_modules_fuzzer", ":v8_simple_wasm_interpreter_base_fuzzer", ":v8_simple_wasm_interpreter_code_fuzzer", ":v8_simple_wasm_interpreter_diff_fuzzer", @@ -7620,6 +7792,8 @@ if (is_component_build) { ] configs = [ ":internal_config" ] + v8_add_configs += [ "//build/config/compiler:thinlto_optimize_max" ] + v8_remove_configs += [ "//build/config/compiler:thinlto_optimize_default" ] public_configs = [ ":external_config" ] } @@ -7755,6 +7929,8 @@ v8_executable("d8") { ":internal_config_base", ":v8_tracing_config", ] + v8_add_configs += [ "//build/config/compiler:thinlto_optimize_max" ] + v8_remove_configs += [ "//build/config/compiler:thinlto_optimize_default" ] deps = [ ":v8", @@ -7762,7 +7938,7 @@ v8_executable("d8") { ":v8_libplatform", ":v8_tracing", "//build/win:default_exe_manifest", - "//third_party/simdutf:simdutf", + "//third_party/simdutf", ] if (is_posix || is_fuchsia) { @@ -7784,10 +7960,9 @@ v8_executable("d8") { deps += [ ":zoslib" ] } - if (v8_enable_partition_alloc) { - defines += [ "V8_ENABLE_PARTITION_ALLOC" ] - deps += [ "//third_party/partition_alloc" ] - } + # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and + # enable the diagnostic by removing this line. + configs += [ "//build/config/compiler:no_exit_time_destructors" ] } v8_executable("v8_hello_world") { @@ -7834,6 +8009,10 @@ v8_executable("v8_sample_process") { if (current_os == "zos" && is_component_build) { deps += [ ":zoslib" ] } + + # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and + # enable the diagnostic by removing this line. + configs += [ "//build/config/compiler:no_exit_time_destructors" ] } if (want_v8_shell) { @@ -7889,6 +8068,8 @@ template("v8_fuzzer") { fuzzer_name = target_name v8_source_set(fuzzer_name) { + testonly = true + sources = invoker.sources deps = [ ":fuzzer_support" ] @@ -7900,9 +8081,15 @@ template("v8_fuzzer") { ":external_config", ":internal_config_base", ] + + # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and + # enable the diagnostic by removing this line. + configs += [ "//build/config/compiler:no_exit_time_destructors" ] } v8_executable("v8_simple_${fuzzer_name}") { + testonly = true + deps = [ ":${fuzzer_name}", "//build/win:default_exe_manifest", @@ -7933,14 +8120,21 @@ if (v8_enable_webassembly) { if (v8_enable_drumbrake) { v8_source_set("lib_wasm_interpreter_fuzzer_common") { + testonly = true + sources = [ "test/fuzzer/wasm/interpreter/interpreter-fuzzer-common.cc", "test/fuzzer/wasm/interpreter/interpreter-fuzzer-common.h", ] deps = [ + ":fuzzer_support", ":v8_internal_headers", + ] + + public_deps = [ ":wasm_fuzzer_common", + ":wasm_test_common", ] configs = [ @@ -7985,6 +8179,12 @@ if (v8_enable_webassembly) { deps = [ ":lib_wasm_interpreter_fuzzer_common" ] } + v8_fuzzer("wasm_interpreter_all_multiple_modules_fuzzer") { + sources = + [ "test/fuzzer/wasm/interpreter/interpreter-all-multiple-modules.cc" ] + deps = [ ":lib_wasm_interpreter_fuzzer_common" ] + } + v8_fuzzer("wasm_interpreter_base_fuzzer") { sources = [ "test/fuzzer/wasm/interpreter/interpreter-base.cc" ] @@ -7999,11 +8199,18 @@ if (v8_enable_webassembly) { } v8_source_set("wasm_test_common") { + testonly = true + sources = [ + "test/common/c-signature.h", "test/common/flag-utils.h", + "test/common/value-helper.h", "test/common/wasm/flag-utils.h", + "test/common/wasm/wasm-macro-gen.h", "test/common/wasm/wasm-module-runner.cc", "test/common/wasm/wasm-module-runner.h", + "test/common/wasm/wasm-run-utils.cc", + "test/common/wasm/wasm-run-utils.h", ] deps = [ @@ -8011,6 +8218,7 @@ if (v8_enable_webassembly) { ":run_torque", ":v8_internal_headers", ":v8_libbase", + ":v8_maybe_temporal", ":v8_shared_internal_headers", ":v8_tracing", ] @@ -8027,6 +8235,8 @@ if (v8_enable_webassembly) { } v8_source_set("wasm_fuzzer_common") { + testonly = true + sources = [ "test/fuzzer/wasm/fuzzer-common.cc", "test/fuzzer/wasm/fuzzer-common.h", @@ -8038,6 +8248,7 @@ if (v8_enable_webassembly) { ":generate_bytecode_builtins_list", ":run_torque", ":v8_internal_headers", + ":v8_maybe_temporal", ":v8_tracing", ":wasm_test_common", ] @@ -8083,13 +8294,6 @@ if (v8_enable_webassembly) { } if (v8_wasm_random_fuzzers) { - v8_wasm_fuzzer("wasm_compile_all_fuzzer") { - sources = [ - "test/common/wasm/test-signatures.h", - "test/fuzzer/wasm/compile-all.cc", - ] - } - v8_wasm_fuzzer("wasm_compile_fuzzer") { sources = [ "test/common/wasm/test-signatures.h", @@ -8104,10 +8308,10 @@ if (v8_enable_webassembly) { ] } - v8_wasm_fuzzer("wasm_compile_wasmgc_fuzzer") { + v8_wasm_fuzzer("wasm_compile_revec_fuzzer") { sources = [ "test/common/wasm/test-signatures.h", - "test/fuzzer/wasm/compile-wasmgc.cc", + "test/fuzzer/wasm/compile-revec.cc", ] } @@ -8115,8 +8319,24 @@ if (v8_enable_webassembly) { sources = [ "test/fuzzer/wasm/init-expr.cc" ] } - v8_wasm_fuzzer("wasm_deopt_fuzzer") { - sources = [ "test/fuzzer/wasm/deopt.cc" ] + if (!v8_disable_write_barriers) { + v8_wasm_fuzzer("wasm_compile_all_fuzzer") { + sources = [ + "test/common/wasm/test-signatures.h", + "test/fuzzer/wasm/compile-all.cc", + ] + } + + v8_wasm_fuzzer("wasm_compile_wasmgc_fuzzer") { + sources = [ + "test/common/wasm/test-signatures.h", + "test/fuzzer/wasm/compile-wasmgc.cc", + ] + } + + v8_wasm_fuzzer("wasm_deopt_fuzzer") { + sources = [ "test/fuzzer/wasm/deopt.cc" ] + } } } # v8_wasm_random_fuzzers } diff --git a/deps/v8/COMMON_OWNERS b/deps/v8/COMMON_OWNERS index 741ba62748faa6..1a14c2458d6d0d 100644 --- a/deps/v8/COMMON_OWNERS +++ b/deps/v8/COMMON_OWNERS @@ -1,4 +1,3 @@ -adamk@chromium.org ahaas@chromium.org alexschulze@chromium.org bikineev@chromium.org @@ -29,8 +28,6 @@ olivf@chromium.org omerkatz@chromium.org pthier@chromium.org rezvan@chromium.org -sroettger@google.com -syg@chromium.org szuend@chromium.org thibaudm@chromium.org vahl@chromium.org diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 9d240951e47b47..c6b16a0d770bf1 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -49,6 +49,7 @@ vars = { 'download_gcmole': False, 'download_jsfunfuzz': False, 'download_prebuilt_bazel': False, + 'download_prebuilt_arm64_llvm_symbolizer': False, 'check_v8_header_includes': False, # By default, download the fuchsia sdk from the public sdk directory. @@ -58,7 +59,7 @@ vars = { 'checkout_fuchsia_no_hooks': False, # reclient CIPD package version - 'reclient_version': 're_client_version:0.177.1.e58c0145-gomaip', + 'reclient_version': 're_client_version:0.179.0.28341fc7-gomaip', # Fetch configuration files required for the 'use_remoteexec' gn arg 'download_remoteexec_cfg': False, @@ -74,24 +75,24 @@ vars = { 'build_with_chromium': False, # GN CIPD package version. - 'gn_version': 'git_revision:90478db6b59b9bebf7ca4cf912d860cf868e724c', + 'gn_version': 'git_revision:5d0a4153b0bcc86c5a23310d5b648a587be3c56d', # ninja CIPD package version # https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/ninja 'ninja_version': 'version:3@1.12.1.chromium.4', # siso CIPD package version - 'siso_version': 'git_revision:70e1167e0e6dad10c8388cace8fd9d9376c43316', + 'siso_version': 'git_revision:8863265a67843154872be2be1fc0c37339691405', # 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:27.20250424.2.1', + 'fuchsia_version': 'version:29.20250824.3.1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling partition_alloc_version # and whatever else without interference from each other. - 'partition_alloc_version': '862506deb382f3f8a8fa9689c8d5136a48e9b778', + 'partition_alloc_version': '51d0a558ecdf5cac58509d08263c36764c270ca6', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_build-tools_version @@ -112,7 +113,7 @@ 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': 'mjFmRj7k_XR9yj60pYbr9mG38FyEbU5oWdU56bZQ5cwC', + 'android_sdk_platform-tools_version': 'qTD9QdBlBf3dyHsN1lJ0RH6AhHxR42Hmg2Ih-Vj4zIEC', # 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. @@ -129,9 +130,9 @@ vars = { deps = { 'build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + '88030b320338e0706b6b93336c4b35e6bbaf467e', + Var('chromium_url') + '/chromium/src/build.git' + '@' + 'd964efc5f27dcb8690921b9dc4a7780dce83695c', 'buildtools': - Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '0f32cb9025766951122d4ed19aba87a94ded3f43', + Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '2ca9a5b96fbf0a4947d626454781e333b28e275a', 'buildtools/linux64': { 'packages': [ { @@ -177,9 +178,9 @@ 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' + '@' + 'c5257e6119f83f856602f2ccbc46547a8fef0960', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'b947715fdda79a420b253821c1cc52272a77222d', 'third_party/android_platform': { - 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '98aee46efb1cc4e09fa0e3ecaa6b19dc258645fa', + 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + 'e97e62b0b5f26315a0cd58ff8772a2483107158e', 'condition': 'checkout_android', }, 'third_party/android_sdk/public': { @@ -231,7 +232,7 @@ deps = { 'dep_type': 'cipd', }, 'third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '000f47cfa393d7f9557025a252862e2a61a60d44', + 'url': Var('chromium_url') + '/catapult.git' + '@' + '3c5077921dbacc75db5768cf4fc0b1d9ca05d2e0', 'condition': 'checkout_android', }, 'third_party/clang-format/script': @@ -245,17 +246,19 @@ deps = { 'condition': 'checkout_android', }, 'third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '1fcc527019d786502b02f71b8b764ee674a40953', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '6b19831e3cfb16884a36b8045383594955712892', + 'third_party/dragonbox/src': + Var('chromium_url') + '/external/github.com/jk-jeon/dragonbox.git' + '@' + '6c7c925b571d54486b9ffae8d9d18a822801cbda', 'third_party/fp16/src': - Var('chromium_url') + '/external/github.com/Maratyszcza/FP16.git' + '@' + '0a92994d729ff76a58f692d3028ca1b64b145d91', + Var('chromium_url') + '/external/github.com/Maratyszcza/FP16.git' + '@' + 'b3720617faf1a4581ed7e6787cc51722ec7751f0', 'third_party/fast_float/src': Var('chromium_url') + '/external/github.com/fastfloat/fast_float.git' + '@' + 'cb1d42aaa1e14b09e1452cfdef373d051b8c02a4', 'third_party/fuchsia-gn-sdk': { - 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-gn-sdk.git' + '@' + 'e678aca1bad7a1c9a38620b2e328281bc68f6357', + 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-gn-sdk.git' + '@' + '7e28b752c19443ee31cb47a7195add4131a1cc09', 'condition': 'checkout_fuchsia', }, 'third_party/simdutf': - Var('chromium_url') + '/chromium/src/third_party/simdutf' + '@' + '62d1cfb62967c0076c997a10d54d50f9571fb8e9', + Var('chromium_url') + '/chromium/src/third_party/simdutf' + '@' + 'acd71a451c1bcb808b7c3a77e0242052909e381e', # Exists for rolling the Fuchsia SDK. Check out of the SDK should always # rely on the hook running |update_sdk.py| script below. 'third_party/fuchsia-sdk/sdk': { @@ -269,21 +272,21 @@ deps = { 'dep_type': 'cipd', }, 'third_party/google_benchmark_chrome': { - 'url': Var('chromium_url') + '/chromium/src/third_party/google_benchmark.git' + '@' + '29e4389fdc1eeb9137eb464b7f34e07c01c2731e', + 'url': Var('chromium_url') + '/chromium/src/third_party/google_benchmark.git' + '@' + 'd6e7f141ed7c93a66890f3750ab634b8b52057a5', }, 'third_party/google_benchmark_chrome/src': { 'url': Var('chromium_url') + '/external/github.com/google/benchmark.git' + '@' + '761305ec3b33abf30e08d50eb829e19a802581cc', }, 'third_party/fuzztest': - Var('chromium_url') + '/chromium/src/third_party/fuzztest.git' + '@' + '4a7e9c055e63f4d67e04229ab491eaefe409addf', + Var('chromium_url') + '/chromium/src/third_party/fuzztest.git' + '@' + 'aa6ba9074b8d66a2e2853a0a0992c25966022e13', 'third_party/fuzztest/src': - Var('chromium_url') + '/external/github.com/google/fuzztest.git' + '@' + 'b10387fdbbca18192f85eaa5323a59f44bf9c468', + Var('chromium_url') + '/external/github.com/google/fuzztest.git' + '@' + '169baf17795850fd4b2c29e4d52136aa8d955b61', 'third_party/googletest/src': - Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'cd430b47a54841ec45d64d2377d7cabaf0eba610', + Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '244cec869d12e53378fa0efb610cd4c32a454ec8', 'third_party/highway/src': Var('chromium_url') + '/external/github.com/google/highway.git' + '@' + '00fe003dac355b979f36157f9407c7c46448958e', 'third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '4c8cc4b365a505ce35be1e0bd488476c5f79805d', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '1b2e3e8a421efae36141a7b932b41e315b089af8', 'third_party/instrumented_libs': { 'url': Var('chromium_url') + '/chromium/third_party/instrumented_libraries.git' + '@' + '69015643b3f68dbd438c010439c59adc52cac808', 'condition': 'checkout_instrumented_libraries', @@ -295,167 +298,181 @@ deps = { 'condition': "checkout_ittapi or check_v8_header_includes", }, 'third_party/jinja2': - Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + '5e1ee241ab04b38889f8d517f2da8b3df7cfbd9a', + Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + 'c3027d884967773057bf74b957e3fea87e5df4d7', 'third_party/jsoncpp/source': Var('chromium_url') + '/external/github.com/open-source-parsers/jsoncpp.git'+ '@' + '42e892d96e47b1f6e29844cc705e148ec4856448', 'third_party/libc++/src': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '917609c669e43edc850eeb192a342434a54e1dfd', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '70c21e34ea54ef13377bc6d8283453290e17c7b8', 'third_party/libc++abi/src': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + 'f2a7f2987f9dcdf8b04c2d8cd4dcb186641a7c3e', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + 'f7f5a32b3e9582092d8a4511acec036a09ae8524', 'third_party/libunwind/src': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '81e2cb40a70de2b6978e6d8658891ded9a77f7e3', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '92fb77dfd4d86aa120730359f5e4d6bb47f1c129', 'third_party/llvm-libc/src': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libc.git' + '@' + '912274164f0877ca917c06e8484ad3be1784833a', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libc.git' + '@' + '11725050a2e117625867ec45d70746bb78b170fd', 'third_party/llvm-build/Release+Asserts': { 'dep_type': 'gcs', 'bucket': 'chromium-browser-clang', 'objects': [ { - 'object_name': 'Linux_x64/clang-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '2cccd3a5b04461f17a2e78d2f8bd18b448443a9dd4d6dfac50e8e84b4d5176f1', - 'size_bytes': 54914604, - 'generation': 1745271343199398, + 'object_name': 'Linux_x64/clang-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': 'a9f5af449672a239366199c17441427c2c4433a120cace9ffd32397e15224c64', + 'size_bytes': 55087424, + 'generation': 1754486730635359, 'condition': 'host_os == "linux"', }, { - 'object_name': 'Linux_x64/clang-tidy-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': 'f0e7dae567266055c9cfa2fba5b3dafa311dc86955f5a3f7a4047ce3096e7b27', - 'size_bytes': 13559360, - 'generation': 1745271343282399, + 'object_name': 'Linux_x64/clang-tidy-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': 'c2ce17d666c5124d1b3999e160836b096b22a7c2dbb6f70637be6dceefa4bb86', + 'size_bytes': 13688944, + 'generation': 1754486730632975, 'condition': 'host_os == "linux" and checkout_clang_tidy', }, { - 'object_name': 'Linux_x64/clangd-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': 'd87ec8e9cd959cf5d12e0de2970f4a88a67f9884467dac5285813d02bbe50bcb', - 'size_bytes': 13767836, - 'generation': 1745271343386108, + 'object_name': 'Linux_x64/clangd-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': 'd42b0b22da85e7a49f239eeb378b0e8cd6eeeb1c685e89155c30a344de219636', + 'size_bytes': 13982120, + 'generation': 1754486730644041, 'condition': 'host_os == "linux" and checkout_clangd', }, { - 'object_name': 'Linux_x64/llvm-code-coverage-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '08f9cdbdc1e3f78dfb11aa9815727e8af0cf8f2b9c9a0e3749ceb4d3584fc900', - 'size_bytes': 2293720, - 'generation': 1745271343569971, + 'object_name': 'Linux_x64/llvm-code-coverage-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '5768970291fb6173bc69c342235e9dcc53c2c475acde8422e7787a8f8170bdd8', + 'size_bytes': 2251652, + 'generation': 1754486730690951, 'condition': 'host_os == "linux" and checkout_clang_coverage_tools', }, { - 'object_name': 'Linux_x64/llvmobjdump-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '4b9c20478c015a03a44842d0bc24a9bd01a87890c76c4496577843ea31a21ed1', - 'size_bytes': 5702536, - 'generation': 1745271343407073, - 'condition': '(checkout_linux or checkout_mac or checkout_android and host_os != "mac")', + 'object_name': 'Linux_x64/llvmobjdump-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '861c331f1bab58556bd84f33632667fd5af90402f94fb104f8b06dc039a8f598', + 'size_bytes': 5619264, + 'generation': 1754486730668455, + 'condition': '(checkout_linux or checkout_mac or checkout_android) and host_os == "linux"', }, { - 'object_name': 'Mac/clang-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '159cc811ee2882098086a426e83cb6744ff59d422d005a54630bc519e782d154', - 'size_bytes': 51986012, - 'generation': 1745271345031799, + 'object_name': 'Mac/clang-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '484e1b4128566635f123aefd6f9db9f0a1e99f462c247d2393941eb1a6b2efe2', + 'size_bytes': 52422108, + 'generation': 1754486732274509, 'condition': 'host_os == "mac" and host_cpu == "x64"', }, { - 'object_name': 'Mac/clang-mac-runtime-library-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': 'ef380bc751dc8b137e294ac1aca295f3e49eb57b938ab011c38c70271d8582fc', - 'size_bytes': 988872, - 'generation': 1745271352425938, + 'object_name': 'Mac/clang-mac-runtime-library-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '9a1fc6d92af9af410736066c8fff34cd1f95b3e3696b2b6dd581f8021eb74abc', + 'size_bytes': 996044, + 'generation': 1754486741367172, 'condition': 'checkout_mac and not host_os == "mac"', }, { - 'object_name': 'Mac/clang-tidy-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '75907ac8d2ab310fd7272715c5d98cd4382dbd0b867872aa9216cede48c274d5', - 'size_bytes': 13609872, - 'generation': 1745271345094426, + 'object_name': 'Mac/clang-tidy-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '4a4a9dcfe0b11c50e9cfb86963b7014dedf53e2de951fd573713803d45c3fb0f', + 'size_bytes': 13749248, + 'generation': 1754486732350716, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clang_tidy', }, { - 'object_name': 'Mac/clangd-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': 'e2bcab0b3961fdc7a63286cf7a98397026ff1b5143d34c8a50844b26a7b023c6', - 'size_bytes': 14998604, - 'generation': 1745271345196743, + 'object_name': 'Mac/clangd-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': 'a26a4bc078745f89a5aee6ba20e3507de4497e236592116e304510ce669d5760', + 'size_bytes': 15159680, + 'generation': 1754486732421420, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clangd', }, { - 'object_name': 'Mac/llvm-code-coverage-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '6e4c8ed691948981d799f4af747288cdd5e90ae873dc36ada66726ad3e6caef1', - 'size_bytes': 2262400, - 'generation': 1745271345385127, + 'object_name': 'Mac/llvm-code-coverage-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': 'f1b13f22aa030969870d72eaee9a3cfa633c41c811d6a4ee442e616ce4836202', + 'size_bytes': 2283192, + 'generation': 1754486732574927, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clang_coverage_tools', }, { - 'object_name': 'Mac_arm64/clang-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '3d437a643cc5838963254a39ab0528f49f2b65cd4dba2c80e628ad88eb419536', - 'size_bytes': 43999512, - 'generation': 1745271353863965, + 'object_name': 'Mac/llvmobjdump-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '99dbba5b4f8eb4b7bd6675d0589a4809576bceb4fc857474302d00b545945dcd', + 'size_bytes': 5489896, + 'generation': 1754486732472583, + 'condition': 'host_os == "mac" and host_cpu == "x64"', + }, + { + 'object_name': 'Mac_arm64/clang-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '7b99ec0bd96307f6eee85abbe9efe97d341051d7572e65d56f99b0e981fdc2c6', + 'size_bytes': 43856532, + 'generation': 1754486742864144, 'condition': 'host_os == "mac" and host_cpu == "arm64"', }, { - 'object_name': 'Mac_arm64/clang-tidy-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '0b4150c9e699e1e904495807aff48d2e5396527bf775d6597818dd4f73a9c38f', - 'size_bytes': 11776260, - 'generation': 1745271353927359, + 'object_name': 'Mac_arm64/clang-tidy-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '9c9538cb6c5e431ff030b524ab456775c914dcff8d29751bd02eb991948fc588', + 'size_bytes': 11831704, + 'generation': 1754486742856483, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clang_tidy', }, { - 'object_name': 'Mac_arm64/clangd-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '9fcd151cfffa01e6befe3760b9bc91d645135c79449dc378af4cb2fe0187150c', - 'size_bytes': 12041956, - 'generation': 1745271354010497, + 'object_name': 'Mac_arm64/clangd-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '6dbb3d3d584e8d2c778f89f48bf9614bfce8e9d5876e03dbc91747991eec33b1', + 'size_bytes': 12138872, + 'generation': 1754486742962580, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clangd', }, { - 'object_name': 'Mac_arm64/llvm-code-coverage-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '1e62752ef5fd9d425699ed44098d5a0eec3be3f827990470aa9f9199d34a2fb8', - 'size_bytes': 1975116, - 'generation': 1745271354276821, + 'object_name': 'Mac_arm64/llvm-code-coverage-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '0e58aceeb995192461b4a26f059694346e869ba2c2ed806c38e74ed92a3fcf0f', + 'size_bytes': 1933704, + 'generation': 1754486743038880, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clang_coverage_tools', }, { - 'object_name': 'Win/clang-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': 'd53230dbb7db57ddcda5a8377b5dd8388deee9ff2766617d54c6159c51e806be', - 'size_bytes': 47036964, - 'generation': 1745271363166454, + 'object_name': 'Mac_arm64/llvmobjdump-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': 'd197d5d7581336a63a11f3cb8ca3d3f807c9f6032a21616d029573b90633fed5', + 'size_bytes': 5243848, + 'generation': 1754486742944902, + 'condition': 'host_os == "mac" and host_cpu == "arm64"', + }, + { + 'object_name': 'Win/clang-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '1f3dc2b70567abfa52effbcdcd271aa54fbe5e4325e91a2d488748998df79f7e', + 'size_bytes': 47038772, + 'generation': 1754486753863077, 'condition': 'host_os == "win"', }, { - 'object_name': 'Win/clang-tidy-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': 'c6022f5923be5afc1685723a2383fcd8f9334cc6ee097ce3c71963de6ded0764', - 'size_bytes': 13415856, - 'generation': 1745271363272778, + 'object_name': 'Win/clang-tidy-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '0e640abc3d4335945662024d0583017ef073d6db59171fad290ee0b86de099bc', + 'size_bytes': 13681872, + 'generation': 1754486754006910, 'condition': 'host_os == "win" and checkout_clang_tidy', }, { - 'object_name': 'Win/clang-win-runtime-library-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '555a34dd110a5fe3f7578745e9f0074cc341e550bed4ec5888accffb0200a7bb', - 'size_bytes': 2483656, - 'generation': 1745271370423782, + 'object_name': 'Win/clang-win-runtime-library-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '3e41cf1c8b4d5996e60353e282e0219608f134ca475a16541f536a63bf1a036f', + 'size_bytes': 2483996, + 'generation': 1754486763172399, 'condition': 'checkout_win and not host_os == "win"', }, { - 'object_name': 'Win/clangd-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '66aafde760608c4c0de94a3947a179db8c8f93c8e474e3081b4401287abe4ee4', - 'size_bytes': 13838692, - 'generation': 1745271363368641, + 'object_name': 'Win/clangd-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': 'd65400e92d8d7393511dc6beab1a2c8be2d4a5b5d946f957a6b55f8e39f666a4', + 'size_bytes': 14175060, + 'generation': 1754486754078416, 'condition': 'host_os == "win" and checkout_clangd', }, { - 'object_name': 'Win/llvm-code-coverage-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': '6944dc39b33dca3bb8f219ffb221e3f345fe56a5fa0447c60ea6a2894ae72687', - 'size_bytes': 2373032, - 'generation': 1745271363562596, + 'object_name': 'Win/llvm-code-coverage-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': '01f7cec8caee5cbc89107f0b287b7f41a4c26979bbec3d88f3eee5faebee4c5e', + 'size_bytes': 2349144, + 'generation': 1754486754112875, 'condition': 'host_os == "win" and checkout_clang_coverage_tools', }, { - 'object_name': 'Win/llvmobjdump-llvmorg-21-init-9266-g09006611-1.tar.xz', - 'sha256sum': 'e8b3e9f7cd7512edc7c05a12e818386cdb8d43bea9affbf0bf4db83a553092a5', - 'size_bytes': 5684140, - 'generation': 1745271363450942, - 'condition': 'checkout_linux or checkout_mac or checkout_android and host_os == "win"', + 'object_name': 'Win/llvmobjdump-llvmorg-21-init-16348-gbd809ffb-17.tar.xz', + 'sha256sum': 'f4048cb8c08849e3f4ff8228ccaca4cf08789023df28bdf5cbad07aa0e245b45', + 'size_bytes': 5603744, + 'generation': 1754486754075834, + 'condition': '(checkout_linux or checkout_mac or checkout_android) and host_os == "win"', }, ], }, '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' + '@' + '9f8efc8637f847ab1ba984212598e6fb9cf1b3d4', + Var('chromium_url') + '/chromium/src/third_party/markupsafe.git' + '@' + '4256084ae14175d38a3ff7d739dca83ae49ccec6', 'third_party/ninja': { 'packages': [ { @@ -473,47 +490,49 @@ deps = { 'third_party/perfetto': Var('android_url') + '/platform/external/perfetto.git' + '@' + '40b529923598b739b2892a536a7692eedbed5685', 'third_party/protobuf': - Var('chromium_url') + '/chromium/src/third_party/protobuf.git' + '@' + '56b98941c7a305f54fc6c1c0a082fcb232f92954', + Var('chromium_url') + '/chromium/src/third_party/protobuf.git' + '@' + 'e354a43e42a0ecacd1d65caafb8d40b21f4b4286', 'third_party/re2/src': - Var('chromium_url') + '/external/github.com/google/re2.git' + '@' + 'c84a140c93352cdabbfb547c531be34515b12228', + Var('chromium_url') + '/external/github.com/google/re2.git' + '@' + '6569a9a3df256f4c0c3813cb8ee2f8eef6e2c1fb', 'third_party/requests': { 'url': Var('chromium_url') + '/external/github.com/kennethreitz/requests.git' + '@' + 'c7e0fc087ceeadb8b4c84a0953a422c474093d6d', 'condition': 'checkout_android', }, 'tools/rust': - Var('chromium_url') + '/chromium/src/tools/rust' + '@' + 'fa679ed68ee49fb99a7e924f57e4d2b6444103d6', + Var('chromium_url') + '/chromium/src/tools/rust' + '@' + 'f71995f8f92a8d6b0658fafce0f0dde769edabfa', + 'tools/win': + Var('chromium_url') + '/chromium/src/tools/win' + '@' + '89d58ebe78f02706d414154f923f759a05a887b6', 'third_party/rust': - Var('chromium_url') + '/chromium/src/third_party/rust' + '@' + '926ec544992cad0ac638f3594fe6195ed493ebff', + Var('chromium_url') + '/chromium/src/third_party/rust' + '@' + 'f058a25008a8a6b48a35656b21f0589535134d0f', 'third_party/rust-toolchain': { 'dep_type': 'gcs', 'bucket': 'chromium-browser-clang', 'objects': [ { - 'object_name': 'Linux_x64/rust-toolchain-c8f94230282a8e8c1148f3e657f0199aad909228-1-llvmorg-21-init-9266-g09006611.tar.xz', - 'sha256sum': '378c432f7739bb5da11aad7b3a2687f8252565eae5f0dcfc55c39a15382c519c', - 'size_bytes': 118598336, - 'generation': 1745271335898717, + 'object_name': 'Linux_x64/rust-toolchain-22be76b7e259f27bf3e55eb931f354cd8b69d55f-4-llvmorg-21-init-16348-gbd809ffb.tar.xz', + 'sha256sum': '3e5cf980edb893cbdc915d62bce1b29b896eda6df6455e145200bf25a52576b1', + 'size_bytes': 159517088, + 'generation': 1756377175296503, 'condition': 'host_os == "linux"', }, { - 'object_name': 'Mac/rust-toolchain-c8f94230282a8e8c1148f3e657f0199aad909228-1-llvmorg-21-init-9266-g09006611.tar.xz', - 'sha256sum': 'bf05c8b5e90d6904de02dca9b3e4cb5e45a1a56207e7af1fbb3a10707704a26a', - 'size_bytes': 111932536, - 'generation': 1745271337336068, + 'object_name': 'Mac/rust-toolchain-22be76b7e259f27bf3e55eb931f354cd8b69d55f-4-llvmorg-21-init-16348-gbd809ffb.tar.xz', + 'sha256sum': '8f0d15259a48df6c284ebcfb9dfb0ecba77d8267620aae1ff42d23a2f595ad77', + 'size_bytes': 132425148, + 'generation': 1756377177172203, 'condition': 'host_os == "mac" and host_cpu == "x64"', }, { - 'object_name': 'Mac_arm64/rust-toolchain-c8f94230282a8e8c1148f3e657f0199aad909228-1-llvmorg-21-init-9266-g09006611.tar.xz', - 'sha256sum': '1aec99f479ff28cefe44ed739844833e016a1da255cf3c17d79e59a273246615', - 'size_bytes': 101605468, - 'generation': 1745271339727037, + 'object_name': 'Mac_arm64/rust-toolchain-22be76b7e259f27bf3e55eb931f354cd8b69d55f-4-llvmorg-21-init-16348-gbd809ffb.tar.xz', + 'sha256sum': 'ef0f5795e28fde6b0708647500fc94138e9518f173c3e99321cd8918006f606c', + 'size_bytes': 120345408, + 'generation': 1756377179094363, 'condition': 'host_os == "mac" and host_cpu == "arm64"', }, { - 'object_name': 'Win/rust-toolchain-c8f94230282a8e8c1148f3e657f0199aad909228-1-llvmorg-21-init-9266-g09006611.tar.xz', - 'sha256sum': 'b291520613a3ebc415e4576a7fa31d840a5ebf4ab9be6e9dc5d90062dc001c1e', - 'size_bytes': 193280372, - 'generation': 1745271341223097, + 'object_name': 'Win/rust-toolchain-22be76b7e259f27bf3e55eb931f354cd8b69d55f-4-llvmorg-21-init-16348-gbd809ffb.tar.xz', + 'sha256sum': '056cfdae49dd3d73b38ca7ef8245dec2105c7a77b47efba99995552ea1d89f6e', + 'size_bytes': 194943632, + 'generation': 1756377180954050, 'condition': 'host_os == "win"', }, ], @@ -521,7 +540,7 @@ deps = { 'third_party/siso': { 'packages': [ { - 'package': 'infra/build/siso/${{platform}}', + 'package': 'build/siso/${{platform}}', 'version': Var('siso_version'), } ], @@ -529,13 +548,13 @@ deps = { 'condition': 'not build_with_chromium and host_cpu != "s390" and host_os != "zos" and host_cpu != "ppc"', }, 'third_party/zlib': - Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '1e85c01b15363d11fab81c46fe2b5c2179113f70', + Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + 'caf4afa1afc92e16fef429f182444bed98a46a6c', 'tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '6c4f037a983abf14a4c8bf00e44db73cdf330a97', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '3895bad8d8b0aa864c77deff02fd42ff7b2732d1', 'tools/protoc_wrapper': - Var('chromium_url') + '/chromium/src/tools/protoc_wrapper.git' + '@' + '8ad6d21544b14c7f753852328d71861b363cc512', + Var('chromium_url') + '/chromium/src/tools/protoc_wrapper.git' + '@' + '3438d4183bfc7c0d6850e8b970204cc8189f0323', 'third_party/abseil-cpp': { - 'url': Var('chromium_url') + '/chromium/src/third_party/abseil-cpp.git' + '@' + '91f1a3775e4c509c3eadd4870fc9929c0021e6e3', + 'url': Var('chromium_url') + '/chromium/src/third_party/abseil-cpp.git' + '@' + '5141e83267542f8869adf18b5bd6440440d6801e', 'condition': 'not build_with_chromium', }, 'third_party/zoslib': { @@ -548,6 +567,7 @@ include_rules = [ # Everybody can use some things. '+include', '+unicode', + '+third_party/dragonbox/src/include', '+third_party/fast_float/src/include', '+third_party/fdlibm', '+third_party/fp16/src/include', @@ -561,16 +581,19 @@ include_rules = [ # to this set -- if in doubt, email v8-dev@. For general guidance, refer to # the Chromium guidelines (though note that some requirements in V8 may be # different to Chromium's): - # https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++11.md + # https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-features.md '+absl/container/flat_hash_map.h', '+absl/container/flat_hash_set.h', '+absl/container/btree_map.h', + '+absl/functional/overload.h', '+absl/status', + '+absl/strings/str_format.h', '+absl/synchronization/mutex.h', '+absl/time/time.h', # Some abseil features are explicitly banned. '-absl/types/any.h', # Requires RTTI. '-absl/types/flags', # Requires RTTI. + '-absl/functional/function_ref.h', # Use base::FunctionRef ] # checkdeps.py shouldn't check for includes in these directories: @@ -624,7 +647,6 @@ hooks = [ 'action': [ 'python3', 'third_party/depot_tools/download_from_google_storage.py', '--no_resume', - '--no_auth', '--bucket', 'chromium-browser-clang', '-s', 'tools/clang/dsymutil/bin/dsymutil.arm64.sha1', '-o', 'tools/clang/dsymutil/bin/dsymutil', @@ -637,7 +659,6 @@ hooks = [ 'action': [ 'python3', 'third_party/depot_tools/download_from_google_storage.py', '--no_resume', - '--no_auth', '--bucket', 'chromium-browser-clang', '-s', 'tools/clang/dsymutil/bin/dsymutil.x64.sha1', '-o', 'tools/clang/dsymutil/bin/dsymutil', @@ -667,13 +688,24 @@ hooks = [ '--platform=linux*', ], }, + { + 'name': 'llvm_symbolizer', + 'pattern': '.', + 'condition': 'download_prebuilt_arm64_llvm_symbolizer', + 'action': [ 'python3', + 'third_party/depot_tools/download_from_google_storage.py', + '--bucket', 'chromium-v8/llvm/arm64', + '--no_resume', + '-s', 'tools/sanitizers/linux/arm64/llvm-symbolizer.sha1', + '--platform=linux*', + ], + }, { 'name': 'wasm_spec_tests', 'pattern': '.', 'action': [ 'python3', 'third_party/depot_tools/download_from_google_storage.py', '--no_resume', - '--no_auth', '-u', '--bucket', 'v8-wasm-spec-tests', '-s', 'test/wasm-spec-tests/tests.tar.gz.sha1', @@ -685,7 +717,6 @@ hooks = [ 'action': [ 'python3', 'third_party/depot_tools/download_from_google_storage.py', '--no_resume', - '--no_auth', '-u', '--bucket', 'v8-wasm-spec-tests', '-s', 'test/wasm-js/tests.tar.gz.sha1', @@ -699,7 +730,6 @@ hooks = [ 'action': [ 'python3', 'third_party/depot_tools/download_from_google_storage.py', '--no_resume', - '--no_auth', '--bucket', 'chromium-browser-clang/ciopfs', '-s', 'build/ciopfs.sha1', ] diff --git a/deps/v8/ENG_REVIEW_OWNERS b/deps/v8/ENG_REVIEW_OWNERS index d601572c0b16d3..d59733542dc665 100644 --- a/deps/v8/ENG_REVIEW_OWNERS +++ b/deps/v8/ENG_REVIEW_OWNERS @@ -2,11 +2,9 @@ # disagreement among owners. Please consult before adding top-level # directories. -adamk@chromium.org gdeepti@chromium.org hpayer@chromium.org #{LAST_RESORT_SUGGESTION} leszeks@chromium.org mlippautz@chromium.org -syg@chromium.org verwaest@chromium.org vahl@chromium.org diff --git a/deps/v8/GEMINI.md b/deps/v8/GEMINI.md new file mode 100644 index 00000000000000..a0231b10b29afb --- /dev/null +++ b/deps/v8/GEMINI.md @@ -0,0 +1,242 @@ +# Gemini Workspace for V8 + +This is the workspace configuration for V8 when using Gemini. + +Documentation can be found at https://v8.dev/docs. + +## Key Commands + +- **Build (Debug):** `tools/dev/gm.py quiet x64.debug` +- **Build (Optimized Debug):** `tools/dev/gm.py quiet x64.optdebug` +- **Build (Release):** `tools/dev/gm.py quiet x64.release` +- **Run All Tests:** `tools/run-tests.py --progress dots --exit-after-n-failures=5 --outdir=out/x64.optdebug` +- **Run C++ Tests:** `tools/run-tests.py --progress dots --exit-after-n-failures=5 --outdir=out/x64.optdebug cctest unittests` +- **Run JavaScript Tests:** `tools/run-tests.py --progress dots --exit-after-n-failures=5 --outdir=out/x64.optdebug mjsunit` +- **Format Code:** `git cl format` + +Some hints: +- You are an expert C++ developer. +- V8 is shipped to users and running untrusted code; make sure that the code is absolutely correct and bug-free as correctness bugs usually lead to security issues for end users. +- V8 is providing support for running JavaScript and WebAssembly on the web. As such, it is critical to aim for best possible performance when optimizing V8. + +## Folder structure + +- `src/`: The main source folder providing the implementation of the virtual machine. Key subdirectories include: + - `src/api/`: Implements the V8 public C++ API, as declared in `include/`. + - `src/asmjs/`: Contains V8's Asm.js pipeline, which compiles the Asm.js subset of JavaScript into WebAssembly. + - `src/ast/`: Defines the Abstract Syntax Tree (AST) used to represent parsed JavaScript, including nodes, scopes, and variables. + - `src/base/`: Provides fundamental, low-level utilities, data structures, and a platform abstraction layer for the entire V8 project. + - `src/baseline/`: Implements the Sparkplug baseline compiler, which generates machine code directly from bytecode for a fast performance boost. + - `src/bigint/`: The implementation of BigInt operations. + - `src/builtins/`: Implementation of JavaScript built-in functions (e.g., `Array.prototype.map`). + - `src/codegen/`: Code generation, including direct machine code generation via macro assemblers, higher level codegen via CodeStubAssembler, definitions of machine code metadata like safepoint tables and source position tables, and `compiler.cc` which defines entry points into the compilers. This contains subdirectories for architecture specific implementations, which should be kept in sync with each other as much as possible. + - `src/common/`: Common definitions and utilities. + - `src/compiler/`: The TurboFan optimizing compiler, including the Turboshaft CFG compiler. + - `src/d8/`: The `d8` shell implementation, for running V8 in a CLI. + - `src/debug/`: The debugger and debug protocol implementation. + - `src/deoptimizer/`: The deoptimizer implementation, which translates optimized frames into unoptimized ones. + - `src/execution/`: The definitions of the execution environment, including the Isolate, frame definitions, microtasks, stack guards, tiering, and on-stack argument handling. + - `src/handles/`: The handle implementation for GC-safe object references. + - `src/heap/`: The garbage collector and memory management code. + - `src/ic/`: The Inline Caching implementation. + - `src/init/`: The V8 initialization code. + - `src/inspector/`: The inspector protocol implementation. + - `src/interpreter/`: The Ignition bytecode compiler and interpreter. + - `src/json/`: The JSON parser and serializer. + - `src/libplatform/`: The platform abstraction layer, for task runners and worker threads. + - `src/logging/`: The logging implementation. + - `src/maglev/`: The Maglev mid-tier optimizing compiler. + - `src/numbers/`: Implementations of various numeric operations. + - `src/objects/`: The representation and behaviour of V8 internal and JavaScript objects. + - `src/parsing/`: The parser and scanner implementation. + - `src/profiler/`: The in-process profiler implementations, for heap snapshots, allocation tracking, and a sampling CPU profiler. + - `src/regexp/`: The regular expression implementation. This contains subdirectories for architecture specific implementations, which should be kept in sync with each other as much as possible. + - `src/runtime/`: C++ functions that can be called from JavaScript at runtime. + - `src/sandbox/`: The implementation of the sandbox, which is a security feature that attempts to limit V8 memory operations to be within a single guarded virtual memory allocation, such that corruptions of objects within the sandbox cannot lead to corruption of objects outside of it. + - `src/snapshot/`: The snapshot implementation, for both the startup snapshot (read-only, startup heap, and startup context), as well as the code-serializer, which generates code caches for caching of user script code. + - `src/strings/`: Implementations of string helpers, such as predicates for characters, unicode processing, hashing and string building. + - `src/torque/`: The Torque language implementation. + - `src/tracing/`: The tracing implementation. + - `src/trap-handler/`: Implementations of trap handlers. + - `src/wasm/`: The WebAssembly implementation. + - `src/zone/`: The implementation of a simple bump-pointer region-based zone allocator. +- `test/`: Folder containing most of the tests and testing code. +- `include/`: Folder containing all of V8's publicAPI that is used when V8 is embedded in other projects such as e.g. the Blink rendering engine. +- `out/`: Folder containing the results of a build. Usually organized in sub folders for the respective configurations. + +## Building + +The full documentation for building using GN can be found at https://v8.dev/docs/build-gn. + +Once the initial dependencies are installed, V8 can be built using `gm.py`, which is a wrapper around GN and Ninja. + +```bash +# List all available build configurations and targets +tools/dev/gm.py + +# Build the d8 shell for x64 in release mode +tools/dev/gm.py quiet x64.release + +# Build d8 for x64 in debug mode +tools/dev/gm.py quiet x64.debug +``` + +- **release:** Optimized for performance, with debug information stripped. Use for benchmarking. +- **debug:** Contains full debug information and enables assertions. Slower, but essential for debugging. +- **optdebug:** A compromise with optimizations enabled and debug information included. Good for general development. + +Make sure to pass the `quiet` keyword unless told to otherwise, so that you don't waste tokens on compilation progress. Errors will still be reported. + +## Debugging + +For debugging, it is recommended to use a `debug` or `optdebug` build. You can run `d8` with GDB or LLDB for native code debugging. + +```bash +# Example of running d8 with gdb +gdb --args out/x64.debug/d8 --my-flag my-script.js +``` + +V8 also provides a rich set of flags for diagnostics. Some of the most common ones are: +- `--trace-opt`: Log optimized functions. +- `--trace-deopt`: Log when and why functions are deoptimized. +- `--trace-gc`: Log garbage collection events. +- `--allow-natives-syntax`: Enables calling of internal V8 functions (e.g. `%OptimizeFunctionOnNextCall(f)`) from JavaScript for testing purposes. + +A comprehensive list of all flags can be found by running `out/x64.debug/d8 --help`. Most V8 flags are in `flag-definitions.h`; flags specific to the `d8` shell are located in `src/d8/d8.cc` within the `Shell::SetOptions` function. + +When debugging issues in Torque code, it is often useful to inspect the generated C++ files in `out//gen/torque-generated/`. This allows you to see the low-level CodeStubAssembler code that is actually being executed. + +## Testing + +The primary script for running tests is `tools/run-tests.py`. You specify the build output directory and the tests you want to run. Key test suites include: +- **unittests:** C++ unit tests for V8's internal components. +- **cctest:** Another, older format for C++ unit tests (deprecated, in the process of being moved to unittests). +- **mjsunit:** JavaScript-based tests for JavaScript language features and builtins. + +```bash +# Run all standard tests for the x64.optdebug build +tools/run-tests.py --progress dots --exit-after-n-failures=5 --outdir=out/x64.optdebug + +# Run a specific test suite (e.g., cctest) +tools/run-tests.py --progress dots --exit-after-n-failures=5 --outdir=out/x64.optdebug cctest + +# Run a specific test file +tools/run-tests.py --progress dots --exit-after-n-failures=5 --outdir=out/x64.optdebug cctest/test-heap +``` + +It's important to pass `--progress dots` so that there is minimal progress reporting, to avoid cluttering the output. + +If there are any failing tests, they will be reported along their stderr and a command to reproduce them e.g. + +``` +=== mjsunit/maglev/regress-429656023 === +--- stderr --- +# +# Fatal error in ../../src/heap/local-factory.h, line 41 +# unreachable code +# +# +# +...stack trace... +Received signal 6 +Command: out/x64.optdebug/d8 --test test/mjsunit/mjsunit.js test/mjsunit/maglev/regress-429656023.js --random-seed=-190258694 --nohard-abort --verify-heap --testing-d8-test-runner --allow-natives-syntax +``` + +You can retry the test either by running the test name with `tools/run-tests.py`, e.g. `tools/run-tests.py --progress dots --outdir=out/x64.optdebug mjsunit/maglev/regress-429656023`, or by running the command directly. When running the command directly, you can add additional flags to help debug the issue, and you can try running a different build (e.g. running a debug build if a release build fails). + +The full testing documentation is at https://v8.dev/docs/test. + +## Coding and Committing + +- Always follow the style conventions used in code surrounding your changes. +- Otherwise, follow [Chromium's C++ style guide](https://chromium.googlesource.com/chromium/src/+/main/styleguide/styleguide.md). +- Use `git cl format` to automatically format your changes. + +### Commit Messages +Commit messages should follow the convention described at https:/v8.dev/docs/contribute#commit-messages. A typical format is: + +``` +[component]: Short description of the change + +Longer description explaining the "why" of the change, not just +the "what". Wrap lines at 72 characters. + +Bug: 123456 +``` + +- The `component` is the area of the codebase (e.g., `compiler`, `runtime`, `api`). +- The `Bug:` line is important for linking to issues in the tracker at https://crbug.com/ + +## Working with Torque + +Torque is a V8-specific language used to write V8 builtins and some V8 object definitions. It provides a higher-level syntax that compiles down to CSA code. + +### Key Concepts + +- **Purpose:** Simplify the creation of V8 builtins and object definitions by providing a more abstract language than writing CodeStubAssembler code directly. +- **File Extension:** `.tq` +- **Location:** Torque files are primarily located in `src/builtins` and `src/objects`. +- **Compilation:** Torque files are compiled by the `torque` compiler, which generates C++ and Code Stub Assembler (CSA) files. These generated files are placed in the `out//gen/torque-generated/` directory and then compiled as part of the normal V8 build process. + - **C++ files** `*.tq` files will generate filenames like `*-tq.inc`, `*-tq.cc`, and `*-tq-inl.inc`. Additionally, there are top-level files: + - `class-forward-declarations.h`: Forward declarations for all Torque-defined classes. + - `builtin-definitions.h`: A list of all defined builtins. + - `csa-types.h`: Type definitions for the Code Stub Assembler. + - `factory.cc` and `factory.inc`: Factory functions for creating instances of Torque-defined classes. + - `class-verifiers.h` and `.cc`: Heap object verification functions (for debug builds). + - `exported-macros-assembler.h` and `.cc`: C++ declarations and definitions for exported Torque macros. + - `objects-body-descriptors-inl.inc`: Inline definitions for object body descriptors, which define the memory layout of objects. + - `objects-printer.cc`: Object printer functions for debugging. + - `instance-types.h`: The `InstanceType` enum, used to identify object types at runtime. + - `interface-descriptors.inc`: Definitions for call interface descriptors, which manage function call conventions. + - **CSA files** These have filenames like `*-csa.cc` and `*-csa.h`. They contain the C++ code that uses the `CodeStubAssembler` API to generate the low-level implementation of builtins. + +### Syntax and Features + +- **Typescript-like Syntax:** Torque's syntax is similar to Typescript with support for functions (macros and builtins), variables, types, and control flow. +- **Macros and Builtins:** + - `macro`: Inlined functions for reusable logic. + - `builtin`: Non-inlined functions, callable from other builtins or JavaScript. +- **`extern` Keyword:** Used to call C++ defined CSA functions from Torque. This is how Torque code interfaces with the rest of the V8 codebase. +- **`transitioning` and `javascript` Keywords:** + - `transitioning`: Indicates a function can cause an object's map to change (e.g., when a property is added to a JSObject). + - `javascript`: Marks a builtin as being directly callable from JavaScript, with Javascript linkage. +- **Type System:** Torque has a strong type system that mirrors the V8 object hierarchy. This allows for compile-time type checking and safer code. +- **Labels and `goto`:** Torque uses a `labels` and `goto` system for control flow, which is particularly useful for handling exceptional cases and optimizing performance. + +### Workflow for Modifying Torque Files + +1. **Identify the relevant `.tq` file:** Builtins are in `src/builtins`, and object definitions are in `src/objects`. +2. **Modify the Torque code:** Make the necessary changes to the `.tq` file, following the existing syntax and conventions. +3. **Rebuild V8:** Run the appropriate `gm.py` command (e.g., `tools/dev/gm.py x64.release`) to recompile V8. This will automatically run the Torque compiler and build the generated C++ files. +4. **Test your changes:** Run the relevant tests to ensure that your changes are correct and have not introduced any regressions. + +### Example + +A simple Torque macro to add two SMIs might look like this: + +```torque +macro AddTwoSmis(a: Smi, b: Smi): Smi { + return a + b; +} +``` + +A more complex example showing a JavaScript-callable builtin: + +```torque +transitioning javascript builtin MyAwesomeBuiltin( + js-implicit context: NativeContext)(x: JSAny): Number { + // ... implementation ... +} +``` + +## Common Pitfalls & Best Practices + +- **Always format before committing:** Run `git cl format` before creating a commit to ensure your code adheres to the style guide. +- **Do not edit generated files:** Files in `out/` are generated by the build process. Edits should be made to the source files (e.g., `.tq` files for Torque, `.pdl` for protocol definitions). +- **Match test configuration to build:** Ensure you are running tests against the correct build type (e.g., run mjsunit from out/x64.debug if you built x64.debug). +- **Check surrounding code for conventions:** Before adding new code, always study the existing patterns, naming conventions, and architectural choices in the file and directory you are working in. +- **Avoid changing unrelated code:** Keep diffs small by only changing the code you intended to change. Nearby code should not be cleaned up while making a change -- if you think there is a good cleanup, suggest it to me for a separate patch. +- **Keep related functions together:** When adding a new function, try to insert it near related functions, to keep similar behaviour close. +- **Don't guess header names:** If you don't know where the definition of a class or function is, don't try to guess the header name, but search for it instead. +- **Be careful with forward declarations:** Many types are forward declared; if you want to use them, you'll need to find the definition. +- **Be careful with inline function definitions:** Many functions are declared as `inline` in the `.h` file, and defined in a `-inl.h` file. If you get compile errors about a missing definition, you are likely missing an `#include` for a `-inl.h` file. You can only include `-inl.h` files from other `-inl.h` files and `.cc` files. diff --git a/deps/v8/MODULE.bazel b/deps/v8/MODULE.bazel index 21e089505f101c..65824eaeaa9770 100644 --- a/deps/v8/MODULE.bazel +++ b/deps/v8/MODULE.bazel @@ -4,6 +4,7 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "rules_cc", version = "0.1.2") bazel_dep(name = "rules_python", version = "1.0.0") bazel_dep(name = "platforms", version = "0.0.11") bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2") diff --git a/deps/v8/OWNERS b/deps/v8/OWNERS index e252b5a2fa648b..546159a30b56e2 100644 --- a/deps/v8/OWNERS +++ b/deps/v8/OWNERS @@ -11,6 +11,7 @@ per-file AUTHORS=file:COMMON_OWNERS per-file BUILD.bazel=file:COMMON_OWNERS per-file BUILD.gn=file:COMMON_OWNERS per-file DEPS=file:COMMON_OWNERS +per-file GEMINI.md=file:COMMON_OWNERS per-file INFRA_OWNERS=file:INFRA_OWNERS per-file MODULE.bazel=file:COMMON_OWNERS per-file PRESUBMIT.py=file:INFRA_OWNERS diff --git a/deps/v8/PPC_OWNERS b/deps/v8/PPC_OWNERS index 6edd45a6ef2e04..514f7980de7335 100644 --- a/deps/v8/PPC_OWNERS +++ b/deps/v8/PPC_OWNERS @@ -1,4 +1,4 @@ -junyan@redhat.com +junyan1@ibm.com joransiu@ca.ibm.com midawson@redhat.com -mfarazma@redhat.com +mfarazma@ibm.com diff --git a/deps/v8/RISCV_OWNERS b/deps/v8/RISCV_OWNERS index e3e11fdf4947db..6650355e2edfe9 100644 --- a/deps/v8/RISCV_OWNERS +++ b/deps/v8/RISCV_OWNERS @@ -1,4 +1,5 @@ brice.dobry@futurewei.com +kasperl@rivosinc.com peng.w@rioslab.org qiuji@iscas.ac.cn yahan@iscas.ac.cn diff --git a/deps/v8/S390_OWNERS b/deps/v8/S390_OWNERS index 6edd45a6ef2e04..514f7980de7335 100644 --- a/deps/v8/S390_OWNERS +++ b/deps/v8/S390_OWNERS @@ -1,4 +1,4 @@ -junyan@redhat.com +junyan1@ibm.com joransiu@ca.ibm.com midawson@redhat.com -mfarazma@redhat.com +mfarazma@ibm.com diff --git a/deps/v8/bazel/defs.bzl b/deps/v8/bazel/defs.bzl index fbd942ba765fe0..b475bf5ff0a160 100644 --- a/deps/v8/bazel/defs.bzl +++ b/deps/v8/bazel/defs.bzl @@ -6,6 +6,9 @@ This module contains helper functions to compile V8. """ +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + FlagInfo = provider("The value of an option.", fields = ["value"]) @@ -117,6 +120,7 @@ def _default_args(): "-Wno-implicit-int-float-conversion", "-Wno-deprecated-copy", "-Wno-non-virtual-dtor", + "-Wno-unnecessary-virtual-specifier", "-isystem .", ], "//conditions:default": [], @@ -213,7 +217,7 @@ def v8_binary( **kwargs): default = _default_args() if _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, noicu_defines, icu_srcs, icu_deps, icu_defines): - native.cc_binary( + cc_binary( name = "noicu/" + name, srcs = srcs + noicu_srcs, deps = deps + noicu_deps + default.deps, @@ -223,7 +227,7 @@ def v8_binary( linkopts = linkopts + default.linkopts, **kwargs ) - native.cc_binary( + cc_binary( name = "icu/" + name, srcs = srcs + icu_srcs, deps = deps + icu_deps + default.deps, @@ -234,7 +238,7 @@ def v8_binary( **kwargs ) else: - native.cc_binary( + cc_binary( name = name, srcs = srcs, deps = deps + default.deps, @@ -262,7 +266,7 @@ def v8_library( **kwargs): default = _default_args() if _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, noicu_defines, icu_srcs, icu_deps, icu_defines): - native.cc_library( + cc_library( name = name + "_noicu", srcs = srcs + noicu_srcs, deps = deps + noicu_deps + default.deps, @@ -281,7 +285,7 @@ def v8_library( name = "noicu/" + name, actual = name + "_noicu", ) - native.cc_library( + cc_library( name = name + "_icu", srcs = srcs + icu_srcs, deps = deps + icu_deps + default.deps, @@ -301,7 +305,7 @@ def v8_library( actual = name + "_icu", ) else: - native.cc_library( + cc_library( name = name, srcs = srcs, deps = deps + default.deps, @@ -549,7 +553,6 @@ def build_config_content(cpu, icu): ("code_comments", "false"), ("component_build", "false"), ("concurrent_marking", "false"), - ("conservative_stack_scanning", "false"), ("current_cpu", cpu), ("dcheck_always_on", "false"), ("debug_code", "false"), @@ -582,6 +585,7 @@ def build_config_content(cpu, icu): ("pointer_compression", "true"), ("runtime_call_stats", "false"), ("sandbox", "false"), + ("sandbox_hardware_support", "false"), ("shared_ro_heap", "false"), ("simd_mips", "false"), ("simulator_run", "false"), diff --git a/deps/v8/build_overrides/partition_alloc.gni b/deps/v8/build_overrides/partition_alloc.gni index 33a094d4c9f67a..2954bc4c725491 100644 --- a/deps/v8/build_overrides/partition_alloc.gni +++ b/deps/v8/build_overrides/partition_alloc.gni @@ -34,6 +34,7 @@ _supported = _supported_compiler && _supported_build_type && use_partition_alloc_as_malloc_default = _supported use_allocator_shim_default = _supported +shim_supports_sized_dealloc_default = false enable_backup_ref_ptr_support_default = _supported put_ref_count_in_previous_slot_default = true enable_backup_ref_ptr_slow_checks_default = false diff --git a/deps/v8/gni/v8.gni b/deps/v8/gni/v8.gni index e137c84b00b5d5..0ddd653e0eca9d 100644 --- a/deps/v8/gni/v8.gni +++ b/deps/v8/gni/v8.gni @@ -4,6 +4,7 @@ import("//build/config/chrome_build.gni") import("//build/config/compiler/pgo/pgo.gni") +import("//build/config/features.gni") import("//build/config/gclient_args.gni") import("//build/config/ios/config.gni") import("//build/config/ios/ios_sdk_overrides.gni") @@ -52,6 +53,16 @@ declare_args() { # add a dependency on the ICU library. v8_enable_i18n_support = true + # Enable Temporal API. Enabling this feature will + # add a dependency on the temporal_rs library. + # + # We currently only want it enabled on d8 and chromium builds (Functionality + # is still not accessible unless --harmony-temporal is enabled at runtime) + # + # Furthermore, some architectures don't have Rust toolchains in Chromium + v8_enable_temporal_support = !(defined(build_with_node) && build_with_node) && + target_cpu != "ppc64" && target_cpu != "s390x" + # Use static libraries instead of source_sets. v8_static_library = false @@ -79,20 +90,31 @@ declare_args() { # Sets -DV8_LITE_MODE. v8_enable_lite_mode = false - # We use target_os == "ios" here because it isn't equivalent to is_ios - # (is_ios is based on host_os). - if (target_os == "ios") { - if (target_platform == "iphoneos") { - # iOS executable code pages is in 18.4 SDK. - # TODO(dtapuska): Change this to an assert. - v8_enable_lite_mode = ios_deployment_target != "18.4" - } else if (target_platform == "tvos") { - # tvOS runs in single process mode and is not allowed to use JIT. - # TODO(crbug.com/394710095): Enable the v8 lite mode to run v8 with the - # jitless mode on tvOS. - v8_enable_lite_mode = true - } - } + # WebAssembly interpreter (DrumBrake) build flag. + v8_enable_drumbrake = false + + # Enable Wasm interpreter tracing. + v8_enable_drumbrake_tracing = false + + # On non-Desktop platforms, enable explicit bounds checks in the Wasm + # interpreter, where the bounds checking is done in the instruction handler, + # not using an unhandled exception filter (which also doesn't work with + # Win-ASAN). + # Also enables explicit bounds checks on component builds in platforms other + # than Windows because of a problem with function name mangling for vectorcall + # ABI on ELF (The vectorcall calling convention requires a mangling that + # includes @@, but on ELF an @ indicates that the part after it is the version + # of the symbol, with @@ indicating the default symbol version to link against + # when none is specified by the caller and this causes linker errors). As a + # workaround, we need to disable the vectorcall calling convention for + # component builds on Linux and Mac, which means that we cannot use DrumBrake + # builtins for Load/Store instruction handlers, because of the different + # calling convention. + # Windows component builds are also enabled to support cross-compilation. + v8_drumbrake_bounds_checks = + (is_win && (is_asan || is_ubsan || is_msan || is_tsan)) || + !(is_win || is_linux || is_mac) || v8_current_cpu != "x64" || !is_clang || + is_component_build # Enable the Turbofan compiler. # Sets -dV8_ENABLE_TURBOFAN. @@ -112,6 +134,26 @@ declare_args() { # Enable 256-bit long vector re-vectorization pass in WASM compilation pipeline. v8_enable_wasm_simd256_revec = false + # We use target_os == "ios" here because it isn't equivalent to is_ios + # (is_ios is based on host_os). + if (target_os == "ios") { + if (target_platform == "iphoneos") { + # iOS executable code pages is in 18.4 SDK which the iOS + Blink targets. + v8_enable_lite_mode = !use_blink + } else if (target_platform == "tvos") { + # tvOS runs in single process mode and is not allowed to use JIT. + v8_enable_lite_mode = true + + # Since v8 has the Wasm interpreter mode with jitless, tvOS enables it + # to use WebAssembly. + v8_enable_drumbrake = true + v8_enable_webassembly = true + + # tvOS doesn't use Turbofan. + v8_enable_turbofan = false + } + } + # Enable runtime call stats. v8_enable_runtime_call_stats = !v8_is_on_release_branch @@ -194,6 +236,10 @@ declare_args() { # Specifies if the target build is a simulator build. By default it is set to # true if the host and target do not match and we are not cross-compiling. v8_target_is_simulator = "" + + # Some fuzzers depend on fuzzing functionality linked into the v8 library. + # For binary size reasons this functionality is not always available. + v8_wasm_random_fuzzers = "" } if (v8_use_external_startup_data == "") { @@ -228,8 +274,9 @@ if (v8_enable_builtins_optimization == "") { if (v8_enable_webassembly == "") { v8_enable_webassembly = !v8_enable_lite_mode } -assert(!(v8_enable_webassembly && v8_enable_lite_mode), - "Webassembly is not available in lite mode.") +assert( + !(v8_enable_webassembly && v8_enable_lite_mode && !v8_enable_drumbrake), + "Webassembly is not available in lite mode without the Wasm interpreter mode.") if (v8_enable_pointer_compression == "") { v8_enable_pointer_compression = @@ -238,18 +285,19 @@ if (v8_enable_pointer_compression == "") { } # The Wasm interpreter is currently supported only on arm64 and x64, on -# Windows, Linux and MacOS. +# Windows, Linux, MacOS and tvOS. is_drumbrake_supported = v8_enable_webassembly && v8_enable_pointer_compression && (v8_current_cpu == "x64" || v8_current_cpu == "arm64") && - (target_os == "win" || target_os == "linux" || target_os == "mac") + (target_os == "win" || target_os == "linux" || target_os == "mac" || + target_os == "ios") # Turbofan is enabled by default, except in lite mode. if (v8_enable_turbofan == "") { v8_enable_turbofan = !v8_enable_lite_mode } -assert(v8_enable_turbofan || !v8_enable_webassembly, - "Webassembly is not available when Turbofan is disabled.") +assert(v8_enable_turbofan || !v8_enable_webassembly || v8_enable_drumbrake, + "WebAssembly requires Turbofan or Drumbrake.") if (v8_target_is_simulator == "") { # We compare target cpu with v8 target cpu to not affect simulator builds for @@ -259,6 +307,14 @@ if (v8_target_is_simulator == "") { (current_cpu != v8_current_cpu && v8_multi_arch_build) } +# Some fuzzers depend on fuzzing functionality linked into the v8 library. +# For binary size reasons this functionality is not available for official +# builds, therefore these fuzzers do not function there and should be skipped +# instead. +if (v8_wasm_random_fuzzers == "") { + v8_wasm_random_fuzzers = !is_official_build +} + # Points to // in v8 stand-alone or to //v8/ in chromium. We need absolute # paths for all configs in templates as they are shared in different # subdirectories. diff --git a/deps/v8/include/DEPS b/deps/v8/include/DEPS index c6d10cd4d7b01d..e3f9da619385c3 100644 --- a/deps/v8/include/DEPS +++ b/deps/v8/include/DEPS @@ -10,4 +10,7 @@ include_rules = [ "+cppgc/type-traits.h", "+cppgc/visitor.h", "+perfetto", + # Used by v8-object.h, for Object::wrap(). + "+cppgc/name-provider.h", + "+cppgc/garbage-collected.h", ] diff --git a/deps/v8/include/OWNERS b/deps/v8/include/OWNERS index be9fad30ae3e56..c0e3a1f767be2f 100644 --- a/deps/v8/include/OWNERS +++ b/deps/v8/include/OWNERS @@ -1,4 +1,3 @@ -adamk@chromium.org cbruni@chromium.org leszeks@chromium.org mlippautz@chromium.org diff --git a/deps/v8/include/cppgc/allocation.h b/deps/v8/include/cppgc/allocation.h index 3e70eff0ddf62c..a7955fd1016e8e 100644 --- a/deps/v8/include/cppgc/allocation.h +++ b/deps/v8/include/cppgc/allocation.h @@ -71,7 +71,7 @@ class MakeGarbageCollectedTraitInternal { template struct AllocationDispatcher final { static void* Invoke(AllocationHandle& handle, size_t size) { - static_assert(std::is_base_of::value, + static_assert(std::is_base_of_v, "Custom space must inherit from CustomSpaceBase."); static_assert( !CustomSpace::kSupportsCompaction, @@ -111,7 +111,7 @@ class MakeGarbageCollectedTraitInternal { api_constants::kDefaultAlignment> final { static void* Invoke(AllocationHandle& handle, size_t size) { - static_assert(std::is_base_of::value, + static_assert(std::is_base_of_v, "Custom space must inherit from CustomSpaceBase."); return MakeGarbageCollectedTraitInternal::Allocate( handle, size, internal::GCInfoTrait::Index(), @@ -164,7 +164,7 @@ class MakeGarbageCollectedTraitBase */ V8_INLINE static void* Allocate(AllocationHandle& handle, size_t size) { static_assert( - std::is_base_of::value, + std::is_base_of_v, "U of GarbageCollected must be a base of T. Check " "GarbageCollected base class inheritance."); static constexpr size_t kWantedAlignment = diff --git a/deps/v8/include/cppgc/cross-thread-persistent.h b/deps/v8/include/cppgc/cross-thread-persistent.h index a5f8bac0b1013e..b389eb582c2957 100644 --- a/deps/v8/include/cppgc/cross-thread-persistent.h +++ b/deps/v8/include/cppgc/cross-thread-persistent.h @@ -102,20 +102,19 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase, // node. } - BasicCrossThreadPersistent( - const SourceLocation& loc = SourceLocation::Current()) + BasicCrossThreadPersistent(SourceLocation loc = SourceLocation::Current()) : LocationPolicy(loc) {} - BasicCrossThreadPersistent( - std::nullptr_t, const SourceLocation& loc = SourceLocation::Current()) + BasicCrossThreadPersistent(std::nullptr_t, + SourceLocation loc = SourceLocation::Current()) : LocationPolicy(loc) {} - BasicCrossThreadPersistent( - SentinelPointer s, const SourceLocation& loc = SourceLocation::Current()) + BasicCrossThreadPersistent(SentinelPointer s, + SourceLocation loc = SourceLocation::Current()) : CrossThreadPersistentBase(s), LocationPolicy(loc) {} - BasicCrossThreadPersistent( - T* raw, const SourceLocation& loc = SourceLocation::Current()) + BasicCrossThreadPersistent(T* raw, + SourceLocation loc = SourceLocation::Current()) : CrossThreadPersistentBase(raw), LocationPolicy(loc) { if (!IsValid(raw)) return; PersistentRegionLock guard; @@ -132,9 +131,8 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase, friend class BasicCrossThreadPersistent; }; - BasicCrossThreadPersistent( - UnsafeCtorTag, T* raw, - const SourceLocation& loc = SourceLocation::Current()) + BasicCrossThreadPersistent(UnsafeCtorTag, T* raw, + SourceLocation loc = SourceLocation::Current()) : CrossThreadPersistentBase(raw), LocationPolicy(loc) { if (!IsValid(raw)) return; CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw); @@ -142,24 +140,23 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase, this->CheckPointer(raw); } - BasicCrossThreadPersistent( - T& raw, const SourceLocation& loc = SourceLocation::Current()) + BasicCrossThreadPersistent(T& raw, + SourceLocation loc = SourceLocation::Current()) : BasicCrossThreadPersistent(&raw, loc) {} template ::value>> + typename = std::enable_if_t>> BasicCrossThreadPersistent( internal::BasicMember member, - const SourceLocation& loc = SourceLocation::Current()) + SourceLocation loc = SourceLocation::Current()) : BasicCrossThreadPersistent(member.Get(), loc) {} - BasicCrossThreadPersistent( - const BasicCrossThreadPersistent& other, - const SourceLocation& loc = SourceLocation::Current()) + BasicCrossThreadPersistent(const BasicCrossThreadPersistent& other, + SourceLocation loc = SourceLocation::Current()) : BasicCrossThreadPersistent(loc) { // Invoke operator=. *this = other; @@ -168,19 +165,18 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase, // Heterogeneous ctor. template ::value>> - BasicCrossThreadPersistent( - const BasicCrossThreadPersistent& other, - const SourceLocation& loc = SourceLocation::Current()) + typename = std::enable_if_t>> + BasicCrossThreadPersistent(const BasicCrossThreadPersistent< + U, OtherWeaknessPolicy, OtherLocationPolicy, + OtherCheckingPolicy>& other, + SourceLocation loc = SourceLocation::Current()) : BasicCrossThreadPersistent(loc) { *this = other; } BasicCrossThreadPersistent( BasicCrossThreadPersistent&& other, - const SourceLocation& loc = SourceLocation::Current()) noexcept { + SourceLocation loc = SourceLocation::Current()) noexcept { // Invoke operator=. *this = std::move(other); } @@ -194,7 +190,7 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase, template ::value>> + typename = std::enable_if_t>> BasicCrossThreadPersistent& operator=( const BasicCrossThreadPersistent::value>> + typename = std::enable_if_t>> BasicCrossThreadPersistent& operator=( internal::BasicMember @@ -338,8 +334,8 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase, } template ::IsStrongPersistent::value>::type> + typename = std::enable_if_t::IsStrongPersistent::value>> BasicCrossThreadPersistent Lock() const { return BasicCrossThreadPersistent< diff --git a/deps/v8/include/cppgc/internal/finalizer-trait.h b/deps/v8/include/cppgc/internal/finalizer-trait.h index ab49af870e0ba3..b62da059fa14d0 100644 --- a/deps/v8/include/cppgc/internal/finalizer-trait.h +++ b/deps/v8/include/cppgc/internal/finalizer-trait.h @@ -70,7 +70,7 @@ struct FinalizerTrait { // - a destructor. static constexpr bool kNonTrivialFinalizer = internal::HasFinalizeGarbageCollectedObject::value || - !std::is_trivially_destructible::type>::value; + !std::is_trivially_destructible_v>; static void Finalize(void* obj) { internal::FinalizerTraitImpl::Finalize(obj); diff --git a/deps/v8/include/cppgc/internal/gc-info.h b/deps/v8/include/cppgc/internal/gc-info.h index d52710b369dc28..b2fbd1fee1cbcf 100644 --- a/deps/v8/include/cppgc/internal/gc-info.h +++ b/deps/v8/include/cppgc/internal/gc-info.h @@ -108,10 +108,10 @@ struct GCInfoTrait final { template struct GCInfoFolding final { static constexpr bool kHasVirtualDestructorAtBase = - std::has_virtual_destructor::value; + std::has_virtual_destructor_v; static constexpr bool kBothTypesAreTriviallyDestructible = - std::is_trivially_destructible::value && - std::is_trivially_destructible::value; + std::is_trivially_destructible_v && + std::is_trivially_destructible_v; static constexpr bool kHasCustomFinalizerDispatchAtBase = internal::HasFinalizeGarbageCollectedObject< ParentMostGarbageCollectedType>::value; diff --git a/deps/v8/include/cppgc/internal/logging.h b/deps/v8/include/cppgc/internal/logging.h index 2129e85f2406e0..887130a16affae 100644 --- a/deps/v8/include/cppgc/internal/logging.h +++ b/deps/v8/include/cppgc/internal/logging.h @@ -12,9 +12,9 @@ namespace cppgc { namespace internal { void V8_EXPORT DCheckImpl(const char*, - const SourceLocation& = SourceLocation::Current()); + SourceLocation = SourceLocation::Current()); [[noreturn]] void V8_EXPORT -FatalImpl(const char*, const SourceLocation& = SourceLocation::Current()); +FatalImpl(const char*, SourceLocation = SourceLocation::Current()); // Used to ignore -Wunused-variable. template diff --git a/deps/v8/include/cppgc/internal/name-trait.h b/deps/v8/include/cppgc/internal/name-trait.h index 6be298557df44b..6e63a72821be76 100644 --- a/deps/v8/include/cppgc/internal/name-trait.h +++ b/deps/v8/include/cppgc/internal/name-trait.h @@ -80,7 +80,7 @@ class NameTrait final : public NameTraitBase { #elif CPPGC_SUPPORTS_OBJECT_NAMES return true; #else // !CPPGC_SUPPORTS_OBJECT_NAMES - return std::is_base_of::value; + return std::is_base_of_v; #endif // !CPPGC_SUPPORTS_OBJECT_NAMES } diff --git a/deps/v8/include/cppgc/internal/pointer-policies.h b/deps/v8/include/cppgc/internal/pointer-policies.h index bba484237da466..432cdb47caa950 100644 --- a/deps/v8/include/cppgc/internal/pointer-policies.h +++ b/deps/v8/include/cppgc/internal/pointer-policies.h @@ -203,11 +203,11 @@ using DefaultCrossThreadPersistentCheckingPolicy = DisabledCheckingPolicy; class KeepLocationPolicy { public: - constexpr const SourceLocation& Location() const { return location_; } + constexpr SourceLocation Location() const { return location_; } protected: constexpr KeepLocationPolicy() = default; - constexpr explicit KeepLocationPolicy(const SourceLocation& location) + constexpr explicit KeepLocationPolicy(SourceLocation location) : location_(location) {} // KeepLocationPolicy must not copy underlying source locations. @@ -228,7 +228,7 @@ class IgnoreLocationPolicy { protected: constexpr IgnoreLocationPolicy() = default; - constexpr explicit IgnoreLocationPolicy(const SourceLocation&) {} + constexpr explicit IgnoreLocationPolicy(SourceLocation) {} }; #if CPPGC_SUPPORTS_OBJECT_NAMES diff --git a/deps/v8/include/cppgc/member.h b/deps/v8/include/cppgc/member.h index c82688d582a8d8..c028bcd06881b2 100644 --- a/deps/v8/include/cppgc/member.h +++ b/deps/v8/include/cppgc/member.h @@ -20,6 +20,8 @@ namespace cppgc { namespace subtle { class HeapConsistency; +template +class TaggedUncompressedMember; } // namespace subtle class Visitor; @@ -163,7 +165,7 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase, template ::value>> + typename = std::enable_if_t>> V8_INLINE BasicMember(const BasicPersistent& p) @@ -219,7 +221,7 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase, template ::value>> + typename = std::enable_if_t>> V8_INLINE BasicMember& operator=( const BasicPersistent& @@ -296,8 +298,10 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase, return *this; } - V8_INLINE const T* GetRawAtomic() const { - return static_cast(Base::GetRawAtomic()); + V8_INLINE const void* GetRawAtomic() const { return Base::GetRawAtomic(); } + + V8_INLINE const T* GetAtomic() const { + return static_cast(GetRawAtomic()); } V8_INLINE void InitializingWriteBarrier(T* value) const { @@ -328,6 +332,8 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase, V8_INLINE T* GetFromGC() const { return Get(); } friend class cppgc::subtle::HeapConsistency; + template + friend class cppgc::subtle::TaggedUncompressedMember; 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 6eb1c659267d96..a86a063ed5e05c 100644 --- a/deps/v8/include/cppgc/persistent.h +++ b/deps/v8/include/cppgc/persistent.h @@ -58,20 +58,20 @@ class BasicPersistent final : public PersistentBase, // Null-state/sentinel constructors. BasicPersistent( // NOLINT - const SourceLocation& loc = SourceLocation::Current()) + SourceLocation loc = SourceLocation::Current()) : LocationPolicy(loc) {} BasicPersistent(std::nullptr_t, // NOLINT - const SourceLocation& loc = SourceLocation::Current()) + SourceLocation loc = SourceLocation::Current()) : LocationPolicy(loc) {} BasicPersistent( // NOLINT - SentinelPointer s, const SourceLocation& loc = SourceLocation::Current()) + SentinelPointer s, SourceLocation loc = SourceLocation::Current()) : PersistentBase(s), LocationPolicy(loc) {} // Raw value constructors. BasicPersistent(T* raw, // NOLINT - const SourceLocation& loc = SourceLocation::Current()) + SourceLocation loc = SourceLocation::Current()) : PersistentBase(raw), LocationPolicy(loc) { if (!IsValid()) return; SetNode(WeaknessPolicy::GetPersistentRegion(GetValue()) @@ -80,30 +80,29 @@ class BasicPersistent final : public PersistentBase, } BasicPersistent(T& raw, // NOLINT - const SourceLocation& loc = SourceLocation::Current()) + SourceLocation loc = SourceLocation::Current()) : BasicPersistent(&raw, loc) {} // Copy ctor. BasicPersistent(const BasicPersistent& other, - const SourceLocation& loc = SourceLocation::Current()) + SourceLocation loc = SourceLocation::Current()) : BasicPersistent(other.Get(), loc) {} // Heterogeneous ctor. template ::value>> + typename = std::enable_if_t>> // NOLINTNEXTLINE BasicPersistent( const BasicPersistent& other, - const SourceLocation& loc = SourceLocation::Current()) + SourceLocation loc = SourceLocation::Current()) : BasicPersistent(other.Get(), loc) {} // Move ctor. The heterogeneous move ctor is not supported since e.g. // persistent can't reuse persistent node from weak persistent. - BasicPersistent( - BasicPersistent&& other, - const SourceLocation& loc = SourceLocation::Current()) noexcept + BasicPersistent(BasicPersistent&& other, + SourceLocation loc = SourceLocation::Current()) noexcept : PersistentBase(std::move(other)), LocationPolicy(std::move(other)) { if (!IsValid()) return; GetNode()->UpdateOwner(this); @@ -116,12 +115,12 @@ class BasicPersistent final : public PersistentBase, template ::value>> + typename = std::enable_if_t>> // NOLINTNEXTLINE BasicPersistent(const internal::BasicMember< U, MemberBarrierPolicy, MemberWeaknessTag, MemberCheckingPolicy, MemberStorageType>& member, - const SourceLocation& loc = SourceLocation::Current()) + SourceLocation loc = SourceLocation::Current()) : BasicPersistent(member.Get(), loc) {} ~BasicPersistent() { Clear(); } @@ -133,7 +132,7 @@ class BasicPersistent final : public PersistentBase, template ::value>> + typename = std::enable_if_t>> BasicPersistent& operator=( const BasicPersistent& other) { @@ -158,7 +157,7 @@ class BasicPersistent final : public PersistentBase, template ::value>> + typename = std::enable_if_t>> BasicPersistent& operator=( const internal::BasicMember& diff --git a/deps/v8/include/cppgc/platform.h b/deps/v8/include/cppgc/platform.h index 917fa25e064c56..8e19272f58bb84 100644 --- a/deps/v8/include/cppgc/platform.h +++ b/deps/v8/include/cppgc/platform.h @@ -165,7 +165,7 @@ V8_EXPORT void ShutdownProcess(); namespace internal { V8_EXPORT void Fatal(const std::string& reason = std::string(), - const SourceLocation& = SourceLocation::Current()); + SourceLocation = SourceLocation::Current()); } // namespace internal diff --git a/deps/v8/include/cppgc/tagged-member.h b/deps/v8/include/cppgc/tagged-member.h index 7a2dfbb4c790c0..b100a54a55c2c8 100644 --- a/deps/v8/include/cppgc/tagged-member.h +++ b/deps/v8/include/cppgc/tagged-member.h @@ -6,6 +6,7 @@ #define INCLUDE_CPPGC_TAGGED_MEMBER_H_ #include +#include #include #include @@ -28,7 +29,7 @@ namespace cppgc::subtle { // TaggedUncompressedMember // m(ParentTag{}, parent); template -struct TaggedUncompressedMember final { +class TaggedUncompressedMember final { CPPGC_DISALLOW_NEW(); static constexpr uintptr_t kTagBit = 0b1; static_assert(kTagBit < internal::api_constants::kAllocationGranularity, @@ -98,7 +99,9 @@ struct TaggedUncompressedMember final { // Construct an untagged pointer and pass it to Visitor::Trace(). The plugin // would warn that ptr_ is untraced, which is why CPPGC_PLUGIN_IGNORE is // used. - UncompressedMember temp(GetUntagged()); + auto* untagged = reinterpret_cast( + reinterpret_cast(ptr_.GetRawAtomic()) & ~kTagBit); + UncompressedMember temp(untagged); v->Trace(temp); } diff --git a/deps/v8/include/cppgc/trace-trait.h b/deps/v8/include/cppgc/trace-trait.h index 5fc863d2ebbac5..9b768a15290fab 100644 --- a/deps/v8/include/cppgc/trace-trait.h +++ b/deps/v8/include/cppgc/trace-trait.h @@ -23,8 +23,7 @@ using TraceRootCallback = void (*)(RootVisitor&, const void* object); // Implementation of the default TraceTrait handling GarbageCollected and // GarbageCollectedMixin. template ::type>> + bool = IsGarbageCollectedMixinTypeV>> struct TraceTraitImpl; } // namespace internal diff --git a/deps/v8/include/cppgc/visitor.h b/deps/v8/include/cppgc/visitor.h index e0b1d19beb35ac..765d9b137af484 100644 --- a/deps/v8/include/cppgc/visitor.h +++ b/deps/v8/include/cppgc/visitor.h @@ -91,7 +91,7 @@ class V8_EXPORT Visitor { */ template void Trace(const Member& member) { - const T* value = member.GetRawAtomic(); + const T* value = member.GetAtomic(); CPPGC_DCHECK(value != kSentinelPointer); TraceImpl(value); } @@ -109,7 +109,7 @@ class V8_EXPORT Visitor { static_assert(!internal::IsAllocatedOnCompactableSpace::value, "Weak references to compactable objects are not allowed"); - const T* value = weak_member.GetRawAtomic(); + const T* value = weak_member.GetAtomic(); // Bailout assumes that WeakMember emits write barrier. if (!value) { @@ -129,7 +129,7 @@ class V8_EXPORT Visitor { */ template void Trace(const subtle::UncompressedMember& member) { - const T* value = member.GetRawAtomic(); + const T* value = member.GetAtomic(); CPPGC_DCHECK(value != kSentinelPointer); TraceImpl(value); } @@ -232,12 +232,12 @@ class V8_EXPORT Visitor { template void TraceEphemeron(const WeakMember& weak_member_key, const Member* member_value) { - const KeyType* key = weak_member_key.GetRawAtomic(); + const KeyType* key = weak_member_key.GetAtomic(); if (!key) return; // `value` must always be non-null. CPPGC_DCHECK(member_value); - const ValueType* value = member_value->GetRawAtomic(); + const ValueType* value = member_value->GetAtomic(); if (!value) return; // KeyType and ValueType may refer to GarbageCollectedMixin. @@ -267,7 +267,7 @@ class V8_EXPORT Visitor { const ValueType* value) { static_assert(!IsGarbageCollectedOrMixinTypeV, "garbage-collected types must use WeakMember and Member"); - const KeyType* key = weak_member_key.GetRawAtomic(); + const KeyType* key = weak_member_key.GetAtomic(); if (!key) return; // `value` must always be non-null. @@ -293,7 +293,7 @@ class V8_EXPORT Visitor { */ template void TraceStrongly(const WeakMember& weak_member) { - const T* value = weak_member.GetRawAtomic(); + const T* value = weak_member.GetAtomic(); CPPGC_DCHECK(value != kSentinelPointer); TraceImpl(value); } @@ -369,6 +369,11 @@ class V8_EXPORT Visitor { return false; } + /** + * Checks whether the visitor is running concurrently to the mutator or not. + */ + virtual bool IsConcurrent() const { return false; } + protected: virtual void Visit(const void* self, TraceDescriptor) {} virtual void VisitWeak(const void* self, TraceDescriptor, WeakCallback, @@ -497,9 +502,9 @@ class V8_EXPORT RootVisitor { } protected: - virtual void VisitRoot(const void*, TraceDescriptor, const SourceLocation&) {} + virtual void VisitRoot(const void*, TraceDescriptor, SourceLocation) {} virtual void VisitWeakRoot(const void* self, TraceDescriptor, WeakCallback, - const void* weak_root, const SourceLocation&) {} + const void* weak_root, SourceLocation) {} private: template diff --git a/deps/v8/include/v8-array-buffer.h b/deps/v8/include/v8-array-buffer.h index 1d93457628cf0c..3e64ece5debda3 100644 --- a/deps/v8/include/v8-array-buffer.h +++ b/deps/v8/include/v8-array-buffer.h @@ -198,7 +198,7 @@ class V8_EXPORT ArrayBuffer : public Object { * Convenience allocator. * * When the sandbox is enabled, this allocator will allocate its backing - * memory inside the sandbox that belongs to passed isolate group. + * memory inside the sandbox that belongs to the passed isolate group. * Otherwise, it will rely on malloc/free. * * Caller takes ownership, i.e. the returned object needs to be freed using diff --git a/deps/v8/include/v8-callbacks.h b/deps/v8/include/v8-callbacks.h index a9f380e38abdde..920e4e25f10cdc 100644 --- a/deps/v8/include/v8-callbacks.h +++ b/deps/v8/include/v8-callbacks.h @@ -324,6 +324,9 @@ using WasmLoadSourceMapCallback = Local (*)(Isolate* isolate, // --- Callback for checking if WebAssembly imported strings are enabled --- using WasmImportedStringsEnabledCallback = bool (*)(Local context); +// --- Callback for checking if WebAssembly Custom Descriptors are enabled --- +using WasmCustomDescriptorsEnabledCallback = bool (*)(Local context); + // --- Callback for checking if the SharedArrayBuffer constructor is enabled --- using SharedArrayBufferConstructorEnabledCallback = bool (*)(Local context); diff --git a/deps/v8/include/v8-context.h b/deps/v8/include/v8-context.h index 43dadadeabff59..c93c5652c502f5 100644 --- a/deps/v8/include/v8-context.h +++ b/deps/v8/include/v8-context.h @@ -256,6 +256,9 @@ class V8_EXPORT Context : public Data { Maybe DeepFreeze(DeepFreezeDelegate* delegate = nullptr); /** Returns the isolate associated with a current context. */ + V8_DEPRECATED( + "Use Isolate::GetCurrent() instead, which is guaranteed to return the " + "same isolate since https://crrev.com/c/6458560.") Isolate* GetIsolate(); /** Returns the microtask queue associated with a current context. */ @@ -311,8 +314,14 @@ class V8_EXPORT Context : public Data { * index, growing the data as needed. Note that index 0 currently has a * special meaning for Chrome's debugger. */ + V8_DEPRECATE_SOON( + "Use SetAlignedPointerInEmbedderData with EmbedderDataTypeTag parameter " + "instead.") void SetAlignedPointerInEmbedderData(int index, void* value); + void SetAlignedPointerInEmbedderData(int index, void* value, + EmbedderDataTypeTag slot); + /** * Control whether code generation from strings is allowed. Calling * this method with false will disable 'eval' and the 'Function' @@ -451,8 +460,7 @@ Local Context::GetEmbedderData(int index) { value = I::DecompressTaggedField(embedder_data, static_cast(value)); #endif - auto isolate = reinterpret_cast( - internal::IsolateFromNeverReadOnlySpaceObject(ctx)); + auto* isolate = I::GetCurrentIsolate(); return Local::New(isolate, value); #else return SlowGetEmbedderData(index); @@ -470,7 +478,8 @@ void* Context::GetAlignedPointerFromEmbedderData(Isolate* isolate, int index) { (I::kEmbedderDataSlotSize * index) + I::kEmbedderDataSlotExternalPointerOffset; return reinterpret_cast( - I::ReadExternalPointerField( + I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag, + internal::kLastEmbedderDataTag}>( isolate, embedder_data, value_offset)); #else return SlowGetAlignedPointerFromEmbedderData(index); @@ -487,9 +496,10 @@ void* Context::GetAlignedPointerFromEmbedderData(int index) { int value_offset = I::kEmbedderDataArrayHeaderSize + (I::kEmbedderDataSlotSize * index) + I::kEmbedderDataSlotExternalPointerOffset; - Isolate* isolate = I::GetIsolateForSandbox(ctx); + Isolate* isolate = I::GetCurrentIsolateForSandbox(); return reinterpret_cast( - I::ReadExternalPointerField( + I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag, + internal::kLastEmbedderDataTag}>( isolate, embedder_data, value_offset)); #else return SlowGetAlignedPointerFromEmbedderData(index); diff --git a/deps/v8/include/v8-debug.h b/deps/v8/include/v8-debug.h index 23b392c7dca0b1..0aff8b9e675e8a 100644 --- a/deps/v8/include/v8-debug.h +++ b/deps/v8/include/v8-debug.h @@ -172,6 +172,17 @@ class V8_EXPORT StackTrace { * a stack trace. */ static Local CurrentScriptNameOrSourceURL(Isolate* isolate); + + /** + * Returns the first valid script id at the top of + * the JS stack. The returned value is Message::kNoScriptIdInfo if no id + * was found. + * + * This method is equivalent to calling StackTrace::CurrentStackTrace and + * walking the resulting frames from the beginning until a non-empty id is + * found. The difference is that this method won't allocate a stack trace. + */ + static int CurrentScriptId(Isolate* isolate); }; } // namespace v8 diff --git a/deps/v8/include/v8-fast-api-calls.h b/deps/v8/include/v8-fast-api-calls.h index 4ffaf2d44a50fd..7f70eee2d542a6 100644 --- a/deps/v8/include/v8-fast-api-calls.h +++ b/deps/v8/include/v8-fast-api-calls.h @@ -93,27 +93,11 @@ * } * }; * - * // TODO(mslekova): Clean-up these constants - * // The constants kV8EmbedderWrapperTypeIndex and - * // kV8EmbedderWrapperObjectIndex describe the offsets for the type info - * // struct and the native object, when expressed as internal field indices - * // within a JSObject. The existance of this helper function assumes that - * // all embedder objects have their JSObject-side type info at the same - * // offset, but this is not a limitation of the API itself. For a detailed - * // use case, see the third example. - * static constexpr int kV8EmbedderWrapperTypeIndex = 0; - * static constexpr int kV8EmbedderWrapperObjectIndex = 1; - * * // The following setup function can be templatized based on * // the {embedder_object} argument. * void SetupCustomEmbedderObject(v8::Isolate* isolate, * v8::Local context, * CustomEmbedderType* embedder_object) { - * isolate->set_embedder_wrapper_type_index( - * kV8EmbedderWrapperTypeIndex); - * isolate->set_embedder_wrapper_object_index( - * kV8EmbedderWrapperObjectIndex); - * * v8::CFunction c_func = * MakeV8CFunction(CustomEmbedderType::FastMethod); * @@ -235,7 +219,6 @@ namespace v8 { class Isolate; -START_ALLOW_USE_DEPRECATED() class CTypeInfo { public: enum class Type : uint8_t { @@ -269,14 +252,6 @@ class CTypeInfo { // than any valid Type enum. static constexpr Type kCallbackOptionsType = Type(255); - enum class V8_DEPRECATE_SOON( - "There is no special support in V8 anymore, there is no need to" - "use a SequenceType") SequenceType : uint8_t { - kScalar, - kIsSequence, // sequence - kIsArrayBuffer // ArrayBuffer - }; - enum class Flags : uint8_t { kNone = 0, kAllowSharedBit = 1 << 0, // Must be an ArrayBuffer or TypedArray @@ -286,27 +261,18 @@ class CTypeInfo { }; explicit constexpr CTypeInfo(Type type, Flags flags = Flags::kNone) - : type_(type), sequence_type_(SequenceType::kScalar), flags_(flags) {} - - V8_DEPRECATE_SOON("Use CTypeInfo(Type, Flags) instead") - constexpr CTypeInfo(Type type, SequenceType sequence_type, - Flags flags = Flags::kNone) - : type_(type), sequence_type_(sequence_type), flags_(flags) {} + : type_(type), flags_(flags) {} typedef uint32_t Identifier; explicit constexpr CTypeInfo(Identifier identifier) - : CTypeInfo(static_cast(identifier >> 16), - static_cast((identifier >> 8) & 255), - static_cast(identifier & 255)) {} + : type_(static_cast((identifier >> 8) & 255)), + flags_(static_cast(identifier & 255)) {} constexpr Identifier GetId() const { - return static_cast(type_) << 16 | - static_cast(sequence_type_) << 8 | + return static_cast(type_) << 8 | static_cast(flags_); } constexpr Type GetType() const { return type_; } - V8_DEPRECATE_SOON("Use the constant SequenceType::kScalar instead") - constexpr SequenceType GetSequenceType() const { return sequence_type_; } constexpr Flags GetFlags() const { return flags_; } static constexpr bool IsIntegralType(Type type) { @@ -326,10 +292,8 @@ class CTypeInfo { private: Type type_; - SequenceType sequence_type_; Flags flags_; }; -END_ALLOW_USE_DEPRECATED() struct FastOneByteString { const char* data; @@ -714,8 +678,7 @@ class CFunctionBuilderWithFunction { // Flags in the template parameter pack are ignored. template struct GetArgBuilder { - using type = - typename std::tuple_element>::type; + using type = std::tuple_element_t>; }; // Returns an ArgBuilder with the same base type as the one at index N, @@ -723,10 +686,8 @@ class CFunctionBuilderWithFunction { template struct GetArgBuilder { using type = CTypeInfoBuilder< - typename std::tuple_element>::type::BaseType, - std::tuple_element>::type::Build() - .GetFlags(), + typename std::tuple_element_t>::BaseType, + std::tuple_element_t>::Build().GetFlags(), Flags...>; }; diff --git a/deps/v8/include/v8-function-callback.h b/deps/v8/include/v8-function-callback.h index 09213431c9200d..0dad94ce22c270 100644 --- a/deps/v8/include/v8-function-callback.h +++ b/deps/v8/include/v8-function-callback.h @@ -42,7 +42,7 @@ class ReturnValue { public: template V8_INLINE ReturnValue(const ReturnValue& that) : value_(that.value_) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); } // Handle-based setters. template @@ -66,12 +66,12 @@ class ReturnValue { V8_INLINE void Set(uint16_t i); V8_INLINE void Set(uint32_t i); V8_INLINE void Set(uint64_t i); - // Fast JS primitive setters + // Fast JS primitive setters. V8_INLINE void SetNull(); V8_INLINE void SetUndefined(); V8_INLINE void SetFalse(); V8_INLINE void SetEmptyString(); - // Convenience getter for Isolate + // Convenience getter for the Isolate. V8_INLINE Isolate* GetIsolate() const; // Pointer setter: Uncompilable to prevent inadvertent misuse. @@ -250,7 +250,7 @@ class PropertyCallbackInfo { * * \note For security reasons, do not pass the object back into the runtime. */ - V8_DEPRECATE_SOON( + V8_DEPRECATED( "V8 will stop providing access to hidden prototype (i.e. " "JSGlobalObject). Use HolderV2() instead. \n" "DO NOT try to workaround this by accessing JSGlobalObject via " @@ -335,7 +335,7 @@ void ReturnValue::SetInternal(internal::Address value) { template template void ReturnValue::Set(const Global& handle) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); if (V8_UNLIKELY(handle.IsEmpty())) { SetDefaultValue(); } else { @@ -346,7 +346,7 @@ void ReturnValue::Set(const Global& handle) { template template void ReturnValue::SetNonEmpty(const Global& handle) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); #ifdef V8_ENABLE_CHECKS internal::VerifyHandleIsNonEmpty(handle.IsEmpty()); #endif // V8_ENABLE_CHECKS @@ -356,7 +356,7 @@ void ReturnValue::SetNonEmpty(const Global& handle) { template template void ReturnValue::Set(const BasicTracedReference& handle) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); if (V8_UNLIKELY(handle.IsEmpty())) { SetDefaultValue(); } else { @@ -367,7 +367,7 @@ void ReturnValue::Set(const BasicTracedReference& handle) { template template void ReturnValue::SetNonEmpty(const BasicTracedReference& handle) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); #ifdef V8_ENABLE_CHECKS internal::VerifyHandleIsNonEmpty(handle.IsEmpty()); #endif // V8_ENABLE_CHECKS @@ -380,16 +380,16 @@ void ReturnValue::Set(const Local handle) { // "V8_DEPRECATE_SOON" this method if |T| is |void|. #ifdef V8_IMMINENT_DEPRECATION_WARNINGS static constexpr bool is_allowed_void = false; - static_assert(!std::is_void::value, + static_assert(!std::is_void_v, "ReturnValue::Set(const Local) is deprecated. " "Do nothing to indicate that the operation succeeded or use " "SetFalse() to indicate that the operation failed (don't " "forget to handle info.ShouldThrowOnError()). " "See http://crbug.com/348660658 for details."); #else - static constexpr bool is_allowed_void = std::is_void::value; + static constexpr bool is_allowed_void = std::is_void_v; #endif // V8_IMMINENT_DEPRECATION_WARNINGS - static_assert(is_allowed_void || std::is_base_of::value, "type check"); + static_assert(is_allowed_void || std::is_base_of_v, "type check"); if (V8_UNLIKELY(handle.IsEmpty())) { SetDefaultValue(); } else if constexpr (is_allowed_void) { @@ -407,16 +407,16 @@ void ReturnValue::SetNonEmpty(const Local handle) { // "V8_DEPRECATE_SOON" this method if |T| is |void|. #ifdef V8_IMMINENT_DEPRECATION_WARNINGS static constexpr bool is_allowed_void = false; - static_assert(!std::is_void::value, + static_assert(!std::is_void_v, "ReturnValue::SetNonEmpty(const Local) is deprecated. " "Do nothing to indicate that the operation succeeded or use " "SetFalse() to indicate that the operation failed (don't " "forget to handle info.ShouldThrowOnError()). " "See http://crbug.com/348660658 for details."); #else - static constexpr bool is_allowed_void = std::is_void::value; + static constexpr bool is_allowed_void = std::is_void_v; #endif // V8_IMMINENT_DEPRECATION_WARNINGS - static_assert(is_allowed_void || std::is_base_of::value, "type check"); + static_assert(is_allowed_void || std::is_base_of_v, "type check"); #ifdef V8_ENABLE_CHECKS internal::VerifyHandleIsNonEmpty(handle.IsEmpty()); #endif // V8_ENABLE_CHECKS @@ -431,13 +431,13 @@ void ReturnValue::SetNonEmpty(const Local handle) { template void ReturnValue::Set(double i) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); SetNonEmpty(Number::New(GetIsolate(), i)); } template void ReturnValue::Set(int16_t i) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); using I = internal::Internals; static_assert(I::IsValidSmi(std::numeric_limits::min())); static_assert(I::IsValidSmi(std::numeric_limits::max())); @@ -446,7 +446,7 @@ void ReturnValue::Set(int16_t i) { template void ReturnValue::Set(int32_t i) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); if (const auto result = internal::Internals::TryIntegralToSmi(i)) { SetInternal(*result); return; @@ -456,7 +456,7 @@ void ReturnValue::Set(int32_t i) { template void ReturnValue::Set(int64_t i) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); if (const auto result = internal::Internals::TryIntegralToSmi(i)) { SetInternal(*result); return; @@ -466,7 +466,7 @@ void ReturnValue::Set(int64_t i) { template void ReturnValue::Set(uint16_t i) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); using I = internal::Internals; static_assert(I::IsValidSmi(std::numeric_limits::min())); static_assert(I::IsValidSmi(std::numeric_limits::max())); @@ -475,7 +475,7 @@ void ReturnValue::Set(uint16_t i) { template void ReturnValue::Set(uint32_t i) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); if (const auto result = internal::Internals::TryIntegralToSmi(i)) { SetInternal(*result); return; @@ -485,7 +485,7 @@ void ReturnValue::Set(uint32_t i) { template void ReturnValue::Set(uint64_t i) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); if (const auto result = internal::Internals::TryIntegralToSmi(i)) { SetInternal(*result); return; @@ -495,7 +495,7 @@ void ReturnValue::Set(uint64_t i) { template void ReturnValue::Set(bool value) { - static_assert(std::is_void::value || std::is_base_of::value, + static_assert(std::is_void_v || std::is_base_of_v, "type check"); using I = internal::Internals; #if V8_STATIC_ROOTS_BOOL @@ -535,7 +535,7 @@ void ReturnValue::SetDefaultValue() { template void ReturnValue::SetNull() { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); using I = internal::Internals; #if V8_STATIC_ROOTS_BOOL #ifdef V8_ENABLE_CHECKS @@ -550,7 +550,7 @@ void ReturnValue::SetNull() { template void ReturnValue::SetUndefined() { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); using I = internal::Internals; #if V8_STATIC_ROOTS_BOOL #ifdef V8_ENABLE_CHECKS @@ -565,7 +565,7 @@ void ReturnValue::SetUndefined() { template void ReturnValue::SetFalse() { - static_assert(std::is_void::value || std::is_base_of::value, + static_assert(std::is_void_v || std::is_base_of_v, "type check"); using I = internal::Internals; #if V8_STATIC_ROOTS_BOOL @@ -581,7 +581,7 @@ void ReturnValue::SetFalse() { template void ReturnValue::SetEmptyString() { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); using I = internal::Internals; #if V8_STATIC_ROOTS_BOOL #ifdef V8_ENABLE_CHECKS diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index 66bb4b7d233cc2..5f006948716a8b 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -237,6 +237,12 @@ using SandboxedPointer_t = Address; // virtual address space for userspace. As such, limit the sandbox to 128GB (a // quarter of the total available address space). constexpr size_t kSandboxSizeLog2 = 37; // 128 GB +#elif defined(V8_TARGET_OS_IOS) +// On iOS, we only get 64 GB of usable virtual address space even with the +// "jumbo" extended virtual addressing entitlement. Limit the sandbox size to +// 16 GB so that the base address + size for the emulated virtual address space +// lies within the 64 GB total virtual address space. +constexpr size_t kSandboxSizeLog2 = 34; // 16 GB #else // Everywhere else use a 1TB sandbox. constexpr size_t kSandboxSizeLog2 = 40; // 1 TB @@ -415,6 +421,11 @@ constexpr size_t kMaxCppHeapPointers = 0; #endif // V8_COMPRESS_POINTERS +// The number of tags reserved for embedder data. The value is picked +// arbitrarily. In Chrome there are 4 embedders, so at least 4 tags are needed. +// A generic tag was used for embedder data before, so one tag is used for that. +#define V8_EMBEDDER_DATA_TAG_COUNT 5 + // Generic tag range struct to represent ranges of type tags. // // When referencing external objects via pointer tables, type tags are @@ -551,7 +562,11 @@ enum ExternalPointerTag : uint16_t { // External pointers using these tags are kept in a per-Isolate external // pointer table and can only be accessed when this Isolate is active. kNativeContextMicrotaskQueueTag, - kEmbedderDataSlotPayloadTag, + + // Placeholders for embedder data. + kFirstEmbedderDataTag, + kLastEmbedderDataTag = kFirstEmbedderDataTag + V8_EMBEDDER_DATA_TAG_COUNT - 1, + kEmbedderDataSlotPayloadTag = kLastEmbedderDataTag, // This tag essentially stands for a `void*` pointer in the V8 API, and it is // the Embedder's responsibility to ensure type safety (against substitution) // and lifetime validity of these objects. @@ -582,11 +597,7 @@ enum ExternalPointerTag : uint16_t { kLastMaybeReadOnlyExternalPointerTag = kLastInterceptorInfoExternalPointerTag, - kWasmInternalFunctionCallTargetTag, - kWasmTypeInfoNativeTypeTag, - kWasmExportedFunctionDataSignatureTag, kWasmStackMemoryTag, - kWasmIndirectFunctionTargetTag, // Foreigns kFirstForeignExternalPointerTag, @@ -620,6 +631,14 @@ enum ExternalPointerTag : uint16_t { kIcuLocalizedNumberFormatterTag, kIcuPluralRulesTag, kIcuCollatorTag, + kTemporalDurationTag, + kTemporalInstantTag, + kTemporalPlainDateTag, + kTemporalPlainTimeTag, + kTemporalPlainDateTimeTag, + kTemporalPlainYearMonthTag, + kTemporalPlainMonthDayTag, + kTemporalZonedDateTimeTag, kDisplayNamesInternalTag, kD8WorkerTag, kD8ModuleEmbedderDataTag, @@ -690,7 +709,8 @@ V8_INLINE static constexpr bool IsManagedExternalPointerType( V8_INLINE static constexpr bool ExternalPointerCanBeEmpty( ExternalPointerTagRange tag_range) { return tag_range.Contains(kArrayBufferExtensionTag) || - tag_range.Contains(kEmbedderDataSlotPayloadTag) || + (tag_range.first <= kLastEmbedderDataTag && + kFirstEmbedderDataTag <= tag_range.last) || kAnyInterceptorInfoExternalPointerTagRange.Contains(tag_range); } @@ -815,12 +835,33 @@ constexpr bool kAllCodeObjectsLiveInTrustedSpace = // {obj} must be the raw tagged pointer representation of a HeapObject // that's guaranteed to never be in ReadOnlySpace. +V8_DEPRECATE_SOON( + "Use GetCurrentIsolate() instead, which is guaranteed to return the same " + "isolate since https://crrev.com/c/6458560.") V8_EXPORT internal::Isolate* IsolateFromNeverReadOnlySpaceObject(Address obj); // Returns if we need to throw when an error occurs. This infers the language // mode based on the current context and the closure. This returns true if the // language mode is strict. V8_EXPORT bool ShouldThrowOnError(internal::Isolate* isolate); + +struct HandleScopeData final { + static constexpr uint32_t kSizeInBytes = + 2 * kApiSystemPointerSize + 2 * kApiInt32Size; + + Address* next; + Address* limit; + int level; + int sealed_level; + + void Initialize() { + next = limit = nullptr; + sealed_level = level = 0; + } +}; + +static_assert(HandleScopeData::kSizeInBytes == sizeof(HandleScopeData)); + /** * This class exports constants and functionality from within v8 that * is necessary to implement inline functions in the v8 api. Don't @@ -874,14 +915,19 @@ class Internals { static const int kBuiltinTier0EntryTableSize = 7 * kApiSystemPointerSize; static const int kBuiltinTier0TableSize = 7 * kApiSystemPointerSize; static const int kLinearAllocationAreaSize = 3 * kApiSystemPointerSize; - static const int kThreadLocalTopSize = 30 * kApiSystemPointerSize; + static const int kThreadLocalTopSize = 29 * kApiSystemPointerSize; static const int kHandleScopeDataSize = 2 * kApiSystemPointerSize + 2 * kApiInt32Size; // ExternalPointerTable and TrustedPointerTable layout guarantees. static const int kExternalPointerTableBasePointerOffset = 0; - static const int kExternalPointerTableSize = 2 * kApiSystemPointerSize; - static const int kTrustedPointerTableSize = 2 * kApiSystemPointerSize; + static const int kSegmentedTableSegmentPoolSize = 4; + static const int kExternalPointerTableSize = + 4 * kApiSystemPointerSize + + kSegmentedTableSegmentPoolSize * sizeof(uint32_t); + static const int kTrustedPointerTableSize = + 4 * kApiSystemPointerSize + + kSegmentedTableSegmentPoolSize * sizeof(uint32_t); static const int kTrustedPointerTableBasePointerOffset = 0; // IsolateData layout guarantees. @@ -901,12 +947,14 @@ class Internals { kBuiltinTier0TableOffset + kBuiltinTier0TableSize; static const int kOldAllocationInfoOffset = kNewAllocationInfoOffset + kLinearAllocationAreaSize; + static const int kLastYoungAllocationOffset = + kOldAllocationInfoOffset + kApiSystemPointerSize; static const int kFastCCallAlignmentPaddingSize = kApiSystemPointerSize == 8 ? 5 * kApiSystemPointerSize : 1 * kApiSystemPointerSize; static const int kIsolateFastCCallCallerPcOffset = - kOldAllocationInfoOffset + kLinearAllocationAreaSize + + kLastYoungAllocationOffset + kLinearAllocationAreaSize + kFastCCallAlignmentPaddingSize; static const int kIsolateFastCCallCallerFpOffset = kIsolateFastCCallCallerPcOffset + kApiSystemPointerSize; @@ -948,8 +996,10 @@ class Internals { static const int kIsolateApiCallbackThunkArgumentOffset = kIsolateEmbedderDataOffset + kNumIsolateDataSlots * kApiSystemPointerSize; #endif // V8_COMPRESS_POINTERS - static const int kIsolateRegexpExecVectorArgumentOffset = + static const int kJSDispatchTableOffset = kIsolateApiCallbackThunkArgumentOffset + kApiSystemPointerSize; + static const int kIsolateRegexpExecVectorArgumentOffset = + kJSDispatchTableOffset + kApiSystemPointerSize; static const int kContinuationPreservedEmbedderDataOffset = kIsolateRegexpExecVectorArgumentOffset + kApiSystemPointerSize; static const int kIsolateRootsOffset = @@ -962,16 +1012,32 @@ class Internals { #if V8_STATIC_ROOTS_BOOL // These constants are copied from static-roots.h and guarded by static asserts. -#define EXPORTED_STATIC_ROOTS_PTR_LIST(V) \ - V(UndefinedValue, 0x11) \ - V(NullValue, 0x2d) \ - V(TrueValue, 0x71) \ - V(FalseValue, 0x55) \ - V(EmptyString, 0x49) \ - V(TheHoleValue, 0x761) +#define EXPORTED_STATIC_ROOTS_PTR_LIST(V) \ + V(UndefinedValue, 0x11) \ + V(NullValue, 0x2d) \ + V(TrueValue, 0x71) \ + V(FalseValue, 0x55) \ + V(EmptyString, 0x49) \ + /* The Hole moves around depending on build flags, so define it */ \ + /* separately inside StaticReadOnlyRoot using build macros */ \ + V(TheHoleValue, kBuildDependentTheHoleValue) using Tagged_t = uint32_t; struct StaticReadOnlyRoot { +#ifdef V8_ENABLE_WEBASSEMBLY +#ifdef V8_INTL_SUPPORT + static constexpr Tagged_t kBuildDependentTheHoleValue = 0x67b9; +#else + static constexpr Tagged_t kBuildDependentTheHoleValue = 0x5b1d; +#endif +#else +#ifdef V8_INTL_SUPPORT + static constexpr Tagged_t kBuildDependentTheHoleValue = 0x6511; +#else + static constexpr Tagged_t kBuildDependentTheHoleValue = 0x5875; +#endif +#endif + #define DEF_ROOT(name, value) static constexpr Tagged_t k##name = value; EXPORTED_STATIC_ROOTS_PTR_LIST(DEF_ROOT) #undef DEF_ROOT @@ -988,12 +1054,12 @@ class Internals { #endif // V8_STATIC_ROOTS_BOOL - static const int kUndefinedValueRootIndex = 4; - static const int kTheHoleValueRootIndex = 5; - static const int kNullValueRootIndex = 6; - static const int kTrueValueRootIndex = 7; - static const int kFalseValueRootIndex = 8; - static const int kEmptyStringRootIndex = 9; + static const int kUndefinedValueRootIndex = 0; + static const int kTheHoleValueRootIndex = 1; + static const int kNullValueRootIndex = 2; + static const int kTrueValueRootIndex = 3; + static const int kFalseValueRootIndex = 4; + static const int kEmptyStringRootIndex = 5; static const int kNodeClassIdOffset = 1 * kApiSystemPointerSize; static const int kNodeFlagsOffset = 1 * kApiSystemPointerSize + 3; @@ -1170,6 +1236,12 @@ class Internals { return *reinterpret_cast(addr); } + V8_INLINE static HandleScopeData* GetHandleScopeData(v8::Isolate* isolate) { + Address addr = + reinterpret_cast
(isolate) + kIsolateHandleScopeDataOffset; + return reinterpret_cast(addr); + } + V8_INLINE static void IncrementLongTasksStatsCounter(v8::Isolate* isolate) { Address addr = reinterpret_cast
(isolate) + kIsolateLongTaskStatsCounterOffset; @@ -1222,7 +1294,7 @@ class Internals { V8_INLINE static T ReadRawField(Address heap_object_ptr, int offset) { Address addr = heap_object_ptr + offset - kHeapObjectTag; #ifdef V8_COMPRESS_POINTERS - if (sizeof(T) > kApiTaggedSize) { + if constexpr (sizeof(T) > kApiTaggedSize) { // TODO(ishell, v8:8875): When pointer compression is enabled 8-byte size // fields (external pointers, doubles and BigInt data) are only // kTaggedSize aligned so we have to use unaligned pointer friendly way of @@ -1256,10 +1328,25 @@ class Internals { #endif } + V8_DEPRECATED( + "Use GetCurrentIsolateForSandbox() instead, which is guaranteed to " + "return the same isolate since https://crrev.com/c/6458560.") V8_INLINE static v8::Isolate* GetIsolateForSandbox(Address obj) { #ifdef V8_ENABLE_SANDBOX - return reinterpret_cast( - internal::IsolateFromNeverReadOnlySpaceObject(obj)); + return GetCurrentIsolate(); +#else + // Not used in non-sandbox mode. + return nullptr; +#endif + } + + // Returns v8::Isolate::Current(), but without needing to include the + // v8-isolate.h header. + V8_EXPORT static v8::Isolate* GetCurrentIsolate(); + + V8_INLINE static v8::Isolate* GetCurrentIsolateForSandbox() { +#ifdef V8_ENABLE_SANDBOX + return GetCurrentIsolate(); #else // Not used in non-sandbox mode. return nullptr; @@ -1334,8 +1421,8 @@ void CastCheck::Perform(T* data) {} template V8_INLINE void PerformCastCheck(T* data) { - CastCheck::value && - !std::is_same>::value>::Perform(data); + CastCheck && + !std::is_same_v>>::Perform(data); } // A base class for backing stores, which is needed due to vagaries of diff --git a/deps/v8/include/v8-isolate.h b/deps/v8/include/v8-isolate.h index 280c09729f8cb4..16c61f605f9909 100644 --- a/deps/v8/include/v8-isolate.h +++ b/deps/v8/include/v8-isolate.h @@ -154,6 +154,10 @@ class V8_EXPORT ResourceConstraints { initial_young_generation_size_ = initial_size; } + uint64_t physical_memory_size_in_bytes() const { + return physical_memory_size_; + } + private: static constexpr size_t kMB = 1048576u; size_t code_range_size_ = 0; @@ -161,6 +165,7 @@ class V8_EXPORT ResourceConstraints { size_t max_young_generation_size_ = 0; size_t initial_old_generation_size_ = 0; size_t initial_young_generation_size_ = 0; + uint64_t physical_memory_size_ = 0; uint32_t* stack_limit_ = nullptr; }; @@ -253,6 +258,17 @@ class V8_EXPORT IsolateGroup { return !operator==(other); } +#ifdef V8_ENABLE_SANDBOX + /** + * Whether the sandbox of the isolate group contains a given pointer. + * Will always return true if the sandbox is not enabled. + */ + bool SandboxContains(void* pointer) const; + VirtualAddressSpace* GetSandboxAddressSpace(); +#else + V8_INLINE bool SandboxContains(void* pointer) const { return true; } +#endif + private: friend class Isolate; friend class ArrayBuffer::Allocator; @@ -345,7 +361,9 @@ class V8_EXPORT Isolate { * for wrapped API objects and are used by the fast C API * (for details see v8-fast-api-calls.h). */ + V8_DEPRECATE_SOON("This field is unused.") int embedder_wrapper_type_index = -1; + V8_DEPRECATE_SOON("This field is unused.") int embedder_wrapper_object_index = -1; /** @@ -557,7 +575,8 @@ class V8_EXPORT Isolate { kBreakIteratorTypeWord = 88, kBreakIteratorTypeLine = 89, kInvalidatedArrayBufferDetachingProtector = 90, - kInvalidatedArrayConstructorProtector = 91, + kInvalidatedArrayConstructorProtector V8_DEPRECATE_SOON( + "The ArrayConstructorProtector has been removed") = 91, kInvalidatedArrayIteratorLookupChainProtector = 92, kInvalidatedArraySpeciesLookupChainProtector = 93, kInvalidatedIsConcatSpreadableLookupChainProtector = 94, @@ -575,8 +594,8 @@ class V8_EXPORT Isolate { kWasmSimdOpcodes = 106, kVarRedeclaredCatchBinding = 107, kWasmRefTypes = 108, - kOBSOLETE_WasmBulkMemory = 109, - kOBSOLETE_WasmMultiValue = 110, + kWasmBulkMemory = 109, + kWasmMultiValue = 110, kWasmExceptionHandling = 111, kInvalidatedMegaDOMProtector = 112, kFunctionPrototypeArguments = 113, @@ -634,6 +653,21 @@ class V8_EXPORT Isolate { kFloat16Array = 165, kExplicitResourceManagement = 166, kWasmBranchHinting = 167, + kWasmMutableGlobals = 168, + kUint8ArrayToFromBase64AndHex = 169, + kAtomicsPause = 170, + kTopLevelAwait = 171, + kLogicalAssignment = 172, + kNullishCoalescing = 173, + kInvalidatedNoDateTimeConfigurationChangeProtector = 174, + kWasmNonTrappingFloatToInt = 175, + kWasmSignExtensionOps = 176, + kRegExpCompile = 177, + kRegExpStaticProperties = 178, + kRegExpStaticPropertiesWithLastMatch = 179, + kWithStatement = 180, + kHtmlWrapperMethods = 181, + kWasmCustomDescriptors = 182, // If you add new values here, you'll also need to update Chromium's: // web_feature.mojom, use_counter_callback.cc, and enums.xml. V8 changes to @@ -937,14 +971,31 @@ class V8_EXPORT Isolate { * Returns the value that was set or restored by * SetContinuationPreservedEmbedderData(), if any. */ + V8_DEPRECATED("Use GetContinuationPreservedEmbedderDataV2 instead") Local GetContinuationPreservedEmbedderData(); /** * Sets a value that will be stored on continuations and reset while the * continuation runs. */ + V8_DEPRECATED("Use SetContinuationPreservedEmbedderDataV2 instead") void SetContinuationPreservedEmbedderData(Local data); + /** + * Returns the value set by `SetContinuationPreservedEmbedderDataV2()` or + * restored during microtask execution for the currently running continuation, + * if any. Returns undefiend if no continuation preserved embedder data was + * set. + */ + Local GetContinuationPreservedEmbedderDataV2(); + + /** + * Sets a value that will be stored on continuations and restored while the + * continuation runs. If `data` is empty, the continuation preserved embedder + * data is set to undefined. + */ + void SetContinuationPreservedEmbedderDataV2(Local data); + /** * Get statistics about the heap memory usage. */ @@ -1660,6 +1711,9 @@ class V8_EXPORT Isolate { void SetWasmImportedStringsEnabledCallback( WasmImportedStringsEnabledCallback callback); + void SetWasmCustomDescriptorsEnabledCallback( + WasmCustomDescriptorsEnabledCallback callback); + void SetSharedArrayBufferConstructorEnabledCallback( SharedArrayBufferConstructorEnabledCallback callback); diff --git a/deps/v8/include/v8-json.h b/deps/v8/include/v8-json.h index 23d918fc9736d8..c70f90182c4487 100644 --- a/deps/v8/include/v8-json.h +++ b/deps/v8/include/v8-json.h @@ -5,7 +5,10 @@ #ifndef INCLUDE_V8_JSON_H_ #define INCLUDE_V8_JSON_H_ +#include + #include "v8-local-handle.h" // NOLINT(build/include_directory) +#include "v8-message.h" // NOLINT(build/include_directory) #include "v8config.h" // NOLINT(build/include_directory) namespace v8 { @@ -25,10 +28,14 @@ class V8_EXPORT JSON { * * \param the context in which to parse and create the value. * \param json_string The string to parse. + * \param origin Optional script origin to use for error reporting. + * If not provided, error reporting will use default origin options + * or attempt to infer origin from the current stack. * \return The corresponding value if successfully parsed. */ static V8_WARN_UNUSED_RESULT MaybeLocal Parse( - Local context, Local json_string); + Local context, Local json_string, + std::optional origin = std::nullopt); /** * Tries to stringify the JSON-serializable object |json_object| and returns diff --git a/deps/v8/include/v8-local-handle.h b/deps/v8/include/v8-local-handle.h index dce757465c25be..bdf1a1d6ff8cb8 100644 --- a/deps/v8/include/v8-local-handle.h +++ b/deps/v8/include/v8-local-handle.h @@ -42,6 +42,7 @@ class BasicTracedReference; template class TracedReference; +class ArrayBuffer; class Boolean; class Context; class EscapableHandleScope; @@ -62,6 +63,8 @@ template class Traced; class TypecheckWitness; class Utils; +class Uint32; +class Value; namespace debug { class ConsoleCallArguments; @@ -78,6 +81,25 @@ class SamplingHeapProfiler; namespace api_internal { // Called when ToLocalChecked is called on an empty Local. V8_EXPORT void ToLocalEmpty(); + +#ifdef V8_ENABLE_CHECKS +template +void TypeCheckLocal(V* value) { + // If `T` does not provide a `Cast` method we cannot check anything. + if constexpr (requires { T::Cast(value); }) { + // TODO(419454582): Remove all these exceptions. + if (std::is_same_v && value->IsArgumentsObject()) return; + if (std::is_same_v && value->IsSharedArrayBuffer()) return; + if (std::is_same_v && value->IsNull()) return; + if (std::is_same_v && value->IsString()) return; + if (std::is_same_v && value->IsUndefined()) return; + if (std::is_same_v && value->IsInt32()) return; + if (std::is_same_v && value->IsNumber()) return; + // Execute the actual check (part of the cast). + T::Cast(value); + } +} +#endif } // namespace api_internal /** @@ -96,18 +118,16 @@ V8_EXPORT void ToLocalEmpty(); */ class V8_EXPORT V8_NODISCARD HandleScope { public: - explicit HandleScope(Isolate* isolate); + V8_INLINE explicit HandleScope(Isolate* isolate); - ~HandleScope(); + V8_INLINE ~HandleScope(); /** * Counts the number of allocated handles. */ static int NumberOfHandles(Isolate* isolate); - V8_INLINE Isolate* GetIsolate() const { - return reinterpret_cast(i_isolate_); - } + V8_INLINE Isolate* GetIsolate() const { return isolate_; } HandleScope(const HandleScope&) = delete; void operator=(const HandleScope&) = delete; @@ -118,12 +138,29 @@ class V8_EXPORT V8_NODISCARD HandleScope { protected: V8_INLINE HandleScope() = default; - void Initialize(Isolate* isolate); + V8_INLINE void Initialize(Isolate* isolate); - static internal::Address* CreateHandle(internal::Isolate* i_isolate, - internal::Address value); + V8_INLINE static internal::Address* CreateHandle(Isolate* i_isolate, + internal::Address value); private: + // Extend the HandleScope making room for more handles. Not inlined. + static internal::Address* Extend(Isolate* isolate); + // Delete any extensions in HandleScope destructor. Not called unless there + // are extensions. Not inlined. + void DeleteExtensions(Isolate* isolate); + +#ifdef V8_ENABLE_CHECKS + // Non-inlined asserts on HandleScope constructor. + void DoInitializeAsserts(Isolate* isolate); + // Non-inlined assert for HandleScope destructor. + void AssertScopeLevelsMatch(); + // Non-inlined asserts for HandleScope destructor. Also zaps the slots + // if this is enabled. + void DoCloseScopeAsserts(int before, internal::Address* limit, + internal::HandleScopeData* current); +#endif + // Declaring operator new and delete as deleted is not spec compliant. // Therefore declare them private instead to disable dynamic alloc void* operator new(size_t size); @@ -131,7 +168,7 @@ class V8_EXPORT V8_NODISCARD HandleScope { void operator delete(void*, size_t); void operator delete[](void*, size_t); - internal::Isolate* i_isolate_; + Isolate* isolate_; internal::Address* prev_next_; internal::Address* prev_limit_; #ifdef V8_ENABLE_CHECKS @@ -148,6 +185,61 @@ class V8_EXPORT V8_NODISCARD HandleScope { friend class Context; }; +HandleScope::HandleScope(Isolate* v8_isolate) { Initialize(v8_isolate); } + +void HandleScope::Initialize(Isolate* v8_isolate) { + using I = internal::Internals; + internal::HandleScopeData* current = I::GetHandleScopeData(v8_isolate); + isolate_ = v8_isolate; + prev_next_ = current->next; + prev_limit_ = current->limit; + current->level++; +#ifdef V8_ENABLE_CHECKS + DoInitializeAsserts(v8_isolate); + scope_level_ = current->level; +#endif +} + +HandleScope::~HandleScope() { + if (V8_UNLIKELY(isolate_ == nullptr)) return; +#ifdef V8_ENABLE_CHECKS + AssertScopeLevelsMatch(); + int handle_count_before = NumberOfHandles(isolate_); +#endif + + using I = internal::Internals; + internal::HandleScopeData* current = I::GetHandleScopeData(isolate_); + std::swap(current->next, prev_next_); + current->level--; + internal::Address* limit = prev_next_; + if (V8_UNLIKELY(current->limit != prev_limit_)) { + current->limit = prev_limit_; + limit = prev_limit_; + DeleteExtensions(isolate_); + } +#ifdef V8_ENABLE_CHECKS + DoCloseScopeAsserts(handle_count_before, limit, current); +#else + (void)limit; // Avoid unused variable warning. +#endif +} + +internal::Address* HandleScope::CreateHandle(Isolate* v8_isolate, + internal::Address value) { + using I = internal::Internals; + internal::HandleScopeData* data = I::GetHandleScopeData(v8_isolate); + internal::Address* result = data->next; + if (V8_UNLIKELY(result == data->limit)) { + result = Extend(v8_isolate); + } + // Update the current next field, set the value in the created handle, + // and return the result. + data->next = reinterpret_cast( + reinterpret_cast(result) + sizeof(internal::Address)); + *result = value; + return result; +} + /** * A base class for local handles. * Its implementation depends on whether direct handle support is enabled. @@ -164,7 +256,11 @@ class LocalBase : public api_internal::DirectHandleBase { V8_INLINE LocalBase() = default; - V8_INLINE explicit LocalBase(internal::Address ptr) : DirectHandleBase(ptr) {} + V8_INLINE explicit LocalBase(internal::Address ptr) : DirectHandleBase(ptr) { +#ifdef V8_ENABLE_CHECKS + if (!IsEmpty()) api_internal::TypeCheckLocal(value()); +#endif + } template V8_INLINE LocalBase(const LocalBase& other) : DirectHandleBase(other) {} @@ -200,14 +296,17 @@ class LocalBase : public api_internal::IndirectHandleBase { V8_INLINE LocalBase() = default; V8_INLINE explicit LocalBase(internal::Address* location) - : IndirectHandleBase(location) {} + : IndirectHandleBase(location) { +#ifdef V8_ENABLE_CHECKS + if (!IsEmpty()) api_internal::TypeCheckLocal(value()); +#endif + } template V8_INLINE LocalBase(const LocalBase& other) : IndirectHandleBase(other) {} V8_INLINE static LocalBase New(Isolate* isolate, internal::Address value) { - return LocalBase(HandleScope::CreateHandle( - reinterpret_cast(isolate), value)); + return LocalBase(HandleScope::CreateHandle(isolate, value)); } V8_INLINE static LocalBase New(Isolate* isolate, T* that) { diff --git a/deps/v8/include/v8-maybe.h b/deps/v8/include/v8-maybe.h index c4d17453a279ab..b65456e759aae3 100644 --- a/deps/v8/include/v8-maybe.h +++ b/deps/v8/include/v8-maybe.h @@ -14,6 +14,12 @@ namespace v8 { +namespace internal { +struct NullMaybeType {}; + +constexpr NullMaybeType kNullMaybe; +} // namespace internal + namespace api_internal { // Called when ToChecked is called on an empty Maybe. V8_EXPORT void FromJustIsNothing(); @@ -32,9 +38,19 @@ V8_EXPORT void FromJustIsNothing(); template class Maybe : public cppgc::internal::ConditionalStackAllocatedBase { public: + constexpr Maybe() = default; + + V8_INLINE Maybe(internal::NullMaybeType) {} + V8_INLINE bool IsNothing() const { return !has_value_; } V8_INLINE bool IsJust() const { return has_value_; } + /** + * Same as IsNothing(). It's useful for unified handling of empty states + * with v8::MaybeLocal. + */ + V8_INLINE bool IsEmpty() const { return IsNothing(); } + /** * An alias for |FromJust|. Will crash if the Maybe<> is nothing. */ @@ -57,6 +73,16 @@ class Maybe : public cppgc::internal::ConditionalStackAllocatedBase { return IsJust(); } + /** + * Converts this Maybe<> to a value of type T, moving out of it. If this + * Maybe<> is nothing (empty), |false| is returned and |out| is left + * untouched. + */ + V8_WARN_UNUSED_RESULT V8_INLINE bool MoveTo(T* out) && { + if (V8_LIKELY(IsJust())) *out = std::move(value_); + return IsJust(); + } + /** * Converts this Maybe<> to a value of type T. If this Maybe<> is * nothing (empty), V8 will crash the process. @@ -93,15 +119,12 @@ class Maybe : public cppgc::internal::ConditionalStackAllocatedBase { } private: - Maybe() : has_value_(false) {} explicit Maybe(const T& t) : has_value_(true), value_(t) {} explicit Maybe(T&& t) : has_value_(true), value_(std::move(t)) {} - bool has_value_; + bool has_value_ = false; T value_; - template - friend Maybe Nothing(); template friend Maybe Just(const U& u); template >*> @@ -109,8 +132,8 @@ class Maybe : public cppgc::internal::ConditionalStackAllocatedBase { }; template -inline Maybe Nothing() { - return Maybe(); +inline constexpr Maybe Nothing() { + return {}; } template @@ -130,7 +153,11 @@ inline Maybe Just(T&& t) { template <> class Maybe { public: + constexpr Maybe() = default; + constexpr Maybe(internal::NullMaybeType) {} + V8_INLINE bool IsNothing() const { return !is_valid_; } + V8_INLINE bool IsEmpty() const { return IsNothing(); } V8_INLINE bool IsJust() const { return is_valid_; } V8_INLINE bool operator==(const Maybe& other) const { @@ -144,13 +171,10 @@ class Maybe { private: struct JustTag {}; - Maybe() : is_valid_(false) {} explicit Maybe(JustTag) : is_valid_(true) {} - bool is_valid_; + bool is_valid_ = false; - template - friend Maybe Nothing(); friend Maybe JustVoid(); }; diff --git a/deps/v8/include/v8-memory-span.h b/deps/v8/include/v8-memory-span.h index 5916cdfe06bb5e..1b72b99fef556d 100644 --- a/deps/v8/include/v8-memory-span.h +++ b/deps/v8/include/v8-memory-span.h @@ -87,15 +87,20 @@ class V8_EXPORT MemorySpan { static constexpr bool is_compatible_iterator_v = is_compatible_iterator::value; + // SFINAE-compatible wrapper for `std::to_address()`. + // Adapted from "base/types/to_address.h" in chromium. template + requires(!std::is_function_v) [[nodiscard]] static constexpr U* to_address(U* p) noexcept { return p; } - template ().operator->())>> - [[nodiscard]] static constexpr auto to_address(It it) noexcept { - return it.operator->(); + template + requires( + requires(const It& it) { std::pointer_traits::to_address(it); } || + requires(const It& it) { it.operator->(); }) + [[nodiscard]] static constexpr auto to_address(const It& it) noexcept { + return std::to_address(it); } public: diff --git a/deps/v8/include/v8-message.h b/deps/v8/include/v8-message.h index b50898530cf95e..04ed4c21a2f49a 100644 --- a/deps/v8/include/v8-message.h +++ b/deps/v8/include/v8-message.h @@ -111,6 +111,9 @@ class V8_EXPORT Message { /** * Return the isolate to which the Message belongs. */ + V8_DEPRECATED( + "Use Isolate::GetCurrent() instead, which is guaranteed to return the " + "same isolate since https://crrev.com/c/6458560.") Isolate* GetIsolate() const; V8_WARN_UNUSED_RESULT MaybeLocal GetSource( diff --git a/deps/v8/include/v8-metrics.h b/deps/v8/include/v8-metrics.h index bf19dead0e6120..f62490a83353c9 100644 --- a/deps/v8/include/v8-metrics.h +++ b/deps/v8/include/v8-metrics.h @@ -37,12 +37,22 @@ struct GarbageCollectionSizes { int64_t bytes_freed = -1; }; +struct GarbageCollectionLimits { + int64_t bytes_baseline = -1; + int64_t bytes_limit = -1; + int64_t bytes_current = -1; + int64_t bytes_max = -1; +}; + struct GarbageCollectionFullCycle { int reason = -1; + int incremental_marking_reason = -1; // The priority of the isolate during the GC cycle. A nullopt value denotes a // mixed priority cycle, meaning the Isolate's priority was changed while the // cycle was in progress. std::optional priority = std::nullopt; + bool reduce_memory = false; + bool is_loading = false; GarbageCollectionPhases total; GarbageCollectionPhases total_cpp; GarbageCollectionPhases main_thread; @@ -55,6 +65,9 @@ struct GarbageCollectionFullCycle { GarbageCollectionSizes objects_cpp; GarbageCollectionSizes memory; GarbageCollectionSizes memory_cpp; + GarbageCollectionLimits old_generation_consumed; + GarbageCollectionLimits global_consumed; + int64_t external_memory_bytes = -1; double collection_rate_in_percent = -1.0; double collection_rate_cpp_in_percent = -1.0; double efficiency_in_bytes_per_us = -1.0; @@ -66,6 +79,7 @@ struct GarbageCollectionFullCycle { double main_thread_collection_weight_in_percent = -1.0; double main_thread_collection_weight_cpp_in_percent = -1.0; int64_t incremental_marking_start_stop_wall_clock_duration_in_us = -1; + int64_t total_duration_since_last_mark_compact = -1; }; struct GarbageCollectionFullMainThreadIncrementalMark { diff --git a/deps/v8/include/v8-object.h b/deps/v8/include/v8-object.h index 3e57ae8efe33f3..860cecaadc3ed7 100644 --- a/deps/v8/include/v8-object.h +++ b/deps/v8/include/v8-object.h @@ -5,6 +5,8 @@ #ifndef INCLUDE_V8_OBJECT_H_ #define INCLUDE_V8_OBJECT_H_ +#include "cppgc/garbage-collected.h" +#include "cppgc/name-provider.h" #include "v8-internal.h" // NOLINT(build/include_directory) #include "v8-local-handle.h" // NOLINT(build/include_directory) #include "v8-maybe.h" // NOLINT(build/include_directory) @@ -23,6 +25,14 @@ class FunctionTemplate; template class PropertyCallbackInfo; +/** + * A tag for embedder data. Objects with different C++ types should use + * different values of EmbedderDataTypeTag when written to embedder data. The + * allowed range is 0..V8_EMBEDDER_DATA_TAG_COUNT - 1. If this is not + * sufficient, V8_EMBEDDER_DATA_TAG_COUNT can be increased. + */ +using EmbedderDataTypeTag = uint16_t; + /** * A private symbol * @@ -427,15 +437,15 @@ class V8_EXPORT Object : public Value { * be skipped by __proto__ and it does not consult the security * handler. */ - V8_DEPRECATE_SOON( + V8_DEPRECATED( "V8 will stop providing access to hidden prototype (i.e. " "JSGlobalObject). Use GetPrototypeV2() instead. " "See http://crbug.com/333672197.") Local GetPrototype(); /** - * Get the prototype object (same as getting __proto__ property). This does - * not consult the security handler. + * Get the prototype object (same as calling Object.getPrototypeOf(..)). + * This does not consult the security handler. * TODO(333672197): rename back to GetPrototype() once the old version goes * through the deprecation process and is removed. */ @@ -446,7 +456,7 @@ class V8_EXPORT Object : public Value { * be skipped by __proto__ and it does not consult the security * handler. */ - V8_DEPRECATE_SOON( + V8_DEPRECATED( "V8 will stop providing access to hidden prototype (i.e. " "JSGlobalObject). Use SetPrototypeV2() instead. " "See http://crbug.com/333672197.") @@ -454,8 +464,8 @@ class V8_EXPORT Object : public Value { Local prototype); /** - * Set the prototype object (same as setting __proto__ property). This does - * does not consult the security handler. + * Set the prototype object (same as calling Object.setPrototypeOf(..)). + * This does not consult the security handler. * TODO(333672197): rename back to SetPrototype() once the old version goes * through the deprecation process and is removed. */ @@ -544,10 +554,43 @@ class V8_EXPORT Object : public Value { * a field, GetAlignedPointerFromInternalField must be used, everything else * leads to undefined behavior. */ + V8_DEPRECATE_SOON( + "Use SetAlignedPointerInInternalField with EmbedderDataTypeTag parameter " + "instead.") void SetAlignedPointerInInternalField(int index, void* value); + + void SetAlignedPointerInInternalField(int index, void* value, + EmbedderDataTypeTag tag); + + V8_DEPRECATE_SOON( + "Use SetAlignedPointerInInternalField with EmbedderDataTypeTag " + "parameter instead.") void SetAlignedPointerInInternalFields(int argc, int indices[], void* values[]); + // Type information for a Wrappable object that got wrapped with + // `v8::Object::Wrap()`. + struct WrapperTypeInfo { + const int16_t type_id; + }; + + // v8::Object::Wrappable serves as the base class for all C++ objects that can + // be wrapped by a JavaScript object using `v8::Object::Wrap()`. + // + // Note that v8::Object::Wrappable` inherits from `NameProvider` and provides + // `GetWrapperTypeInfo` to allow subclasses to have smaller object sizes. + class Wrappable : public cppgc::GarbageCollected, + public cppgc::NameProvider { + public: + virtual const WrapperTypeInfo* GetWrapperTypeInfo() const { + return nullptr; + } + + const char* GetHumanReadableName() const override { return "internal"; } + + virtual void Trace(cppgc::Visitor* visitor) const {} + }; + /** * Unwraps a JS wrapper object. * @@ -593,24 +636,37 @@ class V8_EXPORT Object : public Value { template static V8_INLINE void Wrap(v8::Isolate* isolate, const v8::Local& wrapper, - void* wrappable); + Wrappable* wrappable); template static V8_INLINE void Wrap(v8::Isolate* isolate, const PersistentBase& wrapper, - void* wrappable); + Wrappable* wrappable); template static V8_INLINE void Wrap(v8::Isolate* isolate, const BasicTracedReference& wrapper, - void* wrappable); + Wrappable* wrappable); static V8_INLINE void Wrap(v8::Isolate* isolate, const v8::Local& wrapper, - void* wrappable, CppHeapPointerTag tag); + Wrappable* wrappable, CppHeapPointerTag tag); static V8_INLINE void Wrap(v8::Isolate* isolate, const PersistentBase& wrapper, - void* wrappable, CppHeapPointerTag tag); + Wrappable* wrappable, CppHeapPointerTag tag); static V8_INLINE void Wrap(v8::Isolate* isolate, const BasicTracedReference& wrapper, - void* wrappable, CppHeapPointerTag tag); + Wrappable* wrappable, CppHeapPointerTag tag); + + // Version of Wrap() function for v8::Context::Global() objects. + // Unlike the functions above it wraps both JSGlobalProxy and its hidden + // prototype (JSGlobalObject or remote object). + static void WrapGlobal(v8::Isolate* isolate, + const v8::Local& wrapper, + Wrappable* wrappable, CppHeapPointerTag tag); + + // Checks that wrappables set on JSGlobalProxy and its hidden prototype are + // the same. + static bool CheckGlobalWrappable(v8::Isolate* isolate, + const v8::Local& wrapper, + CppHeapPointerTagRange tag_range); /** * HasOwnProperty() is like JavaScript's @@ -795,8 +851,14 @@ class V8_EXPORT Object : public Value { /** * Return the isolate to which the Object belongs to. */ + V8_DEPRECATED( + "Use Isolate::GetCurrent() instead, which is guaranteed to return the " + "same isolate since https://crrev.com/c/6458560.") Isolate* GetIsolate(); + V8_DEPRECATED( + "Use Isolate::GetCurrent() instead, which is guaranteed to return the " + "same isolate since https://crrev.com/c/6458560.") V8_INLINE static Isolate* GetIsolate(const TracedReference& handle) { return handle.template value()->GetIsolate(); } @@ -871,8 +933,7 @@ Local Object::GetInternalField(int index) { value = I::DecompressTaggedField(obj, static_cast(value)); #endif - auto isolate = reinterpret_cast( - internal::IsolateFromNeverReadOnlySpaceObject(obj)); + auto* isolate = I::GetCurrentIsolate(); return Local::New(isolate, value); } #endif @@ -893,7 +954,8 @@ void* Object::GetAlignedPointerFromInternalField(v8::Isolate* isolate, (I::kEmbedderDataSlotSize * index) + I::kEmbedderDataSlotExternalPointerOffset; A value = - I::ReadExternalPointerField( + I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag, + internal::kLastEmbedderDataTag}>( isolate, obj, offset); return reinterpret_cast(value); } @@ -913,9 +975,10 @@ void* Object::GetAlignedPointerFromInternalField(int index) { int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize + (I::kEmbedderDataSlotSize * index) + I::kEmbedderDataSlotExternalPointerOffset; - Isolate* isolate = I::GetIsolateForSandbox(obj); + Isolate* isolate = I::GetCurrentIsolateForSandbox(); A value = - I::ReadExternalPointerField( + I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag, + internal::kLastEmbedderDataTag}>( isolate, obj, offset); return reinterpret_cast(value); } @@ -1011,7 +1074,7 @@ T* Object::Unwrap(v8::Isolate* isolate, // static template void Object::Wrap(v8::Isolate* isolate, const v8::Local& wrapper, - void* wrappable) { + v8::Object::Wrappable* wrappable) { auto obj = internal::ValueHelper::ValueAsAddress(*wrapper); Wrap(isolate, obj, tag, wrappable); } @@ -1019,7 +1082,7 @@ void Object::Wrap(v8::Isolate* isolate, const v8::Local& wrapper, // static template void Object::Wrap(v8::Isolate* isolate, const PersistentBase& wrapper, - void* wrappable) { + v8::Object::Wrappable* wrappable) { auto obj = internal::ValueHelper::ValueAsAddress(wrapper.template value()); Wrap(isolate, obj, tag, wrappable); @@ -1029,7 +1092,7 @@ void Object::Wrap(v8::Isolate* isolate, const PersistentBase& wrapper, template void Object::Wrap(v8::Isolate* isolate, const BasicTracedReference& wrapper, - void* wrappable) { + v8::Object::Wrappable* wrappable) { auto obj = internal::ValueHelper::ValueAsAddress(wrapper.template value()); Wrap(isolate, obj, tag, wrappable); @@ -1037,14 +1100,14 @@ void Object::Wrap(v8::Isolate* isolate, // static void Object::Wrap(v8::Isolate* isolate, const v8::Local& wrapper, - void* wrappable, CppHeapPointerTag tag) { + v8::Object::Wrappable* wrappable, CppHeapPointerTag tag) { auto obj = internal::ValueHelper::ValueAsAddress(*wrapper); Wrap(isolate, obj, tag, wrappable); } // static void Object::Wrap(v8::Isolate* isolate, const PersistentBase& wrapper, - void* wrappable, CppHeapPointerTag tag) { + v8::Object::Wrappable* wrappable, CppHeapPointerTag tag) { auto obj = internal::ValueHelper::ValueAsAddress(wrapper.template value()); Wrap(isolate, obj, tag, wrappable); @@ -1052,8 +1115,8 @@ void Object::Wrap(v8::Isolate* isolate, const PersistentBase& wrapper, // static void Object::Wrap(v8::Isolate* isolate, - const BasicTracedReference& wrapper, void* wrappable, - CppHeapPointerTag tag) { + const BasicTracedReference& wrapper, + v8::Object::Wrappable* wrappable, CppHeapPointerTag tag) { auto obj = internal::ValueHelper::ValueAsAddress(wrapper.template value()); Wrap(isolate, obj, tag, wrappable); diff --git a/deps/v8/include/v8-persistent-handle.h b/deps/v8/include/v8-persistent-handle.h index d08412fbd05dc4..126fbdb8ff5a21 100644 --- a/deps/v8/include/v8-persistent-handle.h +++ b/deps/v8/include/v8-persistent-handle.h @@ -431,7 +431,7 @@ internal::Address* PersistentBase::New(Isolate* isolate, T* that) { template template void Persistent::Copy(const Persistent& that) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); this->Reset(); if (that.IsEmpty()) return; this->slot() = api_internal::CopyGlobalReference(that.slot()); @@ -459,7 +459,7 @@ void PersistentBase::Reset() { template template void PersistentBase::Reset(Isolate* isolate, const Local& other) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); Reset(); if (other.IsEmpty()) return; this->slot() = New(isolate, *other); @@ -473,7 +473,7 @@ template template void PersistentBase::Reset(Isolate* isolate, const PersistentBase& other) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); Reset(); if (other.IsEmpty()) return; this->slot() = New(isolate, other.template value()); @@ -546,7 +546,7 @@ Global::Global(Global&& other) : PersistentBase(other.slot()) { template template Global& Global::operator=(Global&& rhs) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); if (this != &rhs) { this->Reset(); if (!rhs.IsEmpty()) { diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 43ffeb57d708d3..6aadcab4ba987e 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -11,6 +11,7 @@ #include // For abort. #include +#include #include #include "v8-source-location.h" // NOLINT(build/include_directory) @@ -80,7 +81,7 @@ class TaskRunner { * Embedders should override PostTaskImpl instead of this. */ void PostTask(std::unique_ptr task, - const SourceLocation& location = SourceLocation::Current()) { + SourceLocation location = SourceLocation::Current()) { PostTaskImpl(std::move(task), location); } @@ -103,7 +104,7 @@ class TaskRunner { */ void PostNonNestableTask( std::unique_ptr task, - const SourceLocation& location = SourceLocation::Current()) { + SourceLocation location = SourceLocation::Current()) { PostNonNestableTaskImpl(std::move(task), location); } @@ -114,9 +115,8 @@ class TaskRunner { * * Embedders should override PostDelayedTaskImpl instead of this. */ - void PostDelayedTask( - std::unique_ptr task, double delay_in_seconds, - const SourceLocation& location = SourceLocation::Current()) { + void PostDelayedTask(std::unique_ptr task, double delay_in_seconds, + SourceLocation location = SourceLocation::Current()) { PostDelayedTaskImpl(std::move(task), delay_in_seconds, location); } @@ -140,7 +140,7 @@ class TaskRunner { */ void PostNonNestableDelayedTask( std::unique_ptr task, double delay_in_seconds, - const SourceLocation& location = SourceLocation::Current()) { + SourceLocation location = SourceLocation::Current()) { PostNonNestableDelayedTaskImpl(std::move(task), delay_in_seconds, location); } @@ -154,9 +154,8 @@ class TaskRunner { * * Embedders should override PostIdleTaskImpl instead of this. */ - void PostIdleTask( - std::unique_ptr task, - const SourceLocation& location = SourceLocation::Current()) { + void PostIdleTask(std::unique_ptr task, + SourceLocation location = SourceLocation::Current()) { PostIdleTaskImpl(std::move(task), location); } @@ -499,12 +498,49 @@ class PageAllocator { kNoAccessWillJitLater }; + /** + * Optional hints for AllocatePages(). + */ + class AllocationHint final { + public: + AllocationHint() = default; + + V8_WARN_UNUSED_RESULT constexpr AllocationHint WithAddress( + void* address) const { + return AllocationHint(address, may_grow_); + } + + V8_WARN_UNUSED_RESULT constexpr AllocationHint WithMayGrow() const { + return AllocationHint(address_, true); + } + + bool MayGrow() const { return may_grow_; } + void* Address() const { return address_; } + + private: + constexpr AllocationHint(void* address, bool may_grow) + : address_(address), may_grow_(may_grow) {} + + void* address_ = nullptr; + bool may_grow_ = false; + }; + /** * Allocates memory in range with the given alignment and permission. */ virtual void* AllocatePages(void* address, size_t length, size_t alignment, Permission permissions) = 0; + /** + * Allocates memory in range with the given alignment and permission. In + * addition to AllocatePages it allows to pass in allocation hints. The + * underlying implementation may not make use of hints. + */ + virtual void* AllocatePages(size_t length, size_t alignment, + Permission permissions, AllocationHint hint) { + return AllocatePages(hint.Address(), length, alignment, permissions); + } + /** * Resizes the previously allocated memory at the given address. Returns true * if the allocation could be resized. Returns false if this operation is @@ -665,14 +701,6 @@ class ThreadIsolatedAllocator { * Return the pkey used to implement the thread isolation if Type == kPkey. */ virtual int Pkey() const { return -1; } - - /** - * Per-thread permissions can be reset on signal handler entry. Even reading - * ThreadIsolated memory will segfault in that case. - * Call this function on signal handler entry to ensure that read permissions - * are restored. - */ - static void SetDefaultPermissionsForSignalHandler(); }; // Opaque type representing a handle to a shared memory region. @@ -958,6 +986,29 @@ class VirtualAddressSpace { */ virtual void FreeSharedPages(Address address, size_t size) = 0; + /** + * Memory protection key support. + * + * If supported by the hardware and operating system, virtual address spaces + * can use memory protection keys in addition to the regular page + * permissions. The MemoryProtectionKeyId type identifies a memory protection + * key and is used by the related APIs in this class. + * + * TODO(saelo): consider renaming to just MemoryProtectionKey, but currently + * there's a naming conflict with base::MemoryProtectionKey. + */ + using MemoryProtectionKeyId = int; + + /** + * The memory protection key used by this space, if any. + * + * If this space uses a memory protection key, then all memory pages in it + * will have this key set. In that case, this API will return that key. + * + * \returns the memory protection key used by this space or std::nullopt. + */ + virtual std::optional ActiveMemoryProtectionKey() = 0; + /** * Whether this instance can allocate subspaces or not. * @@ -984,11 +1035,15 @@ class VirtualAddressSpace { * \param max_page_permissions The maximum permissions that pages allocated in * the subspace can obtain. * + * \param key Optional memory protection key for the subspace. If used, the + * returned subspace will use this key for all its memory pages. + * * \returns a new subspace or nullptr on failure. */ virtual std::unique_ptr AllocateSubspace( Address hint, size_t size, size_t alignment, - PagePermissions max_page_permissions) = 0; + PagePermissions max_page_permissions, + std::optional key = std::nullopt) = 0; // // TODO(v8) maybe refactor the methods below before stabilizing the API. For @@ -1127,9 +1182,8 @@ class Platform { * CallOnWorkerThread(). */ V8_DEPRECATE_SOON("Use PostTaskOnWorkerThread instead.") - void CallOnWorkerThread( - std::unique_ptr task, - const SourceLocation& location = SourceLocation::Current()) { + void CallOnWorkerThread(std::unique_ptr task, + SourceLocation location = SourceLocation::Current()) { PostTaskOnWorkerThreadImpl(TaskPriority::kUserVisible, std::move(task), location); } @@ -1143,7 +1197,7 @@ class Platform { V8_DEPRECATE_SOON("Use PostTaskOnWorkerThread instead.") void CallBlockingTaskOnWorkerThread( std::unique_ptr task, - const SourceLocation& location = SourceLocation::Current()) { + SourceLocation location = SourceLocation::Current()) { // Embedders may optionally override this to process these tasks in a high // priority pool. PostTaskOnWorkerThreadImpl(TaskPriority::kUserBlocking, std::move(task), @@ -1158,7 +1212,7 @@ class Platform { V8_DEPRECATE_SOON("Use PostTaskOnWorkerThread instead.") void CallLowPriorityTaskOnWorkerThread( std::unique_ptr task, - const SourceLocation& location = SourceLocation::Current()) { + SourceLocation location = SourceLocation::Current()) { // Embedders may optionally override this to process these tasks in a low // priority pool. PostTaskOnWorkerThreadImpl(TaskPriority::kBestEffort, std::move(task), @@ -1174,7 +1228,7 @@ class Platform { V8_DEPRECATE_SOON("Use PostDelayedTaskOnWorkerThread instead.") void CallDelayedOnWorkerThread( std::unique_ptr task, double delay_in_seconds, - const SourceLocation& location = SourceLocation::Current()) { + SourceLocation location = SourceLocation::Current()) { PostDelayedTaskOnWorkerThreadImpl(TaskPriority::kUserVisible, std::move(task), delay_in_seconds, location); @@ -1187,7 +1241,7 @@ class Platform { */ void PostTaskOnWorkerThread( TaskPriority priority, std::unique_ptr task, - const SourceLocation& location = SourceLocation::Current()) { + SourceLocation location = SourceLocation::Current()) { PostTaskOnWorkerThreadImpl(priority, std::move(task), location); } @@ -1200,7 +1254,7 @@ class Platform { void PostDelayedTaskOnWorkerThread( TaskPriority priority, std::unique_ptr task, double delay_in_seconds, - const SourceLocation& location = SourceLocation::Current()) { + SourceLocation location = SourceLocation::Current()) { PostDelayedTaskOnWorkerThreadImpl(priority, std::move(task), delay_in_seconds, location); } @@ -1257,7 +1311,7 @@ class Platform { */ std::unique_ptr PostJob( TaskPriority priority, std::unique_ptr job_task, - const SourceLocation& location = SourceLocation::Current()) { + SourceLocation location = SourceLocation::Current()) { auto handle = CreateJob(priority, std::move(job_task), location); handle->NotifyConcurrencyIncrease(); return handle; @@ -1280,7 +1334,7 @@ class Platform { */ std::unique_ptr CreateJob( TaskPriority priority, std::unique_ptr job_task, - const SourceLocation& location = SourceLocation::Current()) { + SourceLocation location = SourceLocation::Current()) { return CreateJobImpl(priority, std::move(job_task), location); } diff --git a/deps/v8/include/v8-primitive.h b/deps/v8/include/v8-primitive.h index 50b07d9c10a7bb..1bf21e60ad9a99 100644 --- a/deps/v8/include/v8-primitive.h +++ b/deps/v8/include/v8-primitive.h @@ -635,11 +635,10 @@ class V8_EXPORT String : public Name { bool StringEquals(Local str) const; /** - * Converts an object to a UTF-8-encoded character array. Useful if - * you want to print the object. If conversion to a string fails - * (e.g. due to an exception in the toString() method of the object) - * then the length() method returns 0 and the * operator returns - * NULL. + * Converts an object to a null-terminated UTF-8-encoded character array. + * Useful if you want to print the object. If conversion to a string fails + * (e.g. due to an exception in the toString() method of the object) then the + * length() method returns 0 and the * operator returns NULL. * * WARNING: This will unconditionally copy the contents of the JavaScript * string, and should be avoided in situations where performance is a concern. @@ -647,8 +646,7 @@ class V8_EXPORT String : public Name { */ class V8_EXPORT Utf8Value { public: - Utf8Value(Isolate* isolate, Local obj, - WriteOptions options = REPLACE_INVALID_UTF8); + Utf8Value(Isolate* isolate, Local obj); ~Utf8Value(); char* operator*() { return str_; } const char* operator*() const { return str_; } @@ -851,6 +849,19 @@ class V8_EXPORT Number : public Numeric { public: double Value() const; static Local New(Isolate* isolate, double value); + template + requires(std::is_integral::value && !std::is_same::value && + std::is_signed_v && sizeof(Int) <= sizeof(int32_t)) + V8_INLINE static Local New(Isolate* isolate, Int value) { + return NewFromInt32(isolate, value); + } + template + requires(std::is_integral::value && + !std::is_same::value && std::is_unsigned_v && + sizeof(UInt) <= sizeof(uint32_t)) + V8_INLINE static Local New(Isolate* isolate, UInt value) { + return NewFromUint32(isolate, value); + } V8_INLINE static Number* Cast(v8::Data* data) { #ifdef V8_ENABLE_CHECKS CheckCast(data); @@ -860,6 +871,8 @@ class V8_EXPORT Number : public Numeric { private: Number(); + static Local NewFromInt32(Isolate* isolate, int32_t value); + static Local NewFromUint32(Isolate* isolate, uint32_t value); static void CheckCast(v8::Data* that); }; @@ -994,7 +1007,7 @@ String::ExternalStringResource* String::GetExternalStringResource() const { ExternalStringResource* result; if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) { - Isolate* isolate = I::GetIsolateForSandbox(obj); + Isolate* isolate = I::GetCurrentIsolateForSandbox(); A value = I::ReadExternalPointerField( isolate, obj, I::kStringResourceOffset); result = reinterpret_cast(value); @@ -1039,7 +1052,7 @@ String::ExternalStringResourceBase* String::GetExternalStringResourceBase( ExternalStringResourceBase* resource; if (type == I::kExternalOneByteRepresentationTag || type == I::kExternalTwoByteRepresentationTag) { - Isolate* isolate = I::GetIsolateForSandbox(obj); + Isolate* isolate = I::GetCurrentIsolateForSandbox(); A value = I::ReadExternalPointerField( isolate, obj, I::kStringResourceOffset); resource = reinterpret_cast(value); diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 9581cdb2dbe4ee..f7f88ba6c74969 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -71,6 +71,10 @@ class V8_EXPORT CpuProfileNode { /** The 1-based number of the source line where the function originates. */ int line; + /** The 1-based number of the source column where the function originates. + */ + int column; + /** The count of samples associated with the source line. */ unsigned int hit_count; }; diff --git a/deps/v8/include/v8-sandbox.h b/deps/v8/include/v8-sandbox.h index 857caea3076e00..06d01761798582 100644 --- a/deps/v8/include/v8-sandbox.h +++ b/deps/v8/include/v8-sandbox.h @@ -101,6 +101,12 @@ struct CppHeapPointerTagRange { constexpr CppHeapPointerTagRange kAnyCppHeapPointer( CppHeapPointerTag::kFirstTag, CppHeapPointerTag::kLastTag); +/** + * Hardware support for the V8 Sandbox. + * + * This is an experimental feature that may change or be removed without + * further notice. Use at your own risk. + */ class SandboxHardwareSupport { public: /** @@ -109,6 +115,16 @@ class SandboxHardwareSupport { * hardware permissions to the memory that will be inherited on clone. */ V8_EXPORT static void InitializeBeforeThreadCreation(); + + /** + * Prepares the current thread for executing sandboxed code. + * + * This must be called on newly created threads before they execute any + * sandboxed code (in particular any JavaScript or WebAssembly code). It + * should not be invoked on threads that never execute sandboxed code, + * although it is fine to do so from a security point of view. + */ + V8_EXPORT static void PrepareCurrentThreadForHardwareSandboxing(); }; namespace internal { diff --git a/deps/v8/include/v8-source-location.h b/deps/v8/include/v8-source-location.h index eb307099c5f922..268e3e679aad59 100644 --- a/deps/v8/include/v8-source-location.h +++ b/deps/v8/include/v8-source-location.h @@ -6,21 +6,12 @@ #define INCLUDE_SOURCE_LOCATION_H_ #include +#include #include #include "v8config.h" // NOLINT(build/include_directory) -#if defined(__has_builtin) -#define V8_SUPPORTS_SOURCE_LOCATION \ - (__has_builtin(__builtin_FUNCTION) && __has_builtin(__builtin_FILE) && \ - __has_builtin(__builtin_LINE)) // NOLINT -#elif defined(V8_CC_GNU) && __GNUC__ >= 7 #define V8_SUPPORTS_SOURCE_LOCATION 1 -#elif defined(V8_CC_INTEL) && __ICC >= 1800 -#define V8_SUPPORTS_SOURCE_LOCATION 1 -#else -#define V8_SUPPORTS_SOURCE_LOCATION 0 -#endif namespace v8 { @@ -34,15 +25,18 @@ class V8_EXPORT SourceLocation final { * Construct source location information corresponding to the location of the * call site. */ -#if V8_SUPPORTS_SOURCE_LOCATION static constexpr SourceLocation Current( - const char* function = __builtin_FUNCTION(), - const char* file = __builtin_FILE(), size_t line = __builtin_LINE()) { - return SourceLocation(function, file, line); + const std::source_location& loc = std::source_location::current()) { + return SourceLocation(loc); + } +#ifdef DEBUG + static constexpr SourceLocation CurrentIfDebug( + const std::source_location& loc = std::source_location::current()) { + return SourceLocation(loc); } #else - static constexpr SourceLocation Current() { return SourceLocation(); } -#endif // V8_SUPPORTS_SOURCE_LOCATION + static constexpr SourceLocation CurrentIfDebug() { return {}; } +#endif /** * Constructs unspecified source location information. @@ -55,21 +49,21 @@ class V8_EXPORT SourceLocation final { * * \returns the function name as cstring. */ - constexpr const char* Function() const { return function_; } + constexpr const char* Function() const { return loc_.function_name(); } /** * Returns the name of the current source file represented by this object. * * \returns the file name as cstring. */ - constexpr const char* FileName() const { return file_; } + constexpr const char* FileName() const { return loc_.file_name(); } /** * Returns the line number represented by this object. * * \returns the line number. */ - constexpr size_t Line() const { return line_; } + constexpr size_t Line() const { return loc_.line(); } /** * Returns a human-readable string representing this object. @@ -77,19 +71,18 @@ class V8_EXPORT SourceLocation final { * \returns a human-readable string representing source location information. */ std::string ToString() const { - if (!file_) { + if (loc_.line() == 0) { return {}; } - return std::string(function_) + "@" + file_ + ":" + std::to_string(line_); + return std::string(loc_.function_name()) + "@" + loc_.file_name() + ":" + + std::to_string(loc_.line()); } private: - constexpr SourceLocation(const char* function, const char* file, size_t line) - : function_(function), file_(file), line_(line) {} + constexpr explicit SourceLocation(const std::source_location& loc) + : loc_(loc) {} - const char* function_ = nullptr; - const char* file_ = nullptr; - size_t line_ = 0u; + std::source_location loc_; }; } // namespace v8 diff --git a/deps/v8/include/v8-trace-categories.h b/deps/v8/include/v8-trace-categories.h index aaa0ae586f287c..9072cb45675620 100644 --- a/deps/v8/include/v8-trace-categories.h +++ b/deps/v8/include/v8-trace-categories.h @@ -5,10 +5,11 @@ #ifndef INCLUDE_V8_TRACE_CATEGORIES_H_ #define INCLUDE_V8_TRACE_CATEGORIES_H_ +#include "v8config.h" + #if defined(V8_USE_PERFETTO) #include "perfetto/tracing/track_event.h" -#include "v8config.h" namespace v8 { diff --git a/deps/v8/include/v8-traced-handle.h b/deps/v8/include/v8-traced-handle.h index 28fe6cf5ae3ad0..3eb8e7835d74e7 100644 --- a/deps/v8/include/v8-traced-handle.h +++ b/deps/v8/include/v8-traced-handle.h @@ -181,7 +181,7 @@ class TracedReference : public BasicTracedReference { */ template TracedReference(Isolate* isolate, Local that) : BasicTracedReference() { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); if (V8_UNLIKELY(that.IsEmpty())) { return; } @@ -202,7 +202,7 @@ class TracedReference : public BasicTracedReference { template TracedReference(Isolate* isolate, Local that, IsDroppable) : BasicTracedReference() { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); if (V8_UNLIKELY(that.IsEmpty())) { return; } @@ -351,7 +351,7 @@ V8_INLINE bool operator!=(const v8::Local& lhs, template template void TracedReference::Reset(Isolate* isolate, const Local& other) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); this->Reset(); if (V8_UNLIKELY(other.IsEmpty())) { return; @@ -366,7 +366,7 @@ template template void TracedReference::Reset(Isolate* isolate, const Local& other, IsDroppable) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); this->Reset(); if (V8_UNLIKELY(other.IsEmpty())) { return; @@ -381,7 +381,7 @@ template template TracedReference& TracedReference::operator=( TracedReference&& rhs) noexcept { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); *this = std::move(rhs.template As()); return *this; } @@ -390,7 +390,7 @@ template template TracedReference& TracedReference::operator=( const TracedReference& rhs) { - static_assert(std::is_base_of::value, "type check"); + static_assert(std::is_base_of_v, "type check"); *this = rhs.template As(); return *this; } diff --git a/deps/v8/include/v8-unwinder.h b/deps/v8/include/v8-unwinder.h index 5771eb05a81ecf..7f5a2556f275a9 100644 --- a/deps/v8/include/v8-unwinder.h +++ b/deps/v8/include/v8-unwinder.h @@ -33,6 +33,9 @@ struct V8_EXPORT RegisterState { }; // A StateTag represents a possible state of the VM. +// This enum is append-only to preserve compatibility with historical logs. +// Add new states only at the end and do not reorder or remove existing values. +// LINT.IfChange enum StateTag : uint16_t { JS, GC, @@ -44,7 +47,17 @@ enum StateTag : uint16_t { ATOMICS_WAIT, IDLE, LOGGING, + IDLE_EXTERNAL, }; +// LINT.ThenChange(../tools/profile.mjs, ../tools/tickprocessor.mjs) + +constexpr bool IsExternal(StateTag state) { + return state == EXTERNAL || state == IDLE_EXTERNAL; +} + +constexpr bool IsIdle(StateTag state) { + return state == IDLE || state == IDLE_EXTERNAL; +} // The output structure filled up by GetStackSample API function. struct SampleInfo { diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 40256277702074..9ef4d60891d7b3 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -8,10 +8,10 @@ // These macros define the version number for the current version. // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. -#define V8_MAJOR_VERSION 13 -#define V8_MINOR_VERSION 7 -#define V8_BUILD_NUMBER 152 -#define V8_PATCH_LEVEL 19 +#define V8_MAJOR_VERSION 14 +#define V8_MINOR_VERSION 1 +#define V8_BUILD_NUMBER 146 +#define V8_PATCH_LEVEL 11 // 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 9581df67fd18c3..d03363ac019076 100644 --- a/deps/v8/include/v8config.h +++ b/deps/v8/include/v8config.h @@ -85,6 +85,7 @@ path. Add it with -I to the command line // V8_OS_DARWIN - Darwin (macOS, iOS) // V8_OS_MACOS - macOS // V8_OS_IOS - iOS +// V8_OS_TVOS - tvOS (also sets V8_OS_IOS) // V8_OS_NETBSD - NetBSD // V8_OS_OPENBSD - OpenBSD // V8_OS_POSIX - POSIX compatible (mostly everything except Windows) @@ -108,6 +109,9 @@ path. Add it with -I to the command line # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE # define V8_OS_IOS 1 # define V8_OS_STRING "ios" +# if defined(TARGET_OS_TV) && TARGET_OS_TV +# define V8_OS_TVOS 1 +# endif # else # define V8_OS_MACOS 1 # define V8_OS_STRING "macos" @@ -187,6 +191,7 @@ path. Add it with -I to the command line // V8_TARGET_OS_ANDROID // V8_TARGET_OS_FUCHSIA // V8_TARGET_OS_IOS +// V8_TARGET_OS_TVOS (also sets V8_TARGET_OS_IOS) // V8_TARGET_OS_LINUX // V8_TARGET_OS_MACOS // V8_TARGET_OS_WIN @@ -200,6 +205,7 @@ path. Add it with -I to the command line # if !defined(V8_TARGET_OS_ANDROID) \ && !defined(V8_TARGET_OS_FUCHSIA) \ && !defined(V8_TARGET_OS_IOS) \ + && !defined(V8_TARGET_OS_TVOS) \ && !defined(V8_TARGET_OS_LINUX) \ && !defined(V8_TARGET_OS_MACOS) \ && !defined(V8_TARGET_OS_WIN) \ @@ -212,6 +218,7 @@ path. Add it with -I to the command line # if defined(V8_TARGET_OS_ANDROID) \ || defined(V8_TARGET_OS_FUCHSIA) \ || defined(V8_TARGET_OS_IOS) \ + || defined(V8_TARGET_OS_TVOS) \ || defined(V8_TARGET_OS_LINUX) \ || defined(V8_TARGET_OS_MACOS) \ || defined(V8_TARGET_OS_WIN) \ @@ -232,6 +239,10 @@ path. Add it with -I to the command line # define V8_TARGET_OS_IOS #endif +#ifdef V8_OS_TVOS +# define V8_TARGET_OS_TVOS +#endif + #ifdef V8_OS_LINUX # define V8_TARGET_OS_LINUX #endif @@ -322,6 +333,7 @@ path. Add it with -I to the command line // V8_HAS_CPP_ATTRIBUTE_NODISCARD - [[nodiscard]] supported // V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS // - [[no_unique_address]] supported +// V8_HAS_CPP_ATTRIBUTE_LIFETIME_BOUND - [[clang::lifetimebound]] supported // V8_HAS_BUILTIN_ADD_OVERFLOW - __builtin_add_overflow() supported // V8_HAS_BUILTIN_BIT_CAST - __builtin_bit_cast() supported // V8_HAS_BUILTIN_BSWAP16 - __builtin_bswap16() supported @@ -401,6 +413,7 @@ path. Add it with -I to the command line # define V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS \ (V8_HAS_CPP_ATTRIBUTE(no_unique_address)) #endif +# define V8_HAS_CPP_ATTRIBUTE_LIFETIME_BOUND (V8_HAS_CPP_ATTRIBUTE(clang::lifetimebound)) # define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow)) # define V8_HAS_BUILTIN_ASSUME (__has_builtin(__builtin_assume)) @@ -697,6 +710,17 @@ path. Add it with -I to the command line #define V8_NODISCARD /* NOT SUPPORTED */ #endif + +// Annotate a function to ensure the function is retained in the compiled binary +// even if it appears to be unused to the compiler. +#if V8_HAS_ATTRIBUTE_USED && V8_HAS_ATTRIBUTE_VISIBILITY +#define V8_SYMBOL_USED \ + __attribute__((used, visibility("default"))) +#else +#define V8_SYMBOL_USED /* NOT SUPPORTED */ +#endif + + // The no_unique_address attribute allows tail padding in a non-static data // member to overlap other members of the enclosing class (and in the special // case when the type is empty, permits it to fully overlap other members). The @@ -726,6 +750,41 @@ path. Add it with -I to the command line #define V8_NO_UNIQUE_ADDRESS /* NOT SUPPORTED */ #endif +// Annotates a pointer or reference parameter or return value for a member +// function as having lifetime intertwined with the instance on which the +// function is called. For parameters, the function is assumed to store the +// value into the called-on object, so if the referred-to object is later +// destroyed, the called-on object is also considered to be dangling. For return +// values, the value is assumed to point into the called-on object, so if that +// object is destroyed, the returned value is also considered to be dangling. +// Useful to diagnose some cases of lifetime errors. +// +// See also: +// https://clang.llvm.org/docs/AttributeReference.html#lifetimebound +// +// Usage: +// ``` +// struct S { +// S(int* p V8_LIFETIME_BOUND); +// int* Get() V8_LIFETIME_BOUND; +// }; +// S Func1() { +// int i = 0; +// // The following return will not compile; diagnosed as returning address +// // of a stack object. +// return S(&i); +// } +// int* Func2(int* p) { +// // The following return will not compile; diagnosed as returning address +// // of a local temporary. +// return S(p).Get(); +// } +#if V8_HAS_CPP_ATTRIBUTE_LIFETIME_BOUND +#define V8_LIFETIME_BOUND [[clang::lifetimebound]] +#else +#define V8_LIFETIME_BOUND /* NOT SUPPORTED */ +#endif + // Marks a type as being eligible for the "trivial" ABI despite having a // non-trivial destructor or copy/move constructor. Such types can be relocated // after construction by simply copying their memory, which makes them eligible @@ -798,7 +857,8 @@ V8 shared library set USING_V8_SHARED. #else // V8_OS_WIN // Setup for Linux shared library export. -#if V8_HAS_ATTRIBUTE_VISIBILITY && (defined(BUILDING_V8_SHARED) || USING_V8_SHARED) +#if (V8_HAS_ATTRIBUTE_VISIBILITY && \ + (defined(BUILDING_V8_SHARED) || USING_V8_SHARED)) # define V8_EXPORT __attribute__((visibility("default"))) #else # define V8_EXPORT @@ -909,8 +969,6 @@ V8 shared library set USING_V8_SHARED. #define V8_TARGET_ARCH_32_BIT 1 #elif V8_TARGET_ARCH_ARM64 #define V8_TARGET_ARCH_64_BIT 1 -#elif V8_TARGET_ARCH_MIPS -#define V8_TARGET_ARCH_32_BIT 1 #elif V8_TARGET_ARCH_MIPS64 #define V8_TARGET_ARCH_64_BIT 1 #elif V8_TARGET_ARCH_LOONG64 @@ -948,8 +1006,10 @@ V8 shared library set USING_V8_SHARED. #if (V8_TARGET_ARCH_MIPS64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_MIPS64)) #error Target architecture mips64 is only supported on mips64 and x64 host #endif -#if (V8_TARGET_ARCH_RISCV64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_RISCV64)) -#error Target architecture riscv64 is only supported on riscv64 and x64 host +#if (V8_TARGET_ARCH_RISCV64 && \ + !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_ARM64 || V8_HOST_ARCH_RISCV64)) +#error Target architecture riscv64 is only supported on riscv64, x64, and \ +arm64 host #endif #if (V8_TARGET_ARCH_RISCV32 && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_RISCV32)) #error Target architecture riscv32 is only supported on riscv32 and ia32 host diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index 6f6d3720b79dc6..147910193bd666 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -66,11 +66,8 @@ 'V8 Linux - verify csa - builder': 'release_x86_verify_csa', # Linux64. 'V8 Linux64 - builder': 'release_x64_gcmole', - 'V8 Linux64 - builder (reclient)': 'release_x64_reclient', - 'V8 Linux64 - builder (reclient compare)': 'release_x64_reclient', 'V8 Linux64 - official - builder': 'official_x64_on_release_branch', 'V8 Linux64 - debug builder': 'debug_x64', - 'V8 Linux64 - no leaptiering - debug builder': 'debug_x64_no_leaptiering', 'V8 Linux64 - no shared cage - debug builder': 'debug_x64_no_shared_cage', 'V8 Linux64 - custom snapshot - debug builder': 'debug_x64_custom', 'V8 Linux64 - internal snapshot - builder': 'release_x64_internal', @@ -80,25 +77,22 @@ 'V8 Linux64 - shared - builder': 'release_x64_shared_verify_heap', 'V8 Linux64 - verify csa - builder': 'release_x64_verify_csa', 'V8 Linux64 - no wasm - builder': 'release_x64_webassembly_disabled', + 'V8 Linux64 - PKU - debug builder': 'debug_x64_sandbox_hardware_support', + 'V8 Linux64 - PKU - builder': 'release_x64_sandbox_hardware_support', # Windows. 'V8 Win - arm64 - debug builder': 'debug_arm64', 'V8 Win32 - builder': 'release_x86_minimal_symbols', - 'V8 Win32 - builder (reclient)': 'release_x86_minimal_symbols_reclient', - 'V8 Win32 - builder (reclient compare)': 'release_x86_minimal_symbols_reclient', 'V8 Win32 - debug builder': 'debug_x86_minimal_symbols', # TODO(machenbach): Remove after switching to x64 on infra side. 'V8 Win64 ASAN - builder': 'release_x64_asan_no_lsan', 'V8 Win64 - CET shadow stack - builder': 'release_x64_cet_shadow_stack', 'V8 Win64 - builder': 'release_x64_minimal_symbols', - 'V8 Win64 - builder (reclient)': 'release_x64_minimal_symbols_reclient', - 'V8 Win64 - builder (reclient compare)': 'release_x64_minimal_symbols_reclient', 'V8 Win64 - dev image': 'release_x64_minimal_symbols', 'V8 Win64 - debug builder': 'debug_x64_minimal_symbols', 'V8 Win64 - drumbrake - debug builder': 'debug_x64_drumbrake', # Mac. 'V8 Mac64 - builder': 'release_x64', 'V8 Mac64 - debug builder': 'debug_x64', - 'V8 Mac64 - builder (reclient)': 'release_x64_reclient', 'V8 Official Mac ARM64': 'release_arm64', 'V8 Official Mac ARM64 Debug': 'debug_arm64', 'V8 Mac64 ASAN - builder': 'release_x64_asan_no_lsan', @@ -111,10 +105,10 @@ 'V8 Linux64 TSAN - builder': 'release_x64_tsan', 'V8 Linux64 TSAN - debug builder': 'debug_x64_tsan_minimal_symbols', 'V8 Linux64 TSAN - no-concurrent-marking - builder': 'release_x64_tsan_no_cm', - 'V8 Linux - arm64 - sim - CFI - builder': 'release_simulate_arm64_cfi', 'V8 Linux - arm64 - sim - MSAN - builder': 'release_simulate_arm64_msan', # FYI. 'V8 iOS - sim - builder': 'release_x64_ios_simulator', + 'V8 Linux64 - arm64 - ASAN - builder': 'release_arm64_asan', 'V8 Linux64 - arm64 - builder': 'release_arm64', 'V8 Linux64 - arm64 - debug builder': 'debug_arm64', 'V8 Linux64 - arm64 - sim - no pointer compression - builder': @@ -127,12 +121,10 @@ 'V8 Linux64 - debug - single generation - builder': 'debug_x64_single_generation', 'V8 Linux64 - no pointer compression - builder': 'release_x64_no_pointer_compression', 'V8 Linux64 - sticky mark bits - debug builder': 'debug_x64_sticky_mark_bits', + 'V8 Linux64 - undefined double - debug builder': 'debug_x64_undefined_double', 'V8 Linux64 css - debug builder': 'debug_x64_conservative_stack_scanning', - 'V8 Linux64 gcc - builder': 'release_x64_gcc', 'V8 Linux64 - jammy - gcc - builder': 'release_x64_gcc', - 'V8 Linux64 gcc - debug builder': 'debug_x64_gcc', 'V8 Linux64 - jammy - gcc - debug builder': 'debug_x64_gcc', - 'V8 Linux64 gcc light - debug builder': 'debug_x64_gcc', 'V8 Fuchsia - builder': 'release_x64_fuchsia', 'V8 Fuchsia - debug builder': 'debug_x64_fuchsia', 'V8 Linux64 - cfi - builder': 'release_x64_cfi', @@ -153,43 +145,44 @@ 'V8 Centipede Linux64 ASAN - release builder': 'release_x64_asan_centipede', 'V8 Clusterfuzz Win64 ASAN - release builder': - 'release_x64_asan_no_lsan_verify_heap_turboshaft_csa', + 'release_x64_asan_no_lsan_verify_heap', # Note this is called a debug builder, but it uses a release build # configuration with dchecks (which enables DEBUG in V8), since win-asan # debug is not supported. 'V8 Clusterfuzz Win64 ASAN - debug builder': - 'release_x64_asan_no_lsan_verify_heap_dchecks_turboshaft_csa', + 'release_x64_asan_no_lsan_verify_heap_dchecks', 'V8 Clusterfuzz Mac64 ASAN - release builder': - 'release_x64_asan_no_lsan_verify_heap_turboshaft_csa', + 'release_x64_asan_no_lsan_verify_heap', 'V8 Clusterfuzz Mac64 ASAN - debug builder': - 'debug_x64_asan_no_lsan_static_turboshaft_csa', + 'debug_x64_asan_no_lsan_static', 'V8 Clusterfuzz Linux64 - release builder': - 'release_x64_correctness_fuzzer_turboshaft_csa', - 'V8 Clusterfuzz Linux64 - debug builder': 'debug_x64_turboshaft_csa', + 'release_x64_correctness_fuzzer', + 'V8 Clusterfuzz Linux64 - debug builder': 'debug_x64', 'V8 Clusterfuzz Linux64 ASAN no inline - release builder': - 'release_x64_asan_symbolized_verify_heap_turboshaft_csa', + 'release_x64_asan_symbolized_verify_heap', 'V8 Clusterfuzz Linux ASAN no inline - release builder': - 'release_x86_asan_symbolized_verify_heap_turboshaft_csa', - 'V8 Clusterfuzz Linux64 ASAN - debug builder': 'debug_x64_asan_turboshaft_csa', - 'V8 Clusterfuzz Linux ASAN - debug builder': 'debug_x86_asan_turboshaft_csa', + 'release_x86_asan_symbolized_verify_heap', + 'V8 Clusterfuzz Linux64 ASAN - debug builder': 'debug_x64_asan', + 'V8 Clusterfuzz Linux64 ASAN - undefined double - debug builder': 'debug_x64_asan_undefined_double', + 'V8 Clusterfuzz Linux ASAN - debug builder': 'debug_x86_asan', 'V8 Clusterfuzz Linux64 ASAN arm64 - debug builder': - 'debug_simulate_arm64_asan_turboshaft_csa', - 'V8 Clusterfuzz Linux - debug builder': 'debug_x86_turboshaft_csa', + 'debug_simulate_arm64_asan', + 'V8 Clusterfuzz Linux - debug builder': 'debug_x86', 'V8 Clusterfuzz Linux ASAN arm - debug builder': - 'debug_simulate_arm_asan_turboshaft_csa', + 'debug_simulate_arm_asan', 'V8 Clusterfuzz Linux64 CFI - release builder': - 'release_x64_cfi_clusterfuzz_turboshaft_csa', + 'release_x64_cfi_clusterfuzz', 'V8 Clusterfuzz Linux MSAN no origins': - 'release_simulate_arm64_msan_no_origins_turboshaft_csa', + 'release_simulate_arm64_msan_no_origins', 'V8 Clusterfuzz Linux MSAN chained origins': - 'release_simulate_arm64_msan_turboshaft_csa', - 'V8 Clusterfuzz Linux64 TSAN - release builder': 'release_x64_tsan_turboshaft_csa', + 'release_simulate_arm64_msan', + 'V8 Clusterfuzz Linux64 TSAN - release builder': 'release_x64_tsan', 'V8 Clusterfuzz Linux64 UBSan - release builder': - 'release_x64_ubsan_recover_turboshaft_csa', + 'release_x64_ubsan_recover', 'V8 Clusterfuzz Linux64 sandbox testing - release builder': - 'release_x64_sandbox_testing_turboshaft_csa', + 'release_x64_sandbox_testing', 'V8 Clusterfuzz Linux64 ASAN sandbox testing - release builder': - 'release_x64_asan_sandbox_testing_turboshaft_csa', + 'release_x64_asan_sandbox_testing', }, 'client.v8.perf' : { # Arm @@ -250,7 +243,6 @@ 'v8_android_arm_verify_deterministic_dbg': 'debug_android_arm_verify_deterministic', 'v8_android_arm64_compile_dbg': 'debug_android_arm64', 'v8_android_arm64_d8_compile_rel': 'release_android_arm64', - 'v8_android_arm64_n5x_compile_rel': 'release_android_arm64', 'v8_android_arm64_p7_compile_rel': 'release_android_arm64', 'v8_fuchsia_compile_rel': 'release_x64_fuchsia_trybot', 'v8_ios_simulator': 'release_x64_ios_simulator', @@ -265,6 +257,7 @@ 'v8_linux_gc_stress_compile_dbg': 'debug_x86_trybot', 'v8_linux_shared_compile_rel': 'release_x86_shared_verify_heap', 'v8_linux_vtunejit': 'debug_x86_vtunejit', + 'v8_linux64_arm64_asan_compile_rel': 'release_arm64_asan', 'v8_linux64_arm64_compile_dbg': 'debug_arm64_trybot', 'v8_linux64_arm64_compile_rel': 'release_arm64_trybot', 'v8_linux64_native_arm64_no_pointer_compression_compile_rel': 'release_arm64_no_pointer_compression_trybot', @@ -272,9 +265,9 @@ 'release_simulate_arm64_no_pointer_compression', 'v8_linux64_asan_centipede_compile_dbg': 'debug_x64_asan_centipede', 'v8_linux64_asan_centipede_compile_rel': 'release_x64_asan_centipede', + 'v8_linux64_asan_undefined_double_compile_dbg': 'debug_x64_asan_undefined_double', 'v8_linux64_cppgc_non_default_compile_dbg': 'debug_x64_non_default_cppgc', 'v8_linux64_compile_dbg': 'debug_x64_trybot', - 'v8_linux64_no_leaptiering_compile_dbg': 'debug_x64_no_leaptiering', 'v8_linux64_no_shared_cage_compile_dbg': 'debug_x64_no_shared_cage', 'v8_linux64_coverage_dbg': 'debug_x64_coverage', 'v8_linux64_coverage_rel': 'release_x64_coverage', @@ -299,16 +292,16 @@ 'v8_linux64_no_sandbox_compile_rel': 'release_x64_no_sandbox', 'v8_linux64_official_compile_rel': 'official_x64_on_release_branch', 'v8_linux64_predictable_compile_rel': 'release_x64_predictable', - 'v8_linux64_pku_compile_dbg': 'debug_x64', - 'v8_linux64_pku_compile_rel': 'release_x64', + 'v8_linux64_pku_compile_dbg': 'debug_x64_sandbox_hardware_support', + 'v8_linux64_pku_compile_rel': 'release_x64_sandbox_hardware_support', 'v8_linux64_shared_compile_rel': 'release_x64_shared_verify_heap', 'v8_linux64_single_generation_compile_dbg': 'debug_x64_single_generation', 'v8_linux64_no_wasm_compile_rel': 'release_x64_webassembly_disabled', 'v8_linux64_arm64_no_wasm_compile_dbg': 'debug_arm64_webassembly_disabled', 'v8_linux64_verify_csa_compile_rel': 'release_x64_verify_csa', 'v8_linux64_asan_compile_rel': 'release_x64_asan_minimal_symbols', - 'v8_linux64_sandbox_testing_compile_rel': 'release_x64_sandbox_testing_turboshaft_csa', - 'v8_linux64_asan_sandbox_testing_compile_rel': 'release_x64_asan_sandbox_testing_turboshaft_csa', + 'v8_linux64_sandbox_testing_compile_rel': 'release_x64_sandbox_testing', + 'v8_linux64_asan_sandbox_testing_compile_rel': 'release_x64_asan_sandbox_testing', 'v8_linux64_cfi_compile_rel': 'release_x64_cfi', 'v8_linux64_fuzzilli_compile_rel': 'release_x64_fuzzilli', 'v8_linux64_loong64_compile_rel': 'release_simulate_loong64', @@ -324,6 +317,7 @@ 'v8_linux64_tsan_isolates_compile_rel': 'release_x64_tsan_minimal_symbols', 'v8_linux64_ubsan_compile_rel': 'release_x64_ubsan_minimal_symbols', + 'v8_linux64_undefined_double_compile_dbg': 'debug_x64_undefined_double', 'v8_linux64_verify_builtins_rel': 'release_x64_verify_builtins', 'v8_linux64_verify_deterministic_rel': 'release_x64_verify_deterministic', 'v8_linux_torque_compare': 'torque_compare', @@ -354,11 +348,10 @@ 'v8_linux_arm_armv8a_rel': 'release_simulate_arm_trybot', 'v8_linux_arm_armv8a_dbg': 'debug_simulate_arm', 'v8_linux_arm64_compile_rel': 'release_simulate_arm64_gcmole_trybot', - 'v8_linux_arm64_cfi_compile_rel' : 'release_simulate_arm64_cfi', 'v8_linux_arm64_compile_dbg': 'debug_simulate_arm64', 'v8_linux_arm64_gc_stress_compile_dbg': 'debug_simulate_arm64', 'v8_linux_mips64el_compile_rel': 'release_simulate_mips64el', - 'v8_numfuzz_asan_compile_rel': 'release_x64_asan_symbolized_verify_heap_turboshaft_csa', + 'v8_numfuzz_asan_compile_rel': 'release_x64_asan_symbolized_verify_heap', 'v8_numfuzz_compile_rel': 'release_x64', 'v8_numfuzz_compile_dbg': 'debug_x64', 'v8_numfuzz_tsan_compile_rel': 'release_x64_tsan', @@ -457,15 +450,14 @@ # Debug configs for simulators. 'debug_simulate_arm': [ 'debug_bot', 'simulate_arm'], - 'debug_simulate_arm_asan_turboshaft_csa': [ - 'debug_bot', 'simulate_arm', 'asan', 'v8_enable_turboshaft_csa'], + 'debug_simulate_arm_asan': [ + 'debug_bot', 'simulate_arm', 'asan'], 'debug_simulate_arm_lite': [ 'debug_bot', 'simulate_arm', 'v8_enable_lite_mode'], 'debug_simulate_arm64': [ 'debug_bot', 'simulate_arm64'], - 'debug_simulate_arm64_asan_turboshaft_csa': [ - 'debug_bot', 'simulate_arm64', 'asan', 'lsan', - 'v8_enable_turboshaft_csa'], + 'debug_simulate_arm64_asan': [ + 'debug_bot', 'simulate_arm64', 'asan', 'lsan'], # Release configs for simulators. 'release_simulate_arm_gcmole': [ @@ -478,8 +470,6 @@ 'release_trybot', 'simulate_arm', 'v8_enable_lite_mode'], 'release_simulate_arm_trybot': [ 'release_trybot', 'simulate_arm'], - 'release_simulate_arm64_cfi': [ - 'release_bot', 'simulate_arm64', 'v8_control_flow_integrity'], 'release_simulate_arm64_gcmole': [ 'release_bot', 'simulate_arm64', 'gcmole'], 'release_simulate_arm64_gcmole_trybot': [ @@ -491,11 +481,10 @@ 'release_bot', 'simulate_arm64', 'msan'], 'release_simulate_arm64_msan_minimal_symbols': [ 'release_bot', 'simulate_arm64', 'msan', 'minimal_symbols'], - 'release_simulate_arm64_msan_no_origins_turboshaft_csa': [ - 'release_bot', 'simulate_arm64', 'msan_no_origins', - 'v8_enable_turboshaft_csa'], - 'release_simulate_arm64_msan_turboshaft_csa': [ - 'release_bot', 'simulate_arm64', 'msan', 'v8_enable_turboshaft_csa'], + 'release_simulate_arm64_msan_no_origins': [ + 'release_bot', 'simulate_arm64', 'msan_no_origins'], + 'release_simulate_arm64_msan': [ + 'release_bot', 'simulate_arm64', 'msan'], 'release_simulate_loong64': [ 'release_bot', 'simulate_loong64'], 'release_simulate_mips64el': [ @@ -535,6 +524,8 @@ 'release_bot', 'arm', 'hard_float'], 'release_arm64': [ 'release_bot', 'arm64'], + 'release_arm64_asan': [ + 'release_bot', 'arm64', 'asan'], 'release_arm64_no_pointer_compression': [ 'release_bot', 'arm64', 'v8_disable_pointer_compression'], 'release_arm64_trybot': [ @@ -587,27 +578,25 @@ 'release_bot', 'x64', 'asan', 'lsan', 'minimal_symbols'], 'release_x64_asan_no_lsan': [ 'release_bot', 'x64', 'asan'], - 'release_x64_asan_no_lsan_verify_heap_turboshaft_csa': [ - 'release_bot', 'x64', 'asan', 'v8_verify_heap', - 'v8_enable_turboshaft_csa'], - 'release_x64_asan_no_lsan_verify_heap_dchecks_turboshaft_csa': [ + 'release_x64_asan_no_lsan_verify_heap': [ + 'release_bot', 'x64', 'asan', 'v8_verify_heap'], + 'release_x64_asan_no_lsan_verify_heap_dchecks': [ 'release_bot', 'x64', 'asan', 'dcheck_always_on', - 'v8_enable_slow_dchecks', 'v8_verify_heap', 'v8_enable_turboshaft_csa'], - 'release_x64_sandbox_testing_turboshaft_csa': [ - 'release_bot', 'x64', 'symbolized', 'backtrace', 'v8_enable_memory_corruption_api', - 'v8_enable_turboshaft_csa'], - 'release_x64_asan_sandbox_testing_turboshaft_csa': [ + 'v8_enable_slow_dchecks', 'v8_verify_heap'], + 'release_x64_sandbox_testing': [ + 'release_bot', 'x64', 'symbolized', 'backtrace', 'v8_enable_memory_corruption_api'], + 'release_x64_asan_sandbox_testing': [ 'release_bot', 'x64', 'asan', 'symbolized', - 'v8_enable_memory_corruption_api', 'v8_enable_turboshaft_csa'], - 'release_x64_asan_symbolized_verify_heap_turboshaft_csa': [ + 'v8_enable_memory_corruption_api'], + 'release_x64_asan_symbolized_verify_heap': [ 'release_bot', 'x64', 'asan', 'lsan', 'symbolized', - 'v8_verify_heap', 'v8_enable_turboshaft_csa'], + 'v8_verify_heap'], 'release_x64_cet_shadow_stack': [ 'release_bot', 'x64', 'cet_shadow_stack'], 'release_x64_cfi': [ 'release_bot', 'x64', 'cfi'], - 'release_x64_cfi_clusterfuzz_turboshaft_csa': [ - 'release_bot', 'x64', 'cfi_clusterfuzz', 'v8_enable_turboshaft_csa'], + 'release_x64_cfi_clusterfuzz': [ + 'release_bot', 'x64', 'cfi_clusterfuzz'], 'release_x64_coverage': [ 'release_bot', 'x64', 'clang_coverage'], 'release_x64_fuzzilli': [ @@ -615,9 +604,8 @@ 'v8_verify_heap', 'v8_verify_csa', 'fuzzilli'], 'release_x64_gcmole': [ 'release_bot', 'x64', 'gcmole'], - 'release_x64_correctness_fuzzer_turboshaft_csa' : [ - 'release_bot', 'x64', 'v8_correctness_fuzzer', - 'v8_enable_turboshaft_csa'], + 'release_x64_correctness_fuzzer' : [ + 'release_bot', 'x64', 'v8_correctness_fuzzer'], 'release_x64_disable_runtime_call_stats': [ 'release_bot', 'x64', 'v8_disable_runtime_call_stats'], 'release_x64_fuchsia': [ @@ -625,7 +613,7 @@ 'release_x64_fuchsia_trybot': [ 'release_trybot', 'x64', 'fuchsia'], 'release_x64_gcc': [ - 'release_bot_no_reclient', 'x64', 'gcc', 'lld', 'no_custom_libcxx'], + 'release_bot_no_remoteexec', 'x64', 'gcc', 'lld', 'no_custom_libcxx'], 'release_x64_ios_simulator': [ 'release_bot', 'x64', 'ios_simulator'], 'release_x64_internal': [ @@ -634,15 +622,13 @@ 'release_bot', 'x64', 'v8_lower_limits_mode'], 'release_x64_minimal_symbols': [ 'release_bot', 'x64', 'minimal_symbols'], - 'release_x64_minimal_symbols_reclient': [ - 'release_bot_reclient', 'x64', 'minimal_symbols'], 'release_x64_no_pointer_compression': [ 'release_bot', 'x64', 'no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_enable_javascript_promise_hooks', 'v8_disable_pointer_compression'], - 'release_x64_reclient': [ - 'release_bot_reclient', 'x64'], 'release_x64_no_sandbox': [ 'release_bot', 'x64', 'no_sandbox'], + 'release_x64_sandbox_hardware_support': [ + 'release_bot', 'x64', 'sandbox_hardware_support'], 'release_x64_trybot': [ 'release_trybot', 'x64'], 'release_x64_test_features_gcmole_trybot': [ @@ -655,14 +641,14 @@ 'release_bot', 'x64', 'tsan', 'disable_concurrent_marking'], 'release_x64_tsan_minimal_symbols': [ 'release_bot', 'x64', 'tsan', 'minimal_symbols'], - 'release_x64_tsan_turboshaft_csa': [ - 'release_bot', 'x64', 'tsan', 'v8_enable_turboshaft_csa'], + 'release_x64_tsan': [ + 'release_bot', 'x64', 'tsan'], 'release_x64_ubsan': [ 'release_bot', 'x64', 'ubsan'], 'release_x64_ubsan_minimal_symbols': [ 'release_bot', 'x64', 'ubsan', 'minimal_symbols'], - 'release_x64_ubsan_recover_turboshaft_csa': [ - 'release_bot', 'x64', 'ubsan_recover', 'v8_enable_turboshaft_csa'], + 'release_x64_ubsan_recover': [ + 'release_bot', 'x64', 'ubsan_recover'], 'release_x64_shared_verify_heap': [ 'release_bot', 'x64', 'shared', 'v8_verify_heap'], 'release_x64_verify_builtins': [ @@ -688,13 +674,15 @@ # Debug configs for x64. 'debug_x64': [ 'debug_bot', 'x64'], - 'debug_x64_asan_turboshaft_csa': [ - 'debug_bot', 'x64', 'asan', 'lsan', 'v8_enable_turboshaft_csa'], + 'debug_x64_asan': [ + 'debug_bot', 'x64', 'asan', 'lsan'], 'debug_x64_asan_centipede': [ 'debug_bot', 'x64', 'asan', 'use_centipede'], - 'debug_x64_asan_no_lsan_static_turboshaft_csa': [ - 'debug', 'static', 'reclient', 'v8_enable_slow_dchecks', - 'v8_optimized_debug', 'x64', 'asan', 'v8_enable_turboshaft_csa'], + 'debug_x64_asan_no_lsan_static': [ + 'debug', 'static', 'remoteexec', 'v8_enable_slow_dchecks', + 'v8_optimized_debug', 'x64', 'asan'], + 'debug_x64_asan_undefined_double': [ + 'debug_bot', 'x64', 'asan', 'v8_enable_undefined_double'], 'debug_x64_conservative_stack_scanning': [ 'debug_bot', 'x64', 'conservative_stack_scanning'], 'debug_x64_coverage': [ @@ -706,11 +694,9 @@ 'debug_x64_fuchsia': [ 'debug_bot', 'x64', 'fuchsia'], 'debug_x64_gcc': [ - 'debug_bot_no_reclient', 'x64', 'gcc', 'lld', 'no_custom_libcxx'], + 'debug_bot_no_remoteexec', 'x64', 'gcc', 'lld', 'no_custom_libcxx'], 'debug_x64_header_includes': [ 'debug_bot', 'x64', 'v8_check_header_includes'], - 'debug_x64_no_leaptiering': [ - 'debug_bot', 'x64', 'v8_disable_leaptiering'], 'debug_x64_no_shared_cage': [ 'debug_bot', 'x64', 'v8_disable_pointer_compression_shared_cage'], 'debug_x64_minimal_symbols': [ @@ -721,14 +707,16 @@ 'debug_bot', 'x64', 'perfetto'], 'debug_x64_no_sandbox': [ 'debug_bot', 'x64', 'no_sandbox'], + 'debug_x64_sandbox_hardware_support': [ + 'debug_bot', 'x64', 'sandbox_hardware_support'], 'debug_x64_single_generation': [ 'debug_bot', 'x64', 'v8_enable_single_generation'], 'debug_x64_sticky_mark_bits': [ 'debug_bot', 'x64', 'v8_enable_sticky_mark_bits'], 'debug_x64_trybot': [ 'debug_trybot', 'x64'], - 'debug_x64_turboshaft_csa': [ - 'debug_bot', 'x64', 'v8_enable_turboshaft_csa'], + 'debug_x64': [ + 'debug_bot', 'x64'], 'debug_x64_dict_tracking_trybot': [ 'debug_trybot', 'x64', 'v8_enable_dict_property_const_tracking'], 'debug_x64_trybot_custom': [ @@ -736,45 +724,45 @@ 'debug_x64_tsan_minimal_symbols': [ 'debug_bot_no_slow_dchecks', 'minimal_symbols', 'x64', 'dcheck_always_on', 'tsan', 'v8_disable_verify_heap', 'v8_fast_mksnapshot'], + 'debug_x64_undefined_double': [ + 'debug_bot', 'x64', 'v8_enable_undefined_double'], 'full_debug_x64': [ 'debug_bot', 'x64', 'v8_full_debug'], # Debug configs for x86. 'debug_x86': [ 'debug_bot', 'x86'], - 'debug_x86_asan_turboshaft_csa': [ - 'debug_bot', 'x86', 'asan', 'lsan', 'v8_enable_turboshaft_csa'], + 'debug_x86_asan': [ + 'debug_bot', 'x86', 'asan', 'lsan'], 'debug_x86_minimal_symbols': [ 'debug_bot', 'x86', 'minimal_symbols'], 'debug_x86_no_i18n': [ 'debug_bot', 'x86', 'v8_no_i18n'], 'debug_x86_trybot': [ 'debug_trybot', 'x86'], - 'debug_x86_turboshaft_csa': [ - 'debug_bot', 'x86', 'v8_enable_turboshaft_csa'], + 'debug_x86': [ + 'debug_bot', 'x86'], 'debug_x86_vtunejit': [ 'debug_bot', 'x86', 'v8_enable_vtunejit'], 'full_debug_x86': [ - 'debug', 'x86', 'reclient', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 'x86', 'remoteexec', 'v8_enable_slow_dchecks', 'v8_full_debug'], # Release configs for x86. - 'release_x86_asan_symbolized_verify_heap_turboshaft_csa': [ + 'release_x86_asan_symbolized_verify_heap': [ 'release_bot', 'x86', 'asan', 'lsan', 'symbolized', - 'v8_verify_heap', 'v8_enable_turboshaft_csa'], + 'v8_verify_heap'], 'release_x86_gcmole': [ 'release_bot', 'x86', 'gcmole'], 'release_x86_gcmole_trybot': [ 'release_trybot', 'x86', 'gcmole'], 'release_x86_minimal_symbols': [ 'release_bot', 'x86', 'minimal_symbols'], - 'release_x86_minimal_symbols_reclient': [ - 'release_bot_reclient', 'x86', 'minimal_symbols'], 'release_x86_no_i18n_trybot': [ 'release_trybot', 'x86', 'v8_no_i18n'], 'release_x64_predictable': [ 'release_bot', 'x64', 'v8_enable_verify_predictable'], 'release_x86_shared_verify_heap': [ - 'release', 'x86', 'reclient', 'shared', 'v8_verify_heap'], + 'release', 'x86', 'remoteexec', 'shared', 'v8_verify_heap'], 'release_x86_trybot': [ 'release_trybot', 'x86'], 'release_x86_verify_csa': [ @@ -799,7 +787,7 @@ 'mixins': { 'android': { - 'gn_args': 'target_os="android" v8_android_log_stdout=true default_min_sdk_version=21', + 'gn_args': 'target_os="android" v8_android_log_stdout=true default_min_sdk_version=23', }, 'android_strip_outputs': { @@ -820,7 +808,7 @@ }, 'builtins_profiling': { - 'mixins' : ['release_bot_reclient'], + 'mixins' : ['release_bot_remoteexec'], 'gn_args': 'v8_enable_builtins_profiling=true', }, @@ -866,19 +854,19 @@ 'debug_bot_no_slow_dchecks': { 'mixins': [ - 'debug', 'shared', 'reclient', 'v8_disable_slow_dchecks', + 'debug', 'shared', 'remoteexec', 'v8_disable_slow_dchecks', 'v8_optimized_debug', 'v8_enable_google_benchmark'], }, 'debug_bot': { 'mixins': [ - 'debug', 'shared', 'reclient', 'v8_enable_slow_dchecks', + 'debug', 'shared', 'remoteexec', 'v8_enable_slow_dchecks', 'v8_optimized_debug', 'v8_enable_google_benchmark'], }, - 'debug_bot_no_reclient': { + 'debug_bot_no_remoteexec': { 'mixins': [ - 'debug', 'shared', 'no_reclient', 'v8_enable_slow_dchecks', + 'debug', 'shared', 'no_remoteexec', 'v8_enable_slow_dchecks', 'v8_optimized_debug'], }, @@ -952,14 +940,18 @@ 'gn_args': 'use_custom_libcxx=false', }, - 'no_reclient': { - 'gn_args': 'use_remoteexec=false use_siso=false', + 'no_remoteexec': { + 'gn_args': 'use_remoteexec=false', }, 'no_sandbox': { 'gn_args': 'v8_enable_sandbox=false', }, + 'sandbox_hardware_support': { + 'gn_args': 'v8_enable_sandbox_hardware_support=true', + }, + 'non_default_cppgc': { 'gn_args': 'cppgc_enable_object_names=true cppgc_enable_young_generation=true', }, @@ -968,11 +960,8 @@ 'gn_args': 'v8_use_perfetto=true', }, - # TODO(https://crbug.com/414724525): Temporarily use the reclient and siso - # configs synonym. In a follow up we'll drop the reclient parts and replace - # them with SISO configs. - 'reclient': { - 'gn_args': 'use_remoteexec=true use_siso=true', + 'remoteexec': { + 'gn_args': 'use_remoteexec=true', }, 'release': { @@ -984,15 +973,15 @@ }, 'release_bot': { - 'mixins': ['release', 'static', 'reclient', 'v8_enable_google_benchmark'], + 'mixins': ['release', 'static', 'remoteexec', 'v8_enable_google_benchmark'], }, - 'release_bot_no_reclient': { - 'mixins': ['release', 'static', 'no_reclient'], + 'release_bot_no_remoteexec': { + 'mixins': ['release', 'static', 'no_remoteexec'], }, - 'release_bot_reclient': { - 'mixins': ['release', 'static', 'reclient'], + 'release_bot_remoteexec': { + 'mixins': ['release', 'static', 'remoteexec'], }, 'release_trybot': { @@ -1080,14 +1069,6 @@ 'gn_args': 'v8_correctness_fuzzer=true v8_multi_arch_build=true', }, - 'v8_control_flow_integrity' : { - 'gn_args': 'v8_control_flow_integrity=true', - }, - - 'v8_disable_leaptiering': { - 'gn_args': 'v8_enable_leaptiering=false v8_enable_sandbox=false', - }, - 'v8_disable_runtime_call_stats': { 'gn_args': 'v8_enable_runtime_call_stats=false', }, @@ -1154,8 +1135,8 @@ 'gn_args': 'v8_enable_test_features=true', }, - 'v8_enable_turboshaft_csa': { - 'gn_args': 'v8_enable_turboshaft_csa=true', + 'v8_enable_undefined_double': { + 'gn_args': 'v8_enable_experimental_undefined_double=true', }, 'v8_enable_verify_predictable': { diff --git a/deps/v8/infra/testing/PRESUBMIT.py b/deps/v8/infra/testing/PRESUBMIT.py index 2e93155d8132fc..67e72197eab1b4 100644 --- a/deps/v8/infra/testing/PRESUBMIT.py +++ b/deps/v8/infra/testing/PRESUBMIT.py @@ -24,13 +24,14 @@ # This is not an exhaustive list. It only reflects what we currently use. If # there's need to specify a different dimension, just add it here. SUPPORTED_SWARMING_DIMENSIONS = [ - 'cores', - 'cpu', - 'device_os', - 'device_type', - 'gpu', - 'os', - 'pool', + 'cores', + 'cpu', + 'device_os', + 'device_type', + 'gpu', + 'host_class', + 'os', + 'pool', ] # This is not an exhaustive list. It only reflects what we currently use. If diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl index 787c43b1d5f95b..8e00738857d1a1 100644 --- a/deps/v8/infra/testing/builders.pyl +++ b/deps/v8/infra/testing/builders.pyl @@ -32,18 +32,6 @@ ### luci.v8.try ############################################################################## # Android - 'v8_android_arm64_n5x_rel': { - 'swarming_dimensions' : { - 'device_os': 'OPR4.170623.020', - 'device_type': 'bullhead', - 'os': 'Android', - }, - 'tests': [ - {'name': 'mozilla', 'variant': 'default'}, - {'name': 'test262', 'variant': 'default', 'shards': 12}, - {'name': 'v8testing', 'variant': 'default', 'shards': 4}, - ], - }, 'v8_android_arm64_p7_rel': { 'swarming_dimensions' : { 'device_os': 'AP2A.240705.004', @@ -329,11 +317,21 @@ }, ############################################################################## # Linux64 + 'v8_linux64_arm64_asan_rel': { + 'swarming_dimensions': { + 'os': 'Linux', + 'cpu': 'arm64', + 'pool': 'v8.tests', + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default'}, + ], + }, 'v8_linux64_arm64_dbg': { 'swarming_dimensions': { 'os': 'Linux', 'cpu': 'arm64', - 'pool': 'chromium.tests', + 'pool': 'v8.tests', }, 'tests': [ {'name': 'v8testing', 'variant': 'default'}, @@ -343,7 +341,7 @@ 'swarming_dimensions': { 'os': 'Linux', 'cpu': 'arm64', - 'pool': 'chromium.tests', + 'pool': 'v8.tests', }, 'tests': [ {'name': 'v8testing', 'variant': 'default'}, @@ -422,10 +420,10 @@ {'name': 'test262', 'variant': 'default', 'shards': 3}, {'name': 'test262', 'variant': 'future', 'shards': 3}, {'name': 'test262', 'variant': 'extra', 'shards': 14}, - {'name': 'v8testing', 'shards': 5}, + {'name': 'v8testing', 'shards': 8}, {'name': 'v8testing', 'variant': 'extra', 'shards': 5}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, {'name': 'v8testing', 'variant': 'no_lfa'}, {'name': 'v8testing', 'variant': 'stress_instruction_scheduling'}, @@ -486,7 +484,7 @@ }, 'tests': [ # Infra staging. - {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2}, + {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 4}, # Stress sampling. {'name': 'mjsunit', 'variant': 'stress_sampling'}, {'name': 'webkit', 'variant': 'stress_sampling'}, @@ -539,7 +537,7 @@ }, { 'name': 'mjsunit', - 'variant': 'conservative_pinning', + 'variant': 'conservative_stack_scanning', 'test_args': ['--gc-stress'], 'shards': 2 }, @@ -627,7 +625,7 @@ {'name': 'v8testing', 'variant': 'stress_maglev_future'}, {'name': 'v8testing', 'variant': 'turbolev'}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -639,20 +637,12 @@ {'name': 'v8testing', 'shards': 3}, ], }, - 'v8_linux64_no_leaptiering_dbg': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-22.04', - }, - 'tests': [ - {'name': 'v8testing', 'shards': 5}, - ], - }, 'v8_linux64_no_shared_cage_dbg': { 'swarming_dimensions' : { 'os': 'Ubuntu-22.04', }, 'tests': [ - {'name': 'v8testing', 'shards': 5}, + {'name': 'v8testing', 'shards': 8}, ], }, 'v8_linux64_no_pointer_compression_rel': { @@ -686,9 +676,13 @@ 'os': 'Ubuntu-22.04', 'cpu': 'x86-64-avx2', 'pool': 'v8.tests', + 'host_class': 'pku', }, 'tests': [ - {'name': 'v8testing', 'variant': 'default'}, + {'name': 'v8testing', + 'variant': 'default', + 'test_args': ['--extra-flags', '--force-memory-protection-keys'] + }, ], }, 'v8_linux64_pku_rel': { @@ -696,9 +690,13 @@ 'os': 'Ubuntu-22.04', 'cpu': 'x86-64-avx2', 'pool': 'v8.tests', + 'host_class': 'pku', }, 'tests': [ - {'name': 'v8testing', 'variant': 'default'}, + {'name': 'v8testing', + 'variant': 'default', + 'test_args': ['--extra-flags', '--force-memory-protection-keys'] + }, ], }, 'v8_linux64_sandbox_testing_rel': { @@ -742,7 +740,7 @@ {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, {'name': 'v8testing', 'variant': 'no_lfa'}, {'name': 'v8testing', 'variant': 'slow_path'}, @@ -809,7 +807,7 @@ {'name': 'v8testing', 'variant': 'slow_path', 'shards': 2}, {'name': 'v8testing', 'variant': 'stress_concurrent_allocation', 'shards': 2}, {'name': 'v8testing', 'variant': 'minor_ms', 'shards': 2}, - {'name': 'v8testing', 'variant': 'conservative_pinning', 'shards': 2}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning', 'shards': 2}, {'name': 'v8testing', 'variant': 'precise_pinning', 'shards': 2}, ], }, @@ -853,6 +851,15 @@ {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, ], }, + 'v8_linux64_undefined_double_dbg': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-22.04', + 'cpu': 'x86-64', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 3}, + ], + }, 'v8_linux64_verify_csa_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-22.04', @@ -872,6 +879,13 @@ {'name': 'test262', 'variant': 'default', 'shards': 4}, {'name': 'v8testing', 'shards': 14}, {'name': 'v8testing', 'variant': 'extra', 'shards': 14}, + { + 'name': 'v8testing', + 'suffix': 'all_features', + 'variant': 'default', + 'test_args': ['--extra-flags', '--sim-arm64-optional-features="all"'], + 'shards': 4, + }, ], }, 'v8_linux_arm64_gc_stress_dbg': { @@ -887,20 +901,18 @@ 'os': 'Ubuntu-22.04', }, 'tests': [ + {'name': 'gcmole_v3', 'variant': 'arm64', 'shards': 6}, {'name': 'mozilla', 'shards': 4}, {'name': 'test262', 'variant': 'default', 'shards': 4}, {'name': 'v8testing', 'shards': 14}, {'name': 'v8testing', 'variant': 'extra', 'shards': 14}, - {'name': 'gcmole_v3', 'variant': 'arm64', 'shards': 6}, - ], - }, - 'v8_linux_arm64_cfi_rel': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-22.04', - }, - 'tests': [ - {'name': 'test262', 'variant': 'default', 'shards': 3}, - {'name': 'v8testing', 'shards': 4}, + { + 'name': 'v8testing', + 'suffix': 'all_features', + 'variant': 'default', + 'test_args': ['--extra-flags', '--sim-arm64-optional-features="all"'], + 'shards': 4, + }, ], }, 'v8_linux64_arm64_no_pointer_compression_rel': { @@ -1001,7 +1013,7 @@ {'name': 'v8testing', 'shards': 4}, {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -1026,7 +1038,7 @@ {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -1041,7 +1053,7 @@ {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -1067,7 +1079,7 @@ {'name': 'v8testing', 'shards': 6}, {'name': 'v8testing', 'variant': 'extra', 'shards': 6}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -1100,7 +1112,7 @@ {'name': 'v8testing', 'shards': 3}, {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -1121,7 +1133,7 @@ {'name': 'v8testing', 'variant': 'stress_maglev_future'}, {'name': 'v8testing', 'variant': 'turbolev'}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -1142,7 +1154,7 @@ {'name': 'v8testing', 'variant': 'stress_maglev_future'}, {'name': 'v8testing', 'variant': 'turbolev'}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -1163,7 +1175,7 @@ {'name': 'v8testing', 'variant': 'stress_maglev_future'}, {'name': 'v8testing', 'variant': 'turbolev'}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -1253,15 +1265,6 @@ {'name': 'gcmole_v3', 'variant': 'ia32', 'shards': 6}, ], }, - 'V8 Linux - arm64 - sim - CFI': { - 'swarming_dimensions': { - 'os': 'Ubuntu-22.04', - }, - 'tests': [ - {'name': 'test262', 'variant': 'default', 'shards': 3}, - {'name': 'v8testing', 'shards': 4}, - ], - }, 'V8 Linux - arm64 - sim - MSAN': { 'swarming_dimensions': { 'os': 'Ubuntu-22.04', @@ -1466,7 +1469,7 @@ {'name': 'v8testing', 'variant': 'assert_types'}, {'name': 'v8testing', 'variant': 'extra'}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, {'name': 'v8testing', 'variant': 'no_lfa'}, {'name': 'v8testing', 'variant': 'stress_instruction_scheduling'}, @@ -1569,12 +1572,12 @@ {'name': 'mozilla'}, {'name': 'mozilla', 'variant': 'extra'}, {'name': 'optimize_for_size'}, - {'name': 'test262', 'shards': 9}, - {'name': 'test262', 'variant': 'extra', 'shards': 7}, - {'name': 'v8testing', 'shards': 3}, + {'name': 'test262', 'shards': 12}, + {'name': 'test262', 'variant': 'extra', 'shards': 12}, + {'name': 'v8testing', 'shards': 5}, {'name': 'v8testing', 'variant': 'extra', 'shards': 4}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, {'name': 'v8testing', 'variant': 'no_lfa'}, {'name': 'v8testing', 'variant': 'slow_path'}, @@ -1606,7 +1609,7 @@ 'name': 'v8testing', 'suffix': 'noavx', 'test_args': ['--extra-flags', '--noenable-avx'], - 'shards': 3 + 'shards': 5 }, # Code serializer. {'name': 'benchmarks', 'variant': 'code_serializer', 'shards': 1}, @@ -1644,7 +1647,7 @@ }, 'tests': [ # Infra staging. - {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2}, + {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 3}, # Stress sampling. {'name': 'mjsunit', 'variant': 'stress_sampling'}, {'name': 'webkit', 'variant': 'stress_sampling'}, @@ -1718,9 +1721,13 @@ 'os': 'Ubuntu-22.04', 'cpu': 'x86-64-avx2', 'pool': 'v8.tests', + 'host_class': 'pku', }, 'tests': [ - {'name': 'v8testing', 'variant': 'default'}, + {'name': 'v8testing', + 'variant': 'default', + 'test_args': ['--extra-flags', '--force-memory-protection-keys'] + }, ], }, 'V8 Linux64 - PKU - debug': { @@ -1728,9 +1735,13 @@ 'os': 'Ubuntu-22.04', 'cpu': 'x86-64-avx2', 'pool': 'v8.tests', + 'host_class': 'pku', }, 'tests': [ - {'name': 'v8testing', 'variant': 'default'}, + {'name': 'v8testing', + 'variant': 'default', + 'test_args': ['--extra-flags', '--force-memory-protection-keys'] + }, ], }, 'V8 Linux64 gcc': { @@ -1780,7 +1791,7 @@ }, { 'name': 'mjsunit', - 'variant': 'conservative_pinning', + 'variant': 'conservative_stack_scanning', 'test_args': ['--gc-stress'], 'shards': 2 }, @@ -1808,14 +1819,6 @@ {'name': 'v8testing'}, ], }, - 'V8 Linux64 - no leaptiering - debug': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-22.04', - }, - 'tests': [ - {'name': 'v8testing', 'shards': 5}, - ], - }, 'V8 Linux64 - no shared cage - debug': { 'swarming_dimensions' : { 'os': 'Ubuntu-22.04', @@ -1826,7 +1829,7 @@ 'priority': 35, }, 'tests': [ - {'name': 'v8testing', 'shards': 2}, + {'name': 'v8testing', 'shards': 4}, ], }, 'V8 Linux64 - no pointer compression': { @@ -1883,12 +1886,21 @@ {'name': 'v8testing', 'shards': 3}, ], }, + 'V8 Linux64 - undefined double - debug': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-22.04', + 'cpu': 'x86-64', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 3}, + ], + }, 'V8 Linux64 - verify csa': { 'swarming_dimensions' : { 'os': 'Ubuntu-22.04', }, 'tests': [ - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, ], }, 'V8 Linux64 ASAN': { @@ -1946,7 +1958,7 @@ {'name': 'v8testing', 'variant': 'slow_path', 'shards': 2}, {'name': 'v8testing', 'variant': 'stress_concurrent_allocation', 'shards': 2}, {'name': 'v8testing', 'variant': 'minor_ms', 'shards': 2}, - {'name': 'v8testing', 'variant': 'conservative_pinning', 'shards': 2}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning', 'shards': 2}, {'name': 'v8testing', 'variant': 'precise_pinning', 'shards': 2}, ], }, @@ -2034,7 +2046,7 @@ {'name': 'v8testing', 'shards': 3}, {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -2049,7 +2061,7 @@ {'name': 'v8testing', 'shards': 6}, {'name': 'v8testing', 'variant': 'extra', 'shards': 6}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -2089,7 +2101,7 @@ {'name': 'v8testing', 'variant': 'stress_maglev_future'}, {'name': 'v8testing', 'variant': 'turbolev'}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -2111,7 +2123,7 @@ {'name': 'v8testing', 'variant': 'stress_maglev_future'}, {'name': 'v8testing', 'variant': 'turbolev'}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -2133,7 +2145,7 @@ {'name': 'v8testing', 'variant': 'stress_maglev_future'}, {'name': 'v8testing', 'variant': 'turbolev'}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -2188,7 +2200,7 @@ {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -2212,7 +2224,7 @@ {'name': 'v8testing', 'shards': 4}, {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, {'name': 'v8testing', 'variant': 'minor_ms'}, - {'name': 'v8testing', 'variant': 'conservative_pinning'}, + {'name': 'v8testing', 'variant': 'conservative_stack_scanning'}, {'name': 'v8testing', 'variant': 'precise_pinning'}, ], }, @@ -2249,18 +2261,6 @@ }, ############################################################################## # Ports. - 'V8 Android Arm64 - N5X': { - 'swarming_dimensions': { - 'device_os': 'OPR4.170623.020', - 'device_type': 'bullhead', - 'os': 'Android', - }, - 'tests': [ - {'name': 'mozilla', 'variant': 'default'}, - {'name': 'test262', 'variant': 'default', 'shards': 12}, - {'name': 'v8testing', 'variant': 'default', 'shards': 4}, - ], - }, 'V8 Android Arm64 - P7': { 'swarming_dimensions': { 'device_os': 'AP2A.240705.004', @@ -2399,11 +2399,18 @@ 'os': 'Ubuntu-22.04', }, 'tests': [ + {'name': 'gcmole_v3', 'variant': 'arm64', 'shards': 6}, {'name': 'mozilla'}, {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 3}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, - {'name': 'gcmole_v3', 'variant': 'arm64', 'shards': 6}, + { + 'name': 'v8testing', + 'suffix': 'all_features', + 'variant': 'default', + 'test_args': ['--extra-flags', '--sim-arm64-optional-features="all"'], + 'shards': 2, + }, ], }, 'V8 Linux - arm64 - sim - debug': { @@ -2419,6 +2426,13 @@ {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 12}, {'name': 'v8testing', 'variant': 'extra', 'shards': 14}, + { + 'name': 'v8testing', + 'suffix': 'all_features', + 'variant': 'default', + 'test_args': ['--extra-flags', '--sim-arm64-optional-features="all"'], + 'shards': 3, + }, ], }, 'V8 Linux - arm64 - sim - gc stress': { @@ -2530,11 +2544,21 @@ {'name': 'v8testing', 'shards': 3}, ], }, + 'V8 Linux64 - arm64 - ASAN': { + 'swarming_dimensions': { + 'os': 'Linux', + 'cpu': 'arm64', + 'pool': 'v8.tests', + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default'}, + ], + }, 'V8 Linux64 - arm64': { 'swarming_dimensions': { 'os': 'Linux', 'cpu': 'arm64', - 'pool': 'chromium.tests', + 'pool': 'v8.tests', }, 'tests': [ {'name': 'v8testing', 'variant': 'default'}, @@ -2544,7 +2568,7 @@ 'swarming_dimensions': { 'os': 'Linux', 'cpu': 'arm64', - 'pool': 'chromium.tests', + 'pool': 'v8.tests', }, 'tests': [ {'name': 'v8testing', 'variant': 'default'}, @@ -2587,107 +2611,57 @@ }, ], }, - 'V8 NumFuzz - ASAN': { + 'V8 NumFuzz - TSAN': { 'swarming_dimensions': { 'os': 'Ubuntu-22.04', }, 'swarming_task_attrs': { 'expiration': 13800, - 'hard_timeout': 4200, + 'hard_timeout': 4800, 'priority': 35, }, 'tests': [ {'name': 'd8testing_random_gc', 'shards': 2}, { 'name': 'numfuzz', - 'suffix': 'marking', - 'test_args': ['--total-timeout-sec=2100', '--stress-marking=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'delay', - 'test_args': ['--total-timeout-sec=2100', '--stress-delay-tasks=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'interrupt', - 'test_args': ['--total-timeout-sec=2100', '--stress-interrupt-budget=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'threads', - 'test_args': ['--total-timeout-sec=2100', '--stress-thread-pool-size=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'stack', - 'test_args': ['--total-timeout-sec=2100', '--stress-stack-size=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'combined', + 'suffix': 'allocation', 'test_args': [ - '--total-timeout-sec=2100', - '--stress-delay-tasks=4', - '--stress-deopt=2', - '--stress-compaction=2', - '--stress-gc=4', - '--stress-marking=4', - '--stress-scavenge=4', - '--stress-thread-pool-size=2', - '--stress-stack-size=1', - '--stress-interrupt-budget=1', - ], - 'shards': 4 + '--total-timeout-sec=4200', + '--allocation-offset=1', + '--extra-flags=--gc-interval=500', + ] }, - { - 'name': 'numfuzz', - 'suffix': 'scavenge', - 'test_args': ['--total-timeout-sec=2100', '--stress-scavenge=1'] - }, - ], - }, - 'V8 NumFuzz - TSAN': { - 'swarming_dimensions': { - 'os': 'Ubuntu-22.04', - }, - 'swarming_task_attrs': { - 'expiration': 13800, - 'hard_timeout': 4200, - 'priority': 35, - }, - 'tests': [ - {'name': 'd8testing_random_gc', 'shards': 2}, { 'name': 'numfuzz', 'suffix': 'marking', - 'test_args': ['--total-timeout-sec=2100', '--stress-marking=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-marking=1'] }, { 'name': 'numfuzz', 'suffix': 'delay', - 'test_args': ['--total-timeout-sec=2100', '--stress-delay-tasks=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-delay-tasks=1'] }, { 'name': 'numfuzz', 'suffix': 'interrupt', - 'test_args': ['--total-timeout-sec=2100', '--stress-interrupt-budget=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-interrupt-budget=1'] }, { 'name': 'numfuzz', 'suffix': 'threads', - 'test_args': ['--total-timeout-sec=2100', '--stress-thread-pool-size=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-thread-pool-size=1'] }, { 'name': 'numfuzz', 'suffix': 'stack', - 'test_args': ['--total-timeout-sec=2100', '--stress-stack-size=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-stack-size=1'] }, { 'name': 'numfuzz', 'suffix': 'combined', 'test_args': [ - '--total-timeout-sec=2100', + '--total-timeout-sec=4200', + '--allocation-offset=2', '--stress-delay-tasks=4', '--stress-deopt=2', '--stress-compaction=2', @@ -2703,7 +2677,7 @@ { 'name': 'numfuzz', 'suffix': 'scavenge', - 'test_args': ['--total-timeout-sec=2100', '--stress-scavenge=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-scavenge=1'] }, ], }, @@ -2713,42 +2687,52 @@ }, 'swarming_task_attrs': { 'expiration': 13800, - 'hard_timeout': 4200, + 'hard_timeout': 4800, 'priority': 35, }, 'tests': [ {'name': 'd8testing_random_gc'}, + { + 'name': 'numfuzz', + 'suffix': 'allocation', + 'test_args': [ + '--total-timeout-sec=4200', + '--allocation-offset=1', + '--extra-flags=--gc-interval=500', + ] + }, { 'name': 'numfuzz', 'suffix': 'marking', - 'test_args': ['--total-timeout-sec=2100', '--stress-marking=1'], + 'test_args': ['--total-timeout-sec=4200', '--stress-marking=1'], 'shards': 2 }, { 'name': 'numfuzz', 'suffix': 'delay', - 'test_args': ['--total-timeout-sec=2100', '--stress-delay-tasks=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-delay-tasks=1'] }, { 'name': 'numfuzz', 'suffix': 'interrupt', - 'test_args': ['--total-timeout-sec=2100', '--stress-interrupt-budget=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-interrupt-budget=1'] }, { 'name': 'numfuzz', 'suffix': 'threads', - 'test_args': ['--total-timeout-sec=2100', '--stress-thread-pool-size=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-thread-pool-size=1'] }, { 'name': 'numfuzz', 'suffix': 'stack', - 'test_args': ['--total-timeout-sec=2100', '--stress-stack-size=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-stack-size=1'] }, { 'name': 'numfuzz', 'suffix': 'combined', 'test_args': [ - '--total-timeout-sec=2100', + '--total-timeout-sec=4200', + '--allocation-offset=2', '--stress-delay-tasks=4', '--stress-deopt=2', '--stress-compaction=2', @@ -2764,12 +2748,12 @@ { 'name': 'numfuzz', 'suffix': 'scavenge', - 'test_args': ['--total-timeout-sec=2100', '--stress-scavenge=1'] + 'test_args': ['--total-timeout-sec=4200', '--stress-scavenge=1'] }, { 'name': 'numfuzz', 'suffix': 'deopt', - 'test_args': ['--total-timeout-sec=2100', '--stress-deopt=1'], + 'test_args': ['--total-timeout-sec=4200', '--stress-deopt=1'], 'shards': 2 }, ], @@ -2791,64 +2775,20 @@ }, ], }, - 'v8_numfuzz_asan_rel': { + 'v8_numfuzz_tsan_rel': { 'swarming_dimensions': { 'os': 'Ubuntu-22.04', }, 'tests': [ { 'name': 'numfuzz', - 'suffix': 'marking', - 'test_args': ['--total-timeout-sec=900', '--stress-marking=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'delay', - 'test_args': ['--total-timeout-sec=900', '--stress-delay-tasks=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'interrupt', - 'test_args': ['--total-timeout-sec=900', '--stress-interrupt-budget=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'threads', - 'test_args': ['--total-timeout-sec=900', '--stress-thread-pool-size=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'stack', - 'test_args': ['--total-timeout-sec=900', '--stress-stack-size=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'combined', + 'suffix': 'allocation', 'test_args': [ '--total-timeout-sec=900', - '--stress-delay-tasks=4', - '--stress-deopt=2', - '--stress-compaction=2', - '--stress-gc=4', - '--stress-marking=4', - '--stress-scavenge=4', - '--stress-thread-pool-size=2', - '--stress-stack-size=1', - '--stress-interrupt-budget=1', - ], + '--allocation-offset=1', + '--extra-flags=--gc-interval=500', + ] }, - { - 'name': 'numfuzz', - 'suffix': 'scavenge', - 'test_args': ['--total-timeout-sec=900', '--stress-scavenge=1'] - }, - ], - }, - 'v8_numfuzz_tsan_rel': { - 'swarming_dimensions': { - 'os': 'Ubuntu-22.04', - }, - 'tests': [ { 'name': 'numfuzz', 'suffix': 'marking', @@ -2879,6 +2819,7 @@ 'suffix': 'combined', 'test_args': [ '--total-timeout-sec=900', + '--allocation-offset=2', '--stress-delay-tasks=4', '--stress-deopt=2', '--stress-compaction=2', @@ -2902,6 +2843,15 @@ 'os': 'Ubuntu-22.04', }, 'tests': [ + { + 'name': 'numfuzz', + 'suffix': 'allocation', + 'test_args': [ + '--total-timeout-sec=900', + '--allocation-offset=1', + '--extra-flags=--gc-interval=500', + ] + }, { 'name': 'numfuzz', 'suffix': 'marking', @@ -2932,6 +2882,7 @@ 'suffix': 'combined', 'test_args': [ '--total-timeout-sec=900', + '--allocation-offset=2', '--stress-delay-tasks=4', '--stress-deopt=2', '--stress-compaction=2', diff --git a/deps/v8/infra/whitespace.txt b/deps/v8/infra/whitespace.txt index 7692b0d582ff77..15ba92a9a75e82 100644 --- a/deps/v8/infra/whitespace.txt +++ b/deps/v8/infra/whitespace.txt @@ -1 +1 @@ -Some infra-owned whitespace to test the cherry-picker. \ No newline at end of file +Some infra-owned whitespace to test the cherry-picker. diff --git a/deps/v8/src/DEPS b/deps/v8/src/DEPS index 8a8423c112b384..d6da189c53496c 100644 --- a/deps/v8/src/DEPS +++ b/deps/v8/src/DEPS @@ -26,6 +26,8 @@ include_rules = [ "+src/heap/factory-inl.h", # TODO(v8:10496): Don't expose so much (through transitive includes) outside # of heap/. + "+src/heap/gc-callbacks.h", + "+src/heap/gc-callbacks-inl.h", "+src/heap/gc-tracer.h", "+src/heap/gc-tracer-inl.h", "+src/heap/heap.h", @@ -45,7 +47,7 @@ include_rules = [ "+src/heap/mutable-page-metadata-inl.h", "+src/heap/memory-chunk.h", "+src/heap/page-metadata-inl.h", - "+src/heap/page-pool.h", + "+src/heap/memory-pool.h", "+src/heap/paged-spaces-inl.h", "+src/heap/parked-scope-inl.h", "+src/heap/parked-scope.h", @@ -129,4 +131,13 @@ specific_include_rules = { "snapshot\.cc": [ "+src/heap/read-only-promotion.h", ], + "string-hasher-inl\.h": [ + "+third_party/rapidhash-v8/rapidhash.h", + ], + "heap\.cc": [ + "+third_party/rapidhash-v8/secret.h", + ], + "hash-seed-inl\.h": [ + "+third_party/rapidhash-v8/secret.h", + ], } diff --git a/deps/v8/src/api/api-inl.h b/deps/v8/src/api/api-inl.h index 965ded69be67b7..5ac2bd712866e3 100644 --- a/deps/v8/src/api/api-inl.h +++ b/deps/v8/src/api/api-inl.h @@ -11,52 +11,49 @@ #include "include/v8-fast-api-calls.h" #include "src/common/assert-scope.h" #include "src/execution/microtask-queue.h" +#include "src/execution/vm-state-inl.h" #include "src/flags/flags.h" #include "src/handles/handles-inl.h" #include "src/heap/heap-inl.h" +#include "src/logging/runtime-call-stats.h" #include "src/objects/foreign-inl.h" #include "src/objects/objects-inl.h" namespace v8 { template -inline T ToCData(i::Isolate* isolate, - v8::internal::Tagged obj) { - static_assert(sizeof(T) == sizeof(v8::internal::Address)); - if (obj == v8::internal::Smi::zero()) return nullptr; +inline T ToCData(i::Isolate* isolate, i::Tagged obj) { + static_assert(sizeof(T) == sizeof(i::Address)); + if (obj == i::Smi::zero()) return nullptr; return reinterpret_cast( - v8::internal::Cast(obj)->foreign_address( - isolate)); + i::Cast(obj)->foreign_address(isolate)); } template -inline v8::internal::Address ToCData( - i::Isolate* isolate, v8::internal::Tagged obj) { - if (obj == v8::internal::Smi::zero()) return v8::internal::kNullAddress; - return v8::internal::Cast(obj)->foreign_address( - isolate); +inline i::Address ToCData(i::Isolate* isolate, i::Tagged obj) { + if (obj == i::Smi::zero()) return i::kNullAddress; + return i::Cast(obj)->foreign_address(isolate); } template -inline v8::internal::DirectHandle> FromCData( - v8::internal::Isolate* isolate, T obj) { - static_assert(sizeof(T) == sizeof(v8::internal::Address)); - if (obj == nullptr) return direct_handle(v8::internal::Smi::zero(), isolate); - return isolate->factory()->NewForeign( - reinterpret_cast(obj)); +inline i::DirectHandle> FromCData( + i::Isolate* isolate, T obj) { + static_assert(sizeof(T) == sizeof(i::Address)); + if (obj == nullptr) return direct_handle(i::Smi::zero(), isolate); + return isolate->factory()->NewForeign(reinterpret_cast(obj)); } template -inline v8::internal::DirectHandle> FromCData( - v8::internal::Isolate* isolate, v8::internal::Address obj) { - if (obj == v8::internal::kNullAddress) { - return direct_handle(v8::internal::Smi::zero(), isolate); +inline i::DirectHandle> FromCData( + i::Isolate* isolate, i::Address obj) { + if (obj == i::kNullAddress) { + return direct_handle(i::Smi::zero(), isolate); } return isolate->factory()->NewForeign(obj); } template -inline Local Utils::Convert(v8::internal::DirectHandle obj) { +inline Local Utils::Convert(i::DirectHandle obj) { DCHECK(obj.is_null() || IsSmi(*obj) || !IsTheHole(*obj)); #ifdef V8_ENABLE_DIRECT_HANDLE if (obj.is_null()) return Local(); @@ -70,66 +67,54 @@ inline Local Utils::Convert(v8::internal::DirectHandle obj) { // Implementations of ToLocal -#define MAKE_TO_LOCAL(Name) \ - template