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 @@ ...@@ -4,6 +4,7 @@
import("//build/config/android/config.gni") import("//build/config/android/config.gni")
import("//build/config/arm.gni") import("//build/config/arm.gni")
import("//build/config/dcheck_always_on.gni")
import("//build/config/mips.gni") import("//build/config/mips.gni")
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
...@@ -40,6 +41,9 @@ declare_args() { ...@@ -40,6 +41,9 @@ declare_args() {
# add a dependency on the ICU library. # add a dependency on the ICU library.
v8_enable_i18n_support = true v8_enable_i18n_support = true
# Enable slow dchecks.
v8_enable_slow_dchecks = false
# Interpreted regexp engine exists as platform-independent alternative # Interpreted regexp engine exists as platform-independent alternative
# based where the regular expression is compiled to a bytecode. # based where the regular expression is compiled to a bytecode.
v8_interpreted_regexp = false v8_interpreted_regexp = false
...@@ -47,6 +51,9 @@ declare_args() { ...@@ -47,6 +51,9 @@ declare_args() {
# Sets -dOBJECT_PRINT. # Sets -dOBJECT_PRINT.
v8_object_print = false 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 # With post mortem support enabled, metadata is embedded into libv8 that
# describes various parameters of the VM for use by debuggers. See # describes various parameters of the VM for use by debuggers. See
# tools/gen-postmortem-metadata.py for details. # tools/gen-postmortem-metadata.py for details.
...@@ -287,9 +294,11 @@ config("toolchain") { ...@@ -287,9 +294,11 @@ config("toolchain") {
"DEBUG", "DEBUG",
"TRACE_MAPS", "TRACE_MAPS",
] ]
if (!v8_optimized_debug) { if (v8_enable_slow_dchecks) {
defines += [ "ENABLE_SLOW_DCHECKS" ] defines += [ "ENABLE_SLOW_DCHECKS" ]
} }
} else if (dcheck_always_on) {
defines += [ "DEBUG" ]
} }
} }
...@@ -308,7 +317,12 @@ template("v8_source_set") { ...@@ -308,7 +317,12 @@ template("v8_source_set") {
":toolchain", ":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:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ] configs += [ "//build/config/compiler:optimize_max" ]
} }
......
...@@ -20,7 +20,6 @@ if (((v8_target_arch == "ia32" || ...@@ -20,7 +20,6 @@ if (((v8_target_arch == "ia32" ||
icu_use_data_file = false icu_use_data_file = false
v8_imminent_deprecation_warnings = true v8_imminent_deprecation_warnings = true
v8_optimized_debug = false
# Add simple extras solely for the purpose of the cctests. # Add simple extras solely for the purpose of the cctests.
v8_extra_library_files = [ "//test/cctest/test-extra.js" ] 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