Commit d311e1f1 authored by machenbach's avatar machenbach Committed by Commit bot

[gn] Rework debug configurations

This declares v8_enable_slow_dchecks and v8_optimized_debug
as gn args. It adds support for dcheck_always_on and
debugging with v8_optimized_debug = false.

BUG=chromium:474921
NOTRY=true

Review-Url: https://codereview.chromium.org/2024833002
Cr-Commit-Position: refs/heads/master@{#36789}
parent 2bcbe2fe
......@@ -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")
......@@ -40,6 +41,9 @@ declare_args() {
# 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
......@@ -47,6 +51,9 @@ declare_args() {
# Sets -dOBJECT_PRINT.
v8_object_print = false
# Turns on compiler optimizations in V8 in Debug build.
v8_optimized_debug = true
# 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.
......@@ -287,9 +294,11 @@ config("toolchain") {
"DEBUG",
"TRACE_MAPS",
]
if (!v8_optimized_debug) {
if (v8_enable_slow_dchecks) {
defines += [ "ENABLE_SLOW_DCHECKS" ]
}
} else if (dcheck_always_on) {
defines += [ "DEBUG" ]
}
}
......@@ -308,7 +317,12 @@ template("v8_source_set") {
":toolchain",
]
if (!is_debug || v8_optimized_debug) {
# TODO(machenbach): This config doesn't affect executables and components.
# It should be moved to a common place.
if (is_debug && !v8_optimized_debug) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:no_optimize" ]
} else {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
......
......@@ -20,7 +20,6 @@ if (((v8_target_arch == "ia32" ||
icu_use_data_file = false
v8_imminent_deprecation_warnings = true
v8_optimized_debug = false
# Add simple extras solely for the purpose of the cctests.
v8_extra_library_files = [ "//test/cctest/test-extra.js" ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment