Commit f6a23fb8 authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[maglev] Disable stack-slot reuse

It doesn't take into account stack-slot liveness at time of spill, so
it can cause false sharing.

Bug: v8:7700
Change-Id: Ib8a00d00d857fad40f14fce1d1496fea071e334f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568465
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79737}
parent 1f0d7d20
......@@ -314,12 +314,6 @@ void StraightForwardRegisterAllocator::UpdateUse(
// If a value is dead, make sure it's cleared.
FreeRegisters(node);
// If the stack slot is a local slot, free it so it can be reused.
if (node->is_spilled()) {
compiler::AllocatedOperand slot = node->spill_slot();
if (slot.index() > 0) free_slots_.push_back(slot.index());
}
}
void StraightForwardRegisterAllocator::UpdateUse(
......@@ -632,13 +626,7 @@ void StraightForwardRegisterAllocator::SpillAndClearRegisters() {
void StraightForwardRegisterAllocator::AllocateSpillSlot(ValueNode* node) {
DCHECK(!node->is_spilled());
uint32_t free_slot;
if (free_slots_.empty()) {
free_slot = top_of_stack_++;
} else {
free_slot = free_slots_.back();
free_slots_.pop_back();
}
uint32_t free_slot = top_of_stack_++;
node->Spill(compiler::AllocatedOperand(compiler::AllocatedOperand::STACK_SLOT,
MachineRepresentation::kTagged,
free_slot));
......
......@@ -33,7 +33,6 @@ class StraightForwardRegisterAllocator {
int top_of_stack_ = 0;
RegList free_registers_ = kAllocatableGeneralRegisters;
std::vector<uint32_t> free_slots_;
RegList used_registers() const {
// Only allocatable registers should be free.
......
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