summaryrefslogtreecommitdiff
path: root/deps/v8/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/BUILD.gn')
-rw-r--r--deps/v8/BUILD.gn227
1 files changed, 162 insertions, 65 deletions
diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn
index 72a19b2ca4..4b48f7d687 100644
--- a/deps/v8/BUILD.gn
+++ b/deps/v8/BUILD.gn
@@ -9,19 +9,23 @@ import("//build/config/host_byteorder.gni")
import("//build/config/jumbo.gni")
import("//build/config/mips.gni")
import("//build/config/sanitizers/sanitizers.gni")
+import("//build_overrides/build.gni")
if (is_android) {
import("//build/config/android/rules.gni")
}
import("gni/v8.gni")
-import("gni/isolate.gni")
import("snapshot_toolchain.gni")
declare_args() {
# Print to stdout on Android.
v8_android_log_stdout = false
+ # Turns on all V8 debug features. Enables running V8 in a pseudo debug mode
+ # within a release Chrome.
+ v8_enable_debugging_features = is_debug
+
# Sets -DV8_ENABLE_FUTURE.
v8_enable_future = false
@@ -65,7 +69,8 @@ declare_args() {
v8_enable_fast_mksnapshot = false
# Enable embedded builtins.
- # TODO(jgruber,v8:6666): Support ia32.
+ # TODO(jgruber,v8:6666): Support ia32 and maybe MSVC.
+ # TODO(jgruber,v8:6666): Re-enable after the M67 branch point.
v8_enable_embedded_builtins = false
# Enable code-generation-time checking of types in the CodeStubAssembler.
@@ -142,29 +147,33 @@ declare_args() {
# Enable mitigations for executing untrusted code.
v8_untrusted_code_mitigations = true
+
+ # Enable minor mark compact.
+ v8_enable_minor_mc = true
}
# Derived defaults.
if (v8_enable_verify_heap == "") {
- v8_enable_verify_heap = is_debug
+ v8_enable_verify_heap = v8_enable_debugging_features
}
if (v8_enable_object_print == "") {
- v8_enable_object_print = is_debug
+ v8_enable_object_print = v8_enable_debugging_features
}
if (v8_enable_disassembler == "") {
- v8_enable_disassembler = is_debug
+ v8_enable_disassembler = v8_enable_debugging_features
}
if (v8_enable_trace_maps == "") {
- v8_enable_trace_maps = is_debug
+ v8_enable_trace_maps = v8_enable_debugging_features
}
if (v8_enable_test_features == "") {
- v8_enable_test_features = is_debug || dcheck_always_on
+ v8_enable_test_features = v8_enable_debugging_features || dcheck_always_on
}
if (v8_enable_v8_checks == "") {
- v8_enable_v8_checks = is_debug
+ v8_enable_v8_checks = v8_enable_debugging_features
}
if (v8_check_microtasks_scopes_consistency == "") {
- v8_check_microtasks_scopes_consistency = is_debug || dcheck_always_on
+ v8_check_microtasks_scopes_consistency =
+ v8_enable_debugging_features || dcheck_always_on
}
# Specifies if the target build is a simulator build. Comparing target cpu
@@ -268,6 +277,9 @@ config("features") {
if (v8_enable_vtunejit) {
defines += [ "ENABLE_VTUNE_JIT_INTERFACE" ]
}
+ if (v8_enable_minor_mc) {
+ defines += [ "ENABLE_MINOR_MC" ]
+ }
if (v8_enable_object_print) {
defines += [ "OBJECT_PRINT" ]
}
@@ -326,6 +338,9 @@ config("features") {
if (v8_enable_embedded_builtins) {
defines += [ "V8_EMBEDDED_BUILTINS" ]
}
+ if (v8_use_multi_snapshots) {
+ defines += [ "V8_MULTI_SNAPSHOTS" ]
+ }
}
config("toolchain") {
@@ -497,7 +512,7 @@ config("toolchain") {
# TODO(jochen): Support v8_enable_prof on Windows.
# TODO(jochen): Add support for compiling with simulators.
- if (is_debug) {
+ if (v8_enable_debugging_features) {
if (is_linux && v8_enable_backtrace) {
ldflags += [ "-rdynamic" ]
}
@@ -527,6 +542,8 @@ config("toolchain") {
if (is_clang) {
cflags += [
+ "-Wmissing-field-initializers",
+
# TODO(hans): Remove once http://crbug.com/428099 is resolved.
"-Winconsistent-missing-override",
]
@@ -602,8 +619,6 @@ action("js2c") {
"src/js/prologue.js",
"src/js/array.js",
"src/js/typedarray.js",
- "src/js/messages.js",
- "src/js/spread.js",
"src/debug/mirrors.js",
"src/debug/debug.js",
"src/debug/liveedit.js",
@@ -717,6 +732,8 @@ action("d8_js2c") {
if (is_android && enable_java_templates) {
android_assets("v8_external_startup_data_assets") {
if (v8_use_external_startup_data) {
+ # We don't support side-by-side snapshots on Android within Chromium.
+ assert(!v8_use_multi_snapshots)
deps = [
"//v8",
]
@@ -756,6 +773,10 @@ if (v8_use_external_startup_data) {
"$root_out_dir/natives_blob.bin",
]
+ data = [
+ "$root_out_dir/natives_blob.bin",
+ ]
+
script = "tools/concatenate-files.py"
args = rebase_path(sources + outputs, root_build_dir)
@@ -786,6 +807,8 @@ action("postmortem-metadata") {
"src/objects/js-array.h",
"src/objects/js-regexp-inl.h",
"src/objects/js-regexp.h",
+ "src/objects/js-regexp-string-iterator-inl.h",
+ "src/objects/js-regexp-string-iterator.h",
"src/objects/map.h",
"src/objects/map-inl.h",
"src/objects/script.h",
@@ -804,8 +827,24 @@ action("postmortem-metadata") {
rebase_path(sources, root_build_dir)
}
-if (v8_use_snapshot) {
- action("run_mksnapshot") {
+# Template to generate different V8 snapshots based on different runtime flags.
+# Can be invoked with run_mksnapshot(<name>). The target will resolve to
+# run_mksnapshot_<name>. If <name> is "default", no file suffixes will be used.
+# Otherwise files are suffixed, e.g. embedded_<name>.cc and
+# snapshot_blob_<name>.bin.
+#
+# The template exposes the variables:
+# args: additional flags for mksnapshots
+# embedded_suffix: a camel case suffix for method names in the embedded
+# snapshot.
+template("run_mksnapshot") {
+ name = target_name
+ if (name == "default") {
+ suffix = ""
+ } else {
+ suffix = "_$name"
+ }
+ action("run_mksnapshot_" + name) {
visibility = [ ":*" ] # Only targets in this file can depend on this.
deps = [
@@ -816,19 +855,33 @@ if (v8_use_snapshot) {
sources = []
- outputs = [
- "$target_gen_dir/snapshot.cc",
- ]
+ outputs = []
+
+ data = []
args = [
"./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
"root_out_dir") + "/mksnapshot",
root_build_dir),
"--turbo_instruction_scheduling",
- "--startup_src",
- rebase_path("$target_gen_dir/snapshot.cc", root_build_dir),
]
+ args += invoker.args
+
+ if (v8_enable_embedded_builtins) {
+ outputs += [ "$target_gen_dir/embedded${suffix}.cc" ]
+ args += [
+ "--embedded_src",
+ rebase_path("$target_gen_dir/embedded${suffix}.cc", root_build_dir),
+ ]
+ if (invoker.embedded_variant != "") {
+ args += [
+ "--embedded_variant",
+ invoker.embedded_variant,
+ ]
+ }
+ }
+
if (v8_random_seed != "0") {
args += [
"--random-seed",
@@ -848,10 +901,17 @@ if (v8_use_snapshot) {
}
if (v8_use_external_startup_data) {
- outputs += [ "$root_out_dir/snapshot_blob.bin" ]
+ outputs += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
+ data += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
args += [
"--startup_blob",
- rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir),
+ rebase_path("$root_out_dir/snapshot_blob${suffix}.bin", root_build_dir),
+ ]
+ } else {
+ outputs += [ "$target_gen_dir/snapshot${suffix}.cc" ]
+ args += [
+ "--startup_src",
+ rebase_path("$target_gen_dir/snapshot${suffix}.cc", root_build_dir),
]
}
@@ -869,6 +929,23 @@ if (v8_use_snapshot) {
}
}
+if (v8_use_snapshot) {
+ run_mksnapshot("default") {
+ args = []
+ if (v8_enable_embedded_builtins) {
+ embedded_variant = "Default"
+ }
+ }
+ if (v8_use_multi_snapshots) {
+ run_mksnapshot("trusted") {
+ args = [ "--no-untrusted-code-mitigations" ]
+ if (v8_enable_embedded_builtins) {
+ embedded_variant = "Trusted"
+ }
+ }
+ }
+}
+
action("v8_dump_build_config") {
script = "tools/testrunner/utils/dump_build_config.py"
outputs = [
@@ -882,7 +959,7 @@ action("v8_dump_build_config") {
"is_asan=$is_asan",
"is_cfi=$is_cfi",
"is_component_build=$is_component_build",
- "is_debug=$is_debug",
+ "is_debug=$v8_enable_debugging_features",
"is_gcov_coverage=$is_gcov_coverage",
"is_msan=$is_msan",
"is_tsan=$is_tsan",
@@ -940,12 +1017,13 @@ v8_source_set("v8_nosnapshot") {
"$target_gen_dir/experimental-extras-libraries.cc",
"$target_gen_dir/extras-libraries.cc",
"$target_gen_dir/libraries.cc",
+ "src/snapshot/embedded-empty.cc",
"src/snapshot/snapshot-empty.cc",
]
if (use_jumbo_build == true) {
jumbo_excluded_sources = [
- # TODO(mostynb@opera.com): don't exclude these http://crbug.com/752428
+ # TODO(mostynb@vewd.com): don't exclude these http://crbug.com/752428
# Generated source, contains same variable names as libraries.cc
"$target_gen_dir/experimental-extras-libraries.cc",
"$target_gen_dir/libraries.cc",
@@ -955,7 +1033,7 @@ v8_source_set("v8_nosnapshot") {
configs = [ ":internal_config" ]
}
-if (v8_use_snapshot) {
+if (v8_use_snapshot && !v8_use_external_startup_data) {
v8_source_set("v8_snapshot") {
# Only targets in this file and the top-level visibility target can
# depend on this.
@@ -973,7 +1051,7 @@ if (v8_use_snapshot) {
public_deps = [
# This should be public so downstream targets can declare the snapshot
# output file as their inputs.
- ":run_mksnapshot",
+ ":run_mksnapshot_default",
]
sources = [
@@ -984,9 +1062,13 @@ if (v8_use_snapshot) {
"src/setup-isolate-deserialize.cc",
]
+ if (v8_enable_embedded_builtins) {
+ sources += [ "$target_gen_dir/embedded.cc" ]
+ }
+
if (use_jumbo_build == true) {
jumbo_excluded_sources = [
- # TODO(mostynb@opera.com): don't exclude these http://crbug.com/752428
+ # TODO(mostynb@vewd.com): don't exclude these http://crbug.com/752428
# Generated source, contains same variable names as libraries.cc
"$target_gen_dir/experimental-extras-libraries.cc",
"$target_gen_dir/libraries.cc",
@@ -997,7 +1079,7 @@ if (v8_use_snapshot) {
}
}
-if (v8_use_external_startup_data) {
+if (v8_use_snapshot && v8_use_external_startup_data) {
v8_source_set("v8_external_snapshot") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
@@ -1009,15 +1091,34 @@ if (v8_use_external_startup_data) {
]
public_deps = [
":natives_blob",
- ":run_mksnapshot",
+ ":run_mksnapshot_default",
]
+ if (v8_use_multi_snapshots) {
+ public_deps += [ ":run_mksnapshot_trusted" ]
+ }
+
sources = [
"src/setup-isolate-deserialize.cc",
"src/snapshot/natives-external.cc",
"src/snapshot/snapshot-external.cc",
]
+ if (v8_enable_embedded_builtins) {
+ sources += [ "$target_gen_dir/embedded.cc" ]
+
+ if (v8_use_multi_snapshots) {
+ sources += [ "$target_gen_dir/embedded_trusted.cc" ]
+
+ if (use_jumbo_build == true) {
+ jumbo_excluded_sources = [
+ # Duplicated symbols with embedded.cc
+ "$target_gen_dir/embedded_trusted.cc",
+ ]
+ }
+ }
+ }
+
configs = [ ":internal_config" ]
}
}
@@ -1105,7 +1206,7 @@ v8_source_set("v8_initializers") {
if (use_jumbo_build == true) {
jumbo_excluded_sources = [
- # TODO(mostynb@opera.com): don't exclude these http://crbug.com/752428
+ # TODO(mostynb@vewd.com): don't exclude these http://crbug.com/752428
"src/builtins/builtins-async-iterator-gen.cc",
"src/builtins/builtins-async-generator-gen.cc",
@@ -1232,7 +1333,6 @@ v8_source_set("v8_base") {
"src/allocation.cc",
"src/allocation.h",
"src/api-arguments-inl.h",
- "src/api-arguments.cc",
"src/api-arguments.h",
"src/api-natives.cc",
"src/api-natives.h",
@@ -1350,8 +1450,6 @@ v8_source_set("v8_base") {
"src/compilation-cache.h",
"src/compilation-dependencies.cc",
"src/compilation-dependencies.h",
- "src/compilation-info.cc",
- "src/compilation-info.h",
"src/compilation-statistics.cc",
"src/compilation-statistics.h",
"src/compiler-dispatcher/compiler-dispatcher-job.cc",
@@ -1634,9 +1732,8 @@ v8_source_set("v8_base") {
"src/extensions/trigger-failure-extension.h",
"src/external-reference-table.cc",
"src/external-reference-table.h",
- "src/factory-inl.h",
- "src/factory.cc",
- "src/factory.h",
+ "src/external-reference.cc",
+ "src/external-reference.h",
"src/fast-dtoa.cc",
"src/fast-dtoa.h",
"src/feedback-vector-inl.h",
@@ -1680,6 +1777,9 @@ v8_source_set("v8_base") {
"src/heap/concurrent-marking.h",
"src/heap/embedder-tracing.cc",
"src/heap/embedder-tracing.h",
+ "src/heap/factory-inl.h",
+ "src/heap/factory.cc",
+ "src/heap/factory.h",
"src/heap/gc-idle-time-handler.cc",
"src/heap/gc-idle-time-handler.h",
"src/heap/gc-tracer.cc",
@@ -1866,12 +1966,16 @@ v8_source_set("v8_base") {
"src/objects/js-promise-inl.h",
"src/objects/js-promise.h",
"src/objects/js-regexp-inl.h",
+ "src/objects/js-regexp-string-iterator-inl.h",
+ "src/objects/js-regexp-string-iterator.h",
"src/objects/js-regexp.h",
"src/objects/literal-objects-inl.h",
"src/objects/literal-objects.cc",
"src/objects/literal-objects.h",
"src/objects/map-inl.h",
"src/objects/map.h",
+ "src/objects/maybe-object-inl.h",
+ "src/objects/maybe-object.h",
"src/objects/microtask-inl.h",
"src/objects/microtask.h",
"src/objects/module-inl.h",
@@ -1897,6 +2001,8 @@ v8_source_set("v8_base") {
"src/objects/string.h",
"src/objects/template-objects.cc",
"src/objects/template-objects.h",
+ "src/optimized-compilation-info.cc",
+ "src/optimized-compilation-info.h",
"src/ostreams.cc",
"src/ostreams.h",
"src/parsing/duplicate-finder.h",
@@ -2051,6 +2157,7 @@ v8_source_set("v8_base") {
"src/snapshot/default-serializer-allocator.h",
"src/snapshot/deserializer.cc",
"src/snapshot/deserializer.h",
+ "src/snapshot/macros.h",
"src/snapshot/natives-common.cc",
"src/snapshot/natives.h",
"src/snapshot/object-deserializer.cc",
@@ -2113,6 +2220,8 @@ v8_source_set("v8_base") {
"src/unicode-inl.h",
"src/unicode.cc",
"src/unicode.h",
+ "src/unoptimized-compilation-info.cc",
+ "src/unoptimized-compilation-info.h",
"src/uri.cc",
"src/uri.h",
"src/utils-inl.h",
@@ -2162,8 +2271,6 @@ v8_source_set("v8_base") {
"src/wasm/wasm-code-manager.h",
"src/wasm/wasm-code-specialization.cc",
"src/wasm/wasm-code-specialization.h",
- "src/wasm/wasm-code-wrapper.cc",
- "src/wasm/wasm-code-wrapper.h",
"src/wasm/wasm-constants.h",
"src/wasm/wasm-debug.cc",
"src/wasm/wasm-engine.cc",
@@ -2196,7 +2303,6 @@ v8_source_set("v8_base") {
"src/zone/accounting-allocator.cc",
"src/zone/accounting-allocator.h",
"src/zone/zone-allocator.h",
- "src/zone/zone-allocator.h",
"src/zone/zone-chunk-list.h",
"src/zone/zone-containers.h",
"src/zone/zone-handle-set.h",
@@ -2209,7 +2315,7 @@ v8_source_set("v8_base") {
if (use_jumbo_build == true) {
jumbo_excluded_sources = [
- # TODO(mostynb@opera.com): don't exclude these http://crbug.com/752428
+ # TODO(mostynb@vewd.com): don't exclude these http://crbug.com/752428
"src/profiler/heap-snapshot-generator.cc", # Macro clash in mman-linux.h
# These source files take an unusually large amount of time to
@@ -2364,7 +2470,7 @@ v8_source_set("v8_base") {
]
if (use_jumbo_build) {
jumbo_excluded_sources += [
- # TODO(mostynb@opera.com): fix this code so it doesn't need
+ # TODO(mostynb@vewd.com): fix this code so it doesn't need
# to be excluded, see the comments inside.
"src/arm64/instructions-arm64-constants.cc",
]
@@ -2592,13 +2698,17 @@ v8_component("v8_libbase") {
public_configs = [ ":libbase_config" ]
+ data = []
+
+ data_deps = []
+
defines = []
if (is_component_build) {
defines = [ "BUILDING_V8_BASE_SHARED" ]
}
- if (is_posix) {
+ if (is_posix || is_fuchsia) {
sources += [
"src/base/platform/platform-posix.cc",
"src/base/platform/platform-posix.h",
@@ -2680,6 +2790,12 @@ v8_component("v8_libbase") {
"winmm.lib",
"ws2_32.lib",
]
+
+ data_deps += [ "//build/win:runtime_libs" ]
+ }
+
+ if (is_tsan && !build_with_chromium) {
+ data += [ "tools/sanitizers/tsan_suppressions.txt" ]
}
# TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
@@ -2691,12 +2807,12 @@ v8_component("v8_libplatform") {
"include/libplatform/libplatform-export.h",
"include/libplatform/libplatform.h",
"include/libplatform/v8-tracing.h",
- "src/libplatform/default-background-task-runner.cc",
- "src/libplatform/default-background-task-runner.h",
"src/libplatform/default-foreground-task-runner.cc",
"src/libplatform/default-foreground-task-runner.h",
"src/libplatform/default-platform.cc",
"src/libplatform/default-platform.h",
+ "src/libplatform/default-worker-threads-task-runner.cc",
+ "src/libplatform/default-worker-threads-task-runner.h",
"src/libplatform/task-queue.cc",
"src/libplatform/task-queue.h",
"src/libplatform/tracing/trace-buffer.cc",
@@ -2834,10 +2950,6 @@ group("gn_all") {
if (want_v8_shell) {
deps += [ ":v8_shell" ]
}
-
- if (v8_test_isolation_mode != "noop") {
- deps += [ ":d8_run" ]
- }
}
group("v8_clusterfuzz") {
@@ -2855,13 +2967,6 @@ group("v8_clusterfuzz") {
":d8(//build/toolchain/linux:clang_x86_v8_arm)",
]
}
-
- if (v8_test_isolation_mode != "noop") {
- deps += [
- "test:d8_default_run",
- "tools:run-num-fuzzer_run",
- ]
- }
}
group("v8_archive") {
@@ -2872,7 +2977,7 @@ group("v8_archive") {
group("v8_fuzzers") {
testonly = true
- deps = [
+ data_deps = [
":v8_simple_json_fuzzer",
":v8_simple_multi_return_fuzzer",
":v8_simple_parser_fuzzer",
@@ -2979,7 +3084,7 @@ v8_executable("d8") {
"//build/win:default_exe_manifest",
]
- if (is_posix) {
+ if (is_posix || is_fuchsia) {
sources += [ "src/d8-posix.cc" ]
} else if (is_win) {
sources += [ "src/d8-windows.cc" ]
@@ -2992,18 +3097,10 @@ v8_executable("d8") {
defines = []
if (v8_enable_vtunejit) {
- deps += [ "//src/third_party/vtune:v8_vtune" ]
+ deps += [ "src/third_party/vtune:v8_vtune" ]
}
}
-v8_isolate_run("d8") {
- deps = [
- ":d8",
- ]
-
- isolate = "//src/d8.isolate"
-}
-
v8_executable("v8_hello_world") {
sources = [
"samples/hello-world.cc",