deps: update V8 to 14.1.146.11

PR-URL: https://github.com/nodejs/node/pull/59805
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Michaël Zasso 2025-09-25 10:37:26 +02:00
parent 7757983da4
commit 7772a2df9d
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600
3347 changed files with 168717 additions and 99169 deletions

View File

@ -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

14
deps/v8/.gitignore vendored
View File

@ -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

5
deps/v8/.gn vendored
View File

@ -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<T> 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

View File

@ -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

9
deps/v8/AUTHORS vendored
View File

@ -57,6 +57,7 @@ Alexander Botero-Lowry <alexbl@FreeBSD.org>
Alexander Karpinsky <homm86@gmail.com>
Alexander Neville <dark@volatile.bz>
Alexandre Vassalotti <avassalotti@gmail.com>
Albert Slepak <aslepak@netflix.com>
Alexey Pavlyutkin <alexey.pavlyutkin@syntacore.com>
Alexis Campailla <alexis@janeasystems.com>
Aliya Minimullina <a.minimullina@syntacore.com>
@ -130,6 +131,7 @@ Fedor Indutny <fedor@indutny.com>
Felix Geisendörfer <haimuiba@gmail.com>
Feng Yu <f3n67u@gmail.com>
Filipe David Manana <fdmanana@gmail.com>
Florian Loitsch <floitsch@rivosinc.com>
Frank Lemanschik <frank@dspeed.eu>
Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Gao Sheng <gaosheng08@meituan.com>
@ -148,6 +150,7 @@ Helmut Januschka <helmut@januschka.com>
Hirofumi Mako <mkhrfm@gmail.com>
Hisham Muhammad <hisham@gobolinux.org>
Honggyu Kim <honggyu.kp@gmail.com>
Hood Chatham <robert.hood.chatham@gmail.com>
Huáng Jùnliàng <jlhwung@gmail.com>
HyeockJin Kim <kherootz@gmail.com>
Iain Ireland <iireland@mozilla.com>
@ -183,12 +186,14 @@ Junha Park <jpark3@scu.edu>
Junming Huang <kiminghjm@gmail.com>
Kang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
Karl Skomski <karl@skomski.com>
Kasper Lund <kasperl@rivosinc.com>
Keith Smiley <keithbsmiley@gmail.com>
Kevin Gibbons <bakkot@gmail.com>
Keyhan Vakil <kvakil@googlecontrib.kvakil.me>
Kris Selden <kris.selden@gmail.com>
Kyounga Ra <kyounga@alticast.com>
Levi Zim <rsworktech@outlook.com>
LN Liberda <lauren@selfisekai.rocks>
Loo Rong Jie <loorongjie@gmail.com>
Lu Yahan <yahan@iscas.ac.cn>
Ludovic Mermod <ludovic.mermod@gmail.com>
@ -270,6 +275,7 @@ Sanjoy Das <sanjoy@playingwithpointers.com>
Sam James <sam@gentoo.org>
Sébastien Doeraene <sjrdoeraene@gmail.com>
Seo Sanghyeon <sanxiyn@gmail.com>
Sergey Markelov <sergionso@gmail.com>
Shawn Anastasio <shawnanastasio@gmail.com>
Shawn Presser <shawnpresser@gmail.com>
Sho Miyamoto <me@shqld.dev>
@ -302,6 +308,7 @@ Wael Almattar <waelsy123@gmail.com>
Wang Chen <wangchen20@iscas.ac.cn>
WANG Xuerui <git@xen0n.name>
Wei Wu <lazyparser@gmail.com>
Weicong Yu <yuweicong666@gmail.com>
Wenlu Wang <kingwenlu@gmail.com>
Wenming Yang <yangwenming@bytedance.com>
Wenyu Zhao <wenyu.zhao@anu.edu.au>
@ -335,3 +342,5 @@ Jing Peiyang <jingpeiyang@eswincomputing.com>
magic-akari <akari.ccino@gmail.com>
Ryuhei Shima <shimaryuhei@gmail.com>
Domagoj Stolfa <domagoj.stolfa@gmail.com>
Zhijin Zeng <zhijin.zeng@spacemit.com>
王家睿 <wangjiarui79@gmail.com>

175
deps/v8/BUILD.bazel vendored
View File

@ -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",
],
)

476
deps/v8/BUILD.gn vendored

File diff suppressed because it is too large Load Diff

View File

@ -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

308
deps/v8/DEPS vendored
View File

@ -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',
]

View File

@ -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

242
deps/v8/GEMINI.md vendored Normal file
View File

@ -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/<build-config>/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/<build-config>/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.

View File

@ -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")

1
deps/v8/OWNERS vendored
View File

@ -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

4
deps/v8/PPC_OWNERS vendored
View File

@ -1,4 +1,4 @@
junyan@redhat.com
junyan1@ibm.com
joransiu@ca.ibm.com
midawson@redhat.com
mfarazma@redhat.com
mfarazma@ibm.com

View File

@ -1,4 +1,5 @@
brice.dobry@futurewei.com
kasperl@rivosinc.com
peng.w@rioslab.org
qiuji@iscas.ac.cn
yahan@iscas.ac.cn

4
deps/v8/S390_OWNERS vendored
View File

@ -1,4 +1,4 @@
junyan@redhat.com
junyan1@ibm.com
joransiu@ca.ibm.com
midawson@redhat.com
mfarazma@redhat.com
mfarazma@ibm.com

View File

@ -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"),

View File

@ -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

96
deps/v8/gni/v8.gni vendored
View File

@ -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.

View File

@ -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",
]

View File

@ -1,4 +1,3 @@
adamk@chromium.org
cbruni@chromium.org
leszeks@chromium.org
mlippautz@chromium.org

View File

@ -71,7 +71,7 @@ class MakeGarbageCollectedTraitInternal {
template <typename GCInfoType, typename CustomSpace, size_t alignment>
struct AllocationDispatcher final {
static void* Invoke(AllocationHandle& handle, size_t size) {
static_assert(std::is_base_of<CustomSpaceBase, CustomSpace>::value,
static_assert(std::is_base_of_v<CustomSpaceBase, CustomSpace>,
"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<CustomSpaceBase, CustomSpace>::value,
static_assert(std::is_base_of_v<CustomSpaceBase, CustomSpace>,
"Custom space must inherit from CustomSpaceBase.");
return MakeGarbageCollectedTraitInternal::Allocate(
handle, size, internal::GCInfoTrait<GCInfoType>::Index(),
@ -164,7 +164,7 @@ class MakeGarbageCollectedTraitBase
*/
V8_INLINE static void* Allocate(AllocationHandle& handle, size_t size) {
static_assert(
std::is_base_of<typename T::ParentMostGarbageCollectedType, T>::value,
std::is_base_of_v<typename T::ParentMostGarbageCollectedType, T>,
"U of GarbageCollected<U> must be a base of T. Check "
"GarbageCollected<T> base class inheritance.");
static constexpr size_t kWantedAlignment =

View File

@ -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 <typename U, typename MemberBarrierPolicy,
typename MemberWeaknessTag, typename MemberCheckingPolicy,
typename MemberStorageType,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
typename = std::enable_if_t<std::is_base_of_v<T, U>>>
BasicCrossThreadPersistent(
internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
MemberCheckingPolicy, MemberStorageType>
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 <typename U, typename OtherWeaknessPolicy,
typename OtherLocationPolicy, typename OtherCheckingPolicy,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
BasicCrossThreadPersistent(
const BasicCrossThreadPersistent<U, OtherWeaknessPolicy,
OtherLocationPolicy,
OtherCheckingPolicy>& other,
const SourceLocation& loc = SourceLocation::Current())
typename = std::enable_if_t<std::is_base_of_v<T, U>>>
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 <typename U, typename OtherWeaknessPolicy,
typename OtherLocationPolicy, typename OtherCheckingPolicy,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
typename = std::enable_if_t<std::is_base_of_v<T, U>>>
BasicCrossThreadPersistent& operator=(
const BasicCrossThreadPersistent<U, OtherWeaknessPolicy,
OtherLocationPolicy,
@ -232,7 +228,7 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
template <typename U, typename MemberBarrierPolicy,
typename MemberWeaknessTag, typename MemberCheckingPolicy,
typename MemberStorageType,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
typename = std::enable_if_t<std::is_base_of_v<T, U>>>
BasicCrossThreadPersistent& operator=(
internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
MemberCheckingPolicy, MemberStorageType>
@ -338,8 +334,8 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
}
template <typename U = T,
typename = typename std::enable_if<!BasicCrossThreadPersistent<
U, WeaknessPolicy>::IsStrongPersistent::value>::type>
typename = std::enable_if_t<!BasicCrossThreadPersistent<
U, WeaknessPolicy>::IsStrongPersistent::value>>
BasicCrossThreadPersistent<U, internal::StrongCrossThreadPersistentPolicy>
Lock() const {
return BasicCrossThreadPersistent<

View File

@ -70,7 +70,7 @@ struct FinalizerTrait {
// - a destructor.
static constexpr bool kNonTrivialFinalizer =
internal::HasFinalizeGarbageCollectedObject<T>::value ||
!std::is_trivially_destructible<typename std::remove_cv<T>::type>::value;
!std::is_trivially_destructible_v<std::remove_cv_t<T>>;
static void Finalize(void* obj) {
internal::FinalizerTraitImpl<T, kNonTrivialFinalizer>::Finalize(obj);

View File

@ -108,10 +108,10 @@ struct GCInfoTrait final {
template <typename T, typename ParentMostGarbageCollectedType>
struct GCInfoFolding final {
static constexpr bool kHasVirtualDestructorAtBase =
std::has_virtual_destructor<ParentMostGarbageCollectedType>::value;
std::has_virtual_destructor_v<ParentMostGarbageCollectedType>;
static constexpr bool kBothTypesAreTriviallyDestructible =
std::is_trivially_destructible<ParentMostGarbageCollectedType>::value &&
std::is_trivially_destructible<T>::value;
std::is_trivially_destructible_v<ParentMostGarbageCollectedType> &&
std::is_trivially_destructible_v<T>;
static constexpr bool kHasCustomFinalizerDispatchAtBase =
internal::HasFinalizeGarbageCollectedObject<
ParentMostGarbageCollectedType>::value;

View File

@ -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 <typename>

View File

@ -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<NameProvider, T>::value;
return std::is_base_of_v<NameProvider, T>;
#endif // !CPPGC_SUPPORTS_OBJECT_NAMES
}

View File

@ -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

View File

@ -20,6 +20,8 @@ namespace cppgc {
namespace subtle {
class HeapConsistency;
template <typename, typename, typename>
class TaggedUncompressedMember;
} // namespace subtle
class Visitor;
@ -163,7 +165,7 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase<StorageType>,
template <typename U, typename PersistentWeaknessPolicy,
typename PersistentLocationPolicy,
typename PersistentCheckingPolicy,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
typename = std::enable_if_t<std::is_base_of_v<T, U>>>
V8_INLINE BasicMember(const BasicPersistent<U, PersistentWeaknessPolicy,
PersistentLocationPolicy,
PersistentCheckingPolicy>& p)
@ -219,7 +221,7 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase<StorageType>,
template <typename U, typename PersistentWeaknessPolicy,
typename PersistentLocationPolicy,
typename PersistentCheckingPolicy,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
typename = std::enable_if_t<std::is_base_of_v<T, U>>>
V8_INLINE BasicMember& operator=(
const BasicPersistent<U, PersistentWeaknessPolicy,
PersistentLocationPolicy, PersistentCheckingPolicy>&
@ -296,8 +298,10 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase<StorageType>,
return *this;
}
V8_INLINE const T* GetRawAtomic() const {
return static_cast<const T*>(Base::GetRawAtomic());
V8_INLINE const void* GetRawAtomic() const { return Base::GetRawAtomic(); }
V8_INLINE const T* GetAtomic() const {
return static_cast<const T*>(GetRawAtomic());
}
V8_INLINE void InitializingWriteBarrier(T* value) const {
@ -328,6 +332,8 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase<StorageType>,
V8_INLINE T* GetFromGC() const { return Get(); }
friend class cppgc::subtle::HeapConsistency;
template <typename, typename, typename>
friend class cppgc::subtle::TaggedUncompressedMember;
friend class cppgc::Visitor;
template <typename U>
friend struct cppgc::TraceTrait;

View File

@ -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 <typename U, typename OtherWeaknessPolicy,
typename OtherLocationPolicy, typename OtherCheckingPolicy,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
typename = std::enable_if_t<std::is_base_of_v<T, U>>>
// NOLINTNEXTLINE
BasicPersistent(
const BasicPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
OtherCheckingPolicy>& 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 <typename U, typename MemberBarrierPolicy,
typename MemberWeaknessTag, typename MemberCheckingPolicy,
typename MemberStorageType,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
typename = std::enable_if_t<std::is_base_of_v<T, U>>>
// 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 <typename U, typename OtherWeaknessPolicy,
typename OtherLocationPolicy, typename OtherCheckingPolicy,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
typename = std::enable_if_t<std::is_base_of_v<T, U>>>
BasicPersistent& operator=(
const BasicPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
OtherCheckingPolicy>& other) {
@ -158,7 +157,7 @@ class BasicPersistent final : public PersistentBase,
template <typename U, typename MemberBarrierPolicy,
typename MemberWeaknessTag, typename MemberCheckingPolicy,
typename MemberStorageType,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
typename = std::enable_if_t<std::is_base_of_v<T, U>>>
BasicPersistent& operator=(
const internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
MemberCheckingPolicy, MemberStorageType>&

View File

@ -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

View File

@ -6,6 +6,7 @@
#define INCLUDE_CPPGC_TAGGED_MEMBER_H_
#include <atomic>
#include <concepts>
#include <cstddef>
#include <type_traits>
@ -28,7 +29,7 @@ namespace cppgc::subtle {
// TaggedUncompressedMember<Node, ParentTag, ShadowHostTag>
// m(ParentTag{}, parent);
template <typename Pointee, typename Tag1, typename Tag2>
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<Pointee> temp(GetUntagged());
auto* untagged = reinterpret_cast<Pointee*>(
reinterpret_cast<uintptr_t>(ptr_.GetRawAtomic()) & ~kTagBit);
UncompressedMember<Pointee> temp(untagged);
v->Trace(temp);
}

View File

@ -23,8 +23,7 @@ using TraceRootCallback = void (*)(RootVisitor&, const void* object);
// Implementation of the default TraceTrait handling GarbageCollected and
// GarbageCollectedMixin.
template <typename T,
bool =
IsGarbageCollectedMixinTypeV<typename std::remove_const<T>::type>>
bool = IsGarbageCollectedMixinTypeV<std::remove_const_t<T>>>
struct TraceTraitImpl;
} // namespace internal

View File

@ -91,7 +91,7 @@ class V8_EXPORT Visitor {
*/
template <typename T>
void Trace(const Member<T>& 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<T>::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 <typename T>
void Trace(const subtle::UncompressedMember<T>& 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 <typename KeyType, typename ValueType>
void TraceEphemeron(const WeakMember<KeyType>& weak_member_key,
const Member<ValueType>* 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<ValueType>,
"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 <typename T>
void TraceStrongly(const WeakMember<T>& 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 <typename AnyPersistentType>

View File

@ -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

View File

@ -324,6 +324,9 @@ using WasmLoadSourceMapCallback = Local<String> (*)(Isolate* isolate,
// --- Callback for checking if WebAssembly imported strings are enabled ---
using WasmImportedStringsEnabledCallback = bool (*)(Local<Context> context);
// --- Callback for checking if WebAssembly Custom Descriptors are enabled ---
using WasmCustomDescriptorsEnabledCallback = bool (*)(Local<Context> context);
// --- Callback for checking if the SharedArrayBuffer constructor is enabled ---
using SharedArrayBufferConstructorEnabledCallback =
bool (*)(Local<Context> context);

View File

@ -256,6 +256,9 @@ class V8_EXPORT Context : public Data {
Maybe<void> 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<Value> Context::GetEmbedderData(int index) {
value = I::DecompressTaggedField(embedder_data, static_cast<uint32_t>(value));
#endif
auto isolate = reinterpret_cast<v8::Isolate*>(
internal::IsolateFromNeverReadOnlySpaceObject(ctx));
auto* isolate = I::GetCurrentIsolate();
return Local<Value>::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<void*>(
I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
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<void*>(
I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
internal::kLastEmbedderDataTag}>(
isolate, embedder_data, value_offset));
#else
return SlowGetAlignedPointerFromEmbedderData(index);

View File

@ -172,6 +172,17 @@ class V8_EXPORT StackTrace {
* a stack trace.
*/
static Local<String> 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

View File

@ -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<v8::Context> 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<T>
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<Type>(identifier >> 16),
static_cast<SequenceType>((identifier >> 8) & 255),
static_cast<Flags>(identifier & 255)) {}
: type_(static_cast<Type>((identifier >> 8) & 255)),
flags_(static_cast<Flags>(identifier & 255)) {}
constexpr Identifier GetId() const {
return static_cast<uint8_t>(type_) << 16 |
static_cast<uint8_t>(sequence_type_) << 8 |
return static_cast<uint8_t>(type_) << 8 |
static_cast<uint8_t>(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 <unsigned int N, CTypeInfo::Flags... Flags>
struct GetArgBuilder<false, N, Flags...> {
using type =
typename std::tuple_element<N, std::tuple<ArgBuilders...>>::type;
using type = std::tuple_element_t<N, std::tuple<ArgBuilders...>>;
};
// Returns an ArgBuilder with the same base type as the one at index N,
@ -723,10 +686,8 @@ class CFunctionBuilderWithFunction {
template <unsigned int N, CTypeInfo::Flags... Flags>
struct GetArgBuilder<true, N, Flags...> {
using type = CTypeInfoBuilder<
typename std::tuple_element<N,
std::tuple<ArgBuilders...>>::type::BaseType,
std::tuple_element<N, std::tuple<ArgBuilders...>>::type::Build()
.GetFlags(),
typename std::tuple_element_t<N, std::tuple<ArgBuilders...>>::BaseType,
std::tuple_element_t<N, std::tuple<ArgBuilders...>>::Build().GetFlags(),
Flags...>;
};

View File

@ -42,7 +42,7 @@ class ReturnValue {
public:
template <class S>
V8_INLINE ReturnValue(const ReturnValue<S>& that) : value_(that.value_) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
}
// Handle-based setters.
template <typename S>
@ -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<T>::SetInternal(internal::Address value) {
template <typename T>
template <typename S>
void ReturnValue<T>::Set(const Global<S>& handle) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
if (V8_UNLIKELY(handle.IsEmpty())) {
SetDefaultValue();
} else {
@ -346,7 +346,7 @@ void ReturnValue<T>::Set(const Global<S>& handle) {
template <typename T>
template <typename S>
void ReturnValue<T>::SetNonEmpty(const Global<S>& handle) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
#ifdef V8_ENABLE_CHECKS
internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
#endif // V8_ENABLE_CHECKS
@ -356,7 +356,7 @@ void ReturnValue<T>::SetNonEmpty(const Global<S>& handle) {
template <typename T>
template <typename S>
void ReturnValue<T>::Set(const BasicTracedReference<S>& handle) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
if (V8_UNLIKELY(handle.IsEmpty())) {
SetDefaultValue();
} else {
@ -367,7 +367,7 @@ void ReturnValue<T>::Set(const BasicTracedReference<S>& handle) {
template <typename T>
template <typename S>
void ReturnValue<T>::SetNonEmpty(const BasicTracedReference<S>& handle) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
#ifdef V8_ENABLE_CHECKS
internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
#endif // V8_ENABLE_CHECKS
@ -380,16 +380,16 @@ void ReturnValue<T>::Set(const Local<S> 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<T>::value,
static_assert(!std::is_void_v<T>,
"ReturnValue<void>::Set(const Local<S>) 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<T>::value;
static constexpr bool is_allowed_void = std::is_void_v<T>;
#endif // V8_IMMINENT_DEPRECATION_WARNINGS
static_assert(is_allowed_void || std::is_base_of<T, S>::value, "type check");
static_assert(is_allowed_void || std::is_base_of_v<T, S>, "type check");
if (V8_UNLIKELY(handle.IsEmpty())) {
SetDefaultValue();
} else if constexpr (is_allowed_void) {
@ -407,16 +407,16 @@ void ReturnValue<T>::SetNonEmpty(const Local<S> 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<T>::value,
static_assert(!std::is_void_v<T>,
"ReturnValue<void>::SetNonEmpty(const Local<S>) 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<T>::value;
static constexpr bool is_allowed_void = std::is_void_v<T>;
#endif // V8_IMMINENT_DEPRECATION_WARNINGS
static_assert(is_allowed_void || std::is_base_of<T, S>::value, "type check");
static_assert(is_allowed_void || std::is_base_of_v<T, S>, "type check");
#ifdef V8_ENABLE_CHECKS
internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
#endif // V8_ENABLE_CHECKS
@ -431,13 +431,13 @@ void ReturnValue<T>::SetNonEmpty(const Local<S> handle) {
template <typename T>
void ReturnValue<T>::Set(double i) {
static_assert(std::is_base_of<T, Number>::value, "type check");
static_assert(std::is_base_of_v<T, Number>, "type check");
SetNonEmpty(Number::New(GetIsolate(), i));
}
template <typename T>
void ReturnValue<T>::Set(int16_t i) {
static_assert(std::is_base_of<T, Integer>::value, "type check");
static_assert(std::is_base_of_v<T, Integer>, "type check");
using I = internal::Internals;
static_assert(I::IsValidSmi(std::numeric_limits<int16_t>::min()));
static_assert(I::IsValidSmi(std::numeric_limits<int16_t>::max()));
@ -446,7 +446,7 @@ void ReturnValue<T>::Set(int16_t i) {
template <typename T>
void ReturnValue<T>::Set(int32_t i) {
static_assert(std::is_base_of<T, Integer>::value, "type check");
static_assert(std::is_base_of_v<T, Integer>, "type check");
if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
SetInternal(*result);
return;
@ -456,7 +456,7 @@ void ReturnValue<T>::Set(int32_t i) {
template <typename T>
void ReturnValue<T>::Set(int64_t i) {
static_assert(std::is_base_of<T, Integer>::value, "type check");
static_assert(std::is_base_of_v<T, Integer>, "type check");
if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
SetInternal(*result);
return;
@ -466,7 +466,7 @@ void ReturnValue<T>::Set(int64_t i) {
template <typename T>
void ReturnValue<T>::Set(uint16_t i) {
static_assert(std::is_base_of<T, Integer>::value, "type check");
static_assert(std::is_base_of_v<T, Integer>, "type check");
using I = internal::Internals;
static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::min()));
static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::max()));
@ -475,7 +475,7 @@ void ReturnValue<T>::Set(uint16_t i) {
template <typename T>
void ReturnValue<T>::Set(uint32_t i) {
static_assert(std::is_base_of<T, Integer>::value, "type check");
static_assert(std::is_base_of_v<T, Integer>, "type check");
if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
SetInternal(*result);
return;
@ -485,7 +485,7 @@ void ReturnValue<T>::Set(uint32_t i) {
template <typename T>
void ReturnValue<T>::Set(uint64_t i) {
static_assert(std::is_base_of<T, Integer>::value, "type check");
static_assert(std::is_base_of_v<T, Integer>, "type check");
if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
SetInternal(*result);
return;
@ -495,7 +495,7 @@ void ReturnValue<T>::Set(uint64_t i) {
template <typename T>
void ReturnValue<T>::Set(bool value) {
static_assert(std::is_void<T>::value || std::is_base_of<T, Boolean>::value,
static_assert(std::is_void_v<T> || std::is_base_of_v<T, Boolean>,
"type check");
using I = internal::Internals;
#if V8_STATIC_ROOTS_BOOL
@ -535,7 +535,7 @@ void ReturnValue<T>::SetDefaultValue() {
template <typename T>
void ReturnValue<T>::SetNull() {
static_assert(std::is_base_of<T, Primitive>::value, "type check");
static_assert(std::is_base_of_v<T, Primitive>, "type check");
using I = internal::Internals;
#if V8_STATIC_ROOTS_BOOL
#ifdef V8_ENABLE_CHECKS
@ -550,7 +550,7 @@ void ReturnValue<T>::SetNull() {
template <typename T>
void ReturnValue<T>::SetUndefined() {
static_assert(std::is_base_of<T, Primitive>::value, "type check");
static_assert(std::is_base_of_v<T, Primitive>, "type check");
using I = internal::Internals;
#if V8_STATIC_ROOTS_BOOL
#ifdef V8_ENABLE_CHECKS
@ -565,7 +565,7 @@ void ReturnValue<T>::SetUndefined() {
template <typename T>
void ReturnValue<T>::SetFalse() {
static_assert(std::is_void<T>::value || std::is_base_of<T, Boolean>::value,
static_assert(std::is_void_v<T> || std::is_base_of_v<T, Boolean>,
"type check");
using I = internal::Internals;
#if V8_STATIC_ROOTS_BOOL
@ -581,7 +581,7 @@ void ReturnValue<T>::SetFalse() {
template <typename T>
void ReturnValue<T>::SetEmptyString() {
static_assert(std::is_base_of<T, String>::value, "type check");
static_assert(std::is_base_of_v<T, String>, "type check");
using I = internal::Internals;
#if V8_STATIC_ROOTS_BOOL
#ifdef V8_ENABLE_CHECKS

View File

@ -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
@ -423,6 +434,19 @@ constexpr size_t kMaxCppHeapPointers = 0;
// which all subtypes of a given supertype use contiguous tags. This struct can
// then be used to represent such a type range.
//
// As an example, consider the following type hierarchy:
//
// A F
// / \
// B E
// / \
// C D
//
// A potential type id assignment for range-based type checks is
// {A: 0, B: 1, C: 2, D: 3, E: 4, F: 5}. With that, the type check for type A
// would check for the range [A, E], while the check for B would check range
// [B, D], and for F it would simply check [F, F].
//
// In addition, there is an option for performance tweaks: if the size of the
// type range corresponding to a supertype is a power of two and starts at a
// power of two (e.g. [0x100, 0x13f]), then the compiler can often optimize
@ -551,7 +575,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 +610,7 @@ enum ExternalPointerTag : uint16_t {
kLastMaybeReadOnlyExternalPointerTag = kLastInterceptorInfoExternalPointerTag,
kWasmInternalFunctionCallTargetTag,
kWasmTypeInfoNativeTypeTag,
kWasmExportedFunctionDataSignatureTag,
kWasmStackMemoryTag,
kWasmIndirectFunctionTargetTag,
// Foreigns
kFirstForeignExternalPointerTag,
@ -620,6 +644,14 @@ enum ExternalPointerTag : uint16_t {
kIcuLocalizedNumberFormatterTag,
kIcuPluralRulesTag,
kIcuCollatorTag,
kTemporalDurationTag,
kTemporalInstantTag,
kTemporalPlainDateTag,
kTemporalPlainTimeTag,
kTemporalPlainDateTimeTag,
kTemporalPlainYearMonthTag,
kTemporalPlainMonthDayTag,
kTemporalZonedDateTimeTag,
kDisplayNamesInternalTag,
kD8WorkerTag,
kD8ModuleEmbedderDataTag,
@ -690,7 +722,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 +848,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 +928,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 +960,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 +1009,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 +1025,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 +1067,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 +1249,12 @@ class Internals {
return *reinterpret_cast<void* const*>(addr);
}
V8_INLINE static HandleScopeData* GetHandleScopeData(v8::Isolate* isolate) {
Address addr =
reinterpret_cast<Address>(isolate) + kIsolateHandleScopeDataOffset;
return reinterpret_cast<HandleScopeData*>(addr);
}
V8_INLINE static void IncrementLongTasksStatsCounter(v8::Isolate* isolate) {
Address addr =
reinterpret_cast<Address>(isolate) + kIsolateLongTaskStatsCounterOffset;
@ -1222,7 +1307,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 +1341,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<v8::Isolate*>(
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 +1434,8 @@ void CastCheck<false>::Perform(T* data) {}
template <class T>
V8_INLINE void PerformCastCheck(T* data) {
CastCheck<std::is_base_of<Data, T>::value &&
!std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
CastCheck<std::is_base_of_v<Data, T> &&
!std::is_same_v<Data, std::remove_cv_t<T>>>::Perform(data);
}
// A base class for backing stores, which is needed due to vagaries of

View File

@ -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<Value> GetContinuationPreservedEmbedderData();
/**
* Sets a value that will be stored on continuations and reset while the
* continuation runs.
*/
V8_DEPRECATED("Use SetContinuationPreservedEmbedderDataV2 instead")
void SetContinuationPreservedEmbedderData(Local<Value> 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<Data> 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> 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);

View File

@ -5,7 +5,10 @@
#ifndef INCLUDE_V8_JSON_H_
#define INCLUDE_V8_JSON_H_
#include <optional>
#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<Value> Parse(
Local<Context> context, Local<String> json_string);
Local<Context> context, Local<String> json_string,
std::optional<ScriptOrigin> origin = std::nullopt);
/**
* Tries to stringify the JSON-serializable object |json_object| and returns

View File

@ -42,6 +42,7 @@ class BasicTracedReference;
template <class F>
class TracedReference;
class ArrayBuffer;
class Boolean;
class Context;
class EscapableHandleScope;
@ -62,6 +63,8 @@ template <class F>
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 <typename T, typename V = Value>
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<Array, T> && value->IsArgumentsObject()) return;
if (std::is_same_v<ArrayBuffer, T> && value->IsSharedArrayBuffer()) return;
if (std::is_same_v<Object, T> && value->IsNull()) return;
if (std::is_same_v<Object, T> && value->IsString()) return;
if (std::is_same_v<Object, T> && value->IsUndefined()) return;
if (std::is_same_v<Uint32, T> && value->IsInt32()) return;
if (std::is_same_v<Object, T> && 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<Isolate*>(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<internal::Address*>(
reinterpret_cast<internal::Address>(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<T>(value<Value>());
#endif
}
template <typename S>
V8_INLINE LocalBase(const LocalBase<S>& 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<T>(value<Value>());
#endif
}
template <typename S>
V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {}
V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) {
return LocalBase(HandleScope::CreateHandle(
reinterpret_cast<internal::Isolate*>(isolate), value));
return LocalBase(HandleScope::CreateHandle(isolate, value));
}
V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) {

View File

@ -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 T>
class Maybe : public cppgc::internal::ConditionalStackAllocatedBase<T> {
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<T>.
*/
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<T> {
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<T> {
}
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 <class U>
friend Maybe<U> Nothing();
template <class U>
friend Maybe<U> Just(const U& u);
template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
@ -109,8 +132,8 @@ class Maybe : public cppgc::internal::ConditionalStackAllocatedBase<T> {
};
template <class T>
inline Maybe<T> Nothing() {
return Maybe<T>();
inline constexpr Maybe<T> Nothing() {
return {};
}
template <class T>
@ -130,7 +153,11 @@ inline Maybe<T> Just(T&& t) {
template <>
class Maybe<void> {
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<void> {
private:
struct JustTag {};
Maybe() : is_valid_(false) {}
explicit Maybe(JustTag) : is_valid_(true) {}
bool is_valid_;
bool is_valid_ = false;
template <class U>
friend Maybe<U> Nothing();
friend Maybe<void> JustVoid();
};

View File

@ -87,15 +87,20 @@ class V8_EXPORT MemorySpan {
static constexpr bool is_compatible_iterator_v =
is_compatible_iterator<It>::value;
// SFINAE-compatible wrapper for `std::to_address()`.
// Adapted from "base/types/to_address.h" in chromium.
template <typename U>
requires(!std::is_function_v<U>)
[[nodiscard]] static constexpr U* to_address(U* p) noexcept {
return p;
}
template <typename It,
typename = std::void_t<decltype(std::declval<It&>().operator->())>>
[[nodiscard]] static constexpr auto to_address(It it) noexcept {
return it.operator->();
template <typename It>
requires(
requires(const It& it) { std::pointer_traits<It>::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:

View File

@ -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<String> GetSource(

View File

@ -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<v8::Isolate::Priority> 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 {

View File

@ -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 <typename T>
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<Value> 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<Value> 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<Wrappable>,
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 <CppHeapPointerTag tag>
static V8_INLINE void Wrap(v8::Isolate* isolate,
const v8::Local<v8::Object>& wrapper,
void* wrappable);
Wrappable* wrappable);
template <CppHeapPointerTag tag>
static V8_INLINE void Wrap(v8::Isolate* isolate,
const PersistentBase<Object>& wrapper,
void* wrappable);
Wrappable* wrappable);
template <CppHeapPointerTag tag>
static V8_INLINE void Wrap(v8::Isolate* isolate,
const BasicTracedReference<Object>& wrapper,
void* wrappable);
Wrappable* wrappable);
static V8_INLINE void Wrap(v8::Isolate* isolate,
const v8::Local<v8::Object>& wrapper,
void* wrappable, CppHeapPointerTag tag);
Wrappable* wrappable, CppHeapPointerTag tag);
static V8_INLINE void Wrap(v8::Isolate* isolate,
const PersistentBase<Object>& wrapper,
void* wrappable, CppHeapPointerTag tag);
Wrappable* wrappable, CppHeapPointerTag tag);
static V8_INLINE void Wrap(v8::Isolate* isolate,
const BasicTracedReference<Object>& 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<v8::Object>& 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<v8::Object>& 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<Object>& handle) {
return handle.template value<Object>()->GetIsolate();
}
@ -871,8 +933,7 @@ Local<Data> Object::GetInternalField(int index) {
value = I::DecompressTaggedField(obj, static_cast<uint32_t>(value));
#endif
auto isolate = reinterpret_cast<v8::Isolate*>(
internal::IsolateFromNeverReadOnlySpaceObject(obj));
auto* isolate = I::GetCurrentIsolate();
return Local<Data>::New(isolate, value);
}
#endif
@ -893,7 +954,8 @@ void* Object::GetAlignedPointerFromInternalField(v8::Isolate* isolate,
(I::kEmbedderDataSlotSize * index) +
I::kEmbedderDataSlotExternalPointerOffset;
A value =
I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
internal::kLastEmbedderDataTag}>(
isolate, obj, offset);
return reinterpret_cast<void*>(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<internal::kEmbedderDataSlotPayloadTag>(
I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
internal::kLastEmbedderDataTag}>(
isolate, obj, offset);
return reinterpret_cast<void*>(value);
}
@ -1011,7 +1074,7 @@ T* Object::Unwrap(v8::Isolate* isolate,
// static
template <CppHeapPointerTag tag>
void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& 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<v8::Object>& wrapper,
// static
template <CppHeapPointerTag tag>
void Object::Wrap(v8::Isolate* isolate, const PersistentBase<Object>& wrapper,
void* wrappable) {
v8::Object::Wrappable* wrappable) {
auto obj =
internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
Wrap(isolate, obj, tag, wrappable);
@ -1029,7 +1092,7 @@ void Object::Wrap(v8::Isolate* isolate, const PersistentBase<Object>& wrapper,
template <CppHeapPointerTag tag>
void Object::Wrap(v8::Isolate* isolate,
const BasicTracedReference<Object>& wrapper,
void* wrappable) {
v8::Object::Wrappable* wrappable) {
auto obj =
internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
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<v8::Object>& 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<Object>& wrapper,
void* wrappable, CppHeapPointerTag tag) {
v8::Object::Wrappable* wrappable, CppHeapPointerTag tag) {
auto obj =
internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
Wrap(isolate, obj, tag, wrappable);
@ -1052,8 +1115,8 @@ void Object::Wrap(v8::Isolate* isolate, const PersistentBase<Object>& wrapper,
// static
void Object::Wrap(v8::Isolate* isolate,
const BasicTracedReference<Object>& wrapper, void* wrappable,
CppHeapPointerTag tag) {
const BasicTracedReference<Object>& wrapper,
v8::Object::Wrappable* wrappable, CppHeapPointerTag tag) {
auto obj =
internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
Wrap(isolate, obj, tag, wrappable);

View File

@ -431,7 +431,7 @@ internal::Address* PersistentBase<T>::New(Isolate* isolate, T* that) {
template <class T, class M>
template <class S, class M2>
void Persistent<T, M>::Copy(const Persistent<S, M2>& that) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
this->Reset();
if (that.IsEmpty()) return;
this->slot() = api_internal::CopyGlobalReference(that.slot());
@ -459,7 +459,7 @@ void PersistentBase<T>::Reset() {
template <class T>
template <class S>
void PersistentBase<T>::Reset(Isolate* isolate, const Local<S>& other) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
Reset();
if (other.IsEmpty()) return;
this->slot() = New(isolate, *other);
@ -473,7 +473,7 @@ template <class T>
template <class S>
void PersistentBase<T>::Reset(Isolate* isolate,
const PersistentBase<S>& other) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
Reset();
if (other.IsEmpty()) return;
this->slot() = New(isolate, other.template value<S>());
@ -546,7 +546,7 @@ Global<T>::Global(Global&& other) : PersistentBase<T>(other.slot()) {
template <class T>
template <class S>
Global<T>& Global<T>::operator=(Global<S>&& rhs) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
if (this != &rhs) {
this->Reset();
if (!rhs.IsEmpty()) {

View File

@ -11,6 +11,7 @@
#include <stdlib.h> // For abort.
#include <memory>
#include <optional>
#include <string>
#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> 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> 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> task, double delay_in_seconds,
const SourceLocation& location = SourceLocation::Current()) {
void PostDelayedTask(std::unique_ptr<Task> 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> 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<IdleTask> task,
const SourceLocation& location = SourceLocation::Current()) {
void PostIdleTask(std::unique_ptr<IdleTask> 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<MemoryProtectionKeyId> 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<VirtualAddressSpace> AllocateSubspace(
Address hint, size_t size, size_t alignment,
PagePermissions max_page_permissions) = 0;
PagePermissions max_page_permissions,
std::optional<MemoryProtectionKeyId> 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> task,
const SourceLocation& location = SourceLocation::Current()) {
void CallOnWorkerThread(std::unique_ptr<Task> 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> 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> 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> 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> 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> 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<JobHandle> PostJob(
TaskPriority priority, std::unique_ptr<JobTask> 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<JobHandle> CreateJob(
TaskPriority priority, std::unique_ptr<JobTask> job_task,
const SourceLocation& location = SourceLocation::Current()) {
SourceLocation location = SourceLocation::Current()) {
return CreateJobImpl(priority, std::move(job_task), location);
}

View File

@ -635,11 +635,10 @@ class V8_EXPORT String : public Name {
bool StringEquals(Local<String> 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<v8::Value> obj,
WriteOptions options = REPLACE_INVALID_UTF8);
Utf8Value(Isolate* isolate, Local<v8::Value> 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<Number> New(Isolate* isolate, double value);
template <typename Int>
requires(std::is_integral<Int>::value && !std::is_same<Int, bool>::value &&
std::is_signed_v<Int> && sizeof(Int) <= sizeof(int32_t))
V8_INLINE static Local<Number> New(Isolate* isolate, Int value) {
return NewFromInt32(isolate, value);
}
template <typename UInt>
requires(std::is_integral<UInt>::value &&
!std::is_same<UInt, bool>::value && std::is_unsigned_v<UInt> &&
sizeof(UInt) <= sizeof(uint32_t))
V8_INLINE static Local<Number> 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<Number> NewFromInt32(Isolate* isolate, int32_t value);
static Local<Number> 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<internal::kExternalStringResourceTag>(
isolate, obj, I::kStringResourceOffset);
result = reinterpret_cast<String::ExternalStringResource*>(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<internal::kExternalStringResourceTag>(
isolate, obj, I::kStringResourceOffset);
resource = reinterpret_cast<ExternalStringResourceBase*>(value);

View File

@ -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;
};

View File

@ -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 {

View File

@ -6,21 +6,12 @@
#define INCLUDE_SOURCE_LOCATION_H_
#include <cstddef>
#include <source_location>
#include <string>
#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

View File

@ -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 {

View File

@ -181,7 +181,7 @@ class TracedReference : public BasicTracedReference<T> {
*/
template <class S>
TracedReference(Isolate* isolate, Local<S> that) : BasicTracedReference<T>() {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
if (V8_UNLIKELY(that.IsEmpty())) {
return;
}
@ -202,7 +202,7 @@ class TracedReference : public BasicTracedReference<T> {
template <class S>
TracedReference(Isolate* isolate, Local<S> that, IsDroppable)
: BasicTracedReference<T>() {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
if (V8_UNLIKELY(that.IsEmpty())) {
return;
}
@ -351,7 +351,7 @@ V8_INLINE bool operator!=(const v8::Local<U>& lhs,
template <class T>
template <class S>
void TracedReference<T>::Reset(Isolate* isolate, const Local<S>& other) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
this->Reset();
if (V8_UNLIKELY(other.IsEmpty())) {
return;
@ -366,7 +366,7 @@ template <class T>
template <class S>
void TracedReference<T>::Reset(Isolate* isolate, const Local<S>& other,
IsDroppable) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
this->Reset();
if (V8_UNLIKELY(other.IsEmpty())) {
return;
@ -381,7 +381,7 @@ template <class T>
template <class S>
TracedReference<T>& TracedReference<T>::operator=(
TracedReference<S>&& rhs) noexcept {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
*this = std::move(rhs.template As<T>());
return *this;
}
@ -390,7 +390,7 @@ template <class T>
template <class S>
TracedReference<T>& TracedReference<T>::operator=(
const TracedReference<S>& rhs) {
static_assert(std::is_base_of<T, S>::value, "type check");
static_assert(std::is_base_of_v<T, S>, "type check");
*this = rhs.template As<T>();
return *this;
}

View File

@ -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 {

View File

@ -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.)

View File

@ -85,6 +85,7 @@ path. Add it with -I<path> 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<path> 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<path> 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<path> 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<path> 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<path> 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<path> 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<path> 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))
@ -592,15 +605,11 @@ path. Add it with -I<path> to the command line
// functions.
// Use like:
// V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod();
#if V8_OS_WIN
# define V8_PRESERVE_MOST
#else
#if V8_HAS_ATTRIBUTE_PRESERVE_MOST
# define V8_PRESERVE_MOST __attribute__((preserve_most))
#else
# define V8_PRESERVE_MOST /* NOT SUPPORTED */
#endif
#endif
// A macro (V8_DEPRECATED) to mark classes or functions as deprecated.
@ -697,6 +706,17 @@ path. Add it with -I<path> 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 +746,41 @@ path. Add it with -I<path> 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 +853,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 +965,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 +1002,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

View File

@ -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': {

View File

@ -24,13 +24,14 @@ SUPPORTED_BUILDER_SPEC_KEYS = [
# 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

View File

@ -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': {
'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']
},
{
'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',
'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
},
{
'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,
'hard_timeout': 4800,
'priority': 35,
},
'tests': [
{'name': 'd8testing_random_gc', 'shards': 2},
{
'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']
},
{
'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': {
'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',
'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',
],
},
{
'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': 'allocation',
'test_args': [
'--total-timeout-sec=900',
'--allocation-offset=1',
'--extra-flags=--gc-interval=500',
]
},
{
'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',

View File

@ -1 +1 @@
Some infra-owned whitespace to test the cherry-picker.
Some infra-owned whitespace to test the cherry-picker.

13
deps/v8/src/DEPS vendored
View File

@ -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",
],
}

View File

@ -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 <typename T, internal::ExternalPointerTag tag>
inline T ToCData(i::Isolate* isolate,
v8::internal::Tagged<v8::internal::Object> 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<i::Object> obj) {
static_assert(sizeof(T) == sizeof(i::Address));
if (obj == i::Smi::zero()) return nullptr;
return reinterpret_cast<T>(
v8::internal::Cast<v8::internal::Foreign>(obj)->foreign_address<tag>(
isolate));
i::Cast<i::Foreign>(obj)->foreign_address<tag>(isolate));
}
template <internal::ExternalPointerTag tag>
inline v8::internal::Address ToCData(
i::Isolate* isolate, v8::internal::Tagged<v8::internal::Object> obj) {
if (obj == v8::internal::Smi::zero()) return v8::internal::kNullAddress;
return v8::internal::Cast<v8::internal::Foreign>(obj)->foreign_address<tag>(
isolate);
inline i::Address ToCData(i::Isolate* isolate, i::Tagged<i::Object> obj) {
if (obj == i::Smi::zero()) return i::kNullAddress;
return i::Cast<i::Foreign>(obj)->foreign_address<tag>(isolate);
}
template <internal::ExternalPointerTag tag, typename T>
inline v8::internal::DirectHandle<i::UnionOf<i::Smi, i::Foreign>> 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<tag>(
reinterpret_cast<v8::internal::Address>(obj));
inline i::DirectHandle<i::UnionOf<i::Smi, i::Foreign>> 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<tag>(reinterpret_cast<i::Address>(obj));
}
template <internal::ExternalPointerTag tag>
inline v8::internal::DirectHandle<i::UnionOf<i::Smi, i::Foreign>> 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<i::UnionOf<i::Smi, i::Foreign>> FromCData(
i::Isolate* isolate, i::Address obj) {
if (obj == i::kNullAddress) {
return direct_handle(i::Smi::zero(), isolate);
}
return isolate->factory()->NewForeign<tag>(obj);
}
template <class From, class To>
inline Local<To> Utils::Convert(v8::internal::DirectHandle<From> obj) {
inline Local<To> Utils::Convert(i::DirectHandle<From> obj) {
DCHECK(obj.is_null() || IsSmi(*obj) || !IsTheHole(*obj));
#ifdef V8_ENABLE_DIRECT_HANDLE
if (obj.is_null()) return Local<To>();
@ -70,66 +67,54 @@ inline Local<To> Utils::Convert(v8::internal::DirectHandle<From> obj) {
// Implementations of ToLocal
#define MAKE_TO_LOCAL(Name) \
template <template <typename> typename HandleType, typename T, typename> \
inline auto Utils::Name(HandleType<T> obj) { \
return Utils::Name##_helper(v8::internal::DirectHandle<T>(obj)); \
#define MAKE_TO_LOCAL(Name, From, To) \
inline Local<v8::To> Utils::Name(i::DirectHandle<i::From> obj) { \
return Convert<i::From, v8::To>(obj); \
}
TO_LOCAL_NAME_LIST(MAKE_TO_LOCAL)
TO_LOCAL_LIST(MAKE_TO_LOCAL)
#undef MAKE_TO_LOCAL
#undef TO_LOCAL_LIST
#define MAKE_TO_LOCAL_PRIVATE(Name, From, To) \
inline Local<v8::To> Utils::Name##_helper( \
v8::internal::DirectHandle<v8::internal::From> obj) { \
return Convert<v8::internal::From, v8::To>(obj); \
}
TO_LOCAL_LIST(MAKE_TO_LOCAL_PRIVATE)
#define MAKE_TO_LOCAL_TYPED_ARRAY(Type, typeName, TYPE, ctype) \
Local<v8::Type##Array> Utils::ToLocal##Type##Array( \
v8::internal::DirectHandle<v8::internal::JSTypedArray> obj) { \
DCHECK(obj->type() == v8::internal::kExternal##Type##Array); \
return Convert<v8::internal::JSTypedArray, v8::Type##Array>(obj); \
#define MAKE_TO_LOCAL_TYPED_ARRAY(Type, typeName, TYPE, ctype) \
Local<v8::Type##Array> Utils::ToLocal##Type##Array( \
i::DirectHandle<i::JSTypedArray> obj) { \
DCHECK(obj->type() == i::kExternal##Type##Array); \
return Convert<i::JSTypedArray, v8::Type##Array>(obj); \
}
TYPED_ARRAYS(MAKE_TO_LOCAL_TYPED_ARRAY)
#undef MAKE_TO_LOCAL_TYPED_ARRAY
#undef MAKE_TO_LOCAL
#undef MAKE_TO_LOCAL_PRIVATE
#undef TO_LOCAL_LIST
// Implementations of OpenHandle
#ifdef V8_ENABLE_DIRECT_HANDLE
#define MAKE_OPEN_HANDLE(From, To) \
v8::internal::Handle<v8::internal::To> Utils::OpenHandle( \
const v8::From* that, bool allow_empty_handle) { \
DCHECK(allow_empty_handle || !v8::internal::ValueHelper::IsEmpty(that)); \
DCHECK(v8::internal::ValueHelper::IsEmpty(that) || \
Is##To(v8::internal::Tagged<v8::internal::Object>( \
v8::internal::ValueHelper::ValueAsAddress(that)))); \
if (v8::internal::ValueHelper::IsEmpty(that)) { \
return v8::internal::Handle<v8::internal::To>::null(); \
i::Handle<i::To> Utils::OpenHandle(const v8::From* that, \
bool allow_empty_handle) { \
DCHECK(allow_empty_handle || !i::ValueHelper::IsEmpty(that)); \
DCHECK( \
i::ValueHelper::IsEmpty(that) || \
Is##To(i::Tagged<i::Object>(i::ValueHelper::ValueAsAddress(that)))); \
if (i::ValueHelper::IsEmpty(that)) { \
return i::Handle<i::To>::null(); \
} \
return v8::internal::Handle<v8::internal::To>( \
v8::HandleScope::CreateHandleForCurrentIsolate( \
v8::internal::ValueHelper::ValueAsAddress(that))); \
return i::Handle<i::To>(v8::HandleScope::CreateHandleForCurrentIsolate( \
i::ValueHelper::ValueAsAddress(that))); \
} \
\
v8::internal::DirectHandle<v8::internal::To> Utils::OpenDirectHandle( \
const v8::From* that, bool allow_empty_handle) { \
DCHECK(allow_empty_handle || !v8::internal::ValueHelper::IsEmpty(that)); \
DCHECK(v8::internal::ValueHelper::IsEmpty(that) || \
Is##To(v8::internal::Tagged<v8::internal::Object>( \
v8::internal::ValueHelper::ValueAsAddress(that)))); \
return v8::internal::DirectHandle<v8::internal::To>::FromAddress( \
v8::internal::ValueHelper::ValueAsAddress(that)); \
i::DirectHandle<i::To> Utils::OpenDirectHandle(const v8::From* that, \
bool allow_empty_handle) { \
DCHECK(allow_empty_handle || !i::ValueHelper::IsEmpty(that)); \
DCHECK( \
i::ValueHelper::IsEmpty(that) || \
Is##To(i::Tagged<i::Object>(i::ValueHelper::ValueAsAddress(that)))); \
return i::DirectHandle<i::To>::FromAddress( \
i::ValueHelper::ValueAsAddress(that)); \
} \
\
v8::internal::IndirectHandle<v8::internal::To> Utils::OpenIndirectHandle( \
i::IndirectHandle<i::To> Utils::OpenIndirectHandle( \
const v8::From* that, bool allow_empty_handle) { \
return Utils::OpenHandle(that, allow_empty_handle); \
}
@ -137,23 +122,22 @@ TYPED_ARRAYS(MAKE_TO_LOCAL_TYPED_ARRAY)
#else // !V8_ENABLE_DIRECT_HANDLE
#define MAKE_OPEN_HANDLE(From, To) \
v8::internal::Handle<v8::internal::To> Utils::OpenHandle( \
const v8::From* that, bool allow_empty_handle) { \
DCHECK(allow_empty_handle || !v8::internal::ValueHelper::IsEmpty(that)); \
DCHECK(v8::internal::ValueHelper::IsEmpty(that) || \
Is##To(v8::internal::Tagged<v8::internal::Object>( \
v8::internal::ValueHelper::ValueAsAddress(that)))); \
return v8::internal::Handle<v8::internal::To>( \
reinterpret_cast<v8::internal::Address*>( \
const_cast<v8::From*>(that))); \
i::Handle<i::To> Utils::OpenHandle(const v8::From* that, \
bool allow_empty_handle) { \
DCHECK(allow_empty_handle || !i::ValueHelper::IsEmpty(that)); \
DCHECK( \
i::ValueHelper::IsEmpty(that) || \
Is##To(i::Tagged<i::Object>(i::ValueHelper::ValueAsAddress(that)))); \
return i::Handle<i::To>( \
reinterpret_cast<i::Address*>(const_cast<v8::From*>(that))); \
} \
\
v8::internal::DirectHandle<v8::internal::To> Utils::OpenDirectHandle( \
const v8::From* that, bool allow_empty_handle) { \
i::DirectHandle<i::To> Utils::OpenDirectHandle(const v8::From* that, \
bool allow_empty_handle) { \
return Utils::OpenHandle(that, allow_empty_handle); \
} \
\
v8::internal::IndirectHandle<v8::internal::To> Utils::OpenIndirectHandle( \
i::IndirectHandle<i::To> Utils::OpenIndirectHandle( \
const v8::From* that, bool allow_empty_handle) { \
return Utils::OpenHandle(that, allow_empty_handle); \
}
@ -176,11 +160,12 @@ class V8_NODISCARD CallDepthScope {
if (do_callback) isolate_->FireBeforeCallEnteredCallback();
}
~CallDepthScope() {
i::MicrotaskQueue* microtask_queue =
i::Cast<i::NativeContext>(isolate_->context())
->microtask_queue(isolate_);
explicit CallDepthScope(i::Isolate* isolate) : isolate_(isolate) {
isolate_->thread_local_top()->IncrementCallDepth<do_callback>(this);
if (do_callback) isolate_->FireBeforeCallEnteredCallback();
}
~CallDepthScope() {
isolate_->thread_local_top()->DecrementCallDepth(this);
// Clear the exception when exiting V8 to avoid memory leaks.
// Also clear termination exceptions iff there's no TryCatch handler.
@ -191,19 +176,23 @@ class V8_NODISCARD CallDepthScope {
!isolate_->is_execution_terminating())) {
isolate_->clear_internal_exception();
}
if (do_callback) isolate_->FireCallCompletedCallback(microtask_queue);
#ifdef DEBUG
if (do_callback) {
i::MicrotaskQueue* microtask_queue =
isolate_->native_context()->microtask_queue(isolate_);
isolate_->FireCallCompletedCallback(microtask_queue);
#ifdef DEBUG
if (microtask_queue && microtask_queue->microtasks_policy() ==
v8::MicrotasksPolicy::kScoped) {
DCHECK(microtask_queue->GetMicrotasksScopeDepth() ||
!microtask_queue->DebugMicrotasksScopeDepthIsZero());
}
}
DCHECK(CheckKeptObjectsClearedAfterMicrotaskCheckpoint(microtask_queue));
#endif
}
DCHECK(CheckKeptObjectsClearedAfterMicrotaskCheckpoint(
isolate_->native_context()->microtask_queue(isolate_)));
isolate_->set_context(*saved_context_);
if (!saved_context_.is_null()) isolate_->set_context(*saved_context_);
}
CallDepthScope(const CallDepthScope&) = delete;
@ -260,6 +249,179 @@ class V8_NODISCARD InternalEscapableScope : public EscapableHandleScopeBase {
}
};
// Most API methods should use one of the following three classes:
// EnterV8Scope, EnterV8ScopeNoScriptScope, EnterV8NoScriptNoExceptionScope
//
// The latter two assume that no script is executed, and no exceptions are
// scheduled in addition (respectively). Creating an exception and
// removing it before returning is ok.
template <typename HandleScopeClass, bool do_callback>
class V8_NODISCARD EnterV8InternalScope {
public:
EnterV8InternalScope(i::Isolate* i_isolate, Local<Context> context,
i::RuntimeCallCounterId rcc_id)
: handle_scope_{i_isolate},
call_depth_scope_{i_isolate, context},
#ifdef V8_RUNTIME_CALL_STATS
rcs_scope_{i_isolate, rcc_id},
#endif // V8_RUNTIME_CALL_STATS
vm_state_{i_isolate} {
DCHECK(!i_isolate->is_execution_terminating());
DCHECK_EQ(i_isolate, i::Isolate::TryGetCurrent());
}
EnterV8InternalScope(i::Isolate* i_isolate, i::RuntimeCallCounterId rcc_id)
: handle_scope_{i_isolate},
call_depth_scope_{i_isolate},
#ifdef V8_RUNTIME_CALL_STATS
rcs_scope_{i_isolate, rcc_id},
#endif // V8_RUNTIME_CALL_STATS
vm_state_{i_isolate} {
DCHECK(!i_isolate->is_execution_terminating());
DCHECK_EQ(i_isolate, i::Isolate::TryGetCurrent());
}
template <typename T>
V8_INLINE Local<T> Escape(Local<T> value) {
return handle_scope_.Escape(value);
}
template <typename T>
V8_INLINE MaybeLocal<T> EscapeMaybe(MaybeLocal<T> value) {
return handle_scope_.EscapeMaybe(value);
}
// Same as above, but also converts `MaybeHandle` to `MaybeLocal` with type
// inference via `Utils::ToMaybeLocal`.
template <typename From>
requires requires(From v) { Utils::ToMaybeLocal(v); }
V8_INLINE auto EscapeMaybe(From value) {
return handle_scope_.EscapeMaybe(Utils::ToMaybeLocal(value));
}
private:
HandleScopeClass handle_scope_;
CallDepthScope<do_callback> call_depth_scope_;
#ifdef V8_RUNTIME_CALL_STATS
i::RuntimeCallTimerScope rcs_scope_;
#endif // V8_RUNTIME_CALL_STATS
i::VMState<v8::OTHER> vm_state_;
};
template <typename HandleScopeClass = i::HandleScope>
class V8_NODISCARD EnterV8Scope
: public EnterV8InternalScope<HandleScopeClass, true> {
public:
template <typename... Args>
explicit EnterV8Scope(Args... args)
: EnterV8InternalScope<HandleScopeClass, true>{args...} {}
};
template <typename HandleScopeClass = i::HandleScope>
class V8_NODISCARD EnterV8NoScriptScope
: public EnterV8InternalScope<HandleScopeClass, false> {
public:
template <typename... Args>
EnterV8NoScriptScope(i::Isolate* i_isolate, Args... args)
: EnterV8InternalScope<HandleScopeClass, false>{i_isolate, args...},
no_script_scope_{i_isolate} {}
private:
V8_NO_UNIQUE_ADDRESS i::DisallowJavascriptExecutionDebugOnly no_script_scope_;
};
class V8_NODISCARD EnterV8NoScriptNoExceptionScope {
public:
explicit EnterV8NoScriptNoExceptionScope(i::Isolate* i_isolate)
: vm_state_{i_isolate},
no_script_scope_{i_isolate},
no_exceptions_scope_{i_isolate} {}
private:
i::VMState<v8::OTHER> vm_state_;
V8_NO_UNIQUE_ADDRESS i::DisallowJavascriptExecutionDebugOnly no_script_scope_;
V8_NO_UNIQUE_ADDRESS i::DisallowExceptionsDebugOnly no_exceptions_scope_;
};
// TODO(clemensb): Make this the basis of all the other EnterV8* scopes?
class V8_NODISCARD EnterV8BasicScope {
public:
explicit EnterV8BasicScope(i::Isolate* i_isolate) : vm_state_{i_isolate} {
// Embedders should never enter V8 after terminating it.
DCHECK_IMPLIES(i::v8_flags.strict_termination_checks,
!i_isolate->is_execution_terminating());
}
private:
i::VMState<v8::OTHER> vm_state_;
};
class V8_NODISCARD PrepareForExecutionScope
: public EnterV8InternalScope<InternalEscapableScope, false> {
public:
PrepareForExecutionScope(Local<Context> context,
i::RuntimeCallCounterId rcc_id)
: PrepareForExecutionScope{i::Isolate::Current(), context, rcc_id} {}
PrepareForExecutionScope(i::Isolate* i_isolate, Local<Context> context,
i::RuntimeCallCounterId rcc_id)
: EnterV8InternalScope<InternalEscapableScope,
false>{ClearInternalException(i_isolate), context,
rcc_id},
i_isolate_{i_isolate} {}
i::Isolate* i_isolate() const { return i_isolate_; }
private:
static i::Isolate* ClearInternalException(i::Isolate* i_isolate) {
i_isolate->clear_internal_exception();
return i_isolate;
}
i::Isolate* const i_isolate_;
};
class V8_NODISCARD PrepareForDebugInterfaceExecutionScope {
public:
PrepareForDebugInterfaceExecutionScope(i::Isolate* i_isolate,
Local<Context> context)
: handle_scope_{i_isolate},
call_depth_scope_{i_isolate, context},
vm_state_{i_isolate} {
DCHECK(!i_isolate->is_execution_terminating());
DCHECK_EQ(i_isolate, i::Isolate::TryGetCurrent());
}
template <typename T>
V8_INLINE Local<T> Escape(Local<T> value) {
return handle_scope_.Escape(value);
}
template <typename T>
V8_INLINE MaybeLocal<T> EscapeMaybe(MaybeLocal<T> value) {
return handle_scope_.EscapeMaybe(value);
}
private:
InternalEscapableScope handle_scope_;
CallDepthScope<false> call_depth_scope_;
i::VMState<v8::OTHER> vm_state_;
};
class V8_NODISCARD ApiRuntimeCallStatsScope {
public:
#ifdef V8_RUNTIME_CALL_STATS
ApiRuntimeCallStatsScope(i::Isolate* i_isolate,
i::RuntimeCallCounterId rcc_id)
: rct_scope_{i_isolate, rcc_id} {}
private:
i::RuntimeCallTimerScope rct_scope_;
#else // V8_RUNTIME_CALL_STATS
constexpr ApiRuntimeCallStatsScope(i::Isolate*, i::RuntimeCallCounterId) {}
#endif // V8_RUNTIME_CALL_STATS
};
template <typename T>
void CopySmiElementsToTypedBuffer(T* dst, uint32_t length,
i::Tagged<i::FixedArray> elements) {
@ -287,8 +449,8 @@ template <CTypeInfo::Identifier type_info_id, typename T>
bool CopyAndConvertArrayToCppBuffer(Local<Array> src, T* dst,
uint32_t max_length) {
static_assert(
std::is_same<T, typename i::CTypeInfoTraits<
CTypeInfo(type_info_id).GetType()>::ctype>::value,
std::is_same_v<T, typename i::CTypeInfoTraits<
CTypeInfo(type_info_id).GetType()>::ctype>,
"Type mismatch between the expected CTypeInfo::Type and the destination "
"array");

View File

@ -1,19 +0,0 @@
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// PRESUBMIT_INTENTIONALLY_MISSING_INCLUDE_GUARD
#undef LOG_API
#undef ENTER_V8_BASIC
#undef ENTER_V8_HELPER_INTERNAL
#undef PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE
#undef PREPARE_FOR_EXECUTION_WITH_CONTEXT
#undef PREPARE_FOR_EXECUTION
#undef ENTER_V8
#undef ENTER_V8_NO_SCRIPT
#undef ENTER_V8_NO_SCRIPT_NO_EXCEPTION
#undef ENTER_V8_FOR_NEW_CONTEXT
#undef RETURN_ON_FAILED_EXECUTION
#undef RETURN_ON_FAILED_EXECUTION_PRIMITIVE
#undef RETURN_ESCAPED

View File

@ -1,112 +0,0 @@
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Note 1: Any file that includes this one should include api-macros-undef.h
// at the bottom.
// Note 2: This file is deliberately missing the include guards (the undeffing
// approach wouldn't work otherwise).
//
// PRESUBMIT_INTENTIONALLY_MISSING_INCLUDE_GUARD
/*
* Most API methods should use one of the three macros:
*
* ENTER_V8, ENTER_V8_NO_SCRIPT, ENTER_V8_NO_SCRIPT_NO_EXCEPTION.
*
* The latter two assume that no script is executed, and no exceptions are
* scheduled in addition (respectively). Creating an exception and
* removing it before returning is ok.
*
* Exceptions should be handled either by invoking one of the
* RETURN_ON_FAILED_EXECUTION* macros.
*
* API methods that are part of the debug interface should use
*
* PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE
*
* in a similar fashion to ENTER_V8.
*/
#define API_RCS_SCOPE(i_isolate, class_name, function_name) \
RCS_SCOPE(i_isolate, \
i::RuntimeCallCounterId::kAPI_##class_name##_##function_name);
#define ENTER_V8_BASIC(i_isolate) \
/* Embedders should never enter V8 after terminating it */ \
DCHECK_IMPLIES(i::v8_flags.strict_termination_checks, \
!i_isolate->is_execution_terminating()); \
i::VMState<v8::OTHER> __state__((i_isolate))
#define ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, \
function_name, HandleScopeClass, do_callback) \
DCHECK(!i_isolate->is_execution_terminating()); \
HandleScopeClass handle_scope(i_isolate); \
CallDepthScope<do_callback> call_depth_scope(i_isolate, context); \
API_RCS_SCOPE(i_isolate, class_name, function_name); \
i::VMState<v8::OTHER> __state__((i_isolate)); \
bool has_exception = false
#define PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE(i_isolate, context, \
T) \
DCHECK(!i_isolate->is_execution_terminating()); \
InternalEscapableScope handle_scope(i_isolate); \
CallDepthScope<false> call_depth_scope(i_isolate, context); \
i::VMState<v8::OTHER> __state__((i_isolate)); \
bool has_exception = false
#define PREPARE_FOR_EXECUTION(context, class_name, function_name) \
auto i_isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate()); \
i_isolate->clear_internal_exception(); \
ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, function_name, \
InternalEscapableScope, false);
#define ENTER_V8(i_isolate, context, class_name, function_name, \
HandleScopeClass) \
ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, function_name, \
HandleScopeClass, true)
#ifdef DEBUG
#define ENTER_V8_NO_SCRIPT(i_isolate, context, class_name, function_name, \
HandleScopeClass) \
ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, function_name, \
HandleScopeClass, false); \
i::DisallowJavascriptExecutionDebugOnly __no_script__((i_isolate))
// Lightweight version for APIs that don't require an active context.
#define DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate) \
i::DisallowJavascriptExecutionDebugOnly __no_script__((i_isolate)); \
i::DisallowExceptions __no_exceptions__((i_isolate))
#define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate) \
i::VMState<v8::OTHER> __state__((i_isolate)); \
DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate)
#define ENTER_V8_FOR_NEW_CONTEXT(i_isolate) \
DCHECK_IMPLIES(i::v8_flags.strict_termination_checks, \
!(i_isolate)->is_execution_terminating()); \
i::VMState<v8::OTHER> __state__((i_isolate)); \
i::DisallowExceptions __no_exceptions__((i_isolate))
#else // DEBUG
#define ENTER_V8_NO_SCRIPT(i_isolate, context, class_name, function_name, \
HandleScopeClass) \
ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, function_name, \
HandleScopeClass, false)
#define DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate)
#define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate) \
i::VMState<v8::OTHER> __state__((i_isolate));
#define ENTER_V8_FOR_NEW_CONTEXT(i_isolate) \
i::VMState<v8::OTHER> __state__((i_isolate));
#endif // DEBUG
#define RETURN_ON_FAILED_EXECUTION(T) \
if (has_exception) return MaybeLocal<T>();
#define RETURN_ON_FAILED_EXECUTION_PRIMITIVE(T) \
if (has_exception) return Nothing<T>();
#define RETURN_ESCAPED(value) return handle_scope.Escape(value);

View File

@ -497,27 +497,26 @@ MaybeHandle<JSFunction> ApiNatives::InstantiateFunction(
DirectHandle<FunctionTemplateInfo> data,
MaybeDirectHandle<Name> maybe_name) {
InvokeScope invoke_scope(isolate);
return ::v8::internal::InstantiateFunction(isolate, native_context, data,
maybe_name);
return ::i::InstantiateFunction(isolate, native_context, data, maybe_name);
}
MaybeHandle<JSFunction> ApiNatives::InstantiateFunction(
Isolate* isolate, DirectHandle<FunctionTemplateInfo> data,
MaybeDirectHandle<Name> maybe_name) {
InvokeScope invoke_scope(isolate);
return ::v8::internal::InstantiateFunction(isolate, data, maybe_name);
return ::i::InstantiateFunction(isolate, data, maybe_name);
}
MaybeHandle<JSObject> ApiNatives::InstantiateObject(
Isolate* isolate, DirectHandle<ObjectTemplateInfo> data,
DirectHandle<JSReceiver> new_target) {
InvokeScope invoke_scope(isolate);
return ::v8::internal::InstantiateObject(isolate, data, new_target, false);
return ::i::InstantiateObject(isolate, data, new_target, false);
}
MaybeHandle<JSObject> ApiNatives::InstantiateRemoteObject(
DirectHandle<ObjectTemplateInfo> data) {
Isolate* isolate = data->GetIsolate();
Isolate* isolate = Isolate::Current();
InvokeScope invoke_scope(isolate);
DirectHandle<FunctionTemplateInfo> constructor(

2767
deps/v8/src/api/api.cc vendored

File diff suppressed because it is too large Load Diff

130
deps/v8/src/api/api.h vendored
View File

@ -50,30 +50,25 @@ class EphemeronTable;
} // namespace debug
template <typename T, internal::ExternalPointerTag tag>
inline T ToCData(i::Isolate* isolate,
v8::internal::Tagged<v8::internal::Object> obj);
inline T ToCData(i::Isolate* isolate, i::Tagged<i::Object> obj);
template <internal::ExternalPointerTag tag>
inline v8::internal::Address ToCData(
v8::internal::Isolate* isolate,
v8::internal::Tagged<v8::internal::Object> obj);
inline i::Address ToCData(i::Isolate* isolate, i::Tagged<i::Object> obj);
template <internal::ExternalPointerTag tag, typename T>
inline v8::internal::DirectHandle<
v8::internal::UnionOf<v8::internal::Smi, v8::internal::Foreign>>
FromCData(v8::internal::Isolate* isolate, T obj);
inline i::DirectHandle<i::UnionOf<i::Smi, i::Foreign>> FromCData(
i::Isolate* isolate, T obj);
template <internal::ExternalPointerTag tag>
inline v8::internal::DirectHandle<
v8::internal::UnionOf<v8::internal::Smi, v8::internal::Foreign>>
FromCData(v8::internal::Isolate* isolate, v8::internal::Address obj);
inline i::DirectHandle<i::UnionOf<i::Smi, i::Foreign>> FromCData(
i::Isolate* isolate, i::Address obj);
class ApiFunction {
public:
explicit ApiFunction(v8::internal::Address addr) : addr_(addr) {}
v8::internal::Address address() { return addr_; }
explicit ApiFunction(i::Address addr) : addr_(addr) {}
i::Address address() { return addr_; }
private:
v8::internal::Address addr_;
i::Address addr_;
};
class RegisteredExtension {
@ -100,6 +95,7 @@ class RegisteredExtension {
V(ToLocal, Name, Name) \
V(ToLocal, String, String) \
V(ToLocal, Symbol, Symbol) \
V(ToLocal, JSDate, Object) \
V(ToLocal, JSRegExp, RegExp) \
V(ToLocal, JSReceiver, Object) \
V(ToLocal, JSObject, Object) \
@ -222,96 +218,99 @@ class Utils {
}
return condition;
}
static void ReportOOMFailure(v8::internal::Isolate* isolate,
const char* location, const OOMDetails& details);
static void ReportOOMFailure(i::Isolate* isolate, const char* location,
const OOMDetails& details);
// TODO(42203211): It would be nice if we could keep only a version with
// direct handles. But the implicit conversion from handles to direct handles
// combined with the heterogeneous copy constructor for direct handles make
// this ambiguous.
// TODO(42203211): Use C++20 concepts instead of the enable_if trait, when
// they are fully supported in V8.
#define DECLARE_TO_LOCAL(Name) \
template <template <typename> typename HandleType, typename T, \
typename = std::enable_if_t<std::is_convertible_v< \
HandleType<T>, v8::internal::DirectHandle<T>>>> \
static inline auto Name(HandleType<T> obj);
#define DECLARE_TO_LOCAL(Name) \
template <template <typename> typename HandleType, typename T> \
requires(std::is_convertible_v<HandleType<T>, i::DirectHandle<T>> && \
!std::is_same_v<HandleType<T>, i::DirectHandle<T>>) \
static inline auto Name(HandleType<T> obj) { \
return Name(i::DirectHandle<T>(obj)); \
}
TO_LOCAL_NAME_LIST(DECLARE_TO_LOCAL)
#undef DECLARE_TO_LOCAL
#define DECLARE_TO_LOCAL(Name, From, To) \
static inline Local<v8::To> Name(i::DirectHandle<i::From> obj);
TO_LOCAL_LIST(DECLARE_TO_LOCAL)
#undef DECLARE_TO_LOCAL
template <typename T>
static inline MaybeLocal<T> ToMaybe(Local<T> value) {
return value;
}
template <template <typename> typename HandleType, typename From>
requires std::is_convertible_v<HandleType<From>, i::MaybeDirectHandle<From>>
static inline auto ToMaybeLocal(HandleType<From> maybe_obj_in)
-> decltype(ToMaybe(ToLocal(std::declval<i::DirectHandle<From>>()))) {
i::MaybeDirectHandle<From> maybe_obj = maybe_obj_in;
i::DirectHandle<From> obj;
if (!maybe_obj.ToHandle(&obj)) return {};
return ToMaybe(ToLocal(obj));
}
#define DECLARE_TO_LOCAL_TYPED_ARRAY(Type, typeName, TYPE, ctype) \
static inline Local<v8::Type##Array> ToLocal##Type##Array( \
v8::internal::DirectHandle<v8::internal::JSTypedArray> obj);
i::DirectHandle<i::JSTypedArray> obj);
TYPED_ARRAYS(DECLARE_TO_LOCAL_TYPED_ARRAY)
#undef DECLARE_TO_LOCAL_TYPED_ARRAY
#define DECLARE_OPEN_HANDLE(From, To) \
static inline v8::internal::Handle<v8::internal::To> OpenHandle( \
const From* that, bool allow_empty_handle = false); \
static inline v8::internal::DirectHandle<v8::internal::To> OpenDirectHandle( \
const From* that, bool allow_empty_handle = false); \
static inline v8::internal::IndirectHandle<v8::internal::To> \
OpenIndirectHandle(const From* that, bool allow_empty_handle = false);
#define DECLARE_OPEN_HANDLE(From, To) \
static inline i::Handle<i::To> OpenHandle(const From* that, \
bool allow_empty_handle = false); \
static inline i::DirectHandle<i::To> OpenDirectHandle( \
const From* that, bool allow_empty_handle = false); \
static inline i::IndirectHandle<i::To> OpenIndirectHandle( \
const From* that, bool allow_empty_handle = false);
OPEN_HANDLE_LIST(DECLARE_OPEN_HANDLE)
#undef DECLARE_OPEN_HANDLE
#undef DECLARE_TO_LOCAL_TYPED_ARRAY
#undef DECLARE_TO_LOCAL
template <class From, class To>
static inline Local<To> Convert(v8::internal::DirectHandle<From> obj);
static inline Local<To> Convert(i::DirectHandle<From> obj);
template <class T>
static inline v8::internal::Handle<v8::internal::Object> OpenPersistent(
static inline i::Handle<i::Object> OpenPersistent(
const v8::PersistentBase<T>& persistent) {
return v8::internal::Handle<v8::internal::Object>(persistent.slot());
return i::Handle<i::Object>(persistent.slot());
}
template <class T>
static inline v8::internal::DirectHandle<v8::internal::Object> OpenPersistent(
static inline i::DirectHandle<i::Object> OpenPersistent(
v8::Persistent<T>* persistent) {
return OpenPersistent(*persistent);
}
template <class From, class To>
static inline v8::internal::Handle<To> OpenHandle(v8::Local<From> handle) {
static inline i::Handle<To> OpenHandle(v8::Local<From> handle) {
return OpenHandle(*handle);
}
template <class From, class To>
static inline v8::internal::DirectHandle<To> OpenDirectHandle(
v8::Local<From> handle) {
static inline i::DirectHandle<To> OpenDirectHandle(v8::Local<From> handle) {
return OpenDirectHandle(*handle);
}
private:
V8_NOINLINE V8_PRESERVE_MOST static void ReportApiFailure(
const char* location, const char* message);
#define DECLARE_TO_LOCAL_PRIVATE(Name, From, To) \
static inline Local<v8::To> Name##_helper( \
v8::internal::DirectHandle<v8::internal::From> obj);
TO_LOCAL_LIST(DECLARE_TO_LOCAL_PRIVATE)
#undef DECLARE_TO_LOCAL_PRIVATE
};
// Convert DirectHandle to Local w/o type inference or type checks.
// To get type inference (translating from internal to API types), use
// Utils::ToLocal.
template <class T>
inline v8::Local<T> ToApiHandle(
v8::internal::DirectHandle<v8::internal::Object> obj) {
return Utils::Convert<v8::internal::Object, T>(obj);
}
template <class T>
inline bool ToLocal(v8::internal::MaybeDirectHandle<v8::internal::Object> maybe,
Local<T>* local) {
v8::internal::DirectHandle<v8::internal::Object> handle;
if (maybe.ToHandle(&handle)) {
*local = Utils::Convert<v8::internal::Object, T>(handle);
return true;
}
return false;
inline v8::Local<T> ToApiHandle(i::DirectHandle<i::Object> obj) {
return Utils::Convert<i::Object, T>(obj);
}
namespace internal {
@ -360,9 +359,8 @@ class HandleScopeImplementer {
void FreeThreadResources();
// Garbage collection support.
V8_EXPORT_PRIVATE void Iterate(v8::internal::RootVisitor* v);
V8_EXPORT_PRIVATE static char* Iterate(v8::internal::RootVisitor* v,
char* data);
V8_EXPORT_PRIVATE void Iterate(i::RootVisitor* v);
V8_EXPORT_PRIVATE static char* Iterate(i::RootVisitor* v, char* data);
inline internal::Address* GetSpareOrNewBlock();
inline void DeleteExtensions(internal::Address* prev_limit);
@ -445,7 +443,7 @@ class HandleScopeImplementer {
friend class PersistentHandlesScope;
};
const int kHandleBlockSize = v8::internal::KB - 2; // fit in one page
const int kHandleBlockSize = i::KB - 2; // fit in one page
void HandleScopeImplementer::SaveContext(Tagged<Context> context) {
saved_contexts_.push_back(context);

View File

@ -126,7 +126,7 @@ bool AreStdlibMembersValid(Isolate* isolate, DirectHandle<JSReceiver> stdlib,
void Report(Handle<Script> script, int position, base::Vector<const char> text,
MessageTemplate message_template,
v8::Isolate::MessageErrorLevel level) {
Isolate* isolate = script->GetIsolate();
Isolate* isolate = Isolate::Current();
MessageLocation location(script, position, position);
DirectHandle<String> text_object =
isolate->factory()->InternalizeUtf8String(text);
@ -438,14 +438,10 @@ MaybeDirectHandle<Object> AsmJs::InstantiateAsmWasm(
ReportInstantiationSuccess(script, position,
instantiate_timer.Elapsed().InMillisecondsF());
DirectHandle<Name> single_function_name(
isolate->factory()->InternalizeUtf8String(AsmJs::kSingleFunctionName));
MaybeDirectHandle<Object> single_function =
Object::GetProperty(isolate, instance, single_function_name);
if (!single_function.is_null() &&
!IsUndefined(*single_function.ToHandleChecked(), isolate)) {
return single_function;
}
LookupIterator it(isolate, instance,
isolate->factory()->wasm_asm_single_function_symbol(),
LookupIterator::OWN_SKIP_INTERCEPTOR);
if (it.IsFound()) return it.GetDataValue();
// Here we rely on the fact that the exports object is eagerly created.
// The following check is a weak indicator for that. If this ever changes,

View File

@ -629,15 +629,16 @@ void AsmJsParser::ValidateModuleVarStdlib(VarInfo* info) {
// 6.2 ValidateExport
void AsmJsParser::ValidateExport() {
// clang-format off
EXPECT_TOKEN(TOK(return));
// clang-format on
if (Check('{')) {
for (;;) {
base::Vector<const char> name = CopyCurrentIdentifierString();
if (!scanner_.IsGlobal() && !scanner_.IsLocal()) {
FAIL("Illegal export name");
}
if (name == base::CStrVector("__proto__")) {
FAIL("Illegal export name");
}
Consume();
EXPECT_TOKEN(':');
if (!scanner_.IsGlobal()) {
@ -775,9 +776,7 @@ void AsmJsParser::ValidateFunction() {
bool last_statement_is_return = false;
while (!failed_ && !Peek('}')) {
// clang-format off
last_statement_is_return = Peek(TOK(return));
// clang-format on
RECURSE(ValidateStatement());
}
@ -1041,9 +1040,7 @@ void AsmJsParser::ValidateStatement() {
RECURSE(EmptyStatement());
} else if (Peek(TOK(if))) {
RECURSE(IfStatement());
// clang-format off
} else if (Peek(TOK(return))) {
// clang-format on
RECURSE(ReturnStatement());
} else if (IterationStatement()) {
// Handled in IterationStatement.
@ -1118,9 +1115,7 @@ void AsmJsParser::IfStatement() {
// 6.5.5 ReturnStatement
void AsmJsParser::ReturnStatement() {
// clang-format off
EXPECT_TOKEN(TOK(return));
// clang-format on
if (!Peek(';') && !Peek('}')) {
// TODO(bradnelson): See if this can be factored out.
AsmType* ret;
@ -1863,7 +1858,6 @@ AsmType* AsmJsParser::ShiftExpression() {
switch (scanner_.Token()) {
case TOK(SAR): {
EXPECT_TOKENn(TOK(SAR));
heap_access_shift_position_ = kNoHeapAccessShift;
// Remember position allowing this shift-expression to be used as part
// of a heap access operation expecting `a >> n:NumericLiteral`.
bool imm = false;
@ -1882,7 +1876,10 @@ AsmType* AsmJsParser::ShiftExpression() {
if (imm && old_pos == scanner_.Position()) {
heap_access_shift_position_ = old_code;
heap_access_shift_value_ = shift_imm;
} else {
heap_access_shift_position_ = kNoHeapAccessShift;
}
if (!(a->IsA(AsmType::Intish()) && b->IsA(AsmType::Intish()))) {
FAILn("Expected intish for operator >>.");
}

View File

@ -22,8 +22,7 @@ static const int kMaxIdentifierCount = 0xF000000;
} // namespace
AsmJsScanner::AsmJsScanner(Utf16CharacterStream* stream)
: stream_(stream),
token_(kUninitialized),
: token_(kUninitialized),
preceding_token_(kUninitialized),
next_token_(kUninitialized),
position_(0),
@ -48,6 +47,15 @@ AsmJsScanner::AsmJsScanner(Utf16CharacterStream* stream)
#define V(name) global_names_[#name] = kToken_##name;
KEYWORD_NAME_LIST(V)
#undef V
// Fully read the stream to protect against concurrent modification of on-heap
// data (e.g. strings).
input_offset_ = stream->pos();
static constexpr auto kEndOfInputU = static_cast<base::uc32>(kEndOfInput);
for (base::uc32 ch; (ch = stream->Advance()) != kEndOfInputU;) {
input_.push_back(ch);
}
Next();
}
@ -63,9 +71,7 @@ void AsmJsScanner::Next() {
return;
}
if (token_ == kEndOfInput || token_ == kParseError) {
return;
}
if (token_ == kEndOfInput || token_ == kParseError) return;
#if DEBUG
if (v8_flags.trace_asm_scanner) {
@ -84,9 +90,14 @@ void AsmJsScanner::Next() {
preceding_token_ = token_;
preceding_position_ = position_;
for (;;) {
position_ = stream_->pos();
base::uc32 ch = stream_->Advance();
while (true) {
position_ = input_offset_ + input_position_;
if (!HasMoreChars()) {
token_ = kEndOfInput;
return;
}
base::uc32 ch = NextChar();
switch (ch) {
case ' ':
case '\t':
@ -100,26 +111,20 @@ void AsmJsScanner::Next() {
preceded_by_newline_ = true;
break;
case kEndOfInputU:
token_ = kEndOfInput;
return;
case '\'':
case '"':
ConsumeString(ch);
return;
case '/':
ch = stream_->Advance();
if (ch == '/') {
if (Consume('/')) {
ConsumeCPPComment();
} else if (ch == '*') {
} else if (Consume('*')) {
if (!ConsumeCComment()) {
token_ = kParseError;
return;
}
} else {
stream_->Back();
token_ = '/';
return;
}
@ -213,7 +218,10 @@ std::string AsmJsScanner::Name(token_t token) const {
#endif
void AsmJsScanner::Seek(size_t pos) {
stream_->Seek(pos);
DCHECK_LE(input_offset_, pos);
size_t pos_within_input = pos - input_offset_;
DCHECK_LE(pos_within_input, input_.size());
input_position_ = pos_within_input;
preceding_token_ = kUninitialized;
token_ = kUninitialized;
next_token_ = kUninitialized;
@ -226,13 +234,10 @@ void AsmJsScanner::Seek(size_t pos) {
void AsmJsScanner::ConsumeIdentifier(base::uc32 ch) {
// Consume characters while still part of the identifier.
identifier_string_.clear();
while (IsIdentifierPart(ch)) {
identifier_string_ += ch;
ch = stream_->Advance();
identifier_string_.assign(1, ch);
while (HasMoreChars() && IsIdentifierPart(PeekChar())) {
identifier_string_ += NextChar();
}
// Go back one for next time.
stream_->Back();
// Decode what the identifier means.
if (preceding_token_ == '.') {
@ -284,8 +289,8 @@ void AsmJsScanner::ConsumeNumber(base::uc32 ch) {
number.assign(1, ch);
bool has_dot = ch == '.';
bool has_prefix = false;
for (;;) {
ch = stream_->Advance();
while (HasMoreChars()) {
ch = PeekChar();
if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') ||
(ch >= 'A' && ch <= 'F') || ch == '.' || ch == 'b' || ch == 'o' ||
ch == 'x' ||
@ -300,11 +305,11 @@ void AsmJsScanner::ConsumeNumber(base::uc32 ch) {
has_prefix = true;
}
number.push_back(ch);
Advance();
} else {
break;
}
}
stream_->Back();
// Special case the most common number.
if (number.size() == 1 && number[0] == '0') {
unsigned_value_ = 0;
@ -357,9 +362,9 @@ void AsmJsScanner::ConsumeNumber(base::uc32 ch) {
// TODO(bradnelson): Check if this happens often enough to be a perf
// problem.
if (number[0] == '.') {
for (size_t k = 1; k < number.size(); ++k) {
stream_->Back();
}
size_t rewind_by = number.size() - 1;
DCHECK_LE(rewind_by, input_position_);
input_position_ -= rewind_by;
token_ = '.';
return;
}
@ -381,33 +386,27 @@ void AsmJsScanner::ConsumeNumber(base::uc32 ch) {
}
bool AsmJsScanner::ConsumeCComment() {
for (;;) {
base::uc32 ch = stream_->Advance();
while (ch == '*') {
ch = stream_->Advance();
if (ch == '/') {
return true;
}
while (HasMoreChars()) {
while (Consume('*')) {
if (Consume('/')) return true;
}
if (ch == '\n') {
if (Consume('\n')) {
preceded_by_newline_ = true;
}
if (ch == kEndOfInputU) {
return false;
} else {
Advance();
}
}
return false;
}
void AsmJsScanner::ConsumeCPPComment() {
for (;;) {
base::uc32 ch = stream_->Advance();
if (ch == '\n') {
while (HasMoreChars()) {
if (Consume('\n')) {
preceded_by_newline_ = true;
return;
}
if (ch == kEndOfInputU) {
return;
}
Advance();
}
}
@ -415,12 +414,12 @@ void AsmJsScanner::ConsumeString(base::uc32 quote) {
// Only string allowed is 'use asm' / "use asm".
const char* expected = "use asm";
for (; *expected != '\0'; ++expected) {
if (stream_->Advance() != static_cast<base::uc32>(*expected)) {
if (!Consume(static_cast<base::uc32>(*expected))) {
token_ = kParseError;
return;
}
}
if (stream_->Advance() != quote) {
if (!Consume(quote)) {
token_ = kParseError;
return;
}
@ -428,8 +427,7 @@ void AsmJsScanner::ConsumeString(base::uc32 quote) {
}
void AsmJsScanner::ConsumeCompareOrShift(base::uc32 ch) {
base::uc32 next_ch = stream_->Advance();
if (next_ch == '=') {
if (Consume('=')) {
switch (ch) {
case '<':
token_ = kToken_LE;
@ -446,17 +444,11 @@ void AsmJsScanner::ConsumeCompareOrShift(base::uc32 ch) {
default:
UNREACHABLE();
}
} else if (ch == '<' && next_ch == '<') {
} else if (ch == '<' && Consume('<')) {
token_ = kToken_SHL;
} else if (ch == '>' && next_ch == '>') {
if (stream_->Advance() == '>') {
token_ = kToken_SHR;
} else {
token_ = kToken_SAR;
stream_->Back();
}
} else if (ch == '>' && Consume('>')) {
token_ = Consume('>') ? kToken_SHR : kToken_SAR;
} else {
stream_->Back();
token_ = ch;
}
}

View File

@ -135,11 +135,45 @@ class V8_EXPORT_PRIVATE AsmJsScanner {
};
// clang-format on
static constexpr base::uc32 kEndOfInputU =
static_cast<base::uc32>(kEndOfInput);
private:
Utf16CharacterStream* stream_;
// Consume multiple characters.
void ConsumeIdentifier(base::uc32 ch);
void ConsumeNumber(base::uc32 ch);
bool ConsumeCComment();
void ConsumeCPPComment();
void ConsumeString(base::uc32 quote);
void ConsumeCompareOrShift(base::uc32 ch);
// Classify character categories.
bool IsIdentifierStart(base::uc32 ch);
bool IsIdentifierPart(base::uc32 ch);
bool IsNumberStart(base::uc32 ch);
bool HasMoreChars() const { return input_position_ < input_.size(); }
base::uc32 PeekChar() const {
DCHECK(HasMoreChars());
return input_[input_position_];
}
base::uc32 NextChar() {
DCHECK(HasMoreChars());
return input_[input_position_++];
}
bool Consume(base::uc32 next) {
if (!HasMoreChars() || PeekChar() != next) return false;
++input_position_;
return true;
}
void Advance() {
DCHECK(HasMoreChars());
++input_position_;
}
std::vector<base::uc32> input_;
// Start position of the input stream; i.e. offset of `input_position_`.
size_t input_offset_;
// Current position inside `input_`.
size_t input_position_ = 0;
token_t token_;
token_t preceding_token_;
token_t next_token_; // Only set when in {rewind} state.
@ -156,19 +190,6 @@ class V8_EXPORT_PRIVATE AsmJsScanner {
double double_value_;
uint32_t unsigned_value_;
bool preceded_by_newline_;
// Consume multiple characters.
void ConsumeIdentifier(base::uc32 ch);
void ConsumeNumber(base::uc32 ch);
bool ConsumeCComment();
void ConsumeCPPComment();
void ConsumeString(base::uc32 quote);
void ConsumeCompareOrShift(base::uc32 ch);
// Classify character categories.
bool IsIdentifierStart(base::uc32 ch);
bool IsIdentifierPart(base::uc32 ch);
bool IsNumberStart(base::uc32 ch);
};
} // namespace internal

View File

@ -1,4 +1,3 @@
leszeks@chromium.org
marja@chromium.org
syg@chromium.org
verwaest@chromium.org

View File

@ -292,7 +292,8 @@ std::forward_list<const AstRawString*> AstConsString::ToRawStrings() const {
return result;
}
AstStringConstants::AstStringConstants(Isolate* isolate, uint64_t hash_seed)
AstStringConstants::AstStringConstants(Isolate* isolate,
const HashSeed hash_seed)
: zone_(isolate->allocator(), ZONE_NAME),
string_table_(),
hash_seed_(hash_seed) {

View File

@ -35,6 +35,7 @@
#include "src/common/globals.h"
#include "src/handles/handles.h"
#include "src/numbers/conversions.h"
#include "src/numbers/hash-seed.h"
#include "src/objects/name.h"
#include "src/zone/zone.h"
@ -65,7 +66,7 @@ class AstRawString final : public ZoneObject {
bool AsArrayIndex(uint32_t* index) const;
bool IsIntegerIndex() const;
V8_EXPORT_PRIVATE bool IsOneByteEqualTo(const char* data) const;
uint16_t FirstCharacter() const;
V8_EXPORT_PRIVATE uint16_t FirstCharacter() const;
template <typename IsolateT>
void Internalize(IsolateT* isolate);
@ -299,7 +300,7 @@ class AstStringConstants final {
0 SINGLE_CHARACTER_ASCII_AST_STRING_CONSTANTS(F);
#undef F
AstStringConstants(Isolate* isolate, uint64_t hash_seed);
AstStringConstants(Isolate* isolate, const HashSeed hash_seed);
AstStringConstants(const AstStringConstants&) = delete;
AstStringConstants& operator=(const AstStringConstants&) = delete;
@ -308,7 +309,7 @@ class AstStringConstants final {
AST_STRING_CONSTANTS(F)
#undef F
uint64_t hash_seed() const { return hash_seed_; }
const HashSeed hash_seed() const { return hash_seed_; }
const AstRawStringMap* string_table() const { return &string_table_; }
const AstRawString* one_character_string(int c) const {
DCHECK_GE(c, 0);
@ -329,7 +330,7 @@ class AstStringConstants final {
private:
Zone zone_;
AstRawStringMap string_table_;
uint64_t hash_seed_;
const HashSeed hash_seed_;
#define F(name, str) AstRawString* name##_;
AST_STRING_CONSTANTS(F)
@ -339,12 +340,12 @@ class AstStringConstants final {
class AstValueFactory {
public:
AstValueFactory(Zone* zone, const AstStringConstants* string_constants,
uint64_t hash_seed)
const HashSeed hash_seed)
: AstValueFactory(zone, zone, string_constants, hash_seed) {}
AstValueFactory(Zone* ast_raw_string_zone, Zone* single_parse_zone,
const AstStringConstants* string_constants,
uint64_t hash_seed)
const HashSeed hash_seed)
: string_table_(string_constants->string_table()),
strings_(nullptr),
strings_end_(&strings_),
@ -433,7 +434,7 @@ class AstValueFactory {
Zone* ast_raw_string_zone_;
Zone* single_parse_zone_;
uint64_t hash_seed_;
const HashSeed hash_seed_;
};
extern template EXPORT_TEMPLATE_DECLARE(

View File

@ -202,7 +202,8 @@ Handle<String> FunctionLiteral::GetInferredName(Isolate* isolate) {
void FunctionLiteral::set_shared_function_info(
Handle<SharedFunctionInfo> shared_function_info) {
DCHECK(shared_function_info_.is_null());
CHECK_EQ(shared_function_info->function_literal_id(), function_literal_id_);
CHECK_EQ(shared_function_info->function_literal_id(kRelaxedLoad),
function_literal_id_);
shared_function_info_ = shared_function_info;
}
@ -694,8 +695,8 @@ void ArrayLiteralBoilerplateBuilder::BuildBoilerplateDescription(
Cast<FixedDoubleArray>(*elements)->set(array_index,
literal->AsNumber());
} else {
DCHECK(
IsUninitialized(*GetBoilerplateValue(element, isolate), isolate));
DCHECK(IsUninitializedHole(*GetBoilerplateValue(element, isolate),
isolate));
Cast<FixedDoubleArray>(*elements)->set(array_index, 0);
}
@ -717,7 +718,7 @@ void ArrayLiteralBoilerplateBuilder::BuildBoilerplateDescription(
continue;
}
if (IsUninitialized(boilerplate_value, isolate)) {
if (IsUninitializedHole(boilerplate_value, isolate)) {
boilerplate_value = Smi::zero();
}

View File

@ -1822,6 +1822,8 @@ class Call final : public CallBase {
using IsTaggedTemplateField = CallBase::NextBitField<bool, 1>;
using IsOptionalChainLinkField = IsTaggedTemplateField::Next<bool, 1>;
public:
using EvalScopeInfoIndexField = IsOptionalChainLinkField::Next<uint32_t, 20>;
};

View File

@ -72,20 +72,22 @@ void CallPrinter::Find(AstNode* node, bool print) {
}
}
bool CallPrinter::ShouldPrint() { return found_ && !done_; }
void CallPrinter::Print(char c) {
if (!found_ || done_) return;
if (!ShouldPrint()) return;
num_prints_++;
builder_.AppendCharacter(c);
}
void CallPrinter::Print(const char* str) {
if (!found_ || done_) return;
if (!ShouldPrint()) return;
num_prints_++;
builder_.AppendCString(str);
}
void CallPrinter::Print(DirectHandle<String> str) {
if (!found_ || done_) return;
if (!ShouldPrint()) return;
num_prints_++;
builder_.AppendString(str);
}
@ -276,6 +278,7 @@ void CallPrinter::VisitConditional(Conditional* node) {
void CallPrinter::VisitLiteral(Literal* node) {
if (!ShouldPrint()) return;
// TODO(adamk): Teach Literal how to print its values without
// allocating on the heap.
PrintLiteral(node->BuildValue(isolate_), true);
@ -417,6 +420,7 @@ void CallPrinter::VisitProperty(Property* node) {
Print(".");
// TODO(adamk): Teach Literal how to print its values without
// allocating on the heap.
if (!ShouldPrint()) return;
PrintLiteral(literal->BuildValue(isolate_), false);
} else {
Find(node->obj(), true);
@ -625,6 +629,8 @@ void CallPrinter::FindArguments(const ZonePtrList<Expression>* arguments) {
}
void CallPrinter::PrintLiteral(DirectHandle<Object> value, bool quote) {
if (!ShouldPrint()) return;
if (IsString(*value)) {
if (quote) Print("\"");
Print(Cast<String>(value));

View File

@ -53,6 +53,8 @@ class CallPrinter final : public AstVisitor<CallPrinter> {
void Print(const char* str);
void Print(DirectHandle<String> str);
bool ShouldPrint();
void Find(AstNode* node, bool print = false);
Isolate* isolate_;

View File

@ -72,6 +72,18 @@ void VariableMap::Remove(Variable* var) {
ZoneHashMap::Remove(const_cast<AstRawString*>(name), name->Hash());
}
void VariableMap::RemoveDynamic() {
Entry* current = ZoneHashMap::Start();
while (current != nullptr) {
Variable* var = reinterpret_cast<Variable*>(current->value);
if (var->is_dynamic()) {
ZoneHashMap::Remove(current);
if (current->exists()) continue;
}
current = ZoneHashMap::Next(current);
}
}
void VariableMap::Add(Variable* var) {
const AstRawString* name = var->raw_name();
Entry* p = ZoneHashMap::LookupOrInsert(const_cast<AstRawString*>(name),
@ -263,6 +275,7 @@ Scope::Scope(Zone* zone, ScopeType scope_type,
is_block_scope_for_object_literal_ = true;
}
}
has_context_cells_ = scope_info->HasContextCells();
}
DeclarationScope::DeclarationScope(Zone* zone, ScopeType scope_type,
@ -276,6 +289,7 @@ DeclarationScope::DeclarationScope(Zone* zone, ScopeType scope_type,
if (scope_info->SloppyEvalCanExtendVars()) {
DCHECK(!is_eval_scope());
sloppy_eval_can_extend_vars_ = true;
is_dynamic_scope_ = true;
}
if (scope_info->ClassScopeHasPrivateBrand()) {
DCHECK(IsClassConstructor(function_kind()));
@ -355,7 +369,7 @@ void Scope::SetDefaults() {
sloppy_eval_can_extend_vars_ = false;
scope_nonlinear_ = false;
is_hidden_ = false;
is_debug_evaluate_scope_ = false;
is_dynamic_scope_ = scope_type_ == WITH_SCOPE;
inner_scope_calls_eval_ = false;
force_context_allocation_for_parameters_ = false;
@ -374,6 +388,9 @@ void Scope::SetDefaults() {
is_wrapped_function_ = false;
has_context_cells_ = (is_script_scope() && v8_flags.script_context_cells) ||
(is_function_scope() && v8_flags.function_context_cells);
num_stack_slots_ = 0;
num_heap_slots_ = ContextHeaderLength();
@ -412,6 +429,10 @@ bool Scope::ContainsAsmModule() const {
}
#endif // V8_ENABLE_WEBASSEMBLY
bool Scope::is_debug_evaluate_scope() const {
return is_dynamic_scope_ && scope_info_->IsDebugEvaluateScope();
}
template <typename IsolateT>
Scope* Scope::DeserializeScopeChain(IsolateT* isolate, Zone* zone,
Tagged<ScopeInfo> scope_info,
@ -419,6 +440,8 @@ Scope* Scope::DeserializeScopeChain(IsolateT* isolate, Zone* zone,
AstValueFactory* ast_value_factory,
DeserializationMode deserialization_mode,
ParseInfo* parse_info) {
CHECK_IMPLIES(parse_info != nullptr && parse_info->flags().is_toplevel(),
parse_info->flags().is_eval());
// Reconstruct the outer scope chain from a closure's context chain.
Scope* current_scope = nullptr;
Scope* innermost_scope = nullptr;
@ -429,13 +452,12 @@ Scope* Scope::DeserializeScopeChain(IsolateT* isolate, Zone* zone,
outer_scope =
zone->New<DeclarationScope>(zone, FUNCTION_SCOPE, ast_value_factory,
handle(scope_info, isolate));
outer_scope->set_is_debug_evaluate_scope();
outer_scope->set_is_dynamic_scope();
} else {
// For scope analysis, debug-evaluate is equivalent to a with scope.
outer_scope = zone->New<Scope>(zone, WITH_SCOPE, ast_value_factory,
handle(scope_info, isolate));
}
} else if (scope_info->is_script_scope()) {
// If we reach a script scope, it's the outermost scope. Install the
// scope info of this script context onto the existing script scope to
@ -496,6 +518,9 @@ Scope* Scope::DeserializeScopeChain(IsolateT* isolate, Zone* zone,
if (current_scope != nullptr) {
outer_scope->AddInnerScope(current_scope);
}
outer_scope->set_start_position(scope_info->StartPosition());
outer_scope->set_end_position(scope_info->EndPosition());
current_scope = outer_scope;
if (innermost_scope == nullptr) innermost_scope = current_scope;
scope_info = scope_info->HasOuterScopeInfo() ? scope_info->OuterScopeInfo()
@ -701,6 +726,7 @@ bool DeclarationScope::Analyze(ParseInfo* info) {
if (scope->is_eval_scope() && is_sloppy(scope->language_mode())) {
AstNodeFactory factory(info->ast_value_factory(), info->zone());
scope->HoistSloppyBlockFunctions(&factory);
scope->RemoveDynamic();
}
// We are compiling one of four cases:
@ -952,6 +978,7 @@ void Scope::Snapshot::Reparent(DeclarationScope* new_parent) {
new_parent->RecordEvalCall();
outer_scope_->calls_eval_ = false;
declaration_scope_->sloppy_eval_can_extend_vars_ = false;
declaration_scope_->is_dynamic_scope_ = false;
}
}
@ -1347,7 +1374,7 @@ void DeclarationScope::DeserializeReceiver(AstValueFactory* ast_value_factory) {
}
DCHECK(has_this_declaration());
DeclareThis(ast_value_factory);
if (is_debug_evaluate_scope()) {
if (V8_UNLIKELY(is_debug_evaluate_scope())) {
receiver_->AllocateTo(VariableLocation::LOOKUP, -1);
} else {
receiver_->AllocateTo(VariableLocation::CONTEXT,
@ -2080,19 +2107,6 @@ Variable* Scope::Lookup(VariableProxy* proxy, Scope* scope,
}
while (true) {
DCHECK_IMPLIES(mode == kParsedScope, !scope->is_debug_evaluate_scope_);
// Short-cut: whenever we find a debug-evaluate scope, just look everything
// up dynamically. Debug-evaluate doesn't properly create scope info for the
// lookups it does. It may not have a valid 'this' declaration, and anything
// accessed through debug-evaluate might invalidly resolve to
// stack-allocated variables.
// TODO(yangguo): Remove once debug-evaluate creates proper ScopeInfo for
// the scopes in which it's evaluating.
if (mode == kDeserializedScope &&
V8_UNLIKELY(scope->is_debug_evaluate_scope_)) {
return cache_scope->NonLocal(proxy->raw_name(), VariableMode::kDynamic);
}
// Try to find the variable in this scope.
Variable* var;
if (mode == kParsedScope) {
@ -2105,18 +2119,7 @@ Variable* Scope::Lookup(VariableProxy* proxy, Scope* scope,
// We found a variable and we are done. (Even if there is an 'eval' in this
// scope which introduces the same variable again, the resulting variable
// remains the same.)
//
// For sloppy eval though, we skip dynamic variable to avoid resolving to a
// variable when the variable and proxy are in the same eval execution. The
// variable is not available on subsequent lazy executions of functions in
// the eval, so this avoids inner functions from looking up different
// variables during eager and lazy compilation.
//
// TODO(leszeks): Maybe we want to restrict this to e.g. lookups of a proxy
// living in a different scope to the current one, or some other
// optimisation.
if (var != nullptr &&
!(scope->is_eval_scope() && var->mode() == VariableMode::kDynamic)) {
if (var != nullptr) {
if (mode == kParsedScope && force_context_allocation &&
!var->is_dynamic()) {
var->ForceContextAllocation();
@ -2125,17 +2128,20 @@ Variable* Scope::Lookup(VariableProxy* proxy, Scope* scope,
}
if (scope->outer_scope_ == outer_scope_end) break;
DCHECK(!scope->is_script_scope());
if (V8_UNLIKELY(scope->is_with_scope())) {
return LookupWith(proxy, scope, outer_scope_end, cache_scope,
force_context_allocation);
}
if (V8_UNLIKELY(
scope->is_declaration_scope() &&
scope->AsDeclarationScope()->sloppy_eval_can_extend_vars())) {
return LookupSloppyEval(proxy, scope, outer_scope_end, cache_scope,
force_context_allocation);
if (V8_UNLIKELY(scope->is_dynamic_scope_)) {
DCHECK(!scope->is_script_scope());
if (scope->is_declaration_scope() &&
scope->AsDeclarationScope()->sloppy_eval_can_extend_vars()) {
return LookupSloppyEval(proxy, scope, outer_scope_end, cache_scope,
force_context_allocation);
}
if (scope->is_with_scope()) {
return LookupWith(proxy, scope, outer_scope_end, cache_scope,
force_context_allocation);
}
CHECK_EQ(mode, kDeserializedScope);
CHECK(scope->is_debug_evaluate_scope());
return cache_scope->NonLocal(proxy->raw_name(), VariableMode::kDynamic);
}
force_context_allocation |= scope->is_function_scope();
@ -2474,6 +2480,11 @@ void DeclarationScope::AllocateParameterLocals() {
}
AllocateParameter(var, i);
}
// If we have mapped arguments, do not use context cells.
if (has_mapped_arguments) {
has_context_cells_ = false;
}
}
void DeclarationScope::AllocateParameter(Variable* var, int index) {
@ -2638,6 +2649,13 @@ void Scope::AllocateVariablesRecursively() {
scope->num_heap_slots_ = 0;
}
// If the number of context slots are over the function context threshold,
// do not allocate context cells.
if (scope->is_function_scope() &&
scope->ContextLocalCount() > v8_flags.function_context_cells_max_size) {
scope->has_context_cells_ = false;
}
// Allocation done.
DCHECK(scope->num_heap_slots_ == 0 ||
scope->num_heap_slots_ >= scope->ContextHeaderLength());
@ -2764,7 +2782,7 @@ void DeclarationScope::AllocateScopeInfos(ParseInfo* parse_info,
MaybeHandle<ScopeInfo> outer_scope;
if (scope->outer_scope_ != nullptr) {
DCHECK((std::is_same<Isolate, v8::internal::Isolate>::value));
DCHECK((std::is_same_v<Isolate, v8::internal::Isolate>));
outer_scope = scope->outer_scope_->scope_info_;
}
@ -2943,6 +2961,7 @@ template V8_EXPORT_PRIVATE void DeclarationScope::AllocateScopeInfos(
ParseInfo* info, DirectHandle<Script> script, LocalIsolate* isolate);
int Scope::ContextLocalCount() const {
DCHECK(!is_reparsed());
if (num_heap_slots() == 0) return 0;
Variable* function =
is_function_scope() ? AsDeclarationScope()->function_var() : nullptr;

View File

@ -69,6 +69,7 @@ class VariableMap : public ZoneHashMap {
V8_EXPORT_PRIVATE Variable* Lookup(const AstRawString* name);
void Remove(Variable* var);
void RemoveDynamic();
void Add(Variable* var);
Zone* zone() const { return allocator().zone(); }
@ -130,6 +131,7 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
~Snapshot() {
// Restore eval flags from before the scope was active.
if (sloppy_eval_can_extend_vars_) {
declaration_scope_->is_dynamic_scope_ = true;
declaration_scope_->sloppy_eval_can_extend_vars_ = true;
}
if (calls_eval_) {
@ -394,9 +396,7 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
return has_await_using_declaration_;
}
bool has_context_cells() const {
return v8_flags.script_context_cells && is_script_scope();
}
bool has_context_cells() const { return has_context_cells_; }
bool is_wrapped_function() const {
DCHECK_IMPLIES(is_wrapped_function_, is_function_scope());
@ -606,8 +606,8 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
// Retrieve `IsSimpleParameterList` of current or outer function.
bool HasSimpleParameters();
void set_is_debug_evaluate_scope() { is_debug_evaluate_scope_ = true; }
bool is_debug_evaluate_scope() const { return is_debug_evaluate_scope_; }
void set_is_dynamic_scope() { is_dynamic_scope_ = true; }
bool is_debug_evaluate_scope() const;
bool IsSkippableFunctionScope();
bool is_repl_mode_scope() const { return scope_type_ == REPL_MODE_SCOPE; }
@ -653,6 +653,11 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
void ForceDynamicLookup(VariableProxy* proxy);
void RemoveDynamic() {
DCHECK_EQ(scope_type_, EVAL_SCOPE);
variables_.RemoveDynamic();
}
protected:
Scope(Zone* zone, ScopeType scope_type);
@ -823,7 +828,7 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
bool is_hidden_ : 1;
// Temporary workaround that allows masking of 'this' in debug-evaluate
// scopes.
bool is_debug_evaluate_scope_ : 1;
bool is_dynamic_scope_ : 1;
// True if one of the inner scopes or the scope itself calls eval.
bool inner_scope_calls_eval_ : 1;
@ -849,6 +854,9 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
// If the scope was generated for wrapped function syntax, which will affect
// its UniqueIdInScript.
bool is_wrapped_function_ : 1;
// The context associated with the scope might have context cells.
bool has_context_cells_ : 1;
};
class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
@ -910,7 +918,7 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
while (outer_decl_scope->is_eval_scope()) {
outer_decl_scope = outer_decl_scope->GetDeclarationScope();
}
if (outer_decl_scope->is_debug_evaluate_scope()) {
if (V8_UNLIKELY(outer_decl_scope->is_debug_evaluate_scope())) {
// Don't check anything.
// TODO(9662): Figure out where variables declared by an eval inside a
// debug-evaluate actually go.
@ -922,6 +930,7 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
return;
}
is_dynamic_scope_ = true;
sloppy_eval_can_extend_vars_ = true;
}

View File

@ -39,12 +39,12 @@ class AddressRegion {
bool is_empty() const { return size_ == 0; }
bool contains(Address address) const {
static_assert(std::is_unsigned<Address>::value);
static_assert(std::is_unsigned_v<Address>);
return (address - begin()) < size();
}
bool contains(Address address, size_t size) const {
static_assert(std::is_unsigned<Address>::value);
static_assert(std::is_unsigned_v<Address>);
Address offset = address - begin();
return (offset < size_) && (offset + size <= size_);
}

View File

@ -89,41 +89,36 @@ class AsAtomicImpl {
}
template <typename T>
static void SeqCst_Store(T* addr,
typename std::remove_reference<T>::type new_value) {
static void SeqCst_Store(T* addr, std::remove_reference_t<T> new_value) {
static_assert(sizeof(T) <= sizeof(AtomicStorageType));
base::SeqCst_Store(to_storage_addr(addr),
cast_helper<T>::to_storage_type(new_value));
}
template <typename T>
static void Release_Store(T* addr,
typename std::remove_reference<T>::type new_value) {
static void Release_Store(T* addr, std::remove_reference_t<T> new_value) {
static_assert(sizeof(T) <= sizeof(AtomicStorageType));
base::Release_Store(to_storage_addr(addr),
cast_helper<T>::to_storage_type(new_value));
}
template <typename T>
static void Relaxed_Store(T* addr,
typename std::remove_reference<T>::type new_value) {
static void Relaxed_Store(T* addr, std::remove_reference_t<T> new_value) {
static_assert(sizeof(T) <= sizeof(AtomicStorageType));
base::Relaxed_Store(to_storage_addr(addr),
cast_helper<T>::to_storage_type(new_value));
}
template <typename T>
static T SeqCst_Swap(T* addr,
typename std::remove_reference<T>::type new_value) {
static T SeqCst_Swap(T* addr, std::remove_reference_t<T> new_value) {
static_assert(sizeof(T) <= sizeof(AtomicStorageType));
return base::SeqCst_AtomicExchange(
to_storage_addr(addr), cast_helper<T>::to_storage_type(new_value));
}
template <typename T>
static T Release_CompareAndSwap(
T* addr, typename std::remove_reference<T>::type old_value,
typename std::remove_reference<T>::type new_value) {
static T Release_CompareAndSwap(T* addr, std::remove_reference_t<T> old_value,
std::remove_reference_t<T> new_value) {
static_assert(sizeof(T) <= sizeof(AtomicStorageType));
return cast_helper<T>::to_return_type(base::Release_CompareAndSwap(
to_storage_addr(addr), cast_helper<T>::to_storage_type(old_value),
@ -131,9 +126,8 @@ class AsAtomicImpl {
}
template <typename T>
static T Relaxed_CompareAndSwap(
T* addr, typename std::remove_reference<T>::type old_value,
typename std::remove_reference<T>::type new_value) {
static T Relaxed_CompareAndSwap(T* addr, std::remove_reference_t<T> old_value,
std::remove_reference_t<T> new_value) {
static_assert(sizeof(T) <= sizeof(AtomicStorageType));
return cast_helper<T>::to_return_type(base::Relaxed_CompareAndSwap(
to_storage_addr(addr), cast_helper<T>::to_storage_type(old_value),
@ -141,9 +135,9 @@ class AsAtomicImpl {
}
template <typename T>
static T AcquireRelease_CompareAndSwap(
T* addr, typename std::remove_reference<T>::type old_value,
typename std::remove_reference<T>::type new_value) {
static T AcquireRelease_CompareAndSwap(T* addr,
std::remove_reference_t<T> old_value,
std::remove_reference_t<T> new_value) {
static_assert(sizeof(T) <= sizeof(AtomicStorageType));
return cast_helper<T>::to_return_type(base::AcquireRelease_CompareAndSwap(
to_storage_addr(addr), cast_helper<T>::to_storage_type(old_value),
@ -151,9 +145,8 @@ class AsAtomicImpl {
}
template <typename T>
static T SeqCst_CompareAndSwap(
T* addr, typename std::remove_reference<T>::type old_value,
typename std::remove_reference<T>::type new_value) {
static T SeqCst_CompareAndSwap(T* addr, std::remove_reference_t<T> old_value,
std::remove_reference_t<T> new_value) {
static_assert(sizeof(T) <= sizeof(AtomicStorageType));
return cast_helper<T>::to_return_type(base::SeqCst_CompareAndSwap(
to_storage_addr(addr), cast_helper<T>::to_storage_type(old_value),
@ -275,7 +268,7 @@ template <typename T>
inline void CheckedIncrement(
std::atomic<T>* number, T amount,
std::memory_order order = std::memory_order_seq_cst)
requires std::is_unsigned<T>::value
requires std::is_unsigned_v<T>
{
const T old = number->fetch_add(amount, order);
DCHECK_GE(old + amount, old);
@ -286,7 +279,7 @@ template <typename T>
inline void CheckedDecrement(
std::atomic<T>* number, T amount,
std::memory_order order = std::memory_order_seq_cst)
requires std::is_unsigned<T>::value
requires std::is_unsigned_v<T>
{
const T old = number->fetch_sub(amount, order);
DCHECK_GE(old, amount);

View File

@ -24,7 +24,7 @@ namespace base {
template <class T, int shift, int size, class U = uint32_t>
class BitField final {
public:
static_assert(std::is_unsigned<U>::value);
static_assert(std::is_unsigned_v<U>);
static_assert(shift < 8 * sizeof(U)); // Otherwise shifts by {shift} are UB.
static_assert(size < 8 * sizeof(U)); // Otherwise shifts by {size} are UB.
static_assert(shift + size <= 8 * sizeof(U));
@ -77,8 +77,7 @@ class BitField final {
template <typename A, typename B>
class BitFieldUnion final {
public:
static_assert(
std::is_same<typename A::BaseType, typename B::BaseType>::value);
static_assert(std::is_same_v<typename A::BaseType, typename B::BaseType>);
static_assert((A::kMask & B::kMask) == 0);
static constexpr int kShift = std::min(A::kShift, B::kShift);
static constexpr int kMask = A::kMask | B::kMask;

View File

@ -16,7 +16,7 @@ namespace bits {
template <typename T, bool kMSBFirst = false>
class BitsIterator : public iterator<std::forward_iterator_tag, int> {
static_assert(std::is_integral<T>::value);
static_assert(std::is_integral_v<T>);
public:
explicit BitsIterator(T bits) : bits_(bits) {}

View File

@ -24,7 +24,7 @@ namespace bits {
// CountPopulation(value) returns the number of bits set in |value|.
template <typename T>
constexpr inline unsigned CountPopulation(T value)
requires(std::is_unsigned<T>::value && sizeof(T) <= 8)
requires(std::is_unsigned_v<T> && sizeof(T) <= 8)
{
static_assert(sizeof(T) <= 8);
#if V8_HAS_BUILTIN_POPCOUNT
@ -98,7 +98,7 @@ inline constexpr std::make_signed_t<T> Signed(T value) {
// {sizeof(T) * 8}.
template <typename T, unsigned bits = sizeof(T) * 8>
inline constexpr unsigned CountLeadingZeros(T value)
requires(std::is_unsigned<T>::value && sizeof(T) <= 8)
requires(std::is_unsigned_v<T> && sizeof(T) <= 8)
{
static_assert(bits > 0, "invalid instantiation");
#if V8_HAS_BUILTIN_CLZ
@ -142,7 +142,7 @@ constexpr unsigned CountLeadingSignBits(T value) {
// |value| is guaranteed to be non-zero.
template <typename T, unsigned bits = sizeof(T) * 8>
inline constexpr unsigned CountTrailingZeros(T value)
requires(std::is_integral<T>::value && sizeof(T) <= 8)
requires(std::is_integral_v<T> && sizeof(T) <= 8)
{
#if V8_HAS_BUILTIN_CTZ
return value == 0 ? bits
@ -152,7 +152,7 @@ inline constexpr unsigned CountTrailingZeros(T value)
// Fall back to popcount (see "Hacker's Delight" by Henry S. Warren, Jr.),
// chapter 5-4. On x64, since is faster than counting in a loop and faster
// than doing binary search.
using U = typename std::make_unsigned<T>::type;
using U = typename std::make_unsigned_t<T>;
U u = value;
return CountPopulation(static_cast<U>(~u & (u - 1u)));
#endif
@ -171,7 +171,7 @@ inline constexpr unsigned CountTrailingZeros64(uint64_t value) {
// See CountTrailingZeros for an alternative version that allows |value| == 0.
template <typename T, unsigned bits = sizeof(T) * 8>
inline constexpr unsigned CountTrailingZerosNonZero(T value)
requires(std::is_integral<T>::value && sizeof(T) <= 8)
requires(std::is_integral_v<T> && sizeof(T) <= 8)
{
DCHECK_NE(0, value);
#if V8_HAS_BUILTIN_CTZ
@ -185,7 +185,7 @@ inline constexpr unsigned CountTrailingZerosNonZero(T value)
// Returns true iff |value| is a power of 2.
template <typename T>
constexpr inline bool IsPowerOfTwo(T value)
requires(std::is_integral<T>::value || std::is_enum<T>::value)
requires(std::is_integral_v<T> || std::is_enum_v<T>)
{
return value > 0 && (value & (value - 1)) == 0;
}
@ -193,7 +193,7 @@ constexpr inline bool IsPowerOfTwo(T value)
// Identical to {CountTrailingZeros}, but only works for powers of 2.
template <typename T>
inline constexpr int WhichPowerOfTwo(T value)
requires std::is_integral<T>::value
requires std::is_integral_v<T>
{
DCHECK(IsPowerOfTwo(value));
#if V8_HAS_BUILTIN_CTZ
@ -204,7 +204,7 @@ inline constexpr int WhichPowerOfTwo(T value)
// Fall back to popcount (see "Hacker's Delight" by Henry S. Warren, Jr.),
// chapter 5-4. On x64, since is faster than counting in a loop and faster
// than doing binary search.
using U = typename std::make_unsigned<T>::type;
using U = typename std::make_unsigned_t<T>;
U u = value;
return CountPopulation(static_cast<U>(u - 1));
#endif
@ -290,6 +290,16 @@ inline constexpr uint64_t RotateLeft64(uint64_t value, uint64_t shift) {
return (value << shift) | (value >> ((64 - shift) & 63));
}
// Clear the LSB of a value using Brian Kernighan's method.
template <typename T>
inline constexpr int ClearLsb(T value)
requires std::is_integral_v<T>
{
return value & (value - T{1});
}
static_assert(ClearLsb(0) == 0);
static_assert(ClearLsb(0b10010) == 0b10000);
// SignedAddOverflow32(lhs,rhs,val) performs a signed summation of |lhs| and
// |rhs| and stores the result into the variable pointed to by |val| and
// returns true if the signed summation resulted in an overflow.

View File

@ -31,13 +31,20 @@ size_t BoundedPageAllocator::size() const { return region_allocator_.size(); }
void* BoundedPageAllocator::AllocatePages(void* hint, size_t size,
size_t alignment,
PageAllocator::Permission access) {
return AllocatePages(size, alignment, access,
v8::PageAllocator::AllocationHint().WithAddress(hint));
}
void* BoundedPageAllocator::AllocatePages(size_t size, size_t alignment,
PageAllocator::Permission access,
PageAllocator::AllocationHint hint) {
MutexGuard guard(&mutex_);
DCHECK(IsAligned(alignment, region_allocator_.page_size()));
DCHECK(IsAligned(alignment, allocate_page_size_));
Address address = RegionAllocator::kAllocationFailure;
Address hint_address = reinterpret_cast<Address>(hint);
Address hint_address = reinterpret_cast<Address>(hint.Address());
if (hint_address && IsAligned(hint_address, alignment) &&
region_allocator_.contains(hint_address, size)) {
if (region_allocator_.AllocateRegionAt(hint_address, size)) {
@ -45,10 +52,14 @@ void* BoundedPageAllocator::AllocatePages(void* hint, size_t size,
}
}
const RegionAllocator::AllocationStrategy allocation_strategy =
hint.MayGrow() ? RegionAllocator::AllocationStrategy::kLargestFit
: RegionAllocator::AllocationStrategy::kFirstFit;
if (address == RegionAllocator::kAllocationFailure) {
if (alignment <= allocate_page_size_) {
// TODO(ishell): Consider using randomized version here.
address = region_allocator_.AllocateRegion(size);
address = region_allocator_.AllocateRegion(size, allocation_strategy);
} else {
address = region_allocator_.AllocateAlignedRegion(size, alignment);
}

View File

@ -101,6 +101,10 @@ class V8_BASE_EXPORT BoundedPageAllocator : public v8::PageAllocator {
void* AllocatePages(void* hint, size_t size, size_t alignment,
Permission access) override;
void* AllocatePages(
size_t size, size_t alignment, Permission access,
v8::PageAllocator::AllocationHint allocation_hint) override;
bool ReserveForSharedMemoryMapping(void* address, size_t size) override;
// Allocates pages at given address, returns true on success.

View File

@ -19,7 +19,7 @@ template <typename T, typename U>
(sizeof(U) <= sizeof(T))
inline constexpr bool IsInRange(T value, U lower_limit, U higher_limit) {
DCHECK_LE(lower_limit, higher_limit);
using unsigned_T = typename std::make_unsigned<T>::type;
using unsigned_T = std::make_unsigned_t<T>;
// Use static_cast to support enum classes.
return static_cast<unsigned_T>(static_cast<unsigned_T>(value) -
static_cast<unsigned_T>(lower_limit)) <=
@ -35,7 +35,7 @@ template <typename T, typename U>
inline constexpr bool IsInHalfOpenRange(T value, U lower_limit,
U higher_limit) {
DCHECK_LE(lower_limit, higher_limit);
using unsigned_T = typename std::make_unsigned<T>::type;
using unsigned_T = std::make_unsigned_t<T>;
// Use static_cast to support enum classes.
return static_cast<unsigned_T>(static_cast<unsigned_T>(value) -
static_cast<unsigned_T>(lower_limit)) <
@ -47,7 +47,7 @@ inline constexpr bool IsInHalfOpenRange(T value, U lower_limit,
// works even if {index+length} would wrap around.
template <typename T>
inline constexpr bool IsInBounds(T index, T length, T max)
requires std::is_unsigned<T>::value
requires std::is_unsigned_v<T>
{
return length <= max && index <= (max - length);
}

View File

@ -27,6 +27,15 @@
#endif
#endif
// PKU support (and by extension support for JIT code protections based on PKU)
// is currently only available on x64 Linux.
#if defined(V8_OS_LINUX) && defined(V8_HOST_ARCH_X64)
#define V8_HAS_PKU_SUPPORT 1
#else
#define V8_HAS_PKU_SUPPORT 0
#endif
#define V8_HAS_PKU_JIT_WRITE_PROTECT V8_HAS_PKU_SUPPORT
// pthread_jit_write_protect is only available on arm64 Mac.
#if defined(V8_HOST_ARCH_ARM64) && defined(V8_OS_MACOS)
#define V8_HAS_PTHREAD_JIT_WRITE_PROTECT 1
@ -43,11 +52,6 @@
#define V8_HAS_BECORE_JIT_WRITE_PROTECT 0
#endif
#if defined(V8_OS_LINUX) && defined(V8_HOST_ARCH_X64)
#define V8_HAS_PKU_JIT_WRITE_PROTECT 1
#else
#define V8_HAS_PKU_JIT_WRITE_PROTECT 0
#endif
#if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X64)
#define V8_TARGET_ARCH_STORES_RETURN_ADDRESS_ON_STACK true

View File

@ -55,7 +55,7 @@ class V8_EXPORT_PRIVATE ContextualVariable {
VarType value_;
Scope* previous_;
static_assert(std::is_base_of<ContextualVariable, Derived>::value,
static_assert(std::is_base_of_v<ContextualVariable, Derived>,
"Curiously Recurring Template Pattern");
DISALLOW_NEW_AND_DELETE()

View File

@ -14,7 +14,7 @@
#if V8_OS_LINUX
#include <linux/auxvec.h> // AT_HWCAP
#endif
#if V8_GLIBC_PREREQ(2, 16) || V8_OS_ANDROID
#if V8_OS_LINUX
#include <sys/auxv.h> // getauxval()
#endif
#if V8_OS_QNX
@ -191,6 +191,7 @@ static V8_INLINE void __cpuidex(int cpu_info[4], int info_type,
*/
#define HWCAP2_MTE (1 << 18)
#define HWCAP2_CSSC (1UL << 34)
#define HWCAP2_MOPS (1UL << 43)
#define HWCAP2_HBC (1UL << 44)
#endif // V8_HOST_ARCH_ARM64
@ -199,7 +200,7 @@ static V8_INLINE void __cpuidex(int cpu_info[4], int info_type,
static std::tuple<uint64_t, uint64_t> ReadELFHWCaps() {
uint64_t hwcap = 0;
uint64_t hwcap2 = 0;
#if (V8_GLIBC_PREREQ(2, 16) || V8_OS_ANDROID) && defined(AT_HWCAP)
#if V8_OS_LINUX && defined(AT_HWCAP)
hwcap = static_cast<uint64_t>(getauxval(AT_HWCAP));
#if defined(AT_HWCAP2)
hwcap2 = static_cast<uint64_t>(getauxval(AT_HWCAP2));
@ -452,6 +453,7 @@ CPU::CPU()
has_fp16_(false),
has_hbc_(false),
has_cssc_(false),
has_mops_(false),
is_fp64_mode_(false),
has_non_stop_time_stamp_counter_(false),
is_running_in_vm_(false),
@ -842,6 +844,7 @@ CPU::CPU()
has_cssc_ = (hwcaps2 & HWCAP2_CSSC) != 0;
has_mte_ = (hwcaps2 & HWCAP2_MTE) != 0;
has_hbc_ = (hwcaps2 & HWCAP2_HBC) != 0;
has_mops_ = (hwcaps2 & HWCAP2_MOPS) != 0;
if (hwcaps != 0) {
has_jscvt_ = (hwcaps & HWCAP_JSCVT) != 0;
has_dot_prod_ = (hwcaps & HWCAP_ASIMDDP) != 0;
@ -953,7 +956,9 @@ CPU::CPU()
part_ = -1;
if (auxv_cpu_type) {
if (strcmp(auxv_cpu_type, "power10") == 0) {
if (strcmp(auxv_cpu_type, "power11") == 0) {
part_ = kPPCPower11;
} else if (strcmp(auxv_cpu_type, "power10") == 0) {
part_ = kPPCPower10;
} else if (strcmp(auxv_cpu_type, "power9") == 0) {
part_ = kPPCPower9;

View File

@ -64,7 +64,7 @@ class V8_BASE_EXPORT CPU final {
static const int kNvidiaDenverV10 = 0x002;
// PPC-specific part codes
enum { kPPCPower8, kPPCPower9, kPPCPower10 };
enum { kPPCPower8, kPPCPower9, kPPCPower10, kPPCPower11 };
// General features
bool has_fpu() const { return has_fpu_; }
@ -125,6 +125,7 @@ class V8_BASE_EXPORT CPU final {
bool has_fp16() const { return has_fp16_; }
bool has_hbc() const { return has_hbc_; }
bool has_cssc() const { return has_cssc_; }
bool has_mops() const { return has_mops_; }
// mips features
bool is_fp64_mode() const { return is_fp64_mode_; }
@ -199,6 +200,7 @@ class V8_BASE_EXPORT CPU final {
bool has_fp16_;
bool has_hbc_;
bool has_cssc_;
bool has_mops_;
bool is_fp64_mode_;
bool has_non_stop_time_stamp_counter_;
bool is_running_in_vm_;

View File

@ -41,6 +41,7 @@
#include "src/base/free_deleter.h"
#include "src/base/logging.h"
#include "src/base/macros.h"
#include "src/base/platform/memory-protection-key.h"
namespace v8 {
namespace base {
@ -205,6 +206,10 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) {
// of StackTrace can behave in an async-signal-safe manner.
in_signal_handler = 1;
#if V8_HAS_PKU_SUPPORT
MemoryProtectionKey::SetDefaultPermissionsForAllKeysInSignalHandler();
#endif
PrintToStderr("Received signal ");
char buf[1024] = {0};
internal::itoa_r(signal, buf, sizeof(buf), 10, 0);

View File

@ -5,6 +5,9 @@
#ifndef V8_BASE_DISCRIMINATED_UNION_H_
#define V8_BASE_DISCRIMINATED_UNION_H_
#include <algorithm>
#include <cstdint>
#include <limits>
#include <type_traits>
#include <utility>

View File

@ -173,8 +173,9 @@ bool EmulatedVirtualAddressSubspace::CanAllocateSubspaces() {
std::unique_ptr<v8::VirtualAddressSpace>
EmulatedVirtualAddressSubspace::AllocateSubspace(
Address hint, size_t size, size_t alignment,
PagePermissions max_page_permissions) {
UNREACHABLE();
PagePermissions max_page_permissions,
std::optional<MemoryProtectionKeyId> key) {
UNIMPLEMENTED();
}
bool EmulatedVirtualAddressSubspace::RecommitPages(

View File

@ -64,11 +64,16 @@ class V8_BASE_EXPORT EmulatedVirtualAddressSubspace final
void FreeGuardRegion(Address address, size_t size) override;
std::optional<MemoryProtectionKeyId> ActiveMemoryProtectionKey() override {
return std::nullopt;
}
bool CanAllocateSubspaces() override;
std::unique_ptr<v8::VirtualAddressSpace> AllocateSubspace(
Address hint, size_t size, size_t alignment,
PagePermissions max_page_permissions) override;
PagePermissions max_page_permissions,
std::optional<MemoryProtectionKeyId> key) override;
bool RecommitPages(Address address, size_t size,
PagePermissions permissions) override;

Some files were not shown because too many files have changed in this diff Show More