Reland "[sparkplug] Enable shorter builtin calls behind --short-builtin-calls"

This is a reland of 5f9f09f4db

Original change's description:
> [sparkplug] Enable shorter builtin calls behind --short-builtin-calls
>
> ... on desktop x64 and arm64 if pointer compression is enabled.
>
> Bug: v8:11527
> Change-Id: Ie23b59312c6db34a5f40e23347b3c4f11173612d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2767222
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#73498}

Bug: v8:11527
Change-Id: I5b5524b6b4b301e4afcc09e4621942b77b56c07d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2772235
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73501}
This commit is contained in:
Igor Sheludko 2021-03-18 09:45:43 +01:00 committed by Commit Bot
parent 310210a368
commit db27ea56ac
3 changed files with 21 additions and 10 deletions

View File

@ -345,10 +345,9 @@ if (v8_enable_heap_sandbox == "") {
v8_enable_heap_sandbox = false
}
if (v8_enable_short_builtin_calls == "") {
v8_enable_short_builtin_calls = false
v8_enable_short_builtin_calls =
v8_current_cpu == "x64" || (!is_android && v8_current_cpu == "arm64")
}
assert(!v8_enable_short_builtin_calls || v8_enable_pointer_compression,
"Short builtin calls feature requires pointer compression")
if (v8_enable_single_generation == "") {
v8_enable_single_generation = v8_disable_write_barriers
}
@ -380,6 +379,10 @@ if (v8_multi_arch_build &&
v8_enable_pointer_compression = !v8_enable_pointer_compression
v8_enable_pointer_compression_shared_cage = v8_enable_pointer_compression
}
if (v8_enable_short_builtin_calls && !v8_enable_pointer_compression) {
# Disable short calls when pointer compression is not enabled.
v8_enable_short_builtin_calls = false
}
if (v8_enable_shared_ro_heap == "") {
v8_enable_shared_ro_heap = !v8_enable_pointer_compression
}

View File

@ -106,9 +106,6 @@ STATIC_ASSERT(V8_DEFAULT_STACK_SIZE_KB* KB +
// and friends.
#error Short builtin calls feature requires pointer compression
#endif
#define V8_SHORT_BUILTIN_CALLS_BOOL true
#else
#define V8_SHORT_BUILTIN_CALLS_BOOL false
#endif
// Determine whether dict mode prototypes feature is enabled.

View File

@ -1535,10 +1535,21 @@ DEFINE_BOOL(adjust_os_scheduling_parameters, true,
"adjust OS specific scheduling params for the isolate")
DEFINE_BOOL(experimental_flush_embedded_blob_icache, false,
"Used in an experiment to evaluate icache flushing on certain CPUs")
DEFINE_BOOL_READONLY(
short_builtin_calls, V8_SHORT_BUILTIN_CALLS_BOOL,
"Put embedded builtins code into the code range for shorter "
"builtin calls/jumps")
// Flags for short builtin calls feature
#undef FLAG
#if V8_SHORT_BUILTIN_CALLS
#define FLAG FLAG_FULL
#else
#define FLAG FLAG_READONLY
#endif
DEFINE_BOOL(short_builtin_calls, false,
"Put embedded builtins code into the code range for shorter "
"builtin calls/jumps")
#undef FLAG
#define FLAG FLAG_FULL
// runtime.cc
DEFINE_BOOL(runtime_call_stats, false, "report runtime call counts and times")