diff options
author | Michaël Zasso <targos@protonmail.com> | 2016-09-06 22:49:51 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2016-09-22 09:51:19 +0200 |
commit | ec02b811a8a5c999bab4de312be2d732b7d9d50b (patch) | |
tree | ca3068017254f238cf413a451c57a803572983a4 /deps/v8/BUILD.gn | |
parent | d2eb7ce0105369a9cad82787cb33a665e9bd00ad (diff) | |
download | android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.gz android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.bz2 android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.zip |
deps: update V8 to 5.4.500.27
Pick up latest commit from the 5.4-lkgr branch.
deps: edit V8 gitignore to allow trace event copy
deps: update V8 trace event to 315bf1e2d45be7d53346c31cfcc37424a32c30c8
deps: edit V8 gitignore to allow gtest_prod.h copy
deps: update V8 gtest to 6f8a66431cb592dad629028a50b3dd418a408c87
PR-URL: https://github.com/nodejs/node/pull/8317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/BUILD.gn')
-rw-r--r-- | deps/v8/BUILD.gn | 1015 |
1 files changed, 713 insertions, 302 deletions
diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 28aca24afc..dcefe3706b 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -4,6 +4,7 @@ import("//build/config/android/config.gni") import("//build/config/arm.gni") +import("//build/config/dcheck_always_on.gni") import("//build/config/mips.gni") import("//build/config/sanitizers/sanitizers.gni") @@ -11,16 +12,55 @@ if (is_android) { import("//build/config/android/rules.gni") } -# Because standalone V8 builds are not supported, assume this is part of a -# Chromium build. +import("gni/v8.gni") +import("gni/isolate.gni") import("//build_overrides/v8.gni") import("snapshot_toolchain.gni") declare_args() { - # Enable the snapshot feature, for fast context creation. - # http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html - v8_use_snapshot = true + # Print to stdout on Android. + v8_android_log_stdout = false + + # Sets -DVERIFY_HEAP. + v8_enable_verify_heap = false + + # Enable compiler warnings when using V8_DEPRECATED apis. + v8_deprecation_warnings = false + + # Enable compiler warnings when using V8_DEPRECATE_SOON apis. + v8_imminent_deprecation_warnings = "" + + # Embeds the given script into the snapshot. + v8_embed_script = "" + + # Sets -dENABLE_DISASSEMBLER. + v8_enable_disassembler = "" + + # Sets -dENABLE_GDB_JIT_INTERFACE. + v8_enable_gdbjit = "" + + # Sets -dENABLE_HANDLE_ZAPPING. + v8_enable_handle_zapping = is_debug + + # Enable ECMAScript Internationalization API. Enabling this feature will + # add a dependency on the ICU library. + v8_enable_i18n_support = true + + # Enable slow dchecks. + v8_enable_slow_dchecks = false + + # Interpreted regexp engine exists as platform-independent alternative + # based where the regular expression is compiled to a bytecode. + v8_interpreted_regexp = false + + # Sets -dOBJECT_PRINT. + v8_object_print = "" + + # With post mortem support enabled, metadata is embedded into libv8 that + # describes various parameters of the VM for use by debuggers. See + # tools/gen-postmortem-metadata.py for details. + v8_postmortem_support = false # Similar to vfp but on MIPS. v8_can_use_fpu_instructions = true @@ -29,38 +69,35 @@ declare_args() { v8_use_mips_abi_hardfloat = true } -# TODO(jochen): These will need to be user-settable to support standalone V8 -# builds. -v8_deprecation_warnings = false -v8_enable_disassembler = false -v8_enable_gdbjit = false -v8_enable_handle_zapping = false -v8_enable_i18n_support = true -v8_enable_verify_heap = false -v8_interpreted_regexp = false -v8_object_print = false -v8_postmortem_support = false -v8_random_seed = "314159265" -v8_toolset_for_d8 = "host" - -if (is_msan) { - # Running the V8-generated code on an ARM simulator is a powerful hack that - # allows the tool to see the memory accesses from JITted code. Without this - # flag, JS code causes false positive reports from MSan. - v8_target_arch = "arm64" -} else { - v8_target_arch = target_cpu +# Set project-specific defaults for some args if not provided in args.gn. The +# defaults can be set in the respective build_overrides files. +if (v8_imminent_deprecation_warnings == "") { + if (defined(v8_imminent_deprecation_warnings_default)) { + v8_imminent_deprecation_warnings = v8_imminent_deprecation_warnings_default + } else { + v8_imminent_deprecation_warnings = false + } +} +if (v8_enable_gdbjit == "") { + if (defined(v8_enable_gdbjit_default)) { + v8_enable_gdbjit = v8_enable_gdbjit_default + } else { + v8_enable_gdbjit = false + } } -if (v8_use_snapshot && v8_use_external_startup_data) { - snapshot_target = ":v8_external_snapshot" -} else if (v8_use_snapshot) { - snapshot_target = ":v8_snapshot" -} else { - assert(!v8_use_external_startup_data) - snapshot_target = ":v8_nosnapshot" +# Derived defaults. +if (v8_object_print == "") { + v8_object_print = is_debug && !v8_optimized_debug +} +if (v8_enable_disassembler == "") { + v8_enable_disassembler = is_debug && !v8_optimized_debug } +v8_generated_peephole_source = "$target_gen_dir/bytecode-peephole-table.cc" +v8_random_seed = "314159265" +v8_toolset_for_shell = "host" + ############################################################################### # Configurations # @@ -88,6 +125,11 @@ config("libplatform_config") { include_dirs = [ "include" ] } +# This config should be applied to code using the libsampler. +config("libsampler_config") { + include_dirs = [ "include" ] +} + # This config should only be applied to code using V8 and not any V8 code # itself. config("external_config") { @@ -98,6 +140,10 @@ config("external_config") { ] } include_dirs = [ "include" ] + libs = [] + if (is_android && current_toolchain != host_toolchain) { + libs += [ "log" ] + } } # This config should only be applied to code that needs to be explicitly @@ -113,31 +159,34 @@ config("features") { defines = [] - if (v8_enable_disassembler == true) { + if (v8_enable_disassembler) { defines += [ "ENABLE_DISASSEMBLER" ] } - if (v8_enable_gdbjit == true) { + if (v8_enable_gdbjit) { defines += [ "ENABLE_GDB_JIT_INTERFACE" ] } - if (v8_object_print == true) { + if (v8_object_print) { defines += [ "OBJECT_PRINT" ] } - if (v8_enable_verify_heap == true) { + if (v8_enable_verify_heap) { defines += [ "VERIFY_HEAP" ] } - if (v8_interpreted_regexp == true) { + if (v8_interpreted_regexp) { defines += [ "V8_INTERPRETED_REGEXP" ] } - if (v8_deprecation_warnings == true) { + if (v8_deprecation_warnings) { defines += [ "V8_DEPRECATION_WARNINGS" ] } - if (v8_enable_i18n_support == true) { + if (v8_imminent_deprecation_warnings) { + defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ] + } + if (v8_enable_i18n_support) { defines += [ "V8_I18N_SUPPORT" ] } - if (v8_enable_handle_zapping == true) { + if (v8_enable_handle_zapping) { defines += [ "ENABLE_HANDLE_ZAPPING" ] } - if (v8_use_external_startup_data == true) { + if (v8_use_external_startup_data) { defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ] } } @@ -147,8 +196,9 @@ config("toolchain") { defines = [] cflags = [] + ldflags = [] - if (v8_target_arch == "arm") { + if (v8_current_cpu == "arm") { defines += [ "V8_TARGET_ARCH_ARM" ] if (arm_version == 7) { defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ] @@ -167,6 +217,7 @@ config("toolchain") { "CAN_USE_NEON", ] } + # TODO(jochen): Add support for arm_test_noprobe. if (current_cpu != "arm") { @@ -178,11 +229,12 @@ config("toolchain") { } } } - if (v8_target_arch == "arm64") { + if (v8_current_cpu == "arm64") { defines += [ "V8_TARGET_ARCH_ARM64" ] } + # TODO(jochen): Add support for mips. - if (v8_target_arch == "mipsel") { + if (v8_current_cpu == "mipsel") { defines += [ "V8_TARGET_ARCH_MIPS" ] if (v8_can_use_fpu_instructions) { defines += [ "CAN_USE_FPU_INSTRUCTIONS" ] @@ -212,14 +264,17 @@ config("toolchain") { } else if (mips_arch_variant == "r1") { defines += [ "FPU_MODE_FP32" ] } + # TODO(jochen): Add support for mips_arch_variant rx and loongson. } + # TODO(jochen): Add support for mips64. - if (v8_target_arch == "mips64el") { + if (v8_current_cpu == "mips64el") { defines += [ "V8_TARGET_ARCH_MIPS64" ] if (v8_can_use_fpu_instructions) { defines += [ "CAN_USE_FPU_INSTRUCTIONS" ] } + # TODO(jochen): Add support for big endian host byteorder. defines += [ "V8_TARGET_ARCH_MIPS64_LE" ] if (v8_use_mips_abi_hardfloat) { @@ -236,30 +291,43 @@ config("toolchain") { defines += [ "_MIPS_ARCH_MIPS64R2" ] } } - if (v8_target_arch == "s390") { + if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { defines += [ "V8_TARGET_ARCH_S390" ] - } - if (v8_target_arch == "s390x") { - defines += [ - "V8_TARGET_ARCH_S390", - "V8_TARGET_ARCH_S390X", - ] + if (v8_current_cpu == "s390x") { + defines += [ "V8_TARGET_ARCH_S390X" ] + } + if (host_cpu == "x64" || host_cpu == "x86") { + defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ] + } } - if (v8_target_arch == "x86") { + if (v8_current_cpu == "x86") { defines += [ "V8_TARGET_ARCH_IA32" ] + if (is_win) { + # Ensure no surprising artifacts from 80bit double math with x86. + cflags += [ "/arch:SSE2" ] + } } - if (v8_target_arch == "x64") { + if (v8_current_cpu == "x64") { defines += [ "V8_TARGET_ARCH_X64" ] + if (is_win) { + # 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. + ldflags += [ "/STACK:2097152" ] + } } - - if (is_win) { - defines += [ "WIN32" ] - # TODO(jochen): Support v8_enable_prof. + if (is_android && v8_android_log_stdout) { + defines += [ "V8_ANDROID_LOG_STDOUT" ] } + # TODO(jochen): Support v8_enable_prof on Windows. # TODO(jochen): Add support for compiling with simulators. if (is_debug) { + if (is_linux && v8_enable_backtrace) { + ldflags += [ "-rdynamic" ] + } + # TODO(jochen): Add support for different debug optimization levels. defines += [ "ENABLE_DISASSEMBLER", @@ -267,8 +335,13 @@ config("toolchain") { "OBJECT_PRINT", "VERIFY_HEAP", "DEBUG", - "OPTIMIZED_DEBUG", + "TRACE_MAPS", ] + if (v8_enable_slow_dchecks) { + defines += [ "ENABLE_SLOW_DCHECKS" ] + } + } else if (dcheck_always_on) { + defines += [ "DEBUG" ] } } @@ -297,21 +370,16 @@ action("js2c") { "src/js/symbol.js", "src/js/array.js", "src/js/string.js", - "src/js/uri.js", "src/js/math.js", - "src/third_party/fdlibm/fdlibm.js", "src/js/regexp.js", "src/js/arraybuffer.js", "src/js/typedarray.js", "src/js/iterator-prototype.js", - "src/js/generator.js", - "src/js/object-observe.js", "src/js/collection.js", "src/js/weak-collection.js", "src/js/collection-iterator.js", "src/js/promise.js", "src/js/messages.js", - "src/js/json.js", "src/js/array-iterator.js", "src/js/string-iterator.js", "src/js/templates.js", @@ -359,22 +427,23 @@ action("js2c_experimental") { sources = [ "src/js/macros.py", "src/messages.h", - "src/js/generator.js", + "src/js/harmony-async-await.js", "src/js/harmony-atomics.js", - "src/js/harmony-regexp-exec.js", - "src/js/harmony-object-observe.js", - "src/js/harmony-sharedarraybuffer.js", "src/js/harmony-simd.js", - "src/js/harmony-species.js", - "src/js/harmony-unicode-regexps.js", "src/js/harmony-string-padding.js", - "src/js/promise-extra.js", ] outputs = [ "$target_gen_dir/experimental-libraries.cc", ] + if (v8_enable_i18n_support) { + sources += [ + "src/js/icu-case-mapping.js", + "src/js/intl-extra.js", + ] + } + args = [ rebase_path("$target_gen_dir/experimental-libraries.cc", root_build_dir), @@ -473,14 +542,22 @@ action("d8_js2c") { rebase_path(inputs, root_build_dir) } -if (is_android) { +if (is_android && enable_java_templates) { android_assets("v8_external_startup_data_assets") { if (v8_use_external_startup_data) { deps = [ "//v8", ] - renaming_sources = v8_external_startup_data_renaming_sources - renaming_destinations = v8_external_startup_data_renaming_destinations + sources = [ + "$root_out_dir/natives_blob.bin", + ] + renaming_sources = [ "$root_out_dir/snapshot_blob.bin" ] + if (current_cpu == "arm" || current_cpu == "x86" || + current_cpu == "mipsel") { + renaming_destinations = [ "snapshot_blob_32.bin" ] + } else { + renaming_destinations = [ "snapshot_blob_64.bin" ] + } disable_compression = true } } @@ -543,17 +620,19 @@ action("run_mksnapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. deps = [ - ":mksnapshot($snapshot_toolchain)", + ":mksnapshot($v8_snapshot_toolchain)", ] script = "tools/run.py" + sources = [] + outputs = [ "$target_gen_dir/snapshot.cc", ] args = [ - "./" + rebase_path(get_label_info(":mksnapshot($snapshot_toolchain)", + "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)", "root_out_dir") + "/mksnapshot", root_build_dir), "--startup_src", @@ -574,13 +653,79 @@ action("run_mksnapshot") { rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir), ] } + + if (v8_embed_script != "") { + sources += [ v8_embed_script ] + args += [ rebase_path(v8_embed_script, root_build_dir) ] + } +} + +action("run_mkpeephole") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + deps = [ + ":mkpeephole($v8_snapshot_toolchain)", + ] + + outputs = [ + v8_generated_peephole_source, + ] + + sources = [] + + script = "tools/run.py" + + args = [ + "./" + rebase_path(get_label_info(":mkpeephole($v8_snapshot_toolchain)", + "root_out_dir") + "/mkpeephole", + root_build_dir), + rebase_path(v8_generated_peephole_source, root_build_dir), + ] +} + +action("v8_dump_build_config") { + script = "tools/testrunner/utils/dump_build_config.py" + outputs = [ + "$root_out_dir/v8_build_config.json", + ] + args = [ + rebase_path("$root_out_dir/v8_build_config.json", root_build_dir), + "dcheck_always_on=$dcheck_always_on", + "is_asan=$is_asan", + "is_cfi=$is_cfi", + "is_component_build=$is_component_build", + "is_debug=$is_debug", + "is_msan=$is_msan", + "is_tsan=$is_tsan", + "target_cpu=\"$target_cpu\"", + "v8_enable_i18n_support=$v8_enable_i18n_support", + "v8_target_cpu=\"$v8_target_cpu\"", + "v8_use_snapshot=$v8_use_snapshot", + ] } ############################################################################### # Source Sets (aka static libraries) # -source_set("v8_nosnapshot") { +source_set("v8_maybe_snapshot") { + if (v8_use_snapshot && v8_use_external_startup_data) { + public_deps = [ + ":v8_external_snapshot", + ] + } else if (v8_use_snapshot) { + public_deps = [ + ":v8_snapshot", + ] + } else { + # Ignore v8_use_external_startup_data setting if no snapshot is used. + public_deps = [ + ":v8_nosnapshot", + ] + } +} + +v8_source_set("v8_nosnapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. deps = [ @@ -599,16 +744,10 @@ source_set("v8_nosnapshot") { "src/snapshot/snapshot-empty.cc", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] } -source_set("v8_snapshot") { +v8_source_set("v8_snapshot") { # Only targets in this file and the top-level visibility target can # depend on this. visibility = [ @@ -637,17 +776,11 @@ source_set("v8_snapshot") { "$target_gen_dir/snapshot.cc", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] } if (v8_use_external_startup_data) { - source_set("v8_external_snapshot") { + v8_source_set("v8_external_snapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. deps = [ @@ -667,22 +800,15 @@ if (v8_use_external_startup_data) { "src/snapshot/snapshot-external.cc", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] } } -source_set("v8_base") { +v8_source_set("v8_base") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ - # TODO(fmeawad): This needs to be updated to support standalone V8 builds. - "../base/trace_event/common/trace_event_common.h", + "//base/trace_event/common/trace_event_common.h", "include/v8-debug.h", "include/v8-experimental.h", "include/v8-platform.h", @@ -700,6 +826,7 @@ source_set("v8_base") { "src/allocation-site-scopes.h", "src/allocation.cc", "src/allocation.h", + "src/api-arguments-inl.h", "src/api-arguments.cc", "src/api-arguments.h", "src/api-experimental.cc", @@ -710,22 +837,32 @@ source_set("v8_base") { "src/api.h", "src/arguments.cc", "src/arguments.h", + "src/asmjs/asm-js.cc", + "src/asmjs/asm-js.h", + "src/asmjs/asm-typer.cc", + "src/asmjs/asm-typer.h", + "src/asmjs/asm-types.cc", + "src/asmjs/asm-types.h", + "src/asmjs/asm-wasm-builder.cc", + "src/asmjs/asm-wasm-builder.h", "src/assembler.cc", "src/assembler.h", "src/assert-scope.cc", "src/assert-scope.h", "src/ast/ast-expression-rewriter.cc", "src/ast/ast-expression-rewriter.h", - "src/ast/ast-expression-visitor.cc", - "src/ast/ast-expression-visitor.h", "src/ast/ast-literal-reindexer.cc", "src/ast/ast-literal-reindexer.h", "src/ast/ast-numbering.cc", "src/ast/ast-numbering.h", + "src/ast/ast-traversal-visitor.h", + "src/ast/ast-type-bounds.h", "src/ast/ast-value-factory.cc", "src/ast/ast-value-factory.h", "src/ast/ast.cc", "src/ast/ast.h", + "src/ast/context-slot-cache.cc", + "src/ast/context-slot-cache.h", "src/ast/modules.cc", "src/ast/modules.h", "src/ast/prettyprinter.cc", @@ -736,7 +873,6 @@ source_set("v8_base") { "src/ast/scopes.h", "src/ast/variables.cc", "src/ast/variables.h", - "src/atomic-utils.h", "src/background-parsing-task.cc", "src/background-parsing-task.h", "src/bailout-reason.cc", @@ -751,8 +887,36 @@ source_set("v8_base") { "src/bit-vector.h", "src/bootstrapper.cc", "src/bootstrapper.h", - "src/builtins.cc", - "src/builtins.h", + "src/builtins/builtins-api.cc", + "src/builtins/builtins-array.cc", + "src/builtins/builtins-arraybuffer.cc", + "src/builtins/builtins-boolean.cc", + "src/builtins/builtins-call.cc", + "src/builtins/builtins-callsite.cc", + "src/builtins/builtins-conversion.cc", + "src/builtins/builtins-dataview.cc", + "src/builtins/builtins-date.cc", + "src/builtins/builtins-debug.cc", + "src/builtins/builtins-error.cc", + "src/builtins/builtins-function.cc", + "src/builtins/builtins-generator.cc", + "src/builtins/builtins-global.cc", + "src/builtins/builtins-handler.cc", + "src/builtins/builtins-internal.cc", + "src/builtins/builtins-interpreter.cc", + "src/builtins/builtins-json.cc", + "src/builtins/builtins-math.cc", + "src/builtins/builtins-number.cc", + "src/builtins/builtins-object.cc", + "src/builtins/builtins-proxy.cc", + "src/builtins/builtins-reflect.cc", + "src/builtins/builtins-sharedarraybuffer.cc", + "src/builtins/builtins-string.cc", + "src/builtins/builtins-symbol.cc", + "src/builtins/builtins-typedarray.cc", + "src/builtins/builtins-utils.h", + "src/builtins/builtins.cc", + "src/builtins/builtins.h", "src/cached-powers.cc", "src/cached-powers.h", "src/cancelable-task.cc", @@ -761,8 +925,11 @@ source_set("v8_base") { "src/char-predicates.cc", "src/char-predicates.h", "src/checks.h", + "src/code-events.h", "src/code-factory.cc", "src/code-factory.h", + "src/code-stub-assembler.cc", + "src/code-stub-assembler.h", "src/code-stubs-hydrogen.cc", "src/code-stubs.cc", "src/code-stubs.h", @@ -775,6 +942,10 @@ source_set("v8_base") { "src/compilation-dependencies.h", "src/compilation-statistics.cc", "src/compilation-statistics.h", + "src/compiler-dispatcher/compiler-dispatcher-job.cc", + "src/compiler-dispatcher/compiler-dispatcher-job.h", + "src/compiler-dispatcher/optimizing-compile-dispatcher.cc", + "src/compiler-dispatcher/optimizing-compile-dispatcher.h", "src/compiler.cc", "src/compiler.h", "src/compiler/access-builder.cc", @@ -795,16 +966,16 @@ source_set("v8_base") { "src/compiler/bytecode-branch-analysis.h", "src/compiler/bytecode-graph-builder.cc", "src/compiler/bytecode-graph-builder.h", + "src/compiler/bytecode-loop-analysis.cc", + "src/compiler/bytecode-loop-analysis.h", "src/compiler/c-linkage.cc", - "src/compiler/change-lowering.cc", - "src/compiler/change-lowering.h", - "src/compiler/coalesced-live-ranges.cc", - "src/compiler/coalesced-live-ranges.h", + "src/compiler/checkpoint-elimination.cc", + "src/compiler/checkpoint-elimination.h", + "src/compiler/code-assembler.cc", + "src/compiler/code-assembler.h", "src/compiler/code-generator-impl.h", "src/compiler/code-generator.cc", "src/compiler/code-generator.h", - "src/compiler/code-stub-assembler.cc", - "src/compiler/code-stub-assembler.h", "src/compiler/common-node-cache.cc", "src/compiler/common-node-cache.h", "src/compiler/common-operator-reducer.cc", @@ -820,6 +991,8 @@ source_set("v8_base") { "src/compiler/dead-code-elimination.cc", "src/compiler/dead-code-elimination.h", "src/compiler/diamond.h", + "src/compiler/effect-control-linearizer.cc", + "src/compiler/effect-control-linearizer.h", "src/compiler/escape-analysis-reducer.cc", "src/compiler/escape-analysis-reducer.h", "src/compiler/escape-analysis.cc", @@ -842,8 +1015,6 @@ source_set("v8_base") { "src/compiler/graph-visualizer.h", "src/compiler/graph.cc", "src/compiler/graph.h", - "src/compiler/greedy-allocator.cc", - "src/compiler/greedy-allocator.h", "src/compiler/instruction-codes.h", "src/compiler/instruction-scheduler.cc", "src/compiler/instruction-scheduler.h", @@ -895,10 +1066,15 @@ source_set("v8_base") { "src/compiler/loop-analysis.cc", "src/compiler/loop-analysis.h", "src/compiler/loop-peeling.cc", + "src/compiler/loop-peeling.h", + "src/compiler/loop-variable-optimizer.cc", + "src/compiler/loop-variable-optimizer.h", "src/compiler/machine-operator-reducer.cc", "src/compiler/machine-operator-reducer.h", "src/compiler/machine-operator.cc", "src/compiler/machine-operator.h", + "src/compiler/memory-optimizer.cc", + "src/compiler/memory-optimizer.h", "src/compiler/move-optimizer.cc", "src/compiler/move-optimizer.h", "src/compiler/node-aux-data.h", @@ -914,6 +1090,8 @@ source_set("v8_base") { "src/compiler/node.h", "src/compiler/opcodes.cc", "src/compiler/opcodes.h", + "src/compiler/operation-typer.cc", + "src/compiler/operation-typer.h", "src/compiler/operator-properties.cc", "src/compiler/operator-properties.h", "src/compiler/operator.cc", @@ -926,6 +1104,8 @@ source_set("v8_base") { "src/compiler/pipeline.h", "src/compiler/raw-machine-assembler.cc", "src/compiler/raw-machine-assembler.h", + "src/compiler/redundancy-elimination.cc", + "src/compiler/redundancy-elimination.h", "src/compiler/register-allocator-verifier.cc", "src/compiler/register-allocator-verifier.h", "src/compiler/register-allocator.cc", @@ -948,6 +1128,8 @@ source_set("v8_base") { "src/compiler/source-position.h", "src/compiler/state-values-utils.cc", "src/compiler/state-values-utils.h", + "src/compiler/store-store-elimination.cc", + "src/compiler/store-store-elimination.h", "src/compiler/tail-call-optimization.cc", "src/compiler/tail-call-optimization.h", "src/compiler/type-hint-analyzer.cc", @@ -956,6 +1138,7 @@ source_set("v8_base") { "src/compiler/type-hints.h", "src/compiler/typer.cc", "src/compiler/typer.h", + "src/compiler/unwinding-info-writer.h", "src/compiler/value-numbering-reducer.cc", "src/compiler/value-numbering-reducer.h", "src/compiler/verifier.cc", @@ -973,6 +1156,7 @@ source_set("v8_base") { "src/conversions-inl.h", "src/conversions.cc", "src/conversions.h", + "src/counters-inl.h", "src/counters.cc", "src/counters.h", "src/crankshaft/compilation-phase.cc", @@ -1052,6 +1236,8 @@ source_set("v8_base") { "src/debug/debug.h", "src/debug/liveedit.cc", "src/debug/liveedit.h", + "src/deoptimize-reason.cc", + "src/deoptimize-reason.h", "src/deoptimizer.cc", "src/deoptimizer.h", "src/disasm.h", @@ -1063,6 +1249,8 @@ source_set("v8_base") { "src/dtoa.cc", "src/dtoa.h", "src/effects.h", + "src/eh-frame.cc", + "src/eh-frame.h", "src/elements-kind.cc", "src/elements-kind.h", "src/elements.cc", @@ -1075,6 +1263,8 @@ source_set("v8_base") { "src/extensions/free-buffer-extension.h", "src/extensions/gc-extension.cc", "src/extensions/gc-extension.h", + "src/extensions/ignition-statistics-extension.cc", + "src/extensions/ignition-statistics-extension.h", "src/extensions/statistics-extension.cc", "src/extensions/statistics-extension.h", "src/extensions/trigger-failure-extension.cc", @@ -1111,10 +1301,12 @@ source_set("v8_base") { "src/handles-inl.h", "src/handles.cc", "src/handles.h", - "src/hashmap.h", "src/heap-symbols.h", + "src/heap/array-buffer-tracker-inl.h", "src/heap/array-buffer-tracker.cc", "src/heap/array-buffer-tracker.h", + "src/heap/code-stats.cc", + "src/heap/code-stats.h", "src/heap/gc-idle-time-handler.cc", "src/heap/gc-idle-time-handler.h", "src/heap/gc-tracer.cc", @@ -1129,6 +1321,7 @@ source_set("v8_base") { "src/heap/mark-compact-inl.h", "src/heap/mark-compact.cc", "src/heap/mark-compact.h", + "src/heap/marking.h", "src/heap/memory-reducer.cc", "src/heap/memory-reducer.h", "src/heap/object-stats.cc", @@ -1177,10 +1370,29 @@ source_set("v8_base") { "src/interpreter/bytecode-array-builder.h", "src/interpreter/bytecode-array-iterator.cc", "src/interpreter/bytecode-array-iterator.h", + "src/interpreter/bytecode-array-writer.cc", + "src/interpreter/bytecode-array-writer.h", + "src/interpreter/bytecode-dead-code-optimizer.cc", + "src/interpreter/bytecode-dead-code-optimizer.h", + "src/interpreter/bytecode-decoder.cc", + "src/interpreter/bytecode-decoder.h", + "src/interpreter/bytecode-flags.cc", + "src/interpreter/bytecode-flags.h", "src/interpreter/bytecode-generator.cc", "src/interpreter/bytecode-generator.h", + "src/interpreter/bytecode-label.cc", + "src/interpreter/bytecode-label.h", + "src/interpreter/bytecode-peephole-optimizer.cc", + "src/interpreter/bytecode-peephole-optimizer.h", + "src/interpreter/bytecode-peephole-table.h", + "src/interpreter/bytecode-pipeline.cc", + "src/interpreter/bytecode-pipeline.h", "src/interpreter/bytecode-register-allocator.cc", "src/interpreter/bytecode-register-allocator.h", + "src/interpreter/bytecode-register-optimizer.cc", + "src/interpreter/bytecode-register-optimizer.h", + "src/interpreter/bytecode-register.cc", + "src/interpreter/bytecode-register.h", "src/interpreter/bytecode-traits.h", "src/interpreter/bytecodes.cc", "src/interpreter/bytecodes.h", @@ -1196,12 +1408,12 @@ source_set("v8_base") { "src/interpreter/interpreter-intrinsics.h", "src/interpreter/interpreter.cc", "src/interpreter/interpreter.h", - "src/interpreter/source-position-table.cc", - "src/interpreter/source-position-table.h", "src/isolate-inl.h", "src/isolate.cc", "src/isolate.h", + "src/json-parser.cc", "src/json-parser.h", + "src/json-stringifier.cc", "src/json-stringifier.h", "src/keys.cc", "src/keys.h", @@ -1230,8 +1442,6 @@ source_set("v8_base") { "src/objects-printer.cc", "src/objects.cc", "src/objects.h", - "src/optimizing-compile-dispatcher.cc", - "src/optimizing-compile-dispatcher.h", "src/ostreams.cc", "src/ostreams.h", "src/parsing/expression-classifier.h", @@ -1239,6 +1449,8 @@ source_set("v8_base") { "src/parsing/func-name-inferrer.h", "src/parsing/parameter-initializer-rewriter.cc", "src/parsing/parameter-initializer-rewriter.h", + "src/parsing/parse-info.cc", + "src/parsing/parse-info.h", "src/parsing/parser-base.h", "src/parsing/parser.cc", "src/parsing/parser.h", @@ -1275,12 +1487,14 @@ source_set("v8_base") { "src/profiler/profile-generator-inl.h", "src/profiler/profile-generator.cc", "src/profiler/profile-generator.h", - "src/profiler/sampler.cc", - "src/profiler/sampler.h", + "src/profiler/profiler-listener.cc", + "src/profiler/profiler-listener.h", "src/profiler/sampling-heap-profiler.cc", "src/profiler/sampling-heap-profiler.h", "src/profiler/strings-storage.cc", "src/profiler/strings-storage.h", + "src/profiler/tick-sample.cc", + "src/profiler/tick-sample.h", "src/profiler/unbound-queue-inl.h", "src/profiler/unbound-queue.h", "src/property-descriptor.cc", @@ -1319,6 +1533,7 @@ source_set("v8_base") { "src/runtime/runtime-compiler.cc", "src/runtime/runtime-date.cc", "src/runtime/runtime-debug.cc", + "src/runtime/runtime-error.cc", "src/runtime/runtime-forin.cc", "src/runtime/runtime-function.cc", "src/runtime/runtime-futex.cc", @@ -1326,13 +1541,11 @@ source_set("v8_base") { "src/runtime/runtime-i18n.cc", "src/runtime/runtime-internal.cc", "src/runtime/runtime-interpreter.cc", - "src/runtime/runtime-json.cc", "src/runtime/runtime-literals.cc", "src/runtime/runtime-liveedit.cc", "src/runtime/runtime-maths.cc", "src/runtime/runtime-numbers.cc", "src/runtime/runtime-object.cc", - "src/runtime/runtime-observe.cc", "src/runtime/runtime-operators.cc", "src/runtime/runtime-proxy.cc", "src/runtime/runtime-regexp.cc", @@ -1342,8 +1555,8 @@ source_set("v8_base") { "src/runtime/runtime-symbol.cc", "src/runtime/runtime-test.cc", "src/runtime/runtime-typedarray.cc", - "src/runtime/runtime-uri.cc", "src/runtime/runtime-utils.h", + "src/runtime/runtime-wasm.cc", "src/runtime/runtime.cc", "src/runtime/runtime.h", "src/safepoint-table.cc", @@ -1369,6 +1582,8 @@ source_set("v8_base") { "src/snapshot/snapshot.h", "src/snapshot/startup-serializer.cc", "src/snapshot/startup-serializer.h", + "src/source-position-table.cc", + "src/source-position-table.h", "src/source-position.h", "src/splay-tree-inl.h", "src/splay-tree.h", @@ -1381,8 +1596,6 @@ source_set("v8_base") { "src/string-stream.h", "src/strtod.cc", "src/strtod.h", - "src/third_party/fdlibm/fdlibm.cc", - "src/third_party/fdlibm/fdlibm.h", "src/tracing/trace-event.cc", "src/tracing/trace-event.h", "src/transitions-inl.h", @@ -1397,10 +1610,6 @@ source_set("v8_base") { "src/type-info.h", "src/types.cc", "src/types.h", - "src/typing-asm.cc", - "src/typing-asm.h", - "src/typing-reset.cc", - "src/typing-reset.h", "src/unicode-cache-inl.h", "src/unicode-cache.h", "src/unicode-decoder.cc", @@ -1408,6 +1617,8 @@ source_set("v8_base") { "src/unicode-inl.h", "src/unicode.cc", "src/unicode.h", + "src/uri.cc", + "src/uri.h", "src/utils-inl.h", "src/utils.cc", "src/utils.h", @@ -1416,20 +1627,30 @@ source_set("v8_base") { "src/v8memory.h", "src/v8threads.cc", "src/v8threads.h", + "src/value-serializer.cc", + "src/value-serializer.h", "src/version.cc", "src/version.h", "src/vm-state-inl.h", "src/vm-state.h", - "src/wasm/asm-wasm-builder.cc", - "src/wasm/asm-wasm-builder.h", "src/wasm/ast-decoder.cc", "src/wasm/ast-decoder.h", "src/wasm/decoder.h", "src/wasm/encoder.cc", "src/wasm/encoder.h", + "src/wasm/leb-helper.h", "src/wasm/module-decoder.cc", "src/wasm/module-decoder.h", + "src/wasm/switch-logic.cc", + "src/wasm/switch-logic.h", + "src/wasm/wasm-debug.cc", + "src/wasm/wasm-debug.h", + "src/wasm/wasm-external-refs.cc", "src/wasm/wasm-external-refs.h", + "src/wasm/wasm-function-name-table.cc", + "src/wasm/wasm-function-name-table.h", + "src/wasm/wasm-interpreter.cc", + "src/wasm/wasm-interpreter.h", "src/wasm/wasm-js.cc", "src/wasm/wasm-js.h", "src/wasm/wasm-macro-gen.h", @@ -1445,8 +1666,9 @@ source_set("v8_base") { "src/zone.h", ] - if (v8_target_arch == "x86") { + if (v8_current_cpu == "x86") { sources += [ + "src/builtins/ia32/builtins-ia32.cc", "src/compiler/ia32/code-generator-ia32.cc", "src/compiler/ia32/instruction-codes-ia32.h", "src/compiler/ia32/instruction-scheduler-ia32.cc", @@ -1462,7 +1684,6 @@ source_set("v8_base") { "src/ia32/assembler-ia32-inl.h", "src/ia32/assembler-ia32.cc", "src/ia32/assembler-ia32.h", - "src/ia32/builtins-ia32.cc", "src/ia32/code-stubs-ia32.cc", "src/ia32/code-stubs-ia32.h", "src/ia32/codegen-ia32.cc", @@ -1483,12 +1704,15 @@ source_set("v8_base") { "src/regexp/ia32/regexp-macro-assembler-ia32.cc", "src/regexp/ia32/regexp-macro-assembler-ia32.h", ] - } else if (v8_target_arch == "x64") { + } else if (v8_current_cpu == "x64") { sources += [ + "src/builtins/x64/builtins-x64.cc", "src/compiler/x64/code-generator-x64.cc", "src/compiler/x64/instruction-codes-x64.h", "src/compiler/x64/instruction-scheduler-x64.cc", "src/compiler/x64/instruction-selector-x64.cc", + "src/compiler/x64/unwinding-info-writer-x64.cc", + "src/compiler/x64/unwinding-info-writer-x64.h", "src/crankshaft/x64/lithium-codegen-x64.cc", "src/crankshaft/x64/lithium-codegen-x64.h", "src/crankshaft/x64/lithium-gap-resolver-x64.cc", @@ -1507,7 +1731,6 @@ source_set("v8_base") { "src/x64/assembler-x64-inl.h", "src/x64/assembler-x64.cc", "src/x64/assembler-x64.h", - "src/x64/builtins-x64.cc", "src/x64/code-stubs-x64.cc", "src/x64/code-stubs-x64.h", "src/x64/codegen-x64.cc", @@ -1515,18 +1738,18 @@ source_set("v8_base") { "src/x64/cpu-x64.cc", "src/x64/deoptimizer-x64.cc", "src/x64/disasm-x64.cc", + "src/x64/eh-frame-x64.cc", "src/x64/frames-x64.cc", "src/x64/frames-x64.h", "src/x64/interface-descriptors-x64.cc", "src/x64/macro-assembler-x64.cc", "src/x64/macro-assembler-x64.h", ] - } else if (v8_target_arch == "arm") { + } else if (v8_current_cpu == "arm") { sources += [ "src/arm/assembler-arm-inl.h", "src/arm/assembler-arm.cc", "src/arm/assembler-arm.h", - "src/arm/builtins-arm.cc", "src/arm/code-stubs-arm.cc", "src/arm/code-stubs-arm.h", "src/arm/codegen-arm.cc", @@ -1536,6 +1759,7 @@ source_set("v8_base") { "src/arm/cpu-arm.cc", "src/arm/deoptimizer-arm.cc", "src/arm/disasm-arm.cc", + "src/arm/eh-frame-arm.cc", "src/arm/frames-arm.cc", "src/arm/frames-arm.h", "src/arm/interface-descriptors-arm.cc", @@ -1544,10 +1768,13 @@ source_set("v8_base") { "src/arm/macro-assembler-arm.h", "src/arm/simulator-arm.cc", "src/arm/simulator-arm.h", + "src/builtins/arm/builtins-arm.cc", "src/compiler/arm/code-generator-arm.cc", "src/compiler/arm/instruction-codes-arm.h", "src/compiler/arm/instruction-scheduler-arm.cc", "src/compiler/arm/instruction-selector-arm.cc", + "src/compiler/arm/unwinding-info-writer-arm.cc", + "src/compiler/arm/unwinding-info-writer-arm.h", "src/crankshaft/arm/lithium-arm.cc", "src/crankshaft/arm/lithium-arm.h", "src/crankshaft/arm/lithium-codegen-arm.cc", @@ -1564,12 +1791,11 @@ source_set("v8_base") { "src/regexp/arm/regexp-macro-assembler-arm.cc", "src/regexp/arm/regexp-macro-assembler-arm.h", ] - } else if (v8_target_arch == "arm64") { + } else if (v8_current_cpu == "arm64") { sources += [ "src/arm64/assembler-arm64-inl.h", "src/arm64/assembler-arm64.cc", "src/arm64/assembler-arm64.h", - "src/arm64/builtins-arm64.cc", "src/arm64/code-stubs-arm64.cc", "src/arm64/code-stubs-arm64.h", "src/arm64/codegen-arm64.cc", @@ -1582,6 +1808,7 @@ source_set("v8_base") { "src/arm64/deoptimizer-arm64.cc", "src/arm64/disasm-arm64.cc", "src/arm64/disasm-arm64.h", + "src/arm64/eh-frame-arm64.cc", "src/arm64/frames-arm64.cc", "src/arm64/frames-arm64.h", "src/arm64/instructions-arm64.cc", @@ -1597,10 +1824,13 @@ source_set("v8_base") { "src/arm64/simulator-arm64.h", "src/arm64/utils-arm64.cc", "src/arm64/utils-arm64.h", + "src/builtins/arm64/builtins-arm64.cc", "src/compiler/arm64/code-generator-arm64.cc", "src/compiler/arm64/instruction-codes-arm64.h", "src/compiler/arm64/instruction-scheduler-arm64.cc", "src/compiler/arm64/instruction-selector-arm64.cc", + "src/compiler/arm64/unwinding-info-writer-arm64.cc", + "src/compiler/arm64/unwinding-info-writer-arm64.h", "src/crankshaft/arm64/delayed-masm-arm64-inl.h", "src/crankshaft/arm64/delayed-masm-arm64.cc", "src/crankshaft/arm64/delayed-masm-arm64.h", @@ -1620,8 +1850,9 @@ source_set("v8_base") { "src/regexp/arm64/regexp-macro-assembler-arm64.cc", "src/regexp/arm64/regexp-macro-assembler-arm64.h", ] - } else if (v8_target_arch == "mipsel") { + } else if (v8_current_cpu == "mipsel") { sources += [ + "src/builtins/mips/builtins-mips.cc", "src/compiler/mips/code-generator-mips.cc", "src/compiler/mips/instruction-codes-mips.h", "src/compiler/mips/instruction-scheduler-mips.cc", @@ -1642,7 +1873,6 @@ source_set("v8_base") { "src/mips/assembler-mips-inl.h", "src/mips/assembler-mips.cc", "src/mips/assembler-mips.h", - "src/mips/builtins-mips.cc", "src/mips/code-stubs-mips.cc", "src/mips/code-stubs-mips.h", "src/mips/codegen-mips.cc", @@ -1662,12 +1892,13 @@ source_set("v8_base") { "src/regexp/mips/regexp-macro-assembler-mips.cc", "src/regexp/mips/regexp-macro-assembler-mips.h", ] - } else if (v8_target_arch == "mips64el") { + } else if (v8_current_cpu == "mips64el") { sources += [ - "compiler/mips64/code-generator-mips64.cc", - "compiler/mips64/instruction-codes-mips64.h", - "compiler/mips64/instruction-scheduler-mips64.cc", - "compiler/mips64/instruction-selector-mips64.cc", + "src/builtins/mips64/builtins-mips64.cc", + "src/compiler/mips64/code-generator-mips64.cc", + "src/compiler/mips64/instruction-codes-mips64.h", + "src/compiler/mips64/instruction-scheduler-mips64.cc", + "src/compiler/mips64/instruction-selector-mips64.cc", "src/crankshaft/mips64/lithium-codegen-mips64.cc", "src/crankshaft/mips64/lithium-codegen-mips64.h", "src/crankshaft/mips64/lithium-gap-resolver-mips64.cc", @@ -1684,7 +1915,6 @@ source_set("v8_base") { "src/mips64/assembler-mips64-inl.h", "src/mips64/assembler-mips64.cc", "src/mips64/assembler-mips64.h", - "src/mips64/builtins-mips64.cc", "src/mips64/code-stubs-mips64.cc", "src/mips64/code-stubs-mips64.h", "src/mips64/codegen-mips64.cc", @@ -1704,8 +1934,9 @@ source_set("v8_base") { "src/regexp/mips64/regexp-macro-assembler-mips64.cc", "src/regexp/mips64/regexp-macro-assembler-mips64.h", ] - } else if (v8_target_arch == "s390" || v8_target_arch == "s390x") { + } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { sources += [ + "src/builtins/s390/builtins-s390.cc", "src/compiler/s390/code-generator-s390.cc", "src/compiler/s390/instruction-codes-s390.h", "src/compiler/s390/instruction-scheduler-s390.cc", @@ -1728,7 +1959,6 @@ source_set("v8_base") { "src/s390/assembler-s390-inl.h", "src/s390/assembler-s390.cc", "src/s390/assembler-s390.h", - "src/s390/builtins-s390.cc", "src/s390/code-stubs-s390.cc", "src/s390/code-stubs-s390.h", "src/s390/codegen-s390.cc", @@ -1748,24 +1978,17 @@ source_set("v8_base") { ] } - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":features", - ":toolchain", - ] - - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_max" ] - } + configs = [ ":internal_config" ] defines = [] deps = [ ":v8_libbase", + ":v8_libsampler", ] + sources += [ v8_generated_peephole_source ] + deps += [ ":run_mkpeephole" ] + if (is_win) { # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. cflags = [ "/wd4267" ] @@ -1776,9 +1999,6 @@ source_set("v8_base") { if (is_win) { deps += [ "//third_party/icu:icudata" ] } - - # TODO(jochen): Add support for icu_use_data_file_flag - defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE" ] } else { sources -= [ "src/i18n.cc", @@ -1792,13 +2012,14 @@ source_set("v8_base") { } } -source_set("v8_libbase") { +v8_source_set("v8_libbase") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ "src/base/accounting-allocator.cc", "src/base/accounting-allocator.h", "src/base/adapters.h", + "src/base/atomic-utils.h", "src/base/atomicops.h", "src/base/atomicops_internals_arm64_gcc.h", "src/base/atomicops_internals_arm_gcc.h", @@ -1806,7 +2027,6 @@ source_set("v8_libbase") { "src/base/atomicops_internals_mac.h", "src/base/atomicops_internals_mips64_gcc.h", "src/base/atomicops_internals_mips_gcc.h", - "src/base/atomicops_internals_portable.h", "src/base/atomicops_internals_s390_gcc.h", "src/base/atomicops_internals_tsan.h", "src/base/atomicops_internals_x86_gcc.cc", @@ -1817,11 +2037,20 @@ source_set("v8_libbase") { "src/base/build_config.h", "src/base/cpu.cc", "src/base/cpu.h", + "src/base/debug/stack_trace.cc", + "src/base/debug/stack_trace.h", "src/base/division-by-constant.cc", "src/base/division-by-constant.h", + "src/base/file-utils.cc", + "src/base/file-utils.h", "src/base/flags.h", + "src/base/format-macros.h", + "src/base/free_deleter.h", "src/base/functional.cc", "src/base/functional.h", + "src/base/hashmap.h", + "src/base/ieee754.cc", + "src/base/ieee754.h", "src/base/iterator.h", "src/base/lazy-instance.h", "src/base/logging.cc", @@ -1843,25 +2072,13 @@ source_set("v8_libbase") { "src/base/safe_conversions_impl.h", "src/base/safe_math.h", "src/base/safe_math_impl.h", - "src/base/smart-pointers.h", "src/base/sys-info.cc", "src/base/sys-info.h", "src/base/utils/random-number-generator.cc", "src/base/utils/random-number-generator.h", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config_base", - ":features", - ":toolchain", - ] - - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_max" ] - } + configs = [ ":internal_config_base" ] defines = [] @@ -1870,7 +2087,10 @@ source_set("v8_libbase") { } if (is_linux) { - sources += [ "src/base/platform/platform-linux.cc" ] + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-linux.cc", + ] libs = [ "dl", @@ -1883,18 +2103,31 @@ source_set("v8_libbase") { "rt", ] if (host_os == "mac") { - sources += [ "src/base/platform/platform-macos.cc" ] + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-macos.cc", + ] } else { - sources += [ "src/base/platform/platform-linux.cc" ] + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-linux.cc", + ] } } else { - sources += [ "src/base/platform/platform-linux.cc" ] + sources += [ + "src/base/debug/stack_trace_android.cc", + "src/base/platform/platform-linux.cc", + ] } } else if (is_mac) { - sources += [ "src/base/platform/platform-macos.cc" ] + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-macos.cc", + ] } else if (is_win) { # TODO(jochen): Add support for cygwin. sources += [ + "src/base/debug/stack_trace_win.cc", "src/base/platform/platform-win32.cc", "src/base/win32-headers.h", ] @@ -1902,6 +2135,8 @@ source_set("v8_libbase") { defines += [ "_CRT_RAND_S" ] # for rand_s() libs = [ + "dbghelp.lib", + "shlwapi.lib", "winmm.lib", "ws2_32.lib", ] @@ -1910,36 +2145,51 @@ source_set("v8_libbase") { # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris. } -source_set("v8_libplatform") { +v8_source_set("v8_libplatform") { sources = [ + "//base/trace_event/common/trace_event_common.h", "include/libplatform/libplatform.h", + "include/libplatform/v8-tracing.h", "src/libplatform/default-platform.cc", "src/libplatform/default-platform.h", "src/libplatform/task-queue.cc", "src/libplatform/task-queue.h", + "src/libplatform/tracing/trace-buffer.cc", + "src/libplatform/tracing/trace-buffer.h", + "src/libplatform/tracing/trace-config.cc", + "src/libplatform/tracing/trace-object.cc", + "src/libplatform/tracing/trace-writer.cc", + "src/libplatform/tracing/trace-writer.h", + "src/libplatform/tracing/tracing-controller.cc", "src/libplatform/worker-thread.cc", "src/libplatform/worker-thread.h", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config_base", - ":features", - ":toolchain", + configs = [ ":internal_config_base" ] + + public_configs = [ ":libplatform_config" ] + + deps = [ + ":v8_libbase", ] +} - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_max" ] - } +v8_source_set("v8_libsampler") { + sources = [ + "src/libsampler/sampler.cc", + "src/libsampler/sampler.h", + ] + + configs = [ ":internal_config_base" ] + + public_configs = [ ":libsampler_config" ] deps = [ ":v8_libbase", ] } -source_set("fuzzer_support") { +v8_source_set("fuzzer_support") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ @@ -1947,136 +2197,317 @@ source_set("fuzzer_support") { "test/fuzzer/fuzzer-support.h", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config_base", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config_base" ] deps = [ + ":v8_maybe_snapshot", + ] + + public_deps = [ ":v8_libplatform", - snapshot_target, ] } +v8_source_set("simple_fuzzer") { + sources = [ + "test/fuzzer/fuzzer.cc", + ] + + configs = [ ":internal_config_base" ] +} + ############################################################################### # Executables # -if (current_toolchain == snapshot_toolchain) { - executable("mksnapshot") { +if (current_toolchain == v8_snapshot_toolchain) { + v8_executable("mksnapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ "src/snapshot/mksnapshot.cc", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] deps = [ ":v8_base", ":v8_libplatform", ":v8_nosnapshot", "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", ] } } +v8_executable("mkpeephole") { + # mkpeephole needs to be built for the build host so the peephole lookup + # table can built during build. The table depends on the properties of + # bytecodes that are described in bytecodes.{cc,h}. + visibility = [ ":*" ] # Only targets in this file can depend on this. + + sources = [ + "src/interpreter/bytecode-peephole-optimizer.h", + "src/interpreter/bytecodes.cc", + "src/interpreter/bytecodes.h", + "src/interpreter/mkpeephole.cc", + ] + + configs = [ + ":external_config", + ":internal_config", + ] + + deps = [ + ":v8_libbase", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] +} + ############################################################################### # Public targets # +want_v8_shell = + (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") || + (current_toolchain == v8_snapshot_toolchain && + v8_toolset_for_shell == "host") || + (current_toolchain != host_toolchain && v8_toolset_for_shell == "target") + +group("gn_all") { + testonly = true + + deps = [ + ":d8", + ":v8_hello_world", + ":v8_parser_shell", + ":v8_sample_process", + ":v8_simple_json_fuzzer", + ":v8_simple_parser_fuzzer", + ":v8_simple_regexp_fuzzer", + ":v8_simple_wasm_asmjs_fuzzer", + ":v8_simple_wasm_fuzzer", + "test:gn_all", + "tools:gn_all", + ] + + if (want_v8_shell) { + deps += [ ":v8_shell" ] + } + + if (v8_test_isolation_mode != "noop") { + deps += [ ":d8_run" ] + } +} + if (is_component_build) { - component("v8") { + v8_component("v8") { sources = [ "src/v8dll-main.cc", ] + deps = [ + ":v8_dump_build_config", + ] + public_deps = [ ":v8_base", - snapshot_target, + ":v8_maybe_snapshot", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] public_configs = [ ":external_config" ] - - libs = [] - if (is_android && current_toolchain != host_toolchain) { - libs += [ "log" ] - } } } else { group("v8") { + deps = [ + ":v8_dump_build_config", + ] + public_deps = [ ":v8_base", - snapshot_target, + ":v8_maybe_snapshot", ] public_configs = [ ":external_config" ] } } -if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") || - (current_toolchain == snapshot_toolchain && v8_toolset_for_d8 == "host") || - (current_toolchain != host_toolchain && v8_toolset_for_d8 == "target")) { - executable("d8") { +v8_executable("d8") { + sources = [ + "src/d8.cc", + "src/d8.h", + ] + + configs = [ + # Note: don't use :internal_config here because this target will get + # the :external_config applied to it by virtue of depending on :v8, and + # you can't have both applied to the same target. + ":internal_config_base", + ] + + deps = [ + ":d8_js2c", + ":v8", + ":v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + # TODO(jochen): Add support for vtunejit. + + if (is_posix) { + sources += [ "src/d8-posix.cc" ] + } else if (is_win) { + sources += [ "src/d8-windows.cc" ] + } + + if (!is_component_build) { + sources += [ "$target_gen_dir/d8-js.cc" ] + } + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } +} + +v8_isolate_run("d8") { + deps = [ + ":d8", + ] + + isolate = "//src/d8.isolate" +} + +v8_executable("v8_hello_world") { + sources = [ + "samples/hello-world.cc", + ] + + configs = [ + # Note: don't use :internal_config here because this target will get + # the :external_config applied to it by virtue of depending on :v8, and + # you can't have both applied to the same target. + ":internal_config_base", + ] + + deps = [ + ":v8", + ":v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } +} + +v8_executable("v8_sample_process") { + sources = [ + "samples/process.cc", + ] + + configs = [ + # Note: don't use :internal_config here because this target will get + # the :external_config applied to it by virtue of depending on :v8, and + # you can't have both applied to the same target. + ":internal_config_base", + ] + + deps = [ + ":v8", + ":v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } +} + +v8_executable("v8_parser_shell") { + sources = [ + "tools/parser-shell.cc", + "tools/shell-utils.h", + ] + + configs = [ + ":external_config", + ":internal_config_base", + ] + + deps = [ + ":v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + if (is_component_build) { + # v8_parser_shell can't be built against a shared library, so we + # need to depend on the underlying static target in that case. + deps += [ ":v8_maybe_snapshot" ] + } else { + deps += [ ":v8" ] + } + + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } + + if (is_win) { + # Suppress warnings about importing locally defined symbols. + if (is_component_build) { + ldflags = [ + "/ignore:4049", + "/ignore:4217", + ] + } + } +} + +if (want_v8_shell) { + v8_executable("v8_shell") { sources = [ - "src/d8.cc", - "src/d8.h", + "samples/shell.cc", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ + configs = [ # Note: don't use :internal_config here because this target will get # the :external_config applied to it by virtue of depending on :v8, and # you can't have both applied to the same target. ":internal_config_base", - ":features", - ":toolchain", ] deps = [ - ":d8_js2c", ":v8", ":v8_libplatform", "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", ] - # TODO(jochen): Add support for vtunejit. - - if (is_posix) { - sources += [ "src/d8-posix.cc" ] - } else if (is_win) { - sources += [ "src/d8-windows.cc" ] - } - - if (!is_component_build) { - sources += [ "$target_gen_dir/d8-js.cc" ] - } if (v8_enable_i18n_support) { deps += [ "//third_party/icu" ] } } } -source_set("json_fuzzer") { +template("v8_fuzzer") { + name = target_name + forward_variables_from(invoker, "*") + v8_executable("v8_simple_" + name) { + deps = [ + ":" + name, + ":simple_fuzzer", + "//build/win:default_exe_manifest", + ] + + configs = [ ":external_config" ] + } +} + +v8_source_set("json_fuzzer") { sources = [ "test/fuzzer/json.cc", ] @@ -2085,17 +2516,13 @@ source_set("json_fuzzer") { ":fuzzer_support", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] +} + +v8_fuzzer("json_fuzzer") { } -source_set("parser_fuzzer") { +v8_source_set("parser_fuzzer") { sources = [ "test/fuzzer/parser.cc", ] @@ -2104,17 +2531,13 @@ source_set("parser_fuzzer") { ":fuzzer_support", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] +} + +v8_fuzzer("parser_fuzzer") { } -source_set("regexp_fuzzer") { +v8_source_set("regexp_fuzzer") { sources = [ "test/fuzzer/regexp.cc", ] @@ -2123,17 +2546,13 @@ source_set("regexp_fuzzer") { ":fuzzer_support", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] +} + +v8_fuzzer("regexp_fuzzer") { } -source_set("wasm_fuzzer") { +v8_source_set("wasm_fuzzer") { sources = [ "test/fuzzer/wasm.cc", ] @@ -2142,17 +2561,13 @@ source_set("wasm_fuzzer") { ":fuzzer_support", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] +} + +v8_fuzzer("wasm_fuzzer") { } -source_set("wasm_asmjs_fuzzer") { +v8_source_set("wasm_asmjs_fuzzer") { sources = [ "test/fuzzer/wasm-asmjs.cc", ] @@ -2161,12 +2576,8 @@ source_set("wasm_asmjs_fuzzer") { ":fuzzer_support", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] +} + +v8_fuzzer("wasm_asmjs_fuzzer") { } |