[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: Victor Gomes <victorgomes@chromium.org> Commit-Queue: Victor Gomes <victorgomes@chromium.org> Cr-Commit-Position: refs/heads/main@{#79737}
This commit is contained in:
parent
1f0d7d2072
commit
f6a23fb87d
@ -314,12 +314,6 @@ void StraightForwardRegisterAllocator::UpdateUse(
|
|||||||
|
|
||||||
// If a value is dead, make sure it's cleared.
|
// If a value is dead, make sure it's cleared.
|
||||||
FreeRegisters(node);
|
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(
|
void StraightForwardRegisterAllocator::UpdateUse(
|
||||||
@ -632,13 +626,7 @@ void StraightForwardRegisterAllocator::SpillAndClearRegisters() {
|
|||||||
|
|
||||||
void StraightForwardRegisterAllocator::AllocateSpillSlot(ValueNode* node) {
|
void StraightForwardRegisterAllocator::AllocateSpillSlot(ValueNode* node) {
|
||||||
DCHECK(!node->is_spilled());
|
DCHECK(!node->is_spilled());
|
||||||
uint32_t free_slot;
|
uint32_t free_slot = top_of_stack_++;
|
||||||
if (free_slots_.empty()) {
|
|
||||||
free_slot = top_of_stack_++;
|
|
||||||
} else {
|
|
||||||
free_slot = free_slots_.back();
|
|
||||||
free_slots_.pop_back();
|
|
||||||
}
|
|
||||||
node->Spill(compiler::AllocatedOperand(compiler::AllocatedOperand::STACK_SLOT,
|
node->Spill(compiler::AllocatedOperand(compiler::AllocatedOperand::STACK_SLOT,
|
||||||
MachineRepresentation::kTagged,
|
MachineRepresentation::kTagged,
|
||||||
free_slot));
|
free_slot));
|
||||||
|
@ -33,7 +33,6 @@ class StraightForwardRegisterAllocator {
|
|||||||
|
|
||||||
int top_of_stack_ = 0;
|
int top_of_stack_ = 0;
|
||||||
RegList free_registers_ = kAllocatableGeneralRegisters;
|
RegList free_registers_ = kAllocatableGeneralRegisters;
|
||||||
std::vector<uint32_t> free_slots_;
|
|
||||||
|
|
||||||
RegList used_registers() const {
|
RegList used_registers() const {
|
||||||
// Only allocatable registers should be free.
|
// Only allocatable registers should be free.
|
||||||
|
Loading…
Reference in New Issue
Block a user