Commit 75498793 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

Revert "[build] disable C++ optimization for mksnapshot code."

This reverts commit cee2f772.

Reason for revert: Breaks sanitizer builds: https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20UBSan/4682

Original change's description:
> [build] disable C++ optimization for mksnapshot code.
> 
> By disabling C++ optimizations for code that's only run in mksnapshot,
> that is, CSA and Torque-generated code, we can save compile time.
> I observed up to 2x improvements of compile time for some files,
> while the mksnapshot time did not increase significantly.
> 
> Bug: v8:7629
> Change-Id: I96be2966611b2471b68023e0dd9e351d94f0013c
> Reviewed-on: https://chromium-review.googlesource.com/c/1460941
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59585}

TBR=yangguo@chromium.org,sigurds@chromium.org,tebbi@chromium.org

Change-Id: I50da40da167f49a14e3a8994377c4f9dafdfe2ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7629
Reviewed-on: https://chromium-review.googlesource.com/c/1472630Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59586}
parent cee2f772
......@@ -670,29 +670,6 @@ config("toolchain") {
}
}
config("default_optimization") {
if (is_debug && !v8_optimized_debug) {
configs = [ "//build/config/compiler:no_optimize" ]
} else {
# TODO(crbug.com/621335) Rework this so that we don't have the confusion
# between "optimize_speed" and "optimize_max".
if (((is_posix && !is_android) || is_fuchsia) && !using_sanitizer) {
configs = [ "//build/config/compiler:optimize_speed" ]
} else {
configs = [ "//build/config/compiler:optimize_max" ]
}
}
}
# For code that is only run a few times during the build, C++ optimizations
# are a waste of time.
config("unoptimized_initializer") {
configs = [
":internal_config",
"//build/config/compiler:no_optimize",
]
}
# Configs for code coverage with gcov. Separate configs for cflags and ldflags
# to selectively influde cflags in non-test targets only.
config("v8_gcov_coverage_cflags") {
......@@ -1007,8 +984,7 @@ v8_source_set("torque_generated_initializers") {
]
}
remove_configs = [ v8_path_prefix + ":default_optimization" ]
configs = [ ":unoptimized_initializer" ]
configs = [ ":internal_config" ]
}
action("generate_bytecode_builtins_list") {
......@@ -1484,8 +1460,7 @@ v8_source_set("v8_initializers") {
sources -= [ "src/builtins/builtins-intl-gen.cc" ]
}
remove_configs = [ v8_path_prefix + ":default_optimization" ]
configs = [ ":unoptimized_initializer" ]
configs = [ ":internal_config" ]
}
v8_source_set("v8_init") {
......
......@@ -94,8 +94,20 @@ v8_add_configs = [
v8_path_prefix + ":toolchain",
]
v8_remove_configs += [ "//build/config/compiler:default_optimization" ]
v8_add_configs += [ v8_path_prefix + ":default_optimization" ]
if (is_debug && !v8_optimized_debug) {
v8_remove_configs += [ "//build/config/compiler:default_optimization" ]
v8_add_configs += [ "//build/config/compiler:no_optimize" ]
} else {
v8_remove_configs += [ "//build/config/compiler:default_optimization" ]
# TODO(crbug.com/621335) Rework this so that we don't have the confusion
# between "optimize_speed" and "optimize_max".
if (((is_posix && !is_android) || is_fuchsia) && !using_sanitizer) {
v8_add_configs += [ "//build/config/compiler:optimize_speed" ]
} else {
v8_add_configs += [ "//build/config/compiler:optimize_max" ]
}
}
if (v8_code_coverage && !is_clang) {
v8_add_configs += [
......@@ -137,21 +149,21 @@ template("v8_source_set") {
"configs",
"remove_configs",
])
configs -= v8_remove_configs
configs += v8_add_configs
if (defined(invoker.remove_configs)) {
configs -= invoker.remove_configs
}
configs += invoker.configs
configs -= v8_remove_configs
configs += v8_add_configs
}
}
template("v8_header_set") {
jumbo_source_set(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
configs += invoker.configs
configs -= v8_remove_configs
configs += v8_add_configs
configs += invoker.configs
}
}
......@@ -163,12 +175,12 @@ template("v8_executable") {
"configs",
"remove_configs",
])
configs -= v8_remove_configs
configs += v8_add_configs
if (defined(invoker.remove_configs)) {
configs -= invoker.remove_configs
}
configs += invoker.configs
configs -= v8_remove_configs
configs += v8_add_configs
if (is_linux) {
# For enabling ASLR.
ldflags = [ "-pie" ]
......@@ -191,9 +203,9 @@ template("v8_executable") {
template("v8_component") {
component(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
configs += invoker.configs
configs -= v8_remove_configs
configs += v8_add_configs
configs += invoker.configs
}
}
......@@ -201,9 +213,9 @@ template("v8_static_library") {
static_library(target_name) {
complete_static_lib = true
forward_variables_from(invoker, "*", [ "configs" ])
configs += invoker.configs
configs -= v8_remove_configs
configs -= [ "//build/config/compiler:thin_archive" ]
configs += v8_add_configs
configs += invoker.configs
}
}
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