update V8 build.gns

This commit is contained in:
Alexander Frick 2023-10-08 03:54:53 -05:00
parent 8d399d0281
commit 52815a9d08
6 changed files with 1138 additions and 758 deletions

View File

@ -83,6 +83,17 @@ declare_args() {
# Sets -dENABLE_HUGEPAGE
v8_enable_hugepage = false
# Sets -dV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION.
#
# This flag speeds up the performance of fork/execve on Linux systems for
# embedders which use it (like Node.js). It works by marking the pages that
# V8 allocates as MADV_DONTFORK. Without MADV_DONTFORK, the Linux kernel
# spends a long time manipulating page mappings on fork and exec which the
# child process doesn't generally need to access.
#
# See v8:7381 for more details.
v8_enable_private_mapping_fork_optimization = false
# Sets -dENABLE_HANDLE_ZAPPING.
v8_enable_handle_zapping = is_asan || is_debug
@ -183,6 +194,10 @@ declare_args() {
# the `--trace-turbo` .json file from `mksnapshot`.
v8_log_builtins_block_count_input = ""
# This build flag is used to control whether reorder builtins acoording to
# the call graph with C3 algorithm based builtin PGO profiling.
v8_enable_builtins_reordering = false
# Provides the given V8 log file as an input to mksnapshot, where it can be
# used for profile-guided optimization of builtins.
#
@ -278,6 +293,9 @@ declare_args() {
# Use switch-based dispatch if this is false
v8_enable_regexp_interpreter_threaded_dispatch = true
# Enforce equality of builtins hashes from compatible architectures.
v8_verify_builtins_compatibility = false
# Check mksnapshot determinism by running it multiple times.
v8_verify_deterministic_mksnapshot = false
@ -321,7 +339,7 @@ declare_args() {
# Enable experimental code pointer sandboxing for the V8 sandbox.
# Sets -DV8_CODE_POINTER_SANDBOXING
v8_code_pointer_sandboxing = false
v8_code_pointer_sandboxing = ""
# Expose the memory corruption API to JavaScript. Useful for testing the sandbox.
# WARNING This will expose builtins that (by design) cause memory corruption.
@ -368,10 +386,6 @@ declare_args() {
# This is only used by nodejs.
v8_scriptormodule_legacy_lifetime = false
# Change code emission and runtime features to be CET shadow-stack compliant
# (incomplete and experimental).
v8_enable_cet_shadow_stack = false
# Enables pointer compression for 8GB heaps.
# Sets -DV8_COMPRESS_POINTERS_8GB.
v8_enable_pointer_compression_8gb = ""
@ -394,6 +408,11 @@ declare_args() {
# Enable Maglev's graph printer.
# Sets -DV8_MAGLEV_GRAPH_PRINTER.
v8_enable_maglev_graph_printer = !build_with_chromium
# Enable jump table switch for built-in.
v8_enable_builtin_jump_table_switch = v8_current_cpu == "x64"
v8_shortcut_strings_in_minor_ms = false
}
# Derived defaults.
@ -477,9 +496,8 @@ if (v8_enable_external_code_space == "") {
}
if (v8_enable_maglev == "") {
v8_enable_maglev = v8_enable_turbofan &&
(v8_current_cpu == "arm" ||
((v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression))
(v8_current_cpu == "arm" || v8_current_cpu == "x64" ||
v8_current_cpu == "arm64")
}
assert(v8_enable_turbofan || !v8_enable_maglev,
"Maglev is not available when Turbofan is disabled.")
@ -541,6 +559,11 @@ if (v8_enable_sandbox == "") {
v8_enable_external_code_space && target_os != "fuchsia"
}
if (v8_code_pointer_sandboxing == "") {
# By default, enable code pointer sandboxing if the sandbox is enabled.
v8_code_pointer_sandboxing = v8_enable_sandbox
}
if (v8_enable_static_roots == "") {
# Static roots are only valid for builds with pointer compression and a
# shared read-only heap.
@ -655,8 +678,9 @@ assert(
assert(
!v8_enable_pointer_compression_shared_cage || v8_current_cpu == "x64" ||
v8_current_cpu == "arm64" || v8_current_cpu == "riscv64" ||
v8_current_cpu == "ppc64" || v8_current_cpu == "loong64",
"Sharing a pointer compression cage is only supported on x64, arm64, ppc64, riscv64 and loong64")
v8_current_cpu == "ppc64" || v8_current_cpu == "s390x" ||
v8_current_cpu == "loong64",
"Sharing a pointer compression cage is only supported on x64, arm64, ppc64, s390x, riscv64 and loong64")
assert(!v8_enable_unconditional_write_barriers || !v8_disable_write_barriers,
"Write barriers can't be both enabled and disabled")
@ -871,7 +895,9 @@ if (v8_enable_conservative_stack_scanning) {
if (v8_enable_direct_local) {
enabled_external_v8_defines += [ "V8_ENABLE_DIRECT_LOCAL" ]
}
if (v8_shortcut_strings_in_minor_ms) {
enabled_external_v8_defines += [ "V8_MINORMS_STRING_SHORTCUTTING" ]
}
disabled_external_v8_defines = external_v8_defines - enabled_external_v8_defines
# Put defines that are used in public headers here; public headers are
@ -1002,6 +1028,9 @@ config("features") {
if (v8_enable_hugepage) {
defines += [ "ENABLE_HUGEPAGE" ]
}
if (v8_enable_private_mapping_fork_optimization) {
defines += [ "V8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION" ]
}
if (v8_enable_object_print) {
defines += [ "OBJECT_PRINT" ]
}
@ -1172,6 +1201,12 @@ config("features") {
if (v8_enable_maglev_graph_printer) {
defines += [ "V8_ENABLE_MAGLEV_GRAPH_PRINTER" ]
}
if (v8_enable_builtin_jump_table_switch) {
defines += [ "V8_ENABLE_BUILTIN_JUMP_TABLE_SWITCH" ]
}
if (v8_enable_direct_handle) {
defines += [ "V8_ENABLE_DIRECT_HANDLE" ]
}
}
config("toolchain") {
@ -1606,10 +1641,6 @@ config("toolchain") {
"/wd4715", # 'function' : not all control paths return a value'
# MSVC does not analyze switch (enum) for completeness.
]
# TODO(https://crbug.com/1377771): Keep MSVC on C++17 until source code is
# made compatible with C++20.
cflags_cc = [ "/std:c++17" ]
}
if (!is_clang && !is_win) {
@ -1724,6 +1755,8 @@ if (v8_postmortem_support) {
"src/objects/heap-object.h",
"src/objects/heap-object-inl.h",
"src/objects/instance-type.h",
"src/objects/instance-type-checker.h",
"src/objects/instance-type-inl.h",
"src/objects/js-array-buffer.h",
"src/objects/js-array-buffer-inl.h",
"src/objects/js-array.h",
@ -1850,12 +1883,13 @@ torque_files = [
"src/builtins/promise-any.tq",
"src/builtins/promise-constructor.tq",
"src/builtins/promise-finally.tq",
"src/builtins/promise-jobs.tq",
"src/builtins/promise-misc.tq",
"src/builtins/promise-race.tq",
"src/builtins/promise-reaction-job.tq",
"src/builtins/promise-resolve.tq",
"src/builtins/promise-then.tq",
"src/builtins/promise-jobs.tq",
"src/builtins/promise-withresolvers.tq",
"src/builtins/proxy-constructor.tq",
"src/builtins/proxy-delete-property.tq",
"src/builtins/proxy-get-property.tq",
@ -1878,7 +1912,12 @@ torque_files = [
"src/builtins/regexp-split.tq",
"src/builtins/regexp-test.tq",
"src/builtins/regexp.tq",
"src/builtins/set-difference.tq",
"src/builtins/set-intersection.tq",
"src/builtins/set-is-disjoint-from.tq",
"src/builtins/set-is-subset-of.tq",
"src/builtins/set-is-superset-of.tq",
"src/builtins/set-symmetric-difference.tq",
"src/builtins/set-union.tq",
"src/builtins/string-at.tq",
"src/builtins/string-endswith.tq",
@ -2021,6 +2060,8 @@ if (v8_enable_webassembly) {
torque_files += [
"src/builtins/js-to-wasm.tq",
"src/builtins/wasm.tq",
"src/builtins/wasm-strings.tq",
"src/builtins/wasm-to-js.tq",
"src/debug/debug-wasm-objects.tq",
"src/wasm/wasm-objects.tq",
]
@ -2144,6 +2185,15 @@ group("v8_maybe_icu") {
}
}
group("v8_abseil") {
public_deps = [ "//third_party/abseil-cpp:absl" ]
public_configs = [
"//third_party/abseil-cpp:absl_define_config",
"//third_party/abseil-cpp:absl_include_config",
]
}
v8_header_set("torque_runtime_support") {
visibility = [ ":*" ]
@ -2164,6 +2214,7 @@ v8_source_set("torque_generated_initializers") {
public_deps = [
":torque_runtime_support",
":v8_abseil",
":v8_maybe_icu",
]
@ -2195,7 +2246,10 @@ v8_source_set("torque_generated_definitions") {
":v8_tracing",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
sources = [
"$target_gen_dir/torque-generated/class-forward-declarations.h",
@ -2303,6 +2357,10 @@ template("run_mksnapshot") {
# "--abort-on-bad-builtin-profile-data",
"--warn-about-builtin-profile-data",
]
if (!v8_enable_builtins_profiling && v8_enable_builtins_reordering) {
args += [ "--reorder-builtins" ]
}
}
# This is needed to distinguish between generating code for the simulator
@ -2432,6 +2490,64 @@ if (v8_verify_deterministic_mksnapshot) {
}
}
if (v8_verify_builtins_compatibility) {
# This specifies a separate mksnapshot target for each of:
# x86, x64, arm, arm64.
hashes = "builtins_hashes_$v8_current_cpu"
run_mksnapshot("dump_$v8_current_cpu") {
args = [
"--dump-builtins-hashes-to-file",
hashes,
]
embedded_variant = "Default"
}
# This template defines a comparison action for the architecture the pgo
# profile is made for (e.g. x64) and the architecture the profile is used
# for (e.g. arm64 with toolchain x64_v8_arm64).
template("verify_builtins_hashes") {
forward_variables_from(invoker,
[
"profile_arch",
"target_arch",
])
profile_toolchain = "//build/toolchain/linux:clang_${profile_arch}"
target_toolchain =
"//build/toolchain/linux:clang_${profile_arch}_v8_${target_arch}"
action("compare_builtins_$target_name") {
deps = [
":run_mksnapshot_dump_${profile_arch}($profile_toolchain)",
":run_mksnapshot_dump_${target_arch}($target_toolchain)",
]
report_file = "$root_build_dir/builtins_comparison_$target_name"
script = "tools/builtins-pgo/assert_builtins_hashes.py"
args = [
"builtins_hashes_${profile_arch}",
"builtins_hashes_${target_arch}",
rebase_path(report_file, root_build_dir),
]
outputs = [ report_file ]
}
}
verify_builtins_hashes("x86_arm") {
profile_arch = "x86"
target_arch = "arm"
}
verify_builtins_hashes("x64_arm64") {
profile_arch = "x64"
target_arch = "arm64"
}
group("verify_all_builtins_hashes") {
deps = [
":compare_builtins_x64_arm64",
":compare_builtins_x86_arm",
]
}
}
action("v8_dump_build_config") {
script = "tools/testrunner/utils/dump_build_config.py"
outputs = [ "$root_out_dir/v8_build_config.json" ]
@ -2487,6 +2603,7 @@ action("v8_dump_build_config") {
"DEBUG_defined=$is_DEBUG_defined",
"debugging_features=$v8_enable_debugging_features",
"dict_property_const_tracking=$v8_dict_property_const_tracking",
"direct_handle=$v8_enable_direct_handle",
"direct_local=$v8_enable_direct_local",
"disassembler=$v8_enable_disassembler",
"full_debug=$is_full_debug",
@ -2569,7 +2686,10 @@ v8_source_set("v8_snapshot") {
sources += [ "src/snapshot/snapshot-external.cc" ]
} else {
public_deps += [ ":v8_maybe_icu" ]
public_deps += [
":v8_abseil",
":v8_maybe_icu",
]
sources += [ "$target_gen_dir/snapshot.cc" ]
}
@ -2752,7 +2872,10 @@ v8_source_set("v8_init") {
"src/init/setup-isolate-full.cc",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [ ":internal_config" ]
}
@ -2998,6 +3121,7 @@ v8_header_set("v8_internal_headers") {
"src/codegen/interface-descriptors-inl.h",
"src/codegen/interface-descriptors.h",
"src/codegen/label.h",
"src/codegen/linkage-location.h",
"src/codegen/machine-type.h",
"src/codegen/macro-assembler-base.h",
"src/codegen/macro-assembler-inl.h",
@ -3046,6 +3170,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/backend/gap-resolver.h",
"src/compiler/backend/instruction-codes.h",
"src/compiler/backend/instruction-scheduler.h",
"src/compiler/backend/instruction-selector-adapter.h",
"src/compiler/backend/instruction-selector-impl.h",
"src/compiler/backend/instruction-selector.h",
"src/compiler/backend/instruction.h",
@ -3169,13 +3294,17 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/decompression-optimization.h",
"src/compiler/turboshaft/define-assembler-macros.inc",
"src/compiler/turboshaft/deopt-data.h",
"src/compiler/turboshaft/doubly-threaded-list.h",
"src/compiler/turboshaft/explicit-truncation-reducer.h",
"src/compiler/turboshaft/fast-api-call-reducer.h",
"src/compiler/turboshaft/fast-hash.h",
"src/compiler/turboshaft/graph-builder.h",
"src/compiler/turboshaft/graph-visualizer.h",
"src/compiler/turboshaft/graph.h",
"src/compiler/turboshaft/index.h",
"src/compiler/turboshaft/instruction-selection-phase.h",
"src/compiler/turboshaft/late-escape-analysis-reducer.h",
"src/compiler/turboshaft/late-load-elimination-reducer.h",
"src/compiler/turboshaft/layered-hash-map.h",
"src/compiler/turboshaft/machine-lowering-phase.h",
"src/compiler/turboshaft/machine-lowering-reducer.h",
@ -3189,8 +3318,10 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/pretenuring-propagation-reducer.h",
"src/compiler/turboshaft/recreate-schedule-phase.h",
"src/compiler/turboshaft/recreate-schedule.h",
"src/compiler/turboshaft/reduce-args-helper.h",
"src/compiler/turboshaft/reducer-traits.h",
"src/compiler/turboshaft/representations.h",
"src/compiler/turboshaft/required-optimization-reducer.h",
"src/compiler/turboshaft/runtime-call-descriptors.h",
"src/compiler/turboshaft/select-lowering-reducer.h",
"src/compiler/turboshaft/sidetable.h",
@ -3210,6 +3341,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/types.h",
"src/compiler/turboshaft/undef-assembler-macros.inc",
"src/compiler/turboshaft/uniform-reducer-adapter.h",
"src/compiler/turboshaft/use-map.h",
"src/compiler/turboshaft/utils.h",
"src/compiler/turboshaft/value-numbering-reducer.h",
"src/compiler/turboshaft/variable-reducer.h",
@ -3311,7 +3443,6 @@ v8_header_set("v8_internal_headers") {
"src/heap/array-buffer-sweeper.h",
"src/heap/base-space.h",
"src/heap/basic-memory-chunk.h",
"src/heap/code-object-registry.h",
"src/heap/code-range.h",
"src/heap/code-stats.h",
"src/heap/collection-barrier.h",
@ -3358,6 +3489,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/incremental-marking-job.h",
"src/heap/incremental-marking.h",
"src/heap/index-generator.h",
"src/heap/large-page.h",
"src/heap/large-spaces.h",
"src/heap/linear-allocation-area.h",
"src/heap/list.h",
@ -3367,6 +3499,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/local-heap.h",
"src/heap/mark-compact-inl.h",
"src/heap/mark-compact.h",
"src/heap/mark-sweep-utilities.h",
"src/heap/marking-barrier-inl.h",
"src/heap/marking-barrier.h",
"src/heap/marking-inl.h",
@ -3386,12 +3519,15 @@ v8_header_set("v8_internal_headers") {
"src/heap/memory-measurement.h",
"src/heap/memory-reducer.h",
"src/heap/minor-gc-job.h",
"src/heap/minor-mark-sweep-inl.h",
"src/heap/minor-mark-sweep.h",
"src/heap/new-spaces-inl.h",
"src/heap/new-spaces.h",
"src/heap/object-lock.h",
"src/heap/object-stats.h",
"src/heap/objects-visiting-inl.h",
"src/heap/objects-visiting.h",
"src/heap/page.h",
"src/heap/paged-spaces-inl.h",
"src/heap/paged-spaces.h",
"src/heap/parallel-work-item.h",
@ -3402,6 +3538,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/progress-bar.h",
"src/heap/read-only-heap-inl.h",
"src/heap/read-only-heap.h",
"src/heap/read-only-promotion.h",
"src/heap/read-only-spaces.h",
"src/heap/remembered-set-inl.h",
"src/heap/remembered-set.h",
@ -3414,6 +3551,9 @@ v8_header_set("v8_internal_headers") {
"src/heap/sweeper.h",
"src/heap/traced-handles-marking-visitor.h",
"src/heap/weak-object-worklists.h",
"src/heap/young-generation-marking-visitor-inl.h",
"src/heap/young-generation-marking-visitor.h",
"src/heap/zapping.h",
"src/ic/call-optimization.h",
"src/ic/handler-configuration-inl.h",
"src/ic/handler-configuration.h",
@ -3534,6 +3674,7 @@ v8_header_set("v8_internal_headers") {
"src/objects/heap-object.h",
"src/objects/hole-inl.h",
"src/objects/hole.h",
"src/objects/instance-type-checker.h",
"src/objects/instance-type-inl.h",
"src/objects/instance-type.h",
"src/objects/internal-index.h",
@ -3763,6 +3904,8 @@ v8_header_set("v8_internal_headers") {
"src/sandbox/external-pointer-table-inl.h",
"src/sandbox/external-pointer-table.h",
"src/sandbox/external-pointer.h",
"src/sandbox/indirect-pointer-inl.h",
"src/sandbox/indirect-pointer.h",
"src/sandbox/sandbox.h",
"src/sandbox/sandboxed-pointer-inl.h",
"src/sandbox/sandboxed-pointer.h",
@ -3789,6 +3932,7 @@ v8_header_set("v8_internal_headers") {
"src/snapshot/snapshot-source-sink.h",
"src/snapshot/snapshot-utils.h",
"src/snapshot/snapshot.h",
"src/snapshot/sort-builtins.h",
"src/snapshot/startup-deserializer.h",
"src/snapshot/startup-serializer.h",
"src/strings/char-predicates-inl.h",
@ -3876,6 +4020,7 @@ v8_header_set("v8_internal_headers") {
"src/maglev/maglev-ir-inl.h",
"src/maglev/maglev-ir.h",
"src/maglev/maglev-phi-representation-selector.h",
"src/maglev/maglev-pipeline-statistics.h",
"src/maglev/maglev-regalloc-data.h",
"src/maglev/maglev-regalloc.h",
"src/maglev/maglev-register-frame-array.h",
@ -3898,7 +4043,12 @@ v8_header_set("v8_internal_headers") {
"src/asmjs/asm-scanner.h",
"src/asmjs/asm-types.h",
"src/compiler/int64-lowering.h",
"src/compiler/turboshaft/int64-lowering-phase.h",
"src/compiler/turboshaft/int64-lowering-reducer.h",
"src/compiler/turboshaft/wasm-js-lowering-reducer.h",
"src/compiler/turboshaft/wasm-lowering-reducer.h",
"src/compiler/turboshaft/wasm-optimize-phase.h",
"src/compiler/turboshaft/wasm-turboshaft-compiler.h",
"src/compiler/wasm-address-reassociation.h",
"src/compiler/wasm-call-descriptors.h",
"src/compiler/wasm-compiler-definitions.h",
@ -3943,12 +4093,15 @@ v8_header_set("v8_internal_headers") {
"src/wasm/names-provider.h",
"src/wasm/object-access.h",
"src/wasm/pgo.h",
"src/wasm/serialized-signature-inl.h",
"src/wasm/simd-shuffle.h",
"src/wasm/stacks.h",
"src/wasm/std-object-sizes.h",
"src/wasm/streaming-decoder.h",
"src/wasm/string-builder-multiline.h",
"src/wasm/string-builder.h",
"src/wasm/struct-types.h",
"src/wasm/turboshaft-graph-interface.h",
"src/wasm/value-type.h",
"src/wasm/wasm-arguments.h",
"src/wasm/wasm-code-manager.h",
@ -4558,8 +4711,12 @@ if (v8_current_cpu == "x86") {
if (v8_enable_webassembly) {
v8_compiler_sources += [
"src/compiler/int64-lowering.cc",
"src/compiler/turboshaft/int64-lowering-phase.cc",
"src/compiler/turboshaft/wasm-optimize-phase.cc",
"src/compiler/turboshaft/wasm-turboshaft-compiler.cc",
"src/compiler/wasm-address-reassociation.cc",
"src/compiler/wasm-call-descriptors.cc",
"src/compiler/wasm-compiler-definitions.cc",
"src/compiler/wasm-compiler.cc",
"src/compiler/wasm-escape-analysis.cc",
"src/compiler/wasm-gc-lowering.cc",
@ -4594,6 +4751,7 @@ v8_source_set("v8_compiler_for_mksnapshot_source_set") {
public_deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_maybe_icu",
":v8_tracing",
]
@ -4631,6 +4789,7 @@ v8_source_set("v8_compiler") {
public_deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_internal_headers",
":v8_maybe_icu",
":v8_tracing",
@ -4658,7 +4817,9 @@ v8_source_set("v8_turboshaft") {
"src/compiler/turboshaft/graph-builder.cc",
"src/compiler/turboshaft/graph-visualizer.cc",
"src/compiler/turboshaft/graph.cc",
"src/compiler/turboshaft/instruction-selection-phase.cc",
"src/compiler/turboshaft/late-escape-analysis-reducer.cc",
"src/compiler/turboshaft/late-load-elimination-reducer.cc",
"src/compiler/turboshaft/machine-lowering-phase.cc",
"src/compiler/turboshaft/memory-optimization-reducer.cc",
"src/compiler/turboshaft/operations.cc",
@ -4676,6 +4837,7 @@ v8_source_set("v8_turboshaft") {
"src/compiler/turboshaft/typed-optimizations-phase.cc",
"src/compiler/turboshaft/typer.cc",
"src/compiler/turboshaft/types.cc",
"src/compiler/turboshaft/use-map.cc",
"src/compiler/turboshaft/utils.cc",
]
@ -4879,9 +5041,7 @@ v8_source_set("v8_base_without_compiler") {
"src/handles/traced-handles.cc",
"src/heap/allocation-observer.cc",
"src/heap/array-buffer-sweeper.cc",
"src/heap/base-space.cc",
"src/heap/basic-memory-chunk.cc",
"src/heap/code-object-registry.cc",
"src/heap/code-range.cc",
"src/heap/code-stats.cc",
"src/heap/collection-barrier.cc",
@ -4911,10 +5071,12 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/incremental-marking-job.cc",
"src/heap/incremental-marking.cc",
"src/heap/index-generator.cc",
"src/heap/large-page.cc",
"src/heap/large-spaces.cc",
"src/heap/local-factory.cc",
"src/heap/local-heap.cc",
"src/heap/mark-compact.cc",
"src/heap/mark-sweep-utilities.cc",
"src/heap/marking-barrier.cc",
"src/heap/marking-worklist.cc",
"src/heap/marking.cc",
@ -4925,12 +5087,15 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/memory-measurement.cc",
"src/heap/memory-reducer.cc",
"src/heap/minor-gc-job.cc",
"src/heap/minor-mark-sweep.cc",
"src/heap/new-spaces.cc",
"src/heap/object-stats.cc",
"src/heap/objects-visiting.cc",
"src/heap/page.cc",
"src/heap/paged-spaces.cc",
"src/heap/pretenuring-handler.cc",
"src/heap/read-only-heap.cc",
"src/heap/read-only-promotion.cc",
"src/heap/read-only-spaces.cc",
"src/heap/safepoint.cc",
"src/heap/scavenger.cc",
@ -4940,6 +5105,7 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/sweeper.cc",
"src/heap/traced-handles-marking-visitor.cc",
"src/heap/weak-object-worklists.cc",
"src/heap/zapping.cc",
"src/ic/call-optimization.cc",
"src/ic/handler-configuration.cc",
"src/ic/ic-stats.cc",
@ -5152,6 +5318,7 @@ v8_source_set("v8_base_without_compiler") {
"src/snapshot/snapshot-source-sink.cc",
"src/snapshot/snapshot-utils.cc",
"src/snapshot/snapshot.cc",
"src/snapshot/sort-builtins.cc",
"src/snapshot/startup-deserializer.cc",
"src/snapshot/startup-serializer.cc",
"src/strings/char-predicates.cc",
@ -5203,6 +5370,7 @@ v8_source_set("v8_base_without_compiler") {
"src/maglev/maglev-interpreter-frame-state.cc",
"src/maglev/maglev-ir.cc",
"src/maglev/maglev-phi-representation-selector.cc",
"src/maglev/maglev-pipeline-statistics.cc",
"src/maglev/maglev-regalloc.cc",
"src/maglev/maglev.cc",
]
@ -5258,6 +5426,7 @@ v8_source_set("v8_base_without_compiler") {
"src/wasm/stacks.cc",
"src/wasm/streaming-decoder.cc",
"src/wasm/sync-streaming-decoder.cc",
"src/wasm/turboshaft-graph-interface.cc",
"src/wasm/value-type.cc",
"src/wasm/wasm-code-manager.cc",
"src/wasm/wasm-debug.cc",
@ -5569,6 +5738,7 @@ v8_source_set("v8_base_without_compiler") {
":cppgc_base",
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_headers",
":v8_internal_headers",
":v8_maybe_icu",
@ -5729,12 +5899,6 @@ v8_source_set("torque_base") {
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
# Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for
# Torque on Windows.
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) {
# The :no_optimize config is added to v8_add_configs in v8.gni.
remove_configs += [ "//build/config/compiler:no_optimize" ]
@ -5771,10 +5935,6 @@ v8_source_set("torque_ls_base") {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
v8_component("v8_libbase") {
@ -5815,6 +5975,7 @@ v8_component("v8_libbase") {
"src/base/ieee754.cc",
"src/base/ieee754.h",
"src/base/immediate-crash.h",
"src/base/intrusive-set.h",
"src/base/iterator.h",
"src/base/lazy-instance.h",
"src/base/logging.cc",
@ -6199,6 +6360,8 @@ v8_header_set("v8_heap_base_headers") {
sources = [
"src/heap/base/active-system-pages.h",
"src/heap/base/basic-slot-set.h",
"src/heap/base/bytes.h",
"src/heap/base/incremental-marking-schedule.h",
"src/heap/base/stack.h",
"src/heap/base/worklist.h",
]
@ -6211,6 +6374,7 @@ v8_header_set("v8_heap_base_headers") {
v8_source_set("v8_heap_base") {
sources = [
"src/heap/base/active-system-pages.cc",
"src/heap/base/incremental-marking-schedule.cc",
"src/heap/base/stack.cc",
"src/heap/base/worklist.cc",
]
@ -6359,8 +6523,6 @@ v8_source_set("cppgc_base") {
"src/heap/cppgc/heap-visitor.h",
"src/heap/cppgc/heap.cc",
"src/heap/cppgc/heap.h",
"src/heap/cppgc/incremental-marking-schedule.cc",
"src/heap/cppgc/incremental-marking-schedule.h",
"src/heap/cppgc/liveness-broker.cc",
"src/heap/cppgc/liveness-broker.h",
"src/heap/cppgc/logging.cc",
@ -6520,6 +6682,9 @@ if (v8_enable_webassembly) {
":v8_snapshot",
"//build/win:default_exe_manifest",
]
if (v8_enable_vtunejit) {
deps += [ "src/third_party/vtune:v8_vtune" ]
}
# TODO: v8dll-main.cc equivalent for shared library builds
@ -6633,10 +6798,6 @@ if (current_toolchain == v8_snapshot_toolchain) {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
}
@ -6664,10 +6825,6 @@ v8_executable("torque-language-server") {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
if (v8_enable_i18n_support) {
@ -7064,10 +7221,6 @@ if (want_v8_shell) {
":internal_config_base",
]
if (is_win && !v8_enable_cet_shadow_stack) {
v8_remove_configs += [ "//build/config/compiler:cet_shadow_stack" ]
}
deps = [
":v8",
":v8_libbase",
@ -7192,7 +7345,10 @@ if (v8_enable_webassembly) {
":v8_tracing",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [
":external_config",
@ -7272,7 +7428,10 @@ if (v8_enable_webassembly) {
":wasm_test_common",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [
":external_config",

View File

@ -83,6 +83,17 @@ declare_args() {
# Sets -dENABLE_HUGEPAGE
v8_enable_hugepage = false
# Sets -dV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION.
#
# This flag speeds up the performance of fork/execve on Linux systems for
# embedders which use it (like Node.js). It works by marking the pages that
# V8 allocates as MADV_DONTFORK. Without MADV_DONTFORK, the Linux kernel
# spends a long time manipulating page mappings on fork and exec which the
# child process doesn't generally need to access.
#
# See v8:7381 for more details.
v8_enable_private_mapping_fork_optimization = false
# Sets -dENABLE_HANDLE_ZAPPING.
v8_enable_handle_zapping = is_asan || is_debug
@ -183,6 +194,10 @@ declare_args() {
# the `--trace-turbo` .json file from `mksnapshot`.
v8_log_builtins_block_count_input = ""
# This build flag is used to control whether reorder builtins acoording to
# the call graph with C3 algorithm based builtin PGO profiling.
v8_enable_builtins_reordering = false
# Provides the given V8 log file as an input to mksnapshot, where it can be
# used for profile-guided optimization of builtins.
#
@ -278,6 +293,9 @@ declare_args() {
# Use switch-based dispatch if this is false
v8_enable_regexp_interpreter_threaded_dispatch = true
# Enforce equality of builtins hashes from compatible architectures.
v8_verify_builtins_compatibility = false
# Check mksnapshot determinism by running it multiple times.
v8_verify_deterministic_mksnapshot = false
@ -321,7 +339,7 @@ declare_args() {
# Enable experimental code pointer sandboxing for the V8 sandbox.
# Sets -DV8_CODE_POINTER_SANDBOXING
v8_code_pointer_sandboxing = false
v8_code_pointer_sandboxing = ""
# Expose the memory corruption API to JavaScript. Useful for testing the sandbox.
# WARNING This will expose builtins that (by design) cause memory corruption.
@ -368,10 +386,6 @@ declare_args() {
# This is only used by nodejs.
v8_scriptormodule_legacy_lifetime = false
# Change code emission and runtime features to be CET shadow-stack compliant
# (incomplete and experimental).
v8_enable_cet_shadow_stack = false
# Enables pointer compression for 8GB heaps.
# Sets -DV8_COMPRESS_POINTERS_8GB.
v8_enable_pointer_compression_8gb = ""
@ -394,6 +408,11 @@ declare_args() {
# Enable Maglev's graph printer.
# Sets -DV8_MAGLEV_GRAPH_PRINTER.
v8_enable_maglev_graph_printer = !build_with_chromium
# Enable jump table switch for built-in.
v8_enable_builtin_jump_table_switch = v8_current_cpu == "x64"
v8_shortcut_strings_in_minor_ms = false
}
# Derived defaults.
@ -477,9 +496,8 @@ if (v8_enable_external_code_space == "") {
}
if (v8_enable_maglev == "") {
v8_enable_maglev = v8_enable_turbofan &&
(v8_current_cpu == "arm" ||
((v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression))
(v8_current_cpu == "arm" || v8_current_cpu == "x64" ||
v8_current_cpu == "arm64")
}
assert(v8_enable_turbofan || !v8_enable_maglev,
"Maglev is not available when Turbofan is disabled.")
@ -541,6 +559,11 @@ if (v8_enable_sandbox == "") {
v8_enable_external_code_space && target_os != "fuchsia"
}
if (v8_code_pointer_sandboxing == "") {
# By default, enable code pointer sandboxing if the sandbox is enabled.
v8_code_pointer_sandboxing = v8_enable_sandbox
}
if (v8_enable_static_roots == "") {
# Static roots are only valid for builds with pointer compression and a
# shared read-only heap.
@ -655,8 +678,9 @@ assert(
assert(
!v8_enable_pointer_compression_shared_cage || v8_current_cpu == "x64" ||
v8_current_cpu == "arm64" || v8_current_cpu == "riscv64" ||
v8_current_cpu == "ppc64" || v8_current_cpu == "loong64",
"Sharing a pointer compression cage is only supported on x64, arm64, ppc64, riscv64 and loong64")
v8_current_cpu == "ppc64" || v8_current_cpu == "s390x" ||
v8_current_cpu == "loong64",
"Sharing a pointer compression cage is only supported on x64, arm64, ppc64, s390x, riscv64 and loong64")
assert(!v8_enable_unconditional_write_barriers || !v8_disable_write_barriers,
"Write barriers can't be both enabled and disabled")
@ -871,7 +895,9 @@ if (v8_enable_conservative_stack_scanning) {
if (v8_enable_direct_local) {
enabled_external_v8_defines += [ "V8_ENABLE_DIRECT_LOCAL" ]
}
if (v8_shortcut_strings_in_minor_ms) {
enabled_external_v8_defines += [ "V8_MINORMS_STRING_SHORTCUTTING" ]
}
disabled_external_v8_defines = external_v8_defines - enabled_external_v8_defines
# Put defines that are used in public headers here; public headers are
@ -1002,6 +1028,9 @@ config("features") {
if (v8_enable_hugepage) {
defines += [ "ENABLE_HUGEPAGE" ]
}
if (v8_enable_private_mapping_fork_optimization) {
defines += [ "V8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION" ]
}
if (v8_enable_object_print) {
defines += [ "OBJECT_PRINT" ]
}
@ -1172,6 +1201,12 @@ config("features") {
if (v8_enable_maglev_graph_printer) {
defines += [ "V8_ENABLE_MAGLEV_GRAPH_PRINTER" ]
}
if (v8_enable_builtin_jump_table_switch) {
defines += [ "V8_ENABLE_BUILTIN_JUMP_TABLE_SWITCH" ]
}
if (v8_enable_direct_handle) {
defines += [ "V8_ENABLE_DIRECT_HANDLE" ]
}
}
config("toolchain") {
@ -1337,7 +1372,7 @@ config("toolchain") {
# Increase the initial stack size. The default is 1MB, this is 2MB. This
# applies only to executables and shared libraries produced by V8 since
# ldflags are not pushed to dependants.
cflags += [ "/O2", "/arch:SSE3" ]
cflags += [ "/O2", "-msse4.1" ]
ldflags += [ "/STACK:2097152" ]
}
if (is_linux || is_chromeos) {
@ -1606,10 +1641,6 @@ config("toolchain") {
"/wd4715", # 'function' : not all control paths return a value'
# MSVC does not analyze switch (enum) for completeness.
]
# TODO(https://crbug.com/1377771): Keep MSVC on C++17 until source code is
# made compatible with C++20.
cflags_cc = [ "/std:c++17" ]
}
if (!is_clang && !is_win) {
@ -1724,6 +1755,8 @@ if (v8_postmortem_support) {
"src/objects/heap-object.h",
"src/objects/heap-object-inl.h",
"src/objects/instance-type.h",
"src/objects/instance-type-checker.h",
"src/objects/instance-type-inl.h",
"src/objects/js-array-buffer.h",
"src/objects/js-array-buffer-inl.h",
"src/objects/js-array.h",
@ -1850,12 +1883,13 @@ torque_files = [
"src/builtins/promise-any.tq",
"src/builtins/promise-constructor.tq",
"src/builtins/promise-finally.tq",
"src/builtins/promise-jobs.tq",
"src/builtins/promise-misc.tq",
"src/builtins/promise-race.tq",
"src/builtins/promise-reaction-job.tq",
"src/builtins/promise-resolve.tq",
"src/builtins/promise-then.tq",
"src/builtins/promise-jobs.tq",
"src/builtins/promise-withresolvers.tq",
"src/builtins/proxy-constructor.tq",
"src/builtins/proxy-delete-property.tq",
"src/builtins/proxy-get-property.tq",
@ -1878,7 +1912,12 @@ torque_files = [
"src/builtins/regexp-split.tq",
"src/builtins/regexp-test.tq",
"src/builtins/regexp.tq",
"src/builtins/set-difference.tq",
"src/builtins/set-intersection.tq",
"src/builtins/set-is-disjoint-from.tq",
"src/builtins/set-is-subset-of.tq",
"src/builtins/set-is-superset-of.tq",
"src/builtins/set-symmetric-difference.tq",
"src/builtins/set-union.tq",
"src/builtins/string-at.tq",
"src/builtins/string-endswith.tq",
@ -2021,6 +2060,8 @@ if (v8_enable_webassembly) {
torque_files += [
"src/builtins/js-to-wasm.tq",
"src/builtins/wasm.tq",
"src/builtins/wasm-strings.tq",
"src/builtins/wasm-to-js.tq",
"src/debug/debug-wasm-objects.tq",
"src/wasm/wasm-objects.tq",
]
@ -2144,6 +2185,15 @@ group("v8_maybe_icu") {
}
}
group("v8_abseil") {
public_deps = [ "//third_party/abseil-cpp:absl" ]
public_configs = [
"//third_party/abseil-cpp:absl_define_config",
"//third_party/abseil-cpp:absl_include_config",
]
}
v8_header_set("torque_runtime_support") {
visibility = [ ":*" ]
@ -2164,6 +2214,7 @@ v8_source_set("torque_generated_initializers") {
public_deps = [
":torque_runtime_support",
":v8_abseil",
":v8_maybe_icu",
]
@ -2195,7 +2246,10 @@ v8_source_set("torque_generated_definitions") {
":v8_tracing",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
sources = [
"$target_gen_dir/torque-generated/class-forward-declarations.h",
@ -2303,6 +2357,10 @@ template("run_mksnapshot") {
# "--abort-on-bad-builtin-profile-data",
"--warn-about-builtin-profile-data",
]
if (!v8_enable_builtins_profiling && v8_enable_builtins_reordering) {
args += [ "--reorder-builtins" ]
}
}
# This is needed to distinguish between generating code for the simulator
@ -2432,6 +2490,64 @@ if (v8_verify_deterministic_mksnapshot) {
}
}
if (v8_verify_builtins_compatibility) {
# This specifies a separate mksnapshot target for each of:
# x86, x64, arm, arm64.
hashes = "builtins_hashes_$v8_current_cpu"
run_mksnapshot("dump_$v8_current_cpu") {
args = [
"--dump-builtins-hashes-to-file",
hashes,
]
embedded_variant = "Default"
}
# This template defines a comparison action for the architecture the pgo
# profile is made for (e.g. x64) and the architecture the profile is used
# for (e.g. arm64 with toolchain x64_v8_arm64).
template("verify_builtins_hashes") {
forward_variables_from(invoker,
[
"profile_arch",
"target_arch",
])
profile_toolchain = "//build/toolchain/linux:clang_${profile_arch}"
target_toolchain =
"//build/toolchain/linux:clang_${profile_arch}_v8_${target_arch}"
action("compare_builtins_$target_name") {
deps = [
":run_mksnapshot_dump_${profile_arch}($profile_toolchain)",
":run_mksnapshot_dump_${target_arch}($target_toolchain)",
]
report_file = "$root_build_dir/builtins_comparison_$target_name"
script = "tools/builtins-pgo/assert_builtins_hashes.py"
args = [
"builtins_hashes_${profile_arch}",
"builtins_hashes_${target_arch}",
rebase_path(report_file, root_build_dir),
]
outputs = [ report_file ]
}
}
verify_builtins_hashes("x86_arm") {
profile_arch = "x86"
target_arch = "arm"
}
verify_builtins_hashes("x64_arm64") {
profile_arch = "x64"
target_arch = "arm64"
}
group("verify_all_builtins_hashes") {
deps = [
":compare_builtins_x64_arm64",
":compare_builtins_x86_arm",
]
}
}
action("v8_dump_build_config") {
script = "tools/testrunner/utils/dump_build_config.py"
outputs = [ "$root_out_dir/v8_build_config.json" ]
@ -2487,6 +2603,7 @@ action("v8_dump_build_config") {
"DEBUG_defined=$is_DEBUG_defined",
"debugging_features=$v8_enable_debugging_features",
"dict_property_const_tracking=$v8_dict_property_const_tracking",
"direct_handle=$v8_enable_direct_handle",
"direct_local=$v8_enable_direct_local",
"disassembler=$v8_enable_disassembler",
"full_debug=$is_full_debug",
@ -2569,7 +2686,10 @@ v8_source_set("v8_snapshot") {
sources += [ "src/snapshot/snapshot-external.cc" ]
} else {
public_deps += [ ":v8_maybe_icu" ]
public_deps += [
":v8_abseil",
":v8_maybe_icu",
]
sources += [ "$target_gen_dir/snapshot.cc" ]
}
@ -2752,7 +2872,10 @@ v8_source_set("v8_init") {
"src/init/setup-isolate-full.cc",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [ ":internal_config" ]
}
@ -2998,6 +3121,7 @@ v8_header_set("v8_internal_headers") {
"src/codegen/interface-descriptors-inl.h",
"src/codegen/interface-descriptors.h",
"src/codegen/label.h",
"src/codegen/linkage-location.h",
"src/codegen/machine-type.h",
"src/codegen/macro-assembler-base.h",
"src/codegen/macro-assembler-inl.h",
@ -3046,6 +3170,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/backend/gap-resolver.h",
"src/compiler/backend/instruction-codes.h",
"src/compiler/backend/instruction-scheduler.h",
"src/compiler/backend/instruction-selector-adapter.h",
"src/compiler/backend/instruction-selector-impl.h",
"src/compiler/backend/instruction-selector.h",
"src/compiler/backend/instruction.h",
@ -3169,13 +3294,17 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/decompression-optimization.h",
"src/compiler/turboshaft/define-assembler-macros.inc",
"src/compiler/turboshaft/deopt-data.h",
"src/compiler/turboshaft/doubly-threaded-list.h",
"src/compiler/turboshaft/explicit-truncation-reducer.h",
"src/compiler/turboshaft/fast-api-call-reducer.h",
"src/compiler/turboshaft/fast-hash.h",
"src/compiler/turboshaft/graph-builder.h",
"src/compiler/turboshaft/graph-visualizer.h",
"src/compiler/turboshaft/graph.h",
"src/compiler/turboshaft/index.h",
"src/compiler/turboshaft/instruction-selection-phase.h",
"src/compiler/turboshaft/late-escape-analysis-reducer.h",
"src/compiler/turboshaft/late-load-elimination-reducer.h",
"src/compiler/turboshaft/layered-hash-map.h",
"src/compiler/turboshaft/machine-lowering-phase.h",
"src/compiler/turboshaft/machine-lowering-reducer.h",
@ -3189,8 +3318,10 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/pretenuring-propagation-reducer.h",
"src/compiler/turboshaft/recreate-schedule-phase.h",
"src/compiler/turboshaft/recreate-schedule.h",
"src/compiler/turboshaft/reduce-args-helper.h",
"src/compiler/turboshaft/reducer-traits.h",
"src/compiler/turboshaft/representations.h",
"src/compiler/turboshaft/required-optimization-reducer.h",
"src/compiler/turboshaft/runtime-call-descriptors.h",
"src/compiler/turboshaft/select-lowering-reducer.h",
"src/compiler/turboshaft/sidetable.h",
@ -3210,6 +3341,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/types.h",
"src/compiler/turboshaft/undef-assembler-macros.inc",
"src/compiler/turboshaft/uniform-reducer-adapter.h",
"src/compiler/turboshaft/use-map.h",
"src/compiler/turboshaft/utils.h",
"src/compiler/turboshaft/value-numbering-reducer.h",
"src/compiler/turboshaft/variable-reducer.h",
@ -3311,7 +3443,6 @@ v8_header_set("v8_internal_headers") {
"src/heap/array-buffer-sweeper.h",
"src/heap/base-space.h",
"src/heap/basic-memory-chunk.h",
"src/heap/code-object-registry.h",
"src/heap/code-range.h",
"src/heap/code-stats.h",
"src/heap/collection-barrier.h",
@ -3358,6 +3489,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/incremental-marking-job.h",
"src/heap/incremental-marking.h",
"src/heap/index-generator.h",
"src/heap/large-page.h",
"src/heap/large-spaces.h",
"src/heap/linear-allocation-area.h",
"src/heap/list.h",
@ -3367,6 +3499,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/local-heap.h",
"src/heap/mark-compact-inl.h",
"src/heap/mark-compact.h",
"src/heap/mark-sweep-utilities.h",
"src/heap/marking-barrier-inl.h",
"src/heap/marking-barrier.h",
"src/heap/marking-inl.h",
@ -3386,12 +3519,15 @@ v8_header_set("v8_internal_headers") {
"src/heap/memory-measurement.h",
"src/heap/memory-reducer.h",
"src/heap/minor-gc-job.h",
"src/heap/minor-mark-sweep-inl.h",
"src/heap/minor-mark-sweep.h",
"src/heap/new-spaces-inl.h",
"src/heap/new-spaces.h",
"src/heap/object-lock.h",
"src/heap/object-stats.h",
"src/heap/objects-visiting-inl.h",
"src/heap/objects-visiting.h",
"src/heap/page.h",
"src/heap/paged-spaces-inl.h",
"src/heap/paged-spaces.h",
"src/heap/parallel-work-item.h",
@ -3402,6 +3538,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/progress-bar.h",
"src/heap/read-only-heap-inl.h",
"src/heap/read-only-heap.h",
"src/heap/read-only-promotion.h",
"src/heap/read-only-spaces.h",
"src/heap/remembered-set-inl.h",
"src/heap/remembered-set.h",
@ -3414,6 +3551,9 @@ v8_header_set("v8_internal_headers") {
"src/heap/sweeper.h",
"src/heap/traced-handles-marking-visitor.h",
"src/heap/weak-object-worklists.h",
"src/heap/young-generation-marking-visitor-inl.h",
"src/heap/young-generation-marking-visitor.h",
"src/heap/zapping.h",
"src/ic/call-optimization.h",
"src/ic/handler-configuration-inl.h",
"src/ic/handler-configuration.h",
@ -3534,6 +3674,7 @@ v8_header_set("v8_internal_headers") {
"src/objects/heap-object.h",
"src/objects/hole-inl.h",
"src/objects/hole.h",
"src/objects/instance-type-checker.h",
"src/objects/instance-type-inl.h",
"src/objects/instance-type.h",
"src/objects/internal-index.h",
@ -3763,6 +3904,8 @@ v8_header_set("v8_internal_headers") {
"src/sandbox/external-pointer-table-inl.h",
"src/sandbox/external-pointer-table.h",
"src/sandbox/external-pointer.h",
"src/sandbox/indirect-pointer-inl.h",
"src/sandbox/indirect-pointer.h",
"src/sandbox/sandbox.h",
"src/sandbox/sandboxed-pointer-inl.h",
"src/sandbox/sandboxed-pointer.h",
@ -3789,6 +3932,7 @@ v8_header_set("v8_internal_headers") {
"src/snapshot/snapshot-source-sink.h",
"src/snapshot/snapshot-utils.h",
"src/snapshot/snapshot.h",
"src/snapshot/sort-builtins.h",
"src/snapshot/startup-deserializer.h",
"src/snapshot/startup-serializer.h",
"src/strings/char-predicates-inl.h",
@ -3876,6 +4020,7 @@ v8_header_set("v8_internal_headers") {
"src/maglev/maglev-ir-inl.h",
"src/maglev/maglev-ir.h",
"src/maglev/maglev-phi-representation-selector.h",
"src/maglev/maglev-pipeline-statistics.h",
"src/maglev/maglev-regalloc-data.h",
"src/maglev/maglev-regalloc.h",
"src/maglev/maglev-register-frame-array.h",
@ -3898,7 +4043,12 @@ v8_header_set("v8_internal_headers") {
"src/asmjs/asm-scanner.h",
"src/asmjs/asm-types.h",
"src/compiler/int64-lowering.h",
"src/compiler/turboshaft/int64-lowering-phase.h",
"src/compiler/turboshaft/int64-lowering-reducer.h",
"src/compiler/turboshaft/wasm-js-lowering-reducer.h",
"src/compiler/turboshaft/wasm-lowering-reducer.h",
"src/compiler/turboshaft/wasm-optimize-phase.h",
"src/compiler/turboshaft/wasm-turboshaft-compiler.h",
"src/compiler/wasm-address-reassociation.h",
"src/compiler/wasm-call-descriptors.h",
"src/compiler/wasm-compiler-definitions.h",
@ -3943,12 +4093,15 @@ v8_header_set("v8_internal_headers") {
"src/wasm/names-provider.h",
"src/wasm/object-access.h",
"src/wasm/pgo.h",
"src/wasm/serialized-signature-inl.h",
"src/wasm/simd-shuffle.h",
"src/wasm/stacks.h",
"src/wasm/std-object-sizes.h",
"src/wasm/streaming-decoder.h",
"src/wasm/string-builder-multiline.h",
"src/wasm/string-builder.h",
"src/wasm/struct-types.h",
"src/wasm/turboshaft-graph-interface.h",
"src/wasm/value-type.h",
"src/wasm/wasm-arguments.h",
"src/wasm/wasm-code-manager.h",
@ -4558,8 +4711,12 @@ if (v8_current_cpu == "x86") {
if (v8_enable_webassembly) {
v8_compiler_sources += [
"src/compiler/int64-lowering.cc",
"src/compiler/turboshaft/int64-lowering-phase.cc",
"src/compiler/turboshaft/wasm-optimize-phase.cc",
"src/compiler/turboshaft/wasm-turboshaft-compiler.cc",
"src/compiler/wasm-address-reassociation.cc",
"src/compiler/wasm-call-descriptors.cc",
"src/compiler/wasm-compiler-definitions.cc",
"src/compiler/wasm-compiler.cc",
"src/compiler/wasm-escape-analysis.cc",
"src/compiler/wasm-gc-lowering.cc",
@ -4594,6 +4751,7 @@ v8_source_set("v8_compiler_for_mksnapshot_source_set") {
public_deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_maybe_icu",
":v8_tracing",
]
@ -4631,6 +4789,7 @@ v8_source_set("v8_compiler") {
public_deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_internal_headers",
":v8_maybe_icu",
":v8_tracing",
@ -4658,7 +4817,9 @@ v8_source_set("v8_turboshaft") {
"src/compiler/turboshaft/graph-builder.cc",
"src/compiler/turboshaft/graph-visualizer.cc",
"src/compiler/turboshaft/graph.cc",
"src/compiler/turboshaft/instruction-selection-phase.cc",
"src/compiler/turboshaft/late-escape-analysis-reducer.cc",
"src/compiler/turboshaft/late-load-elimination-reducer.cc",
"src/compiler/turboshaft/machine-lowering-phase.cc",
"src/compiler/turboshaft/memory-optimization-reducer.cc",
"src/compiler/turboshaft/operations.cc",
@ -4676,6 +4837,7 @@ v8_source_set("v8_turboshaft") {
"src/compiler/turboshaft/typed-optimizations-phase.cc",
"src/compiler/turboshaft/typer.cc",
"src/compiler/turboshaft/types.cc",
"src/compiler/turboshaft/use-map.cc",
"src/compiler/turboshaft/utils.cc",
]
@ -4879,9 +5041,7 @@ v8_source_set("v8_base_without_compiler") {
"src/handles/traced-handles.cc",
"src/heap/allocation-observer.cc",
"src/heap/array-buffer-sweeper.cc",
"src/heap/base-space.cc",
"src/heap/basic-memory-chunk.cc",
"src/heap/code-object-registry.cc",
"src/heap/code-range.cc",
"src/heap/code-stats.cc",
"src/heap/collection-barrier.cc",
@ -4911,10 +5071,12 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/incremental-marking-job.cc",
"src/heap/incremental-marking.cc",
"src/heap/index-generator.cc",
"src/heap/large-page.cc",
"src/heap/large-spaces.cc",
"src/heap/local-factory.cc",
"src/heap/local-heap.cc",
"src/heap/mark-compact.cc",
"src/heap/mark-sweep-utilities.cc",
"src/heap/marking-barrier.cc",
"src/heap/marking-worklist.cc",
"src/heap/marking.cc",
@ -4925,12 +5087,15 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/memory-measurement.cc",
"src/heap/memory-reducer.cc",
"src/heap/minor-gc-job.cc",
"src/heap/minor-mark-sweep.cc",
"src/heap/new-spaces.cc",
"src/heap/object-stats.cc",
"src/heap/objects-visiting.cc",
"src/heap/page.cc",
"src/heap/paged-spaces.cc",
"src/heap/pretenuring-handler.cc",
"src/heap/read-only-heap.cc",
"src/heap/read-only-promotion.cc",
"src/heap/read-only-spaces.cc",
"src/heap/safepoint.cc",
"src/heap/scavenger.cc",
@ -4940,6 +5105,7 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/sweeper.cc",
"src/heap/traced-handles-marking-visitor.cc",
"src/heap/weak-object-worklists.cc",
"src/heap/zapping.cc",
"src/ic/call-optimization.cc",
"src/ic/handler-configuration.cc",
"src/ic/ic-stats.cc",
@ -5152,6 +5318,7 @@ v8_source_set("v8_base_without_compiler") {
"src/snapshot/snapshot-source-sink.cc",
"src/snapshot/snapshot-utils.cc",
"src/snapshot/snapshot.cc",
"src/snapshot/sort-builtins.cc",
"src/snapshot/startup-deserializer.cc",
"src/snapshot/startup-serializer.cc",
"src/strings/char-predicates.cc",
@ -5203,6 +5370,7 @@ v8_source_set("v8_base_without_compiler") {
"src/maglev/maglev-interpreter-frame-state.cc",
"src/maglev/maglev-ir.cc",
"src/maglev/maglev-phi-representation-selector.cc",
"src/maglev/maglev-pipeline-statistics.cc",
"src/maglev/maglev-regalloc.cc",
"src/maglev/maglev.cc",
]
@ -5258,6 +5426,7 @@ v8_source_set("v8_base_without_compiler") {
"src/wasm/stacks.cc",
"src/wasm/streaming-decoder.cc",
"src/wasm/sync-streaming-decoder.cc",
"src/wasm/turboshaft-graph-interface.cc",
"src/wasm/value-type.cc",
"src/wasm/wasm-code-manager.cc",
"src/wasm/wasm-debug.cc",
@ -5569,6 +5738,7 @@ v8_source_set("v8_base_without_compiler") {
":cppgc_base",
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_headers",
":v8_internal_headers",
":v8_maybe_icu",
@ -5729,12 +5899,6 @@ v8_source_set("torque_base") {
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
# Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for
# Torque on Windows.
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) {
# The :no_optimize config is added to v8_add_configs in v8.gni.
remove_configs += [ "//build/config/compiler:no_optimize" ]
@ -5771,10 +5935,6 @@ v8_source_set("torque_ls_base") {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
v8_component("v8_libbase") {
@ -5815,6 +5975,7 @@ v8_component("v8_libbase") {
"src/base/ieee754.cc",
"src/base/ieee754.h",
"src/base/immediate-crash.h",
"src/base/intrusive-set.h",
"src/base/iterator.h",
"src/base/lazy-instance.h",
"src/base/logging.cc",
@ -6199,6 +6360,8 @@ v8_header_set("v8_heap_base_headers") {
sources = [
"src/heap/base/active-system-pages.h",
"src/heap/base/basic-slot-set.h",
"src/heap/base/bytes.h",
"src/heap/base/incremental-marking-schedule.h",
"src/heap/base/stack.h",
"src/heap/base/worklist.h",
]
@ -6211,6 +6374,7 @@ v8_header_set("v8_heap_base_headers") {
v8_source_set("v8_heap_base") {
sources = [
"src/heap/base/active-system-pages.cc",
"src/heap/base/incremental-marking-schedule.cc",
"src/heap/base/stack.cc",
"src/heap/base/worklist.cc",
]
@ -6359,8 +6523,6 @@ v8_source_set("cppgc_base") {
"src/heap/cppgc/heap-visitor.h",
"src/heap/cppgc/heap.cc",
"src/heap/cppgc/heap.h",
"src/heap/cppgc/incremental-marking-schedule.cc",
"src/heap/cppgc/incremental-marking-schedule.h",
"src/heap/cppgc/liveness-broker.cc",
"src/heap/cppgc/liveness-broker.h",
"src/heap/cppgc/logging.cc",
@ -6520,6 +6682,9 @@ if (v8_enable_webassembly) {
":v8_snapshot",
"//build/win:default_exe_manifest",
]
if (v8_enable_vtunejit) {
deps += [ "src/third_party/vtune:v8_vtune" ]
}
# TODO: v8dll-main.cc equivalent for shared library builds
@ -6633,10 +6798,6 @@ if (current_toolchain == v8_snapshot_toolchain) {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
}
@ -6664,10 +6825,6 @@ v8_executable("torque-language-server") {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
if (v8_enable_i18n_support) {
@ -7064,10 +7221,6 @@ if (want_v8_shell) {
":internal_config_base",
]
if (is_win && !v8_enable_cet_shadow_stack) {
v8_remove_configs += [ "//build/config/compiler:cet_shadow_stack" ]
}
deps = [
":v8",
":v8_libbase",
@ -7192,7 +7345,10 @@ if (v8_enable_webassembly) {
":v8_tracing",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [
":external_config",
@ -7272,7 +7428,10 @@ if (v8_enable_webassembly) {
":wasm_test_common",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [
":external_config",

View File

@ -83,6 +83,17 @@ declare_args() {
# Sets -dENABLE_HUGEPAGE
v8_enable_hugepage = false
# Sets -dV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION.
#
# This flag speeds up the performance of fork/execve on Linux systems for
# embedders which use it (like Node.js). It works by marking the pages that
# V8 allocates as MADV_DONTFORK. Without MADV_DONTFORK, the Linux kernel
# spends a long time manipulating page mappings on fork and exec which the
# child process doesn't generally need to access.
#
# See v8:7381 for more details.
v8_enable_private_mapping_fork_optimization = false
# Sets -dENABLE_HANDLE_ZAPPING.
v8_enable_handle_zapping = is_asan || is_debug
@ -183,6 +194,10 @@ declare_args() {
# the `--trace-turbo` .json file from `mksnapshot`.
v8_log_builtins_block_count_input = ""
# This build flag is used to control whether reorder builtins acoording to
# the call graph with C3 algorithm based builtin PGO profiling.
v8_enable_builtins_reordering = false
# Provides the given V8 log file as an input to mksnapshot, where it can be
# used for profile-guided optimization of builtins.
#
@ -278,6 +293,9 @@ declare_args() {
# Use switch-based dispatch if this is false
v8_enable_regexp_interpreter_threaded_dispatch = true
# Enforce equality of builtins hashes from compatible architectures.
v8_verify_builtins_compatibility = false
# Check mksnapshot determinism by running it multiple times.
v8_verify_deterministic_mksnapshot = false
@ -321,7 +339,7 @@ declare_args() {
# Enable experimental code pointer sandboxing for the V8 sandbox.
# Sets -DV8_CODE_POINTER_SANDBOXING
v8_code_pointer_sandboxing = false
v8_code_pointer_sandboxing = ""
# Expose the memory corruption API to JavaScript. Useful for testing the sandbox.
# WARNING This will expose builtins that (by design) cause memory corruption.
@ -368,10 +386,6 @@ declare_args() {
# This is only used by nodejs.
v8_scriptormodule_legacy_lifetime = false
# Change code emission and runtime features to be CET shadow-stack compliant
# (incomplete and experimental).
v8_enable_cet_shadow_stack = false
# Enables pointer compression for 8GB heaps.
# Sets -DV8_COMPRESS_POINTERS_8GB.
v8_enable_pointer_compression_8gb = ""
@ -394,6 +408,11 @@ declare_args() {
# Enable Maglev's graph printer.
# Sets -DV8_MAGLEV_GRAPH_PRINTER.
v8_enable_maglev_graph_printer = !build_with_chromium
# Enable jump table switch for built-in.
v8_enable_builtin_jump_table_switch = v8_current_cpu == "x64"
v8_shortcut_strings_in_minor_ms = false
}
# Derived defaults.
@ -477,9 +496,8 @@ if (v8_enable_external_code_space == "") {
}
if (v8_enable_maglev == "") {
v8_enable_maglev = v8_enable_turbofan &&
(v8_current_cpu == "arm" ||
((v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression))
(v8_current_cpu == "arm" || v8_current_cpu == "x64" ||
v8_current_cpu == "arm64")
}
assert(v8_enable_turbofan || !v8_enable_maglev,
"Maglev is not available when Turbofan is disabled.")
@ -541,6 +559,11 @@ if (v8_enable_sandbox == "") {
v8_enable_external_code_space && target_os != "fuchsia"
}
if (v8_code_pointer_sandboxing == "") {
# By default, enable code pointer sandboxing if the sandbox is enabled.
v8_code_pointer_sandboxing = v8_enable_sandbox
}
if (v8_enable_static_roots == "") {
# Static roots are only valid for builds with pointer compression and a
# shared read-only heap.
@ -655,8 +678,9 @@ assert(
assert(
!v8_enable_pointer_compression_shared_cage || v8_current_cpu == "x64" ||
v8_current_cpu == "arm64" || v8_current_cpu == "riscv64" ||
v8_current_cpu == "ppc64" || v8_current_cpu == "loong64",
"Sharing a pointer compression cage is only supported on x64, arm64, ppc64, riscv64 and loong64")
v8_current_cpu == "ppc64" || v8_current_cpu == "s390x" ||
v8_current_cpu == "loong64",
"Sharing a pointer compression cage is only supported on x64, arm64, ppc64, s390x, riscv64 and loong64")
assert(!v8_enable_unconditional_write_barriers || !v8_disable_write_barriers,
"Write barriers can't be both enabled and disabled")
@ -871,7 +895,9 @@ if (v8_enable_conservative_stack_scanning) {
if (v8_enable_direct_local) {
enabled_external_v8_defines += [ "V8_ENABLE_DIRECT_LOCAL" ]
}
if (v8_shortcut_strings_in_minor_ms) {
enabled_external_v8_defines += [ "V8_MINORMS_STRING_SHORTCUTTING" ]
}
disabled_external_v8_defines = external_v8_defines - enabled_external_v8_defines
# Put defines that are used in public headers here; public headers are
@ -1002,6 +1028,9 @@ config("features") {
if (v8_enable_hugepage) {
defines += [ "ENABLE_HUGEPAGE" ]
}
if (v8_enable_private_mapping_fork_optimization) {
defines += [ "V8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION" ]
}
if (v8_enable_object_print) {
defines += [ "OBJECT_PRINT" ]
}
@ -1172,6 +1201,12 @@ config("features") {
if (v8_enable_maglev_graph_printer) {
defines += [ "V8_ENABLE_MAGLEV_GRAPH_PRINTER" ]
}
if (v8_enable_builtin_jump_table_switch) {
defines += [ "V8_ENABLE_BUILTIN_JUMP_TABLE_SWITCH" ]
}
if (v8_enable_direct_handle) {
defines += [ "V8_ENABLE_DIRECT_HANDLE" ]
}
}
config("toolchain") {
@ -1337,7 +1372,7 @@ config("toolchain") {
# Increase the initial stack size. The default is 1MB, this is 2MB. This
# applies only to executables and shared libraries produced by V8 since
# ldflags are not pushed to dependants.
cflags += [ "/O2", "/arch:SSE3" ]
cflags += [ "/O2", "-msse3" ]
ldflags += [ "/STACK:2097152" ]
}
if (is_linux || is_chromeos) {
@ -1606,10 +1641,6 @@ config("toolchain") {
"/wd4715", # 'function' : not all control paths return a value'
# MSVC does not analyze switch (enum) for completeness.
]
# TODO(https://crbug.com/1377771): Keep MSVC on C++17 until source code is
# made compatible with C++20.
cflags_cc = [ "/std:c++17" ]
}
if (!is_clang && !is_win) {
@ -1724,6 +1755,8 @@ if (v8_postmortem_support) {
"src/objects/heap-object.h",
"src/objects/heap-object-inl.h",
"src/objects/instance-type.h",
"src/objects/instance-type-checker.h",
"src/objects/instance-type-inl.h",
"src/objects/js-array-buffer.h",
"src/objects/js-array-buffer-inl.h",
"src/objects/js-array.h",
@ -1850,12 +1883,13 @@ torque_files = [
"src/builtins/promise-any.tq",
"src/builtins/promise-constructor.tq",
"src/builtins/promise-finally.tq",
"src/builtins/promise-jobs.tq",
"src/builtins/promise-misc.tq",
"src/builtins/promise-race.tq",
"src/builtins/promise-reaction-job.tq",
"src/builtins/promise-resolve.tq",
"src/builtins/promise-then.tq",
"src/builtins/promise-jobs.tq",
"src/builtins/promise-withresolvers.tq",
"src/builtins/proxy-constructor.tq",
"src/builtins/proxy-delete-property.tq",
"src/builtins/proxy-get-property.tq",
@ -1878,7 +1912,12 @@ torque_files = [
"src/builtins/regexp-split.tq",
"src/builtins/regexp-test.tq",
"src/builtins/regexp.tq",
"src/builtins/set-difference.tq",
"src/builtins/set-intersection.tq",
"src/builtins/set-is-disjoint-from.tq",
"src/builtins/set-is-subset-of.tq",
"src/builtins/set-is-superset-of.tq",
"src/builtins/set-symmetric-difference.tq",
"src/builtins/set-union.tq",
"src/builtins/string-at.tq",
"src/builtins/string-endswith.tq",
@ -2021,6 +2060,8 @@ if (v8_enable_webassembly) {
torque_files += [
"src/builtins/js-to-wasm.tq",
"src/builtins/wasm.tq",
"src/builtins/wasm-strings.tq",
"src/builtins/wasm-to-js.tq",
"src/debug/debug-wasm-objects.tq",
"src/wasm/wasm-objects.tq",
]
@ -2144,6 +2185,15 @@ group("v8_maybe_icu") {
}
}
group("v8_abseil") {
public_deps = [ "//third_party/abseil-cpp:absl" ]
public_configs = [
"//third_party/abseil-cpp:absl_define_config",
"//third_party/abseil-cpp:absl_include_config",
]
}
v8_header_set("torque_runtime_support") {
visibility = [ ":*" ]
@ -2164,6 +2214,7 @@ v8_source_set("torque_generated_initializers") {
public_deps = [
":torque_runtime_support",
":v8_abseil",
":v8_maybe_icu",
]
@ -2195,7 +2246,10 @@ v8_source_set("torque_generated_definitions") {
":v8_tracing",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
sources = [
"$target_gen_dir/torque-generated/class-forward-declarations.h",
@ -2303,6 +2357,10 @@ template("run_mksnapshot") {
# "--abort-on-bad-builtin-profile-data",
"--warn-about-builtin-profile-data",
]
if (!v8_enable_builtins_profiling && v8_enable_builtins_reordering) {
args += [ "--reorder-builtins" ]
}
}
# This is needed to distinguish between generating code for the simulator
@ -2432,6 +2490,64 @@ if (v8_verify_deterministic_mksnapshot) {
}
}
if (v8_verify_builtins_compatibility) {
# This specifies a separate mksnapshot target for each of:
# x86, x64, arm, arm64.
hashes = "builtins_hashes_$v8_current_cpu"
run_mksnapshot("dump_$v8_current_cpu") {
args = [
"--dump-builtins-hashes-to-file",
hashes,
]
embedded_variant = "Default"
}
# This template defines a comparison action for the architecture the pgo
# profile is made for (e.g. x64) and the architecture the profile is used
# for (e.g. arm64 with toolchain x64_v8_arm64).
template("verify_builtins_hashes") {
forward_variables_from(invoker,
[
"profile_arch",
"target_arch",
])
profile_toolchain = "//build/toolchain/linux:clang_${profile_arch}"
target_toolchain =
"//build/toolchain/linux:clang_${profile_arch}_v8_${target_arch}"
action("compare_builtins_$target_name") {
deps = [
":run_mksnapshot_dump_${profile_arch}($profile_toolchain)",
":run_mksnapshot_dump_${target_arch}($target_toolchain)",
]
report_file = "$root_build_dir/builtins_comparison_$target_name"
script = "tools/builtins-pgo/assert_builtins_hashes.py"
args = [
"builtins_hashes_${profile_arch}",
"builtins_hashes_${target_arch}",
rebase_path(report_file, root_build_dir),
]
outputs = [ report_file ]
}
}
verify_builtins_hashes("x86_arm") {
profile_arch = "x86"
target_arch = "arm"
}
verify_builtins_hashes("x64_arm64") {
profile_arch = "x64"
target_arch = "arm64"
}
group("verify_all_builtins_hashes") {
deps = [
":compare_builtins_x64_arm64",
":compare_builtins_x86_arm",
]
}
}
action("v8_dump_build_config") {
script = "tools/testrunner/utils/dump_build_config.py"
outputs = [ "$root_out_dir/v8_build_config.json" ]
@ -2487,6 +2603,7 @@ action("v8_dump_build_config") {
"DEBUG_defined=$is_DEBUG_defined",
"debugging_features=$v8_enable_debugging_features",
"dict_property_const_tracking=$v8_dict_property_const_tracking",
"direct_handle=$v8_enable_direct_handle",
"direct_local=$v8_enable_direct_local",
"disassembler=$v8_enable_disassembler",
"full_debug=$is_full_debug",
@ -2569,7 +2686,10 @@ v8_source_set("v8_snapshot") {
sources += [ "src/snapshot/snapshot-external.cc" ]
} else {
public_deps += [ ":v8_maybe_icu" ]
public_deps += [
":v8_abseil",
":v8_maybe_icu",
]
sources += [ "$target_gen_dir/snapshot.cc" ]
}
@ -2752,7 +2872,10 @@ v8_source_set("v8_init") {
"src/init/setup-isolate-full.cc",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [ ":internal_config" ]
}
@ -2998,6 +3121,7 @@ v8_header_set("v8_internal_headers") {
"src/codegen/interface-descriptors-inl.h",
"src/codegen/interface-descriptors.h",
"src/codegen/label.h",
"src/codegen/linkage-location.h",
"src/codegen/machine-type.h",
"src/codegen/macro-assembler-base.h",
"src/codegen/macro-assembler-inl.h",
@ -3046,6 +3170,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/backend/gap-resolver.h",
"src/compiler/backend/instruction-codes.h",
"src/compiler/backend/instruction-scheduler.h",
"src/compiler/backend/instruction-selector-adapter.h",
"src/compiler/backend/instruction-selector-impl.h",
"src/compiler/backend/instruction-selector.h",
"src/compiler/backend/instruction.h",
@ -3169,13 +3294,17 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/decompression-optimization.h",
"src/compiler/turboshaft/define-assembler-macros.inc",
"src/compiler/turboshaft/deopt-data.h",
"src/compiler/turboshaft/doubly-threaded-list.h",
"src/compiler/turboshaft/explicit-truncation-reducer.h",
"src/compiler/turboshaft/fast-api-call-reducer.h",
"src/compiler/turboshaft/fast-hash.h",
"src/compiler/turboshaft/graph-builder.h",
"src/compiler/turboshaft/graph-visualizer.h",
"src/compiler/turboshaft/graph.h",
"src/compiler/turboshaft/index.h",
"src/compiler/turboshaft/instruction-selection-phase.h",
"src/compiler/turboshaft/late-escape-analysis-reducer.h",
"src/compiler/turboshaft/late-load-elimination-reducer.h",
"src/compiler/turboshaft/layered-hash-map.h",
"src/compiler/turboshaft/machine-lowering-phase.h",
"src/compiler/turboshaft/machine-lowering-reducer.h",
@ -3189,8 +3318,10 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/pretenuring-propagation-reducer.h",
"src/compiler/turboshaft/recreate-schedule-phase.h",
"src/compiler/turboshaft/recreate-schedule.h",
"src/compiler/turboshaft/reduce-args-helper.h",
"src/compiler/turboshaft/reducer-traits.h",
"src/compiler/turboshaft/representations.h",
"src/compiler/turboshaft/required-optimization-reducer.h",
"src/compiler/turboshaft/runtime-call-descriptors.h",
"src/compiler/turboshaft/select-lowering-reducer.h",
"src/compiler/turboshaft/sidetable.h",
@ -3210,6 +3341,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/types.h",
"src/compiler/turboshaft/undef-assembler-macros.inc",
"src/compiler/turboshaft/uniform-reducer-adapter.h",
"src/compiler/turboshaft/use-map.h",
"src/compiler/turboshaft/utils.h",
"src/compiler/turboshaft/value-numbering-reducer.h",
"src/compiler/turboshaft/variable-reducer.h",
@ -3311,7 +3443,6 @@ v8_header_set("v8_internal_headers") {
"src/heap/array-buffer-sweeper.h",
"src/heap/base-space.h",
"src/heap/basic-memory-chunk.h",
"src/heap/code-object-registry.h",
"src/heap/code-range.h",
"src/heap/code-stats.h",
"src/heap/collection-barrier.h",
@ -3358,6 +3489,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/incremental-marking-job.h",
"src/heap/incremental-marking.h",
"src/heap/index-generator.h",
"src/heap/large-page.h",
"src/heap/large-spaces.h",
"src/heap/linear-allocation-area.h",
"src/heap/list.h",
@ -3367,6 +3499,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/local-heap.h",
"src/heap/mark-compact-inl.h",
"src/heap/mark-compact.h",
"src/heap/mark-sweep-utilities.h",
"src/heap/marking-barrier-inl.h",
"src/heap/marking-barrier.h",
"src/heap/marking-inl.h",
@ -3386,12 +3519,15 @@ v8_header_set("v8_internal_headers") {
"src/heap/memory-measurement.h",
"src/heap/memory-reducer.h",
"src/heap/minor-gc-job.h",
"src/heap/minor-mark-sweep-inl.h",
"src/heap/minor-mark-sweep.h",
"src/heap/new-spaces-inl.h",
"src/heap/new-spaces.h",
"src/heap/object-lock.h",
"src/heap/object-stats.h",
"src/heap/objects-visiting-inl.h",
"src/heap/objects-visiting.h",
"src/heap/page.h",
"src/heap/paged-spaces-inl.h",
"src/heap/paged-spaces.h",
"src/heap/parallel-work-item.h",
@ -3402,6 +3538,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/progress-bar.h",
"src/heap/read-only-heap-inl.h",
"src/heap/read-only-heap.h",
"src/heap/read-only-promotion.h",
"src/heap/read-only-spaces.h",
"src/heap/remembered-set-inl.h",
"src/heap/remembered-set.h",
@ -3414,6 +3551,9 @@ v8_header_set("v8_internal_headers") {
"src/heap/sweeper.h",
"src/heap/traced-handles-marking-visitor.h",
"src/heap/weak-object-worklists.h",
"src/heap/young-generation-marking-visitor-inl.h",
"src/heap/young-generation-marking-visitor.h",
"src/heap/zapping.h",
"src/ic/call-optimization.h",
"src/ic/handler-configuration-inl.h",
"src/ic/handler-configuration.h",
@ -3534,6 +3674,7 @@ v8_header_set("v8_internal_headers") {
"src/objects/heap-object.h",
"src/objects/hole-inl.h",
"src/objects/hole.h",
"src/objects/instance-type-checker.h",
"src/objects/instance-type-inl.h",
"src/objects/instance-type.h",
"src/objects/internal-index.h",
@ -3763,6 +3904,8 @@ v8_header_set("v8_internal_headers") {
"src/sandbox/external-pointer-table-inl.h",
"src/sandbox/external-pointer-table.h",
"src/sandbox/external-pointer.h",
"src/sandbox/indirect-pointer-inl.h",
"src/sandbox/indirect-pointer.h",
"src/sandbox/sandbox.h",
"src/sandbox/sandboxed-pointer-inl.h",
"src/sandbox/sandboxed-pointer.h",
@ -3789,6 +3932,7 @@ v8_header_set("v8_internal_headers") {
"src/snapshot/snapshot-source-sink.h",
"src/snapshot/snapshot-utils.h",
"src/snapshot/snapshot.h",
"src/snapshot/sort-builtins.h",
"src/snapshot/startup-deserializer.h",
"src/snapshot/startup-serializer.h",
"src/strings/char-predicates-inl.h",
@ -3876,6 +4020,7 @@ v8_header_set("v8_internal_headers") {
"src/maglev/maglev-ir-inl.h",
"src/maglev/maglev-ir.h",
"src/maglev/maglev-phi-representation-selector.h",
"src/maglev/maglev-pipeline-statistics.h",
"src/maglev/maglev-regalloc-data.h",
"src/maglev/maglev-regalloc.h",
"src/maglev/maglev-register-frame-array.h",
@ -3898,7 +4043,12 @@ v8_header_set("v8_internal_headers") {
"src/asmjs/asm-scanner.h",
"src/asmjs/asm-types.h",
"src/compiler/int64-lowering.h",
"src/compiler/turboshaft/int64-lowering-phase.h",
"src/compiler/turboshaft/int64-lowering-reducer.h",
"src/compiler/turboshaft/wasm-js-lowering-reducer.h",
"src/compiler/turboshaft/wasm-lowering-reducer.h",
"src/compiler/turboshaft/wasm-optimize-phase.h",
"src/compiler/turboshaft/wasm-turboshaft-compiler.h",
"src/compiler/wasm-address-reassociation.h",
"src/compiler/wasm-call-descriptors.h",
"src/compiler/wasm-compiler-definitions.h",
@ -3943,12 +4093,15 @@ v8_header_set("v8_internal_headers") {
"src/wasm/names-provider.h",
"src/wasm/object-access.h",
"src/wasm/pgo.h",
"src/wasm/serialized-signature-inl.h",
"src/wasm/simd-shuffle.h",
"src/wasm/stacks.h",
"src/wasm/std-object-sizes.h",
"src/wasm/streaming-decoder.h",
"src/wasm/string-builder-multiline.h",
"src/wasm/string-builder.h",
"src/wasm/struct-types.h",
"src/wasm/turboshaft-graph-interface.h",
"src/wasm/value-type.h",
"src/wasm/wasm-arguments.h",
"src/wasm/wasm-code-manager.h",
@ -4558,8 +4711,12 @@ if (v8_current_cpu == "x86") {
if (v8_enable_webassembly) {
v8_compiler_sources += [
"src/compiler/int64-lowering.cc",
"src/compiler/turboshaft/int64-lowering-phase.cc",
"src/compiler/turboshaft/wasm-optimize-phase.cc",
"src/compiler/turboshaft/wasm-turboshaft-compiler.cc",
"src/compiler/wasm-address-reassociation.cc",
"src/compiler/wasm-call-descriptors.cc",
"src/compiler/wasm-compiler-definitions.cc",
"src/compiler/wasm-compiler.cc",
"src/compiler/wasm-escape-analysis.cc",
"src/compiler/wasm-gc-lowering.cc",
@ -4594,6 +4751,7 @@ v8_source_set("v8_compiler_for_mksnapshot_source_set") {
public_deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_maybe_icu",
":v8_tracing",
]
@ -4631,6 +4789,7 @@ v8_source_set("v8_compiler") {
public_deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_internal_headers",
":v8_maybe_icu",
":v8_tracing",
@ -4658,7 +4817,9 @@ v8_source_set("v8_turboshaft") {
"src/compiler/turboshaft/graph-builder.cc",
"src/compiler/turboshaft/graph-visualizer.cc",
"src/compiler/turboshaft/graph.cc",
"src/compiler/turboshaft/instruction-selection-phase.cc",
"src/compiler/turboshaft/late-escape-analysis-reducer.cc",
"src/compiler/turboshaft/late-load-elimination-reducer.cc",
"src/compiler/turboshaft/machine-lowering-phase.cc",
"src/compiler/turboshaft/memory-optimization-reducer.cc",
"src/compiler/turboshaft/operations.cc",
@ -4676,6 +4837,7 @@ v8_source_set("v8_turboshaft") {
"src/compiler/turboshaft/typed-optimizations-phase.cc",
"src/compiler/turboshaft/typer.cc",
"src/compiler/turboshaft/types.cc",
"src/compiler/turboshaft/use-map.cc",
"src/compiler/turboshaft/utils.cc",
]
@ -4879,9 +5041,7 @@ v8_source_set("v8_base_without_compiler") {
"src/handles/traced-handles.cc",
"src/heap/allocation-observer.cc",
"src/heap/array-buffer-sweeper.cc",
"src/heap/base-space.cc",
"src/heap/basic-memory-chunk.cc",
"src/heap/code-object-registry.cc",
"src/heap/code-range.cc",
"src/heap/code-stats.cc",
"src/heap/collection-barrier.cc",
@ -4911,10 +5071,12 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/incremental-marking-job.cc",
"src/heap/incremental-marking.cc",
"src/heap/index-generator.cc",
"src/heap/large-page.cc",
"src/heap/large-spaces.cc",
"src/heap/local-factory.cc",
"src/heap/local-heap.cc",
"src/heap/mark-compact.cc",
"src/heap/mark-sweep-utilities.cc",
"src/heap/marking-barrier.cc",
"src/heap/marking-worklist.cc",
"src/heap/marking.cc",
@ -4925,12 +5087,15 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/memory-measurement.cc",
"src/heap/memory-reducer.cc",
"src/heap/minor-gc-job.cc",
"src/heap/minor-mark-sweep.cc",
"src/heap/new-spaces.cc",
"src/heap/object-stats.cc",
"src/heap/objects-visiting.cc",
"src/heap/page.cc",
"src/heap/paged-spaces.cc",
"src/heap/pretenuring-handler.cc",
"src/heap/read-only-heap.cc",
"src/heap/read-only-promotion.cc",
"src/heap/read-only-spaces.cc",
"src/heap/safepoint.cc",
"src/heap/scavenger.cc",
@ -4940,6 +5105,7 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/sweeper.cc",
"src/heap/traced-handles-marking-visitor.cc",
"src/heap/weak-object-worklists.cc",
"src/heap/zapping.cc",
"src/ic/call-optimization.cc",
"src/ic/handler-configuration.cc",
"src/ic/ic-stats.cc",
@ -5152,6 +5318,7 @@ v8_source_set("v8_base_without_compiler") {
"src/snapshot/snapshot-source-sink.cc",
"src/snapshot/snapshot-utils.cc",
"src/snapshot/snapshot.cc",
"src/snapshot/sort-builtins.cc",
"src/snapshot/startup-deserializer.cc",
"src/snapshot/startup-serializer.cc",
"src/strings/char-predicates.cc",
@ -5203,6 +5370,7 @@ v8_source_set("v8_base_without_compiler") {
"src/maglev/maglev-interpreter-frame-state.cc",
"src/maglev/maglev-ir.cc",
"src/maglev/maglev-phi-representation-selector.cc",
"src/maglev/maglev-pipeline-statistics.cc",
"src/maglev/maglev-regalloc.cc",
"src/maglev/maglev.cc",
]
@ -5258,6 +5426,7 @@ v8_source_set("v8_base_without_compiler") {
"src/wasm/stacks.cc",
"src/wasm/streaming-decoder.cc",
"src/wasm/sync-streaming-decoder.cc",
"src/wasm/turboshaft-graph-interface.cc",
"src/wasm/value-type.cc",
"src/wasm/wasm-code-manager.cc",
"src/wasm/wasm-debug.cc",
@ -5569,6 +5738,7 @@ v8_source_set("v8_base_without_compiler") {
":cppgc_base",
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_headers",
":v8_internal_headers",
":v8_maybe_icu",
@ -5729,12 +5899,6 @@ v8_source_set("torque_base") {
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
# Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for
# Torque on Windows.
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) {
# The :no_optimize config is added to v8_add_configs in v8.gni.
remove_configs += [ "//build/config/compiler:no_optimize" ]
@ -5771,10 +5935,6 @@ v8_source_set("torque_ls_base") {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
v8_component("v8_libbase") {
@ -5815,6 +5975,7 @@ v8_component("v8_libbase") {
"src/base/ieee754.cc",
"src/base/ieee754.h",
"src/base/immediate-crash.h",
"src/base/intrusive-set.h",
"src/base/iterator.h",
"src/base/lazy-instance.h",
"src/base/logging.cc",
@ -6199,6 +6360,8 @@ v8_header_set("v8_heap_base_headers") {
sources = [
"src/heap/base/active-system-pages.h",
"src/heap/base/basic-slot-set.h",
"src/heap/base/bytes.h",
"src/heap/base/incremental-marking-schedule.h",
"src/heap/base/stack.h",
"src/heap/base/worklist.h",
]
@ -6211,6 +6374,7 @@ v8_header_set("v8_heap_base_headers") {
v8_source_set("v8_heap_base") {
sources = [
"src/heap/base/active-system-pages.cc",
"src/heap/base/incremental-marking-schedule.cc",
"src/heap/base/stack.cc",
"src/heap/base/worklist.cc",
]
@ -6359,8 +6523,6 @@ v8_source_set("cppgc_base") {
"src/heap/cppgc/heap-visitor.h",
"src/heap/cppgc/heap.cc",
"src/heap/cppgc/heap.h",
"src/heap/cppgc/incremental-marking-schedule.cc",
"src/heap/cppgc/incremental-marking-schedule.h",
"src/heap/cppgc/liveness-broker.cc",
"src/heap/cppgc/liveness-broker.h",
"src/heap/cppgc/logging.cc",
@ -6520,6 +6682,9 @@ if (v8_enable_webassembly) {
":v8_snapshot",
"//build/win:default_exe_manifest",
]
if (v8_enable_vtunejit) {
deps += [ "src/third_party/vtune:v8_vtune" ]
}
# TODO: v8dll-main.cc equivalent for shared library builds
@ -6633,10 +6798,6 @@ if (current_toolchain == v8_snapshot_toolchain) {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
}
@ -6664,10 +6825,6 @@ v8_executable("torque-language-server") {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
if (v8_enable_i18n_support) {
@ -7064,10 +7221,6 @@ if (want_v8_shell) {
":internal_config_base",
]
if (is_win && !v8_enable_cet_shadow_stack) {
v8_remove_configs += [ "//build/config/compiler:cet_shadow_stack" ]
}
deps = [
":v8",
":v8_libbase",
@ -7192,7 +7345,10 @@ if (v8_enable_webassembly) {
":v8_tracing",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [
":external_config",
@ -7272,7 +7428,10 @@ if (v8_enable_webassembly) {
":wasm_test_common",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [
":external_config",

View File

@ -1,257 +0,0 @@
const fs = require('fs');
const path = require('path');
const os = require('os');
const childProcess = require('child_process');
const process = require('process');
let genPatch = false;
let output = path.resolve(os.homedir(),'./Desktop');
let ffmpegRoot = path.resolve('./');
for (const [idx, argv] of process.argv.entries()) {
switch (argv) {
case '-r':
ffmpegRoot = process.argv[idx + 1];
if (typeof ffmpegRoot !== 'string' || !fs.existsSync(genPath('./ffmpeg_generated.gni'))) {
console.error('Please provide the correct path of `src/third_party/ffmpeg`!');
process.exit(1);
}
break;
case '-o':
output = process.argv[idx + 1];
if (!fs.existsSync(output)) {
fs.mkdirSync(output, {
recursive: true
});
}
break;
case '-g':
genPatch = true;
break;
default:
break;
}
}
const encodingConfig = { encoding: 'utf8' };
const patches = [
{
condition: 'if ((is_apple && ffmpeg_branding == "Chrome") || (is_win && ffmpeg_branding == "Chrome") || (use_linux_config && ffmpeg_branding == "Chrome") || (use_linux_config && ffmpeg_branding == "ChromeOS")) {',
ffmpeg_c_sources : [
'libavcodec/autorename_libavcodec_bswapdsp.c',
'libavcodec/dovi_rpu.c',
'libavcodec/dynamic_hdr_vivid.c',
'libavcodec/hevc_cabac.c',
'libavcodec/hevc_data.c',
'libavcodec/hevc_filter.c',
'libavcodec/hevc_mvs.c',
'libavcodec/hevc_parse.c',
'libavcodec/hevc_parser.c',
'libavcodec/hevc_ps.c',
'libavcodec/hevc_refs.c',
'libavcodec/hevc_sei.c',
'libavcodec/hevcdec.c',
'libavcodec/hevcdsp.c',
'libavcodec/hevcpred.c',
]
},
{
condition: 'if ((is_apple && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (use_linux_config && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x86" && ffmpeg_branding == "ChromeOS")) {',
ffmpeg_c_sources: [
'libavcodec/x86/bswapdsp_init.c',
'libavcodec/x86/hevcdsp_init.c',
],
ffmpeg_asm_sources: [
'libavcodec/x86/bswapdsp.asm',
'libavcodec/x86/hevc_add_res.asm',
'libavcodec/x86/hevc_deblock.asm',
'libavcodec/x86/hevc_idct.asm',
'libavcodec/x86/hevc_mc.asm',
'libavcodec/x86/hevc_sao.asm',
'libavcodec/x86/hevc_sao_10bit.asm',
]
},
{
condition: 'if ((is_apple && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS")) {',
ffmpeg_c_sources: [
'libavcodec/aarch64/hevcdsp_init_aarch64.c',
],
ffmpeg_gas_sources: [
'libavcodec/aarch64/autorename_libavcodec_aarch64_hevcdsp_idct_neon.S',
'libavcodec/aarch64/autorename_libavcodec_aarch64_hevcdsp_sao_neon.S',
'libavcodec/aarch64/hevcdsp_deblock_neon.S',
'libavcodec/aarch64/hevcdsp_qpel_neon.S',
]
},
{
condition: 'if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (use_linux_config && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "arm" && ffmpeg_branding == "ChromeOS")) {',
ffmpeg_c_sources: [
'libavcodec/arm/hevcdsp_init_arm.c',
]
},
{
condition: 'if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS")) {',
ffmpeg_c_sources: [
'libavcodec/arm/hevcdsp_init_neon.c',
],
ffmpeg_gas_sources: [
'libavcodec/arm/hevcdsp_deblock_neon.S',
'libavcodec/arm/hevcdsp_idct_neon.S',
'libavcodec/arm/hevcdsp_qpel_neon.S',
'libavcodec/arm/hevcdsp_sao_neon.S',
]
}
]
function genPath(subPath) {
return path.resolve(ffmpegRoot, subPath);
}
function modifyAVCodec(filename, value) {
const content = fs.readFileSync(filename, encodingConfig);
if (content.includes(value)) {
return;
}
fs.writeFileSync(filename, content.replace('NULL };', `${value},\n NULL };`), encodingConfig);
}
function writeAutoRenameFile(filename, content) {
fs.writeFileSync(filename, content, encodingConfig);
}
function enableHevcConfig(filename) {
let content = fs.readFileSync(filename, encodingConfig);
content = content
.replace('define CONFIG_HEVC_DECODER 0', 'define CONFIG_HEVC_DECODER 1')
.replace('define CONFIG_HEVC_PARSER 0', 'define CONFIG_HEVC_PARSER 1')
.replace('define CONFIG_HEVCPARSE 0', 'define CONFIG_HEVCPARSE 1')
.replace('define CONFIG_HEVC_SEI 0', 'define CONFIG_HEVC_SEI 1')
.replace('define CONFIG_BSWAPDSP 0', 'define CONFIG_BSWAPDSP 1')
.replace('define CONFIG_DOVI_RPU 0', 'define CONFIG_DOVI_RPU 1')
.replace("--enable-decoder='aac,h264'", "--enable-decoder='aac,h264,hevc'")
.replace("--enable-parser='aac,h264'", "--enable-decoder='aac,h264,hevc'");
fs.writeFileSync(filename, content, encodingConfig);
}
function modifyHevcBuildFFmpegPy(filename) {
let content = fs.readFileSync(filename, encodingConfig);
content = content
.replace('--enable-decoder=aac,h264', '--enable-decoder=aac,h264,hevc')
.replace('--enable-parser=aac,h264', '--enable-parser=aac,h264,hevc');
fs.writeFileSync(filename, content, encodingConfig);
}
function enableFFMPEGHevc(brand, os, arch) {
modifyAVCodec(genPath(`./chromium/config/${brand}/${os}/${arch}/libavcodec/codec_list.c`), '&ff_hevc_decoder');
modifyAVCodec(genPath(`./chromium/config/${brand}/${os}/${arch}/libavcodec/parser_list.c`), '&ff_hevc_parser');
if (os !== 'win-msvc') {
enableHevcConfig(genPath(`./chromium/config/${brand}/${os}/${arch}/config_components.h`));
}
enableHevcConfig(genPath(`chromium/config/${brand}/${os}/${arch}/config.h`));
if ((arch === 'x64' || arch === 'ia32') && (os === 'win' || os == 'win-msvc' || os == 'mac')) {
enableHevcConfig(genPath(`chromium/config/${brand}/${os}/${arch}/config.asm`));
}
}
function modifyFFMPEGGenerated(filename) {
let content = fs.readFileSync(filename, encodingConfig);
for (const patch of patches) {
if (!content.includes(patch.condition)) {
console.error(`Failed to modify ffmpeg_generated.gni, please upgrade the script!`);
process.exit(1);
}
let toAdd = '';
for (const [field, sources] of Object.entries(patch)) {
if (field === 'condition') {
continue;
}
toAdd += `
${field} += [
${sources.map(source => ` "${source}"`).join(',\n')}
]
`;
}
if (!content.includes(toAdd)) {
content = content
.replace(patch.condition, patch.condition + '\n' + toAdd);
}
}
fs.writeFileSync(filename, content, encodingConfig);
}
function enableSoftwreDecodeHEVC() {
// 1. Add hevc decorder param for ffmpeg
enableFFMPEGHevc('Chrome', 'win', 'ia32');
enableFFMPEGHevc('Chrome', 'win', 'x64');
enableFFMPEGHevc('Chrome', 'win', 'arm64');
enableFFMPEGHevc('Chrome', 'win-msvc', 'ia32');
enableFFMPEGHevc('Chrome', 'win-msvc', 'x64');
enableFFMPEGHevc('Chrome', 'mac', 'x64');
enableFFMPEGHevc('Chrome', 'mac', 'arm64');
enableFFMPEGHevc('Chrome', 'ios', 'arm64');
enableFFMPEGHevc('Chrome', 'linux', 'x64');
enableFFMPEGHevc('Chrome', 'linux', 'ia32');
enableFFMPEGHevc('Chrome', 'linux', 'arm64');
enableFFMPEGHevc('Chrome', 'linux', 'arm');
enableFFMPEGHevc('Chrome', 'linux', 'arm-neon');
enableFFMPEGHevc('Chromium', 'win', 'ia32');
enableFFMPEGHevc('Chromium', 'win', 'x64');
enableFFMPEGHevc('Chromium', 'win', 'arm64');
enableFFMPEGHevc('Chromium', 'win-msvc', 'ia32');
enableFFMPEGHevc('Chromium', 'win-msvc', 'x64');
enableFFMPEGHevc('Chromium', 'mac', 'x64');
enableFFMPEGHevc('Chromium', 'mac', 'arm64');
enableFFMPEGHevc('Chromium', 'ios', 'arm64');
enableFFMPEGHevc('Chromium', 'linux', 'x64');
enableFFMPEGHevc('Chromium', 'linux', 'ia32');
enableFFMPEGHevc('Chromium', 'linux', 'arm64');
enableFFMPEGHevc('Chromium', 'linux', 'arm');
enableFFMPEGHevc('Chromium', 'linux', 'arm-neon');
enableFFMPEGHevc('Chromium', 'linux-noasm', 'x64');
enableFFMPEGHevc('ChromeOS', 'linux', 'x64');
enableFFMPEGHevc('ChromeOS', 'linux', 'ia32');
enableFFMPEGHevc('ChromeOS', 'linux', 'arm64');
enableFFMPEGHevc('ChromeOS', 'linux', 'arm');
enableFFMPEGHevc('ChromeOS', 'linux', 'arm-neon');
enableFFMPEGHevc('ChromeOS', 'linux-noasm', 'x64');
// 2. Modify build_ffmpeg.py
modifyHevcBuildFFmpegPy(genPath(`./chromium/scripts/build_ffmpeg.py`));
// 3. Create auto rename file
const prefix = '// File automatically generated. See crbug.com/495833.';
writeAutoRenameFile(genPath(`./libavcodec/aarch64/autorename_libavcodec_aarch64_hevcdsp_idct_neon.S`), [prefix, '#include "hevcdsp_idct_neon.S"'].join('\n'));
writeAutoRenameFile(genPath(`./libavcodec/aarch64/autorename_libavcodec_aarch64_hevcdsp_sao_neon.S`), [prefix, '#include "hevcdsp_sao_neon.S"'].join('\n'));
writeAutoRenameFile(genPath(`./libavcodec/autorename_libavcodec_bswapdsp.c`), [prefix, '#include "bswapdsp.c"'].join('\n'));
// 4. Modify ffmpeg_generated.gni
modifyFFMPEGGenerated(genPath(`./ffmpeg_generated.gni`));
// 5. Commit the code then `git format-patch HEAD^ -o /path/to/export/patch`
// if you want to generate the `.patch` file.
if (genPatch) {
// Commit the code.
try {
const msg = [
"Video: Add HEVC ffmpeg decoder & parser",
"Add ffmpeg software decoder and parser for HEVC to enable SW HEVC decoding"
].map(v => `-m "${v}" `).join('');
childProcess.execSync(`git add -A && git commit ${msg}`, {
cwd: ffmpegRoot
});
} catch(e) {}
// Gen patch.
try {
childProcess.execSync(`git format-patch HEAD"^" -o "${output}"`, {
cwd: ffmpegRoot
});
console.log('Generate patch success!');
} catch (e) {}
}
}
enableSoftwreDecodeHEVC();
console.log('Modify ffmpeg success!');

File diff suppressed because it is too large Load Diff

View File

@ -83,6 +83,17 @@ declare_args() {
# Sets -dENABLE_HUGEPAGE
v8_enable_hugepage = false
# Sets -dV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION.
#
# This flag speeds up the performance of fork/execve on Linux systems for
# embedders which use it (like Node.js). It works by marking the pages that
# V8 allocates as MADV_DONTFORK. Without MADV_DONTFORK, the Linux kernel
# spends a long time manipulating page mappings on fork and exec which the
# child process doesn't generally need to access.
#
# See v8:7381 for more details.
v8_enable_private_mapping_fork_optimization = false
# Sets -dENABLE_HANDLE_ZAPPING.
v8_enable_handle_zapping = is_asan || is_debug
@ -183,6 +194,10 @@ declare_args() {
# the `--trace-turbo` .json file from `mksnapshot`.
v8_log_builtins_block_count_input = ""
# This build flag is used to control whether reorder builtins acoording to
# the call graph with C3 algorithm based builtin PGO profiling.
v8_enable_builtins_reordering = false
# Provides the given V8 log file as an input to mksnapshot, where it can be
# used for profile-guided optimization of builtins.
#
@ -278,6 +293,9 @@ declare_args() {
# Use switch-based dispatch if this is false
v8_enable_regexp_interpreter_threaded_dispatch = true
# Enforce equality of builtins hashes from compatible architectures.
v8_verify_builtins_compatibility = false
# Check mksnapshot determinism by running it multiple times.
v8_verify_deterministic_mksnapshot = false
@ -321,7 +339,7 @@ declare_args() {
# Enable experimental code pointer sandboxing for the V8 sandbox.
# Sets -DV8_CODE_POINTER_SANDBOXING
v8_code_pointer_sandboxing = false
v8_code_pointer_sandboxing = ""
# Expose the memory corruption API to JavaScript. Useful for testing the sandbox.
# WARNING This will expose builtins that (by design) cause memory corruption.
@ -368,10 +386,6 @@ declare_args() {
# This is only used by nodejs.
v8_scriptormodule_legacy_lifetime = false
# Change code emission and runtime features to be CET shadow-stack compliant
# (incomplete and experimental).
v8_enable_cet_shadow_stack = false
# Enables pointer compression for 8GB heaps.
# Sets -DV8_COMPRESS_POINTERS_8GB.
v8_enable_pointer_compression_8gb = ""
@ -394,6 +408,11 @@ declare_args() {
# Enable Maglev's graph printer.
# Sets -DV8_MAGLEV_GRAPH_PRINTER.
v8_enable_maglev_graph_printer = !build_with_chromium
# Enable jump table switch for built-in.
v8_enable_builtin_jump_table_switch = v8_current_cpu == "x64"
v8_shortcut_strings_in_minor_ms = false
}
# Derived defaults.
@ -477,9 +496,8 @@ if (v8_enable_external_code_space == "") {
}
if (v8_enable_maglev == "") {
v8_enable_maglev = v8_enable_turbofan &&
(v8_current_cpu == "arm" ||
((v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression))
(v8_current_cpu == "arm" || v8_current_cpu == "x64" ||
v8_current_cpu == "arm64")
}
assert(v8_enable_turbofan || !v8_enable_maglev,
"Maglev is not available when Turbofan is disabled.")
@ -541,6 +559,11 @@ if (v8_enable_sandbox == "") {
v8_enable_external_code_space && target_os != "fuchsia"
}
if (v8_code_pointer_sandboxing == "") {
# By default, enable code pointer sandboxing if the sandbox is enabled.
v8_code_pointer_sandboxing = v8_enable_sandbox
}
if (v8_enable_static_roots == "") {
# Static roots are only valid for builds with pointer compression and a
# shared read-only heap.
@ -655,8 +678,9 @@ assert(
assert(
!v8_enable_pointer_compression_shared_cage || v8_current_cpu == "x64" ||
v8_current_cpu == "arm64" || v8_current_cpu == "riscv64" ||
v8_current_cpu == "ppc64" || v8_current_cpu == "loong64",
"Sharing a pointer compression cage is only supported on x64, arm64, ppc64, riscv64 and loong64")
v8_current_cpu == "ppc64" || v8_current_cpu == "s390x" ||
v8_current_cpu == "loong64",
"Sharing a pointer compression cage is only supported on x64, arm64, ppc64, s390x, riscv64 and loong64")
assert(!v8_enable_unconditional_write_barriers || !v8_disable_write_barriers,
"Write barriers can't be both enabled and disabled")
@ -871,7 +895,9 @@ if (v8_enable_conservative_stack_scanning) {
if (v8_enable_direct_local) {
enabled_external_v8_defines += [ "V8_ENABLE_DIRECT_LOCAL" ]
}
if (v8_shortcut_strings_in_minor_ms) {
enabled_external_v8_defines += [ "V8_MINORMS_STRING_SHORTCUTTING" ]
}
disabled_external_v8_defines = external_v8_defines - enabled_external_v8_defines
# Put defines that are used in public headers here; public headers are
@ -1002,6 +1028,9 @@ config("features") {
if (v8_enable_hugepage) {
defines += [ "ENABLE_HUGEPAGE" ]
}
if (v8_enable_private_mapping_fork_optimization) {
defines += [ "V8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION" ]
}
if (v8_enable_object_print) {
defines += [ "OBJECT_PRINT" ]
}
@ -1172,6 +1201,12 @@ config("features") {
if (v8_enable_maglev_graph_printer) {
defines += [ "V8_ENABLE_MAGLEV_GRAPH_PRINTER" ]
}
if (v8_enable_builtin_jump_table_switch) {
defines += [ "V8_ENABLE_BUILTIN_JUMP_TABLE_SWITCH" ]
}
if (v8_enable_direct_handle) {
defines += [ "V8_ENABLE_DIRECT_HANDLE" ]
}
}
config("toolchain") {
@ -1606,10 +1641,6 @@ config("toolchain") {
"/wd4715", # 'function' : not all control paths return a value'
# MSVC does not analyze switch (enum) for completeness.
]
# TODO(https://crbug.com/1377771): Keep MSVC on C++17 until source code is
# made compatible with C++20.
cflags_cc = [ "/std:c++17" ]
}
if (!is_clang && !is_win) {
@ -1724,6 +1755,8 @@ if (v8_postmortem_support) {
"src/objects/heap-object.h",
"src/objects/heap-object-inl.h",
"src/objects/instance-type.h",
"src/objects/instance-type-checker.h",
"src/objects/instance-type-inl.h",
"src/objects/js-array-buffer.h",
"src/objects/js-array-buffer-inl.h",
"src/objects/js-array.h",
@ -1850,12 +1883,13 @@ torque_files = [
"src/builtins/promise-any.tq",
"src/builtins/promise-constructor.tq",
"src/builtins/promise-finally.tq",
"src/builtins/promise-jobs.tq",
"src/builtins/promise-misc.tq",
"src/builtins/promise-race.tq",
"src/builtins/promise-reaction-job.tq",
"src/builtins/promise-resolve.tq",
"src/builtins/promise-then.tq",
"src/builtins/promise-jobs.tq",
"src/builtins/promise-withresolvers.tq",
"src/builtins/proxy-constructor.tq",
"src/builtins/proxy-delete-property.tq",
"src/builtins/proxy-get-property.tq",
@ -1878,7 +1912,12 @@ torque_files = [
"src/builtins/regexp-split.tq",
"src/builtins/regexp-test.tq",
"src/builtins/regexp.tq",
"src/builtins/set-difference.tq",
"src/builtins/set-intersection.tq",
"src/builtins/set-is-disjoint-from.tq",
"src/builtins/set-is-subset-of.tq",
"src/builtins/set-is-superset-of.tq",
"src/builtins/set-symmetric-difference.tq",
"src/builtins/set-union.tq",
"src/builtins/string-at.tq",
"src/builtins/string-endswith.tq",
@ -2021,6 +2060,8 @@ if (v8_enable_webassembly) {
torque_files += [
"src/builtins/js-to-wasm.tq",
"src/builtins/wasm.tq",
"src/builtins/wasm-strings.tq",
"src/builtins/wasm-to-js.tq",
"src/debug/debug-wasm-objects.tq",
"src/wasm/wasm-objects.tq",
]
@ -2144,6 +2185,15 @@ group("v8_maybe_icu") {
}
}
group("v8_abseil") {
public_deps = [ "//third_party/abseil-cpp:absl" ]
public_configs = [
"//third_party/abseil-cpp:absl_define_config",
"//third_party/abseil-cpp:absl_include_config",
]
}
v8_header_set("torque_runtime_support") {
visibility = [ ":*" ]
@ -2164,6 +2214,7 @@ v8_source_set("torque_generated_initializers") {
public_deps = [
":torque_runtime_support",
":v8_abseil",
":v8_maybe_icu",
]
@ -2195,7 +2246,10 @@ v8_source_set("torque_generated_definitions") {
":v8_tracing",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
sources = [
"$target_gen_dir/torque-generated/class-forward-declarations.h",
@ -2303,6 +2357,10 @@ template("run_mksnapshot") {
# "--abort-on-bad-builtin-profile-data",
"--warn-about-builtin-profile-data",
]
if (!v8_enable_builtins_profiling && v8_enable_builtins_reordering) {
args += [ "--reorder-builtins" ]
}
}
# This is needed to distinguish between generating code for the simulator
@ -2432,6 +2490,64 @@ if (v8_verify_deterministic_mksnapshot) {
}
}
if (v8_verify_builtins_compatibility) {
# This specifies a separate mksnapshot target for each of:
# x86, x64, arm, arm64.
hashes = "builtins_hashes_$v8_current_cpu"
run_mksnapshot("dump_$v8_current_cpu") {
args = [
"--dump-builtins-hashes-to-file",
hashes,
]
embedded_variant = "Default"
}
# This template defines a comparison action for the architecture the pgo
# profile is made for (e.g. x64) and the architecture the profile is used
# for (e.g. arm64 with toolchain x64_v8_arm64).
template("verify_builtins_hashes") {
forward_variables_from(invoker,
[
"profile_arch",
"target_arch",
])
profile_toolchain = "//build/toolchain/linux:clang_${profile_arch}"
target_toolchain =
"//build/toolchain/linux:clang_${profile_arch}_v8_${target_arch}"
action("compare_builtins_$target_name") {
deps = [
":run_mksnapshot_dump_${profile_arch}($profile_toolchain)",
":run_mksnapshot_dump_${target_arch}($target_toolchain)",
]
report_file = "$root_build_dir/builtins_comparison_$target_name"
script = "tools/builtins-pgo/assert_builtins_hashes.py"
args = [
"builtins_hashes_${profile_arch}",
"builtins_hashes_${target_arch}",
rebase_path(report_file, root_build_dir),
]
outputs = [ report_file ]
}
}
verify_builtins_hashes("x86_arm") {
profile_arch = "x86"
target_arch = "arm"
}
verify_builtins_hashes("x64_arm64") {
profile_arch = "x64"
target_arch = "arm64"
}
group("verify_all_builtins_hashes") {
deps = [
":compare_builtins_x64_arm64",
":compare_builtins_x86_arm",
]
}
}
action("v8_dump_build_config") {
script = "tools/testrunner/utils/dump_build_config.py"
outputs = [ "$root_out_dir/v8_build_config.json" ]
@ -2487,6 +2603,7 @@ action("v8_dump_build_config") {
"DEBUG_defined=$is_DEBUG_defined",
"debugging_features=$v8_enable_debugging_features",
"dict_property_const_tracking=$v8_dict_property_const_tracking",
"direct_handle=$v8_enable_direct_handle",
"direct_local=$v8_enable_direct_local",
"disassembler=$v8_enable_disassembler",
"full_debug=$is_full_debug",
@ -2569,7 +2686,10 @@ v8_source_set("v8_snapshot") {
sources += [ "src/snapshot/snapshot-external.cc" ]
} else {
public_deps += [ ":v8_maybe_icu" ]
public_deps += [
":v8_abseil",
":v8_maybe_icu",
]
sources += [ "$target_gen_dir/snapshot.cc" ]
}
@ -2752,7 +2872,10 @@ v8_source_set("v8_init") {
"src/init/setup-isolate-full.cc",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [ ":internal_config" ]
}
@ -2998,6 +3121,7 @@ v8_header_set("v8_internal_headers") {
"src/codegen/interface-descriptors-inl.h",
"src/codegen/interface-descriptors.h",
"src/codegen/label.h",
"src/codegen/linkage-location.h",
"src/codegen/machine-type.h",
"src/codegen/macro-assembler-base.h",
"src/codegen/macro-assembler-inl.h",
@ -3046,6 +3170,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/backend/gap-resolver.h",
"src/compiler/backend/instruction-codes.h",
"src/compiler/backend/instruction-scheduler.h",
"src/compiler/backend/instruction-selector-adapter.h",
"src/compiler/backend/instruction-selector-impl.h",
"src/compiler/backend/instruction-selector.h",
"src/compiler/backend/instruction.h",
@ -3169,13 +3294,17 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/decompression-optimization.h",
"src/compiler/turboshaft/define-assembler-macros.inc",
"src/compiler/turboshaft/deopt-data.h",
"src/compiler/turboshaft/doubly-threaded-list.h",
"src/compiler/turboshaft/explicit-truncation-reducer.h",
"src/compiler/turboshaft/fast-api-call-reducer.h",
"src/compiler/turboshaft/fast-hash.h",
"src/compiler/turboshaft/graph-builder.h",
"src/compiler/turboshaft/graph-visualizer.h",
"src/compiler/turboshaft/graph.h",
"src/compiler/turboshaft/index.h",
"src/compiler/turboshaft/instruction-selection-phase.h",
"src/compiler/turboshaft/late-escape-analysis-reducer.h",
"src/compiler/turboshaft/late-load-elimination-reducer.h",
"src/compiler/turboshaft/layered-hash-map.h",
"src/compiler/turboshaft/machine-lowering-phase.h",
"src/compiler/turboshaft/machine-lowering-reducer.h",
@ -3189,8 +3318,10 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/pretenuring-propagation-reducer.h",
"src/compiler/turboshaft/recreate-schedule-phase.h",
"src/compiler/turboshaft/recreate-schedule.h",
"src/compiler/turboshaft/reduce-args-helper.h",
"src/compiler/turboshaft/reducer-traits.h",
"src/compiler/turboshaft/representations.h",
"src/compiler/turboshaft/required-optimization-reducer.h",
"src/compiler/turboshaft/runtime-call-descriptors.h",
"src/compiler/turboshaft/select-lowering-reducer.h",
"src/compiler/turboshaft/sidetable.h",
@ -3210,6 +3341,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/types.h",
"src/compiler/turboshaft/undef-assembler-macros.inc",
"src/compiler/turboshaft/uniform-reducer-adapter.h",
"src/compiler/turboshaft/use-map.h",
"src/compiler/turboshaft/utils.h",
"src/compiler/turboshaft/value-numbering-reducer.h",
"src/compiler/turboshaft/variable-reducer.h",
@ -3311,7 +3443,6 @@ v8_header_set("v8_internal_headers") {
"src/heap/array-buffer-sweeper.h",
"src/heap/base-space.h",
"src/heap/basic-memory-chunk.h",
"src/heap/code-object-registry.h",
"src/heap/code-range.h",
"src/heap/code-stats.h",
"src/heap/collection-barrier.h",
@ -3358,6 +3489,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/incremental-marking-job.h",
"src/heap/incremental-marking.h",
"src/heap/index-generator.h",
"src/heap/large-page.h",
"src/heap/large-spaces.h",
"src/heap/linear-allocation-area.h",
"src/heap/list.h",
@ -3367,6 +3499,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/local-heap.h",
"src/heap/mark-compact-inl.h",
"src/heap/mark-compact.h",
"src/heap/mark-sweep-utilities.h",
"src/heap/marking-barrier-inl.h",
"src/heap/marking-barrier.h",
"src/heap/marking-inl.h",
@ -3386,12 +3519,15 @@ v8_header_set("v8_internal_headers") {
"src/heap/memory-measurement.h",
"src/heap/memory-reducer.h",
"src/heap/minor-gc-job.h",
"src/heap/minor-mark-sweep-inl.h",
"src/heap/minor-mark-sweep.h",
"src/heap/new-spaces-inl.h",
"src/heap/new-spaces.h",
"src/heap/object-lock.h",
"src/heap/object-stats.h",
"src/heap/objects-visiting-inl.h",
"src/heap/objects-visiting.h",
"src/heap/page.h",
"src/heap/paged-spaces-inl.h",
"src/heap/paged-spaces.h",
"src/heap/parallel-work-item.h",
@ -3402,6 +3538,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/progress-bar.h",
"src/heap/read-only-heap-inl.h",
"src/heap/read-only-heap.h",
"src/heap/read-only-promotion.h",
"src/heap/read-only-spaces.h",
"src/heap/remembered-set-inl.h",
"src/heap/remembered-set.h",
@ -3414,6 +3551,9 @@ v8_header_set("v8_internal_headers") {
"src/heap/sweeper.h",
"src/heap/traced-handles-marking-visitor.h",
"src/heap/weak-object-worklists.h",
"src/heap/young-generation-marking-visitor-inl.h",
"src/heap/young-generation-marking-visitor.h",
"src/heap/zapping.h",
"src/ic/call-optimization.h",
"src/ic/handler-configuration-inl.h",
"src/ic/handler-configuration.h",
@ -3534,6 +3674,7 @@ v8_header_set("v8_internal_headers") {
"src/objects/heap-object.h",
"src/objects/hole-inl.h",
"src/objects/hole.h",
"src/objects/instance-type-checker.h",
"src/objects/instance-type-inl.h",
"src/objects/instance-type.h",
"src/objects/internal-index.h",
@ -3763,6 +3904,8 @@ v8_header_set("v8_internal_headers") {
"src/sandbox/external-pointer-table-inl.h",
"src/sandbox/external-pointer-table.h",
"src/sandbox/external-pointer.h",
"src/sandbox/indirect-pointer-inl.h",
"src/sandbox/indirect-pointer.h",
"src/sandbox/sandbox.h",
"src/sandbox/sandboxed-pointer-inl.h",
"src/sandbox/sandboxed-pointer.h",
@ -3789,6 +3932,7 @@ v8_header_set("v8_internal_headers") {
"src/snapshot/snapshot-source-sink.h",
"src/snapshot/snapshot-utils.h",
"src/snapshot/snapshot.h",
"src/snapshot/sort-builtins.h",
"src/snapshot/startup-deserializer.h",
"src/snapshot/startup-serializer.h",
"src/strings/char-predicates-inl.h",
@ -3876,6 +4020,7 @@ v8_header_set("v8_internal_headers") {
"src/maglev/maglev-ir-inl.h",
"src/maglev/maglev-ir.h",
"src/maglev/maglev-phi-representation-selector.h",
"src/maglev/maglev-pipeline-statistics.h",
"src/maglev/maglev-regalloc-data.h",
"src/maglev/maglev-regalloc.h",
"src/maglev/maglev-register-frame-array.h",
@ -3898,7 +4043,12 @@ v8_header_set("v8_internal_headers") {
"src/asmjs/asm-scanner.h",
"src/asmjs/asm-types.h",
"src/compiler/int64-lowering.h",
"src/compiler/turboshaft/int64-lowering-phase.h",
"src/compiler/turboshaft/int64-lowering-reducer.h",
"src/compiler/turboshaft/wasm-js-lowering-reducer.h",
"src/compiler/turboshaft/wasm-lowering-reducer.h",
"src/compiler/turboshaft/wasm-optimize-phase.h",
"src/compiler/turboshaft/wasm-turboshaft-compiler.h",
"src/compiler/wasm-address-reassociation.h",
"src/compiler/wasm-call-descriptors.h",
"src/compiler/wasm-compiler-definitions.h",
@ -3943,12 +4093,15 @@ v8_header_set("v8_internal_headers") {
"src/wasm/names-provider.h",
"src/wasm/object-access.h",
"src/wasm/pgo.h",
"src/wasm/serialized-signature-inl.h",
"src/wasm/simd-shuffle.h",
"src/wasm/stacks.h",
"src/wasm/std-object-sizes.h",
"src/wasm/streaming-decoder.h",
"src/wasm/string-builder-multiline.h",
"src/wasm/string-builder.h",
"src/wasm/struct-types.h",
"src/wasm/turboshaft-graph-interface.h",
"src/wasm/value-type.h",
"src/wasm/wasm-arguments.h",
"src/wasm/wasm-code-manager.h",
@ -4558,8 +4711,12 @@ if (v8_current_cpu == "x86") {
if (v8_enable_webassembly) {
v8_compiler_sources += [
"src/compiler/int64-lowering.cc",
"src/compiler/turboshaft/int64-lowering-phase.cc",
"src/compiler/turboshaft/wasm-optimize-phase.cc",
"src/compiler/turboshaft/wasm-turboshaft-compiler.cc",
"src/compiler/wasm-address-reassociation.cc",
"src/compiler/wasm-call-descriptors.cc",
"src/compiler/wasm-compiler-definitions.cc",
"src/compiler/wasm-compiler.cc",
"src/compiler/wasm-escape-analysis.cc",
"src/compiler/wasm-gc-lowering.cc",
@ -4594,6 +4751,7 @@ v8_source_set("v8_compiler_for_mksnapshot_source_set") {
public_deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_maybe_icu",
":v8_tracing",
]
@ -4631,6 +4789,7 @@ v8_source_set("v8_compiler") {
public_deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_internal_headers",
":v8_maybe_icu",
":v8_tracing",
@ -4658,7 +4817,9 @@ v8_source_set("v8_turboshaft") {
"src/compiler/turboshaft/graph-builder.cc",
"src/compiler/turboshaft/graph-visualizer.cc",
"src/compiler/turboshaft/graph.cc",
"src/compiler/turboshaft/instruction-selection-phase.cc",
"src/compiler/turboshaft/late-escape-analysis-reducer.cc",
"src/compiler/turboshaft/late-load-elimination-reducer.cc",
"src/compiler/turboshaft/machine-lowering-phase.cc",
"src/compiler/turboshaft/memory-optimization-reducer.cc",
"src/compiler/turboshaft/operations.cc",
@ -4676,6 +4837,7 @@ v8_source_set("v8_turboshaft") {
"src/compiler/turboshaft/typed-optimizations-phase.cc",
"src/compiler/turboshaft/typer.cc",
"src/compiler/turboshaft/types.cc",
"src/compiler/turboshaft/use-map.cc",
"src/compiler/turboshaft/utils.cc",
]
@ -4879,9 +5041,7 @@ v8_source_set("v8_base_without_compiler") {
"src/handles/traced-handles.cc",
"src/heap/allocation-observer.cc",
"src/heap/array-buffer-sweeper.cc",
"src/heap/base-space.cc",
"src/heap/basic-memory-chunk.cc",
"src/heap/code-object-registry.cc",
"src/heap/code-range.cc",
"src/heap/code-stats.cc",
"src/heap/collection-barrier.cc",
@ -4911,10 +5071,12 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/incremental-marking-job.cc",
"src/heap/incremental-marking.cc",
"src/heap/index-generator.cc",
"src/heap/large-page.cc",
"src/heap/large-spaces.cc",
"src/heap/local-factory.cc",
"src/heap/local-heap.cc",
"src/heap/mark-compact.cc",
"src/heap/mark-sweep-utilities.cc",
"src/heap/marking-barrier.cc",
"src/heap/marking-worklist.cc",
"src/heap/marking.cc",
@ -4925,12 +5087,15 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/memory-measurement.cc",
"src/heap/memory-reducer.cc",
"src/heap/minor-gc-job.cc",
"src/heap/minor-mark-sweep.cc",
"src/heap/new-spaces.cc",
"src/heap/object-stats.cc",
"src/heap/objects-visiting.cc",
"src/heap/page.cc",
"src/heap/paged-spaces.cc",
"src/heap/pretenuring-handler.cc",
"src/heap/read-only-heap.cc",
"src/heap/read-only-promotion.cc",
"src/heap/read-only-spaces.cc",
"src/heap/safepoint.cc",
"src/heap/scavenger.cc",
@ -4940,6 +5105,7 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/sweeper.cc",
"src/heap/traced-handles-marking-visitor.cc",
"src/heap/weak-object-worklists.cc",
"src/heap/zapping.cc",
"src/ic/call-optimization.cc",
"src/ic/handler-configuration.cc",
"src/ic/ic-stats.cc",
@ -5152,6 +5318,7 @@ v8_source_set("v8_base_without_compiler") {
"src/snapshot/snapshot-source-sink.cc",
"src/snapshot/snapshot-utils.cc",
"src/snapshot/snapshot.cc",
"src/snapshot/sort-builtins.cc",
"src/snapshot/startup-deserializer.cc",
"src/snapshot/startup-serializer.cc",
"src/strings/char-predicates.cc",
@ -5203,6 +5370,7 @@ v8_source_set("v8_base_without_compiler") {
"src/maglev/maglev-interpreter-frame-state.cc",
"src/maglev/maglev-ir.cc",
"src/maglev/maglev-phi-representation-selector.cc",
"src/maglev/maglev-pipeline-statistics.cc",
"src/maglev/maglev-regalloc.cc",
"src/maglev/maglev.cc",
]
@ -5258,6 +5426,7 @@ v8_source_set("v8_base_without_compiler") {
"src/wasm/stacks.cc",
"src/wasm/streaming-decoder.cc",
"src/wasm/sync-streaming-decoder.cc",
"src/wasm/turboshaft-graph-interface.cc",
"src/wasm/value-type.cc",
"src/wasm/wasm-code-manager.cc",
"src/wasm/wasm-debug.cc",
@ -5569,6 +5738,7 @@ v8_source_set("v8_base_without_compiler") {
":cppgc_base",
":generate_bytecode_builtins_list",
":run_torque",
":v8_abseil",
":v8_headers",
":v8_internal_headers",
":v8_maybe_icu",
@ -5729,12 +5899,6 @@ v8_source_set("torque_base") {
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
# Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for
# Torque on Windows.
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) {
# The :no_optimize config is added to v8_add_configs in v8.gni.
remove_configs += [ "//build/config/compiler:no_optimize" ]
@ -5771,10 +5935,6 @@ v8_source_set("torque_ls_base") {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
v8_component("v8_libbase") {
@ -5815,6 +5975,7 @@ v8_component("v8_libbase") {
"src/base/ieee754.cc",
"src/base/ieee754.h",
"src/base/immediate-crash.h",
"src/base/intrusive-set.h",
"src/base/iterator.h",
"src/base/lazy-instance.h",
"src/base/logging.cc",
@ -6199,6 +6360,8 @@ v8_header_set("v8_heap_base_headers") {
sources = [
"src/heap/base/active-system-pages.h",
"src/heap/base/basic-slot-set.h",
"src/heap/base/bytes.h",
"src/heap/base/incremental-marking-schedule.h",
"src/heap/base/stack.h",
"src/heap/base/worklist.h",
]
@ -6211,6 +6374,7 @@ v8_header_set("v8_heap_base_headers") {
v8_source_set("v8_heap_base") {
sources = [
"src/heap/base/active-system-pages.cc",
"src/heap/base/incremental-marking-schedule.cc",
"src/heap/base/stack.cc",
"src/heap/base/worklist.cc",
]
@ -6359,8 +6523,6 @@ v8_source_set("cppgc_base") {
"src/heap/cppgc/heap-visitor.h",
"src/heap/cppgc/heap.cc",
"src/heap/cppgc/heap.h",
"src/heap/cppgc/incremental-marking-schedule.cc",
"src/heap/cppgc/incremental-marking-schedule.h",
"src/heap/cppgc/liveness-broker.cc",
"src/heap/cppgc/liveness-broker.h",
"src/heap/cppgc/logging.cc",
@ -6520,6 +6682,9 @@ if (v8_enable_webassembly) {
":v8_snapshot",
"//build/win:default_exe_manifest",
]
if (v8_enable_vtunejit) {
deps += [ "src/third_party/vtune:v8_vtune" ]
}
# TODO: v8dll-main.cc equivalent for shared library builds
@ -6633,10 +6798,6 @@ if (current_toolchain == v8_snapshot_toolchain) {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
}
@ -6664,10 +6825,6 @@ v8_executable("torque-language-server") {
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
]
if (is_win && is_asan) {
remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
if (v8_enable_i18n_support) {
@ -7064,10 +7221,6 @@ if (want_v8_shell) {
":internal_config_base",
]
if (is_win && !v8_enable_cet_shadow_stack) {
v8_remove_configs += [ "//build/config/compiler:cet_shadow_stack" ]
}
deps = [
":v8",
":v8_libbase",
@ -7192,7 +7345,10 @@ if (v8_enable_webassembly) {
":v8_tracing",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [
":external_config",
@ -7272,7 +7428,10 @@ if (v8_enable_webassembly) {
":wasm_test_common",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [
":v8_abseil",
":v8_maybe_icu",
]
configs = [
":external_config",