Commit 85b4b5d7 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by V8 LUCI CQ

[compiler] only enable MidTierRegisterAllocator for Wasm

The mid-tier register allocator keeps values in stack slots for too
long. This is incompatible with left-trimming, therefore we cannot
enable it for JS functions.

Bug: chromium:1335054
Change-Id: I61ab97d4fbfcbb81319e611a64a6454e050a1d65
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695266Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81070}
parent eab795f3
......@@ -3659,8 +3659,11 @@ bool PipelineImpl::SelectInstructions(Linkage* linkage) {
const RegisterConfiguration* config = RegisterConfiguration::Default();
std::unique_ptr<const RegisterConfiguration> restricted_config;
// The mid-tier register allocator keeps values in stack slots for too long.
// This is incompatible with left-trimming, therefore we cannot enable it for
// JS functions.
bool use_mid_tier_register_allocator =
!CodeKindIsStaticallyCompiled(data->info()->code_kind()) &&
data->info()->code_kind() == CodeKind::WASM_FUNCTION &&
(FLAG_turbo_force_mid_tier_regalloc ||
(FLAG_turbo_use_mid_tier_regalloc_for_huge_functions &&
data->sequence()->VirtualRegisterCount() >
......
......@@ -57,10 +57,6 @@ 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));
......
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