[builtins][arm64] Prevent use of mid-tier register allocator for statically compiled code

Always use the top tier register allocator when statically compiling
code as we want the best performance and aren't as concerned about
compile time.

This also avoids a current bug when the mid-tier register allocator
is used with statically compiled code.

Bug: chromium:1299793
Change-Id: I74175d75847d092d1d5373661d536a299a7da1b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3484316
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79400}
This commit is contained in:
George Wort 2022-02-24 17:16:45 +00:00 committed by V8 LUCI CQ
parent cef57b958a
commit 9f0c84b347
2 changed files with 9 additions and 4 deletions

View File

@ -3471,10 +3471,11 @@ bool PipelineImpl::SelectInstructions(Linkage* linkage) {
const RegisterConfiguration* config = RegisterConfiguration::Default();
std::unique_ptr<const RegisterConfiguration> restricted_config;
bool use_mid_tier_register_allocator =
FLAG_turbo_force_mid_tier_regalloc ||
(FLAG_turbo_use_mid_tier_regalloc_for_huge_functions &&
data->sequence()->VirtualRegisterCount() >
kTopTierVirtualRegistersLimit);
!CodeKindIsStaticallyCompiled(data->info()->code_kind()) &&
(FLAG_turbo_force_mid_tier_regalloc ||
(FLAG_turbo_use_mid_tier_regalloc_for_huge_functions &&
data->sequence()->VirtualRegisterCount() >
kTopTierVirtualRegistersLimit));
if (call_descriptor->HasRestrictedAllocatableRegisters()) {
RegList registers = call_descriptor->AllocatableRegisters();

View File

@ -57,6 +57,10 @@ inline constexpr bool CodeKindIsBaselinedJSFunction(CodeKind kind) {
return kind == CodeKind::BASELINE;
}
inline constexpr bool CodeKindIsStaticallyCompiled(CodeKind kind) {
return kind == CodeKind::BYTECODE_HANDLER || kind == CodeKind::BUILTIN;
}
inline constexpr bool CodeKindIsUnoptimizedJSFunction(CodeKind kind) {
STATIC_ASSERT(static_cast<int>(CodeKind::INTERPRETED_FUNCTION) + 1 ==
static_cast<int>(CodeKind::BASELINE));