Commit c83651ef authored by Victor Gomes's avatar Victor Gomes Committed by V8 LUCI CQ

[bazel] Add v8_enable_short_builtin_calls flag

No-Try: True
Change-Id: I14986d7eb1e24faef2d6d4f1decde613b2454f1f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3535788Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79529}
parent 6b690a6b
......@@ -44,7 +44,6 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression
# v8_enable_builtins_profiling
# v8_enable_builtins_profiling_verbose
# v8_builtins_profiling_log_file
# v8_enable_short_builtin_calls
# v8_enable_external_code_space
# v8_postmortem_support
# v8_use_siphash
......@@ -231,6 +230,62 @@ selects.config_setting_group(
],
)
# We use a string flag to create a 3 value-logic.
# If no explicit value for v8_enable_short_builtin_calls, we set it to 'none'.
v8_string(
name = "v8_enable_short_builtin_calls",
default = "none",
)
# Default setting for v8_enable_pointer_compression.
config_setting(
name = "v8_enable_short_builtin_calls_is_none",
flag_values = {
":v8_enable_short_builtin_calls": "none",
},
)
# Explicity defined v8_enable_pointer_compression.
config_setting(
name = "v8_enable_short_builtin_calls_is_true",
flag_values = {
":v8_enable_short_builtin_calls": "True",
},
)
# Default setting for v8_enable_short_builtin_calls when target is x64.
# Disable short calls when pointer compression is not enabled.
selects.config_setting_group(
name = "v8_target_x64_default_short_builtin_calls",
match_all = [
":v8_enable_short_builtin_calls_is_none",
"@v8//bazel/config:v8_target_x64",
":is_v8_enable_pointer_compression",
],
)
# Default setting for v8_enable_short_builtin_calls when target is arm64, but not Android.
selects.config_setting_group(
name = "v8_target_arm64_default_short_builtin_calls",
match_all = [
":v8_enable_short_builtin_calls_is_none",
"@v8//bazel/config:v8_target_arm64",
"@v8//bazel/config:is_not_android",
],
)
# v8_enable_short_builtin_calls is valid whenever it is explicitly defined
# or we have the default settings for targets x64 and arm64.
# TODO(victorgomes): v8_enable_short_builtin_calls should not be enabled when CFI is enabled.
selects.config_setting_group(
name = "is_v8_enable_short_builtin_calls",
match_any = [
":v8_enable_short_builtin_calls_is_true",
":v8_target_x64_default_short_builtin_calls",
":v8_target_arm64_default_short_builtin_calls",
],
)
# Enable -rdynamic.
selects.config_setting_group(
name = "should_add_rdynamic",
......@@ -339,6 +394,11 @@ v8_config(
"V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE",
],
"//conditions:default": [],
}) + select({
":is_v8_enable_short_builtin_calls": [
"V8_SHORT_BUILTIN_CALLS",
],
"//conditions:default": [],
}) + select({
":is_v8_enable_test_features": [
"V8_ENABLE_ALLOCATION_TIMEOUT",
......
......@@ -177,6 +177,15 @@ selects.config_setting_group(
],
)
selects.config_setting_group(
name = "is_not_android",
match_any = [
":is_windows",
":is_linux",
":is_macos",
]
)
selects.config_setting_group(
name = "is_non_android_posix",
match_any = [
......
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