[build] Enable slow-fast-switch feature on a subset of bots

This prefixes the flag to be more uniform with existing flags and makes
it available as a gn argument.

The switch feature is enabled on a subset of bots, the linux64 release
trybot and all sanitizers. Note, this doesn't switch to slow paths -
it just allows to use the runtime flag on those bots.

Bug: v8:7120
Change-Id: I706a7a9bd503c13d5432cac9a13a909f4f32a0a7
Reviewed-on: https://chromium-review.googlesource.com/798412
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49739}
This commit is contained in:
Michael Achenbach 2017-11-30 10:20:19 +01:00 committed by Commit Bot
parent abe77c57df
commit 9095b279fa
5 changed files with 29 additions and 4 deletions

View File

@ -89,6 +89,9 @@ declare_args() {
# Sets -dV8_CONCURRENT_MARKING
v8_enable_concurrent_marking = true
# Sets -dV8_ENABLE_SLOWFAST_SWITCH
v8_enable_slow_fast_switch = ""
# Build the snapshot with unwinding information for perf.
# Sets -dV8_USE_SNAPSHOT_WITH_UNWINDING_INFO.
v8_perf_prof_unwinding_info = false
@ -149,6 +152,9 @@ if (v8_enable_disassembler == "") {
if (v8_enable_trace_maps == "") {
v8_enable_trace_maps = is_debug
}
if (v8_enable_slow_fast_switch == "") {
v8_enable_slow_fast_switch = is_debug
}
if (v8_enable_v8_checks == "") {
v8_enable_v8_checks = is_debug
}
@ -275,6 +281,9 @@ config("features") {
if (v8_enable_trace_feedback_updates) {
defines += [ "V8_TRACE_FEEDBACK_UPDATES" ]
}
if (v8_enable_slow_fast_switch) {
defines += [ "V8_ENABLE_SLOWFAST_SWITCH" ]
}
if (v8_enable_v8_checks) {
defines += [ "V8_ENABLE_CHECKS" ]
}

View File

@ -204,7 +204,7 @@
'v8_linux_gcc_rel': 'gn_release_x86_gcc_minimal_symbols',
'v8_linux_shared_compile_rel': 'gn_release_x86_shared_verify_heap',
'v8_linux64_gcc_compile_dbg': 'gn_debug_x64_gcc',
'v8_linux64_rel_ng': 'gn_release_x64_trybot',
'v8_linux64_rel_ng': 'gn_release_x64_test_features_trybot',
'v8_linux64_verify_csa_rel_ng': 'gn_release_x64_verify_csa',
'v8_linux64_gyp_rel_ng': 'gyp_release_x64',
'v8_linux64_asan_rel_ng': 'gn_release_x64_asan_minimal_symbols',
@ -428,6 +428,8 @@
'gn', 'release_bot', 'x64', 'minimal_symbols', 'swarming'],
'gn_release_x64_trybot': [
'gn', 'release_trybot', 'x64', 'swarming'],
'gn_release_x64_test_features_trybot': [
'gn', 'release_trybot', 'x64', 'swarming', 'v8_enable_slow_fast_switch'],
'gn_release_x64_tsan': [
'gn', 'release_bot', 'x64', 'tsan', 'swarming'],
'gn_release_x64_tsan_concurrent_marking': [
@ -555,6 +557,7 @@
},
'asan': {
'mixins': ['v8_enable_slow_fast_switch'],
'gn_args': 'is_asan=true',
'gyp_defines': 'clang=1 asan=1',
},
@ -565,12 +568,14 @@
},
'cfi': {
'mixins': ['v8_enable_slow_fast_switch'],
'gn_args': ('is_cfi=true use_cfi_cast=true use_cfi_diag=true '
'use_cfi_recover=false'),
'gyp_defines': 'cfi_vptr=1 cfi_diag=1',
},
'cfi_clusterfuzz': {
'mixins': ['v8_enable_slow_fast_switch'],
'gn_args': ('is_cfi=true use_cfi_cast=true use_cfi_diag=true '
'use_cfi_recover=true'),
'gyp_defines': 'cfi_vptr=1 cfi_diag=1',
@ -647,6 +652,7 @@
},
'lsan': {
'mixins': ['v8_enable_slow_fast_switch'],
'gn_args': 'is_lsan=true',
'gyp_defines': 'lsan=1',
},
@ -662,11 +668,13 @@
},
'msan': {
'mixins': ['v8_enable_slow_fast_switch'],
'gn_args': ('is_msan=true msan_track_origins=2 '
'use_prebuilt_instrumented_libraries=true'),
},
'msan_no_origins': {
'mixins': ['v8_enable_slow_fast_switch'],
'gn_args': ('is_msan=true msan_track_origins=0 '
'use_prebuilt_instrumented_libraries=true'),
},
@ -756,11 +764,13 @@
},
'tsan': {
'mixins': ['v8_enable_slow_fast_switch'],
'gn_args': 'is_tsan=true',
'gyp_defines': 'clang=1 tsan=1',
},
'ubsan_vptr': {
'mixins': ['v8_enable_slow_fast_switch'],
# TODO(krasin): Remove is_ubsan_no_recover=true when
# https://llvm.org/bugs/show_bug.cgi?id=25569 is fixed and just use
# ubsan_vptr instead.
@ -768,6 +778,7 @@
},
'ubsan_vptr_recover': {
'mixins': ['v8_enable_slow_fast_switch'],
# Ubsan vptr with recovery.
'gn_args': 'is_ubsan_vptr=true is_ubsan_no_recover=false',
},
@ -782,6 +793,7 @@
},
'v8_correctness_fuzzer': {
'mixins': ['v8_enable_slow_fast_switch'],
'gn_args': 'v8_correctness_fuzzer=true v8_multi_arch_build=true',
},
@ -795,6 +807,10 @@
'gyp_defines': 'v8_enable_slow_dchecks=1',
},
'v8_enable_slow_fast_switch': {
'gn_args': 'v8_enable_slow_fast_switch=true',
},
'v8_enable_verify_predictable': {
'gn_args': 'v8_enable_verify_predictable=true',
'gyp_defines': 'v8_enable_verify_predictable=1',

View File

@ -3273,7 +3273,7 @@ class TypedElementsAccessor
DisallowHeapAllocation no_gc;
DisallowJavascriptExecution no_js(isolate);
#if defined(DEBUG) || defined(ENABLE_SLOWFAST_SWITCH)
#if defined(V8_ENABLE_SLOWFAST_SWITCH)
if (isolate->force_slow_path()) return true;
#endif

View File

@ -2613,7 +2613,7 @@ bool Object::IterationHasObservableEffects() {
JSArray* array = JSArray::cast(this);
Isolate* isolate = array->GetIsolate();
#if defined(DEBUG) || defined(ENABLE_SLOWFAST_SWITCH)
#if defined(V8_ENABLE_SLOWFAST_SWITCH)
if (isolate->force_slow_path()) return true;
#endif

View File

@ -134,7 +134,7 @@ bool RegExpUtils::IsUnmodifiedRegExp(Isolate* isolate, Handle<Object> obj) {
// TODO(ishell): Update this check once map changes for constant field
// tracking are landing.
#if defined(DEBUG) || defined(ENABLE_SLOWFAST_SWITCH)
#if defined(V8_ENABLE_SLOWFAST_SWITCH)
if (isolate->force_slow_path()) return false;
#endif