Reland "[build] Add V8-specific dcheck_always_on"

This is a reland of cecc666f4d

Depends on:
https://crrev.com/c/3043611

Original change's description:
> [build] Add V8-specific dcheck_always_on
>
> This makes the V8 dcheck control independent of Chromium's and
> prepares switching Chromium's default behavior without affecting V8
> developers or builders.
>
> Preparation for: https://crrev.com/c/2893204
>
> Bug: chromium:1225701
> Change-Id: I520b96019b04196f4420716ff3500ebd6c21666f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3038528
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75827}

Bug: chromium:1225701
Change-Id: I56568b78592addba01793d2d14f768c9ee10103d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3041670
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75839}
This commit is contained in:
Michael Achenbach 2021-07-19 15:55:40 +02:00 committed by V8 LUCI CQ
parent ee6ad641a0
commit 67960ba110
10 changed files with 34 additions and 30 deletions

View File

@ -33,6 +33,10 @@ declare_args() {
# Dynamically set an additional dependency from v8/custom_deps. # Dynamically set an additional dependency from v8/custom_deps.
v8_custom_deps = "" v8_custom_deps = ""
# Separate control for dchecks in V8. Defaults to Chromium's behavior if
# built with Chromium.
v8_dcheck_always_on = build_with_chromium && dcheck_always_on
# Turns on all V8 debug features. Enables running V8 in a pseudo debug mode # Turns on all V8 debug features. Enables running V8 in a pseudo debug mode
# within a release Chrome. # within a release Chrome.
v8_enable_debugging_features = is_debug v8_enable_debugging_features = is_debug
@ -358,7 +362,7 @@ if (v8_enable_trace_maps == "") {
v8_enable_trace_maps = v8_enable_debugging_features v8_enable_trace_maps = v8_enable_debugging_features
} }
if (v8_enable_test_features == "") { if (v8_enable_test_features == "") {
v8_enable_test_features = v8_enable_debugging_features || dcheck_always_on v8_enable_test_features = v8_enable_debugging_features || v8_dcheck_always_on
} }
if (v8_enable_v8_checks == "") { if (v8_enable_v8_checks == "") {
v8_enable_v8_checks = v8_enable_debugging_features v8_enable_v8_checks = v8_enable_debugging_features
@ -1141,7 +1145,7 @@ config("toolchain") {
if (v8_enable_slow_dchecks) { if (v8_enable_slow_dchecks) {
defines += [ "ENABLE_SLOW_DCHECKS" ] defines += [ "ENABLE_SLOW_DCHECKS" ]
} }
} else if (dcheck_always_on) { } else if (v8_dcheck_always_on) {
defines += [ "DEBUG" ] defines += [ "DEBUG" ]
} }
@ -1986,7 +1990,6 @@ action("v8_dump_build_config") {
args = [ args = [
rebase_path("$root_out_dir/v8_build_config.json", root_build_dir), rebase_path("$root_out_dir/v8_build_config.json", root_build_dir),
"current_cpu=\"$current_cpu\"", "current_cpu=\"$current_cpu\"",
"dcheck_always_on=$dcheck_always_on",
"is_android=$is_android", "is_android=$is_android",
"is_asan=$is_asan", "is_asan=$is_asan",
"is_cfi=$is_cfi", "is_cfi=$is_cfi",
@ -2000,6 +2003,7 @@ action("v8_dump_build_config") {
"is_ubsan_vptr=$is_ubsan_vptr", "is_ubsan_vptr=$is_ubsan_vptr",
"target_cpu=\"$target_cpu\"", "target_cpu=\"$target_cpu\"",
"v8_current_cpu=\"$v8_current_cpu\"", "v8_current_cpu=\"$v8_current_cpu\"",
"v8_dcheck_always_on=$v8_dcheck_always_on",
"v8_enable_atomic_marking_state=$v8_enable_atomic_marking_state", "v8_enable_atomic_marking_state=$v8_enable_atomic_marking_state",
"v8_enable_atomic_object_field_writes=" + "v8_enable_atomic_object_field_writes=" +
"$v8_enable_atomic_object_field_writes", "$v8_enable_atomic_object_field_writes",

View File

@ -396,7 +396,7 @@
# TODO(v8:v7703): Make pointer compression bots testing non pointer # TODO(v8:v7703): Make pointer compression bots testing non pointer
# compression mode while pointer compression is temporarily enabled # compression mode while pointer compression is temporarily enabled
# on arm64 # on arm64
'release_bot', 'simulate_arm64', 'dcheck_always_on', 'release_bot', 'simulate_arm64', 'v8_dcheck_always_on',
'v8_enable_slow_dchecks', 'v8_disable_pointer_compression'], 'v8_enable_slow_dchecks', 'v8_disable_pointer_compression'],
'release_simulate_arm64_msan': [ 'release_simulate_arm64_msan': [
'release_bot', 'simulate_arm64', 'msan'], 'release_bot', 'simulate_arm64', 'msan'],
@ -469,7 +469,7 @@
'release_x64_asan_no_lsan_verify_heap': [ 'release_x64_asan_no_lsan_verify_heap': [
'release_bot', 'x64', 'asan', 'v8_verify_heap'], 'release_bot', 'x64', 'asan', 'v8_verify_heap'],
'release_x64_asan_no_lsan_verify_heap_dchecks': [ 'release_x64_asan_no_lsan_verify_heap_dchecks': [
'release_bot', 'x64', 'asan', 'dcheck_always_on', 'release_bot', 'x64', 'asan', 'v8_dcheck_always_on',
'v8_enable_slow_dchecks', 'v8_verify_heap'], 'v8_enable_slow_dchecks', 'v8_verify_heap'],
'release_x64_asan_symbolized_verify_heap': [ 'release_x64_asan_symbolized_verify_heap': [
'release_bot', 'x64', 'asan', 'lsan', 'symbolized', 'release_bot', 'x64', 'asan', 'lsan', 'symbolized',
@ -479,7 +479,7 @@
'release_x64_cfi_clusterfuzz': [ 'release_x64_cfi_clusterfuzz': [
'release_bot', 'x64', 'cfi_clusterfuzz'], 'release_bot', 'x64', 'cfi_clusterfuzz'],
'release_x64_fuzzilli': [ 'release_x64_fuzzilli': [
'release_bot', 'x64', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'release_bot', 'x64', 'v8_dcheck_always_on', 'v8_enable_slow_dchecks',
'v8_verify_heap', 'v8_verify_csa', 'fuzzilli'], 'v8_verify_heap', 'v8_verify_csa', 'fuzzilli'],
'release_x64_msvc': [ 'release_x64_msvc': [
'release_bot_no_goma', 'x64', 'minimal_symbols', 'msvc'], 'release_bot_no_goma', 'x64', 'minimal_symbols', 'msvc'],
@ -501,7 +501,7 @@
'release_x64_minimal_symbols': [ 'release_x64_minimal_symbols': [
'release_bot', 'x64', 'minimal_symbols'], 'release_bot', 'x64', 'minimal_symbols'],
'release_x64_pointer_compression': [ 'release_x64_pointer_compression': [
'release_bot', 'x64', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'release_bot', 'x64', 'v8_dcheck_always_on', 'v8_enable_slow_dchecks',
'v8_disable_pointer_compression'], 'v8_disable_pointer_compression'],
'release_x64_pointer_compression_without_dchecks': [ 'release_x64_pointer_compression_without_dchecks': [
'release_bot', 'x64', 'v8_disable_pointer_compression'], 'release_bot', 'x64', 'v8_disable_pointer_compression'],
@ -526,7 +526,7 @@
'release_x64_shared_verify_heap': [ 'release_x64_shared_verify_heap': [
'release_bot', 'x64', 'shared', 'v8_verify_heap'], 'release_bot', 'x64', 'shared', 'v8_verify_heap'],
'release_x64_verify_csa': [ 'release_x64_verify_csa': [
'release_bot', 'x64', 'dcheck_always_on', 'release_bot', 'x64', 'v8_dcheck_always_on',
'v8_enable_slow_dchecks', 'v8_verify_csa'], 'v8_enable_slow_dchecks', 'v8_verify_csa'],
'release_x64_webassembly_disabled': [ 'release_x64_webassembly_disabled': [
'release_bot', 'x64', 'webassembly_disabled'], 'release_bot', 'x64', 'webassembly_disabled'],
@ -610,7 +610,7 @@
'release_x86_trybot': [ 'release_x86_trybot': [
'release_trybot', 'x86'], 'release_trybot', 'x86'],
'release_x86_verify_csa': [ 'release_x86_verify_csa': [
'release_bot', 'x86', 'dcheck_always_on', 'release_bot', 'x86', 'v8_dcheck_always_on',
'v8_enable_slow_dchecks', 'v8_verify_csa'], 'v8_enable_slow_dchecks', 'v8_verify_csa'],
# Official configs for x86. # Official configs for x86.
@ -664,8 +664,8 @@
'gn_args': 'v8_code_coverage=true', 'gn_args': 'v8_code_coverage=true',
}, },
'dcheck_always_on': { 'v8_dcheck_always_on': {
'gn_args': 'dcheck_always_on=true', 'gn_args': 'v8_dcheck_always_on=true',
}, },
'debug': { 'debug': {
@ -799,7 +799,7 @@
}, },
'release_trybot': { 'release_trybot': {
'mixins': ['release_bot', 'minimal_symbols', 'dcheck_always_on'], 'mixins': ['release_bot', 'minimal_symbols', 'v8_dcheck_always_on'],
}, },
'official': { 'official': {

View File

@ -29,12 +29,12 @@
}], # ALWAYS }], # ALWAYS
############################################################################## ##############################################################################
['mode != debug or dcheck_always_on', { ['mode != debug or v8_dcheck_always_on', {
# Investigating flaky tests: https://crbug.com/v8/10876. Enable only on pure debug. # Investigating flaky tests: https://crbug.com/v8/10876. Enable only on pure debug.
'debugger/pause-on-oom': [SKIP], 'debugger/pause-on-oom': [SKIP],
'debugger/pause-on-oom-wide': [SKIP], 'debugger/pause-on-oom-wide': [SKIP],
'debugger/pause-on-oom-extrawide': [SKIP], 'debugger/pause-on-oom-extrawide': [SKIP],
}], # 'mode != debug or dcheck_always_on' }], # 'mode != debug or v8_dcheck_always_on'
############################################################################## ##############################################################################
['system == android', { ['system == android', {

View File

@ -103,7 +103,7 @@
############################################################################## ##############################################################################
# Tests verifying CHECK and ASSERT. # Tests verifying CHECK and ASSERT.
'verify-check-false': [FAIL, NO_VARIANTS], 'verify-check-false': [FAIL, NO_VARIANTS],
'verify-assert-false': [NO_VARIANTS, ['mode == release and dcheck_always_on == False', PASS], ['mode == debug', FAIL]], 'verify-assert-false': [NO_VARIANTS, ['mode == release and v8_dcheck_always_on == False', PASS], ['mode == debug', FAIL]],
############################################################################## ##############################################################################
# Tests with different versions for release and debug. # Tests with different versions for release and debug.
@ -138,15 +138,15 @@
'regress/regress-655573': [PASS, SLOW], 'regress/regress-655573': [PASS, SLOW],
'regress/regress-1200351': [PASS, SLOW], 'regress/regress-1200351': [PASS, SLOW],
'regress/regress-crbug-808192': [PASS, SLOW, NO_VARIANTS, ['arch not in (ia32, x64)', SKIP], ['tsan', SKIP]], 'regress/regress-crbug-808192': [PASS, SLOW, NO_VARIANTS, ['arch not in (ia32, x64)', SKIP], ['tsan', SKIP]],
'regress/regress-crbug-918301': [PASS, SLOW, NO_VARIANTS, ['mode != release or dcheck_always_on', SKIP], ['(arch == arm or arch == arm64) and simulator_run', SKIP]], 'regress/regress-crbug-918301': [PASS, SLOW, NO_VARIANTS, ['mode != release or v8_dcheck_always_on', SKIP], ['(arch == arm or arch == arm64) and simulator_run', SKIP]],
'regress/wasm/regress-810973': [PASS, SLOW], 'regress/wasm/regress-810973': [PASS, SLOW],
'sealed-array-reduce': [PASS, SLOW], 'sealed-array-reduce': [PASS, SLOW],
'string-replace-gc': [PASS, SLOW], 'string-replace-gc': [PASS, SLOW],
'wasm/embenchen/*': [PASS, SLOW], 'wasm/embenchen/*': [PASS, SLOW],
'wasm/futex': [PASS, SLOW], 'wasm/futex': [PASS, SLOW],
'wasm/unreachable-validation': [PASS, SLOW], 'wasm/unreachable-validation': [PASS, SLOW],
'wasm/atomics-stress': [PASS, SLOW, NO_VARIANTS, ['mode != release or dcheck_always_on', SKIP], ['tsan', SKIP]], 'wasm/atomics-stress': [PASS, SLOW, NO_VARIANTS, ['mode != release or v8_dcheck_always_on', SKIP], ['tsan', SKIP]],
'wasm/atomics64-stress': [PASS, SLOW, NO_VARIANTS, ['mode != release or dcheck_always_on', SKIP], ['tsan', SKIP]], 'wasm/atomics64-stress': [PASS, SLOW, NO_VARIANTS, ['mode != release or v8_dcheck_always_on', SKIP], ['tsan', SKIP]],
'wasm/compare-exchange-stress': [PASS, SLOW, NO_VARIANTS], 'wasm/compare-exchange-stress': [PASS, SLOW, NO_VARIANTS],
'wasm/compare-exchange64-stress': [PASS, SLOW, NO_VARIANTS], 'wasm/compare-exchange64-stress': [PASS, SLOW, NO_VARIANTS],

View File

@ -70,10 +70,10 @@
# Too slow on debug simulators. # Too slow on debug simulators.
'dfg-inline-function-dot-caller': [SKIP], 'dfg-inline-function-dot-caller': [SKIP],
}], # 'mode == debug and simulator_run' }], # 'mode == debug and simulator_run'
['dcheck_always_on == True and (arch == arm or arch == arm64)', { ['v8_dcheck_always_on == True and (arch == arm or arch == arm64)', {
# Doesn't work with gcc 4.6 on arm or arm64 for some reason. # Doesn't work with gcc 4.6 on arm or arm64 for some reason.
'reentrant-caching': [SKIP], 'reentrant-caching': [SKIP],
}], # 'dcheck_always_on == True and (arch == arm or arch == arm64)' }], # 'v8_dcheck_always_on == True and (arch == arm or arch == arm64)'
['arch == mips', { ['arch == mips', {
# Too slow for mips big-endian boards on bots (no FPU). # Too slow for mips big-endian boards on bots (no FPU).
'dfg-int-overflow-in-loop': [SKIP], 'dfg-int-overflow-in-loop': [SKIP],

View File

@ -173,7 +173,7 @@ class BuildConfig(object):
self.control_flow_integrity = build_config['v8_control_flow_integrity'] self.control_flow_integrity = build_config['v8_control_flow_integrity']
self.concurrent_marking = build_config['v8_enable_concurrent_marking'] self.concurrent_marking = build_config['v8_enable_concurrent_marking']
self.single_generation = build_config['v8_enable_single_generation'] self.single_generation = build_config['v8_enable_single_generation']
self.dcheck_always_on = build_config['dcheck_always_on'] self.v8_dcheck_always_on = build_config['v8_dcheck_always_on']
self.gcov_coverage = build_config['is_gcov_coverage'] self.gcov_coverage = build_config['is_gcov_coverage']
self.is_android = build_config['is_android'] self.is_android = build_config['is_android']
self.is_clang = build_config['is_clang'] self.is_clang = build_config['is_clang']
@ -212,8 +212,8 @@ class BuildConfig(object):
detected_options.append('cfi_vptr') detected_options.append('cfi_vptr')
if self.control_flow_integrity: if self.control_flow_integrity:
detected_options.append('control_flow_integrity') detected_options.append('control_flow_integrity')
if self.dcheck_always_on: if self.v8_dcheck_always_on:
detected_options.append('dcheck_always_on') detected_options.append('v8_dcheck_always_on')
if self.gcov_coverage: if self.gcov_coverage:
detected_options.append('gcov_coverage') detected_options.append('gcov_coverage')
if self.msan: if self.msan:
@ -495,7 +495,7 @@ class BaseTestRunner(object):
def _process_default_options(self, options): def _process_default_options(self, options):
if self.build_config.is_debug: if self.build_config.is_debug:
self.mode_options = DEBUG_MODE self.mode_options = DEBUG_MODE
elif self.build_config.dcheck_always_on: elif self.build_config.v8_dcheck_always_on:
self.mode_options = TRY_RELEASE_MODE self.mode_options = TRY_RELEASE_MODE
else: else:
self.mode_options = RELEASE_MODE self.mode_options = RELEASE_MODE
@ -683,7 +683,7 @@ class BaseTestRunner(object):
"control_flow_integrity": self.build_config.control_flow_integrity, "control_flow_integrity": self.build_config.control_flow_integrity,
"concurrent_marking": self.build_config.concurrent_marking, "concurrent_marking": self.build_config.concurrent_marking,
"single_generation": self.build_config.single_generation, "single_generation": self.build_config.single_generation,
"dcheck_always_on": self.build_config.dcheck_always_on, "v8_dcheck_always_on": self.build_config.v8_dcheck_always_on,
"deopt_fuzzer": False, "deopt_fuzzer": False,
"endurance_fuzzer": False, "endurance_fuzzer": False,
"gc_fuzzer": False, "gc_fuzzer": False,

View File

@ -345,7 +345,7 @@ class SystemTest(unittest.TestCase):
""" """
with temp_base() as basedir: with temp_base() as basedir:
override_build_config( override_build_config(
basedir, dcheck_always_on=True, is_asan=True, is_cfi=True, basedir, v8_dcheck_always_on=True, is_asan=True, is_cfi=True,
is_msan=True, is_tsan=True, is_ubsan_vptr=True, target_cpu='x86', is_msan=True, is_tsan=True, is_ubsan_vptr=True, target_cpu='x86',
v8_enable_i18n_support=False, v8_target_cpu='x86', v8_enable_i18n_support=False, v8_target_cpu='x86',
v8_enable_verify_csa=False, v8_enable_lite_mode=False, v8_enable_verify_csa=False, v8_enable_lite_mode=False,
@ -361,7 +361,7 @@ class SystemTest(unittest.TestCase):
'>>> Autodetected:\n' '>>> Autodetected:\n'
'asan\n' 'asan\n'
'cfi_vptr\n' 'cfi_vptr\n'
'dcheck_always_on\n' 'v8_dcheck_always_on\n'
'msan\n' 'msan\n'
'no_i18n\n' 'no_i18n\n'
'tsan\n' 'tsan\n'

View File

@ -1,6 +1,6 @@
{ {
"current_cpu": "x64", "current_cpu": "x64",
"dcheck_always_on": false, "v8_dcheck_always_on": false,
"is_android": false, "is_android": false,
"is_asan": false, "is_asan": false,
"is_cfi": false, "is_cfi": false,

View File

@ -1,6 +1,6 @@
{ {
"current_cpu": "x64", "current_cpu": "x64",
"dcheck_always_on": false, "v8_dcheck_always_on": false,
"is_android": false, "is_android": false,
"is_asan": false, "is_asan": false,
"is_cfi": false, "is_cfi": false,

View File

@ -1,6 +1,6 @@
{ {
"current_cpu": "x64", "current_cpu": "x64",
"dcheck_always_on": false, "v8_dcheck_always_on": false,
"is_android": false, "is_android": false,
"is_asan": false, "is_asan": false,
"is_cfi": false, "is_cfi": false,