From 61c6cbb9e1d1ce2c77eb6d590bd7ecfb94426611 Mon Sep 17 00:00:00 2001 From: thakis Date: Tue, 12 Apr 2016 06:47:44 -0700 Subject: [PATCH] Port v8_optimized_debug to gn. Makes browser_tests --gtest_filter=CrSettingsBrowserTest.CrSettingsTest complete in a little over 8 seconds instead of timing out after 45s on my box. Without this patch, the test is much slower in gn builds than in gyp builds. v8/ part, goes with https://codereview.chromium.org/1880693003 BUG=chromium:586511 LOG=n Review URL: https://codereview.chromium.org/1882453002 Cr-Commit-Position: refs/heads/master@{#35415} --- BUILD.gn | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 9d9a96ca76..f985083ec0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -246,8 +246,11 @@ config("toolchain") { "OBJECT_PRINT", "VERIFY_HEAP", "DEBUG", - "OPTIMIZED_DEBUG", + "TRACE_MAPS", ] + if (!v8_optimized_debug) { + defines += [ "ENABLE_SLOW_DCHECKS" ] + } } } @@ -583,6 +586,10 @@ source_set("v8_nosnapshot") { ":features", ":toolchain", ] + if (!is_debug || v8_optimized_debug) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } } source_set("v8_snapshot") { @@ -621,6 +628,10 @@ source_set("v8_snapshot") { ":features", ":toolchain", ] + if (!is_debug || v8_optimized_debug) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } } if (v8_use_external_startup_data) { @@ -651,6 +662,10 @@ if (v8_use_external_startup_data) { ":features", ":toolchain", ] + if (!is_debug || v8_optimized_debug) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } } } @@ -1734,7 +1749,7 @@ source_set("v8_base") { ":toolchain", ] - if (!is_debug) { + if (!is_debug || v8_optimized_debug) { configs -= [ "//build/config/compiler:default_optimization" ] configs += [ "//build/config/compiler:optimize_max" ] } @@ -1836,7 +1851,7 @@ source_set("v8_libbase") { ":toolchain", ] - if (!is_debug) { + if (!is_debug || v8_optimized_debug) { configs -= [ "//build/config/compiler:default_optimization" ] configs += [ "//build/config/compiler:optimize_max" ] } @@ -1907,7 +1922,7 @@ source_set("v8_libplatform") { ":toolchain", ] - if (!is_debug) { + if (!is_debug || v8_optimized_debug) { configs -= [ "//build/config/compiler:default_optimization" ] configs += [ "//build/config/compiler:optimize_max" ] }