Skip to content

Commit 85b4b5d

Browse files
tebbiV8 LUCI CQ
authored andcommitted
[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/+/3695266 Reviewed-by: Clemens Backes <[email protected]> Auto-Submit: Tobias Tebbi <[email protected]> Commit-Queue: Tobias Tebbi <[email protected]> Cr-Commit-Position: refs/heads/main@{#81070}
1 parent eab795f commit 85b4b5d

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/compiler/pipeline.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3659,8 +3659,11 @@ bool PipelineImpl::SelectInstructions(Linkage* linkage) {
36593659

36603660
const RegisterConfiguration* config = RegisterConfiguration::Default();
36613661
std::unique_ptr<const RegisterConfiguration> restricted_config;
3662+
// The mid-tier register allocator keeps values in stack slots for too long.
3663+
// This is incompatible with left-trimming, therefore we cannot enable it for
3664+
// JS functions.
36623665
bool use_mid_tier_register_allocator =
3663-
!CodeKindIsStaticallyCompiled(data->info()->code_kind()) &&
3666+
data->info()->code_kind() == CodeKind::WASM_FUNCTION &&
36643667
(FLAG_turbo_force_mid_tier_regalloc ||
36653668
(FLAG_turbo_use_mid_tier_regalloc_for_huge_functions &&
36663669
data->sequence()->VirtualRegisterCount() >

src/objects/code-kind.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ inline constexpr bool CodeKindIsBaselinedJSFunction(CodeKind kind) {
5757
return kind == CodeKind::BASELINE;
5858
}
5959

60-
inline constexpr bool CodeKindIsStaticallyCompiled(CodeKind kind) {
61-
return kind == CodeKind::BYTECODE_HANDLER || kind == CodeKind::BUILTIN;
62-
}
63-
6460
inline constexpr bool CodeKindIsUnoptimizedJSFunction(CodeKind kind) {
6561
static_assert(static_cast<int>(CodeKind::INTERPRETED_FUNCTION) + 1 ==
6662
static_cast<int>(CodeKind::BASELINE));

0 commit comments

Comments
 (0)