Remove AllocSpill/FreeSpill
Doesn't work, so we shouldn't maintain it. We can add a feature like this later if we need it (although it might be easier and just as good to just increase the preallocated spill number if needed).
Esse commit está contido em:
@@ -1258,15 +1258,6 @@ D:T = Reload S0:T
|
||||
|
||||
Loads from a spilled temporary S0, and stores the result in D.
|
||||
|
||||
AllocSpill S0:ConstInt
|
||||
|
||||
Allocates S0 slots of additional spill space on the stack.
|
||||
Generated when the preallocated spill space is exhausted.
|
||||
|
||||
FreeSpill S0:ConstInt
|
||||
|
||||
Deallocates S0 slots of spill space on the stack.
|
||||
|
||||
|
||||
16. Continuations & Closures
|
||||
|
||||
|
||||
@@ -2352,28 +2352,6 @@ void CodeGenerator::cgFreeActRec(IRInstruction* inst) {
|
||||
m_regs[inst->getDst()].getReg());
|
||||
}
|
||||
|
||||
void CodeGenerator::cgAllocSpill(IRInstruction* inst) {
|
||||
SSATmp* numSlots = inst->getSrc(0);
|
||||
|
||||
assert(numSlots->isConst());
|
||||
int64_t n = numSlots->getValInt();
|
||||
assert(n >= 0 && n % 2 == 0);
|
||||
if (n > 0) {
|
||||
m_as.sub_imm32_reg64(spillSlotsToSize(n), reg::rsp);
|
||||
}
|
||||
}
|
||||
|
||||
void CodeGenerator::cgFreeSpill(IRInstruction* inst) {
|
||||
SSATmp* numSlots = inst->getSrc(0);
|
||||
|
||||
assert(numSlots->isConst());
|
||||
int64_t n = numSlots->getValInt();
|
||||
assert(n >= 0 && n % 2 == 0);
|
||||
if (n > 0) {
|
||||
m_as.add_imm32_reg64(spillSlotsToSize(n), reg::rsp);
|
||||
}
|
||||
}
|
||||
|
||||
void CodeGenerator::cgSpill(IRInstruction* inst) {
|
||||
SSATmp* dst = inst->getDst();
|
||||
SSATmp* src = inst->getSrc(0);
|
||||
|
||||
@@ -416,8 +416,6 @@ O(InterpOneCF, ND, S(FramePtr) S(StkPtr) \
|
||||
C(Int), T|E|N|Mem|Refs|Er) \
|
||||
O(Spill, DofS(0), SUnk, Mem) \
|
||||
O(Reload, DofS(0), SUnk, Mem) \
|
||||
O(AllocSpill, ND, C(Int), E|Mem) \
|
||||
O(FreeSpill, ND, C(Int), E|Mem) \
|
||||
O(CreateCont, D(Obj), C(TCA) \
|
||||
S(FramePtr) \
|
||||
C(Bool) \
|
||||
|
||||
@@ -146,8 +146,6 @@ private:
|
||||
static SSATmp* getSpilledTmp(SSATmp* tmp);
|
||||
static SSATmp* getOrigTmp(SSATmp* tmp);
|
||||
uint32_t assignSpillLoc();
|
||||
void insertAllocFreeSpill(Trace* trace, uint32_t numExtraSpillLocs);
|
||||
void insertAllocFreeSpillAux(Trace* trace, uint32_t numExtraSpillLocs);
|
||||
void rematerialize();
|
||||
void rematerializeAux();
|
||||
void removeUnusedSpills();
|
||||
@@ -573,47 +571,6 @@ uint32_t LinearScan::assignSpillLoc() {
|
||||
return maxSpillLoc;
|
||||
}
|
||||
|
||||
void LinearScan::insertAllocFreeSpill(Trace* trace,
|
||||
uint32_t numExtraSpillLocs) {
|
||||
insertAllocFreeSpillAux(trace, numExtraSpillLocs);
|
||||
for (Trace* exit : trace->getExitTraces()) {
|
||||
insertAllocFreeSpillAux(exit, numExtraSpillLocs);
|
||||
}
|
||||
}
|
||||
|
||||
void LinearScan::insertAllocFreeSpillAux(Trace* trace,
|
||||
uint32_t numExtraSpillLocs) {
|
||||
SSATmp* tmp = m_irFactory->gen(DefConst, Type::Int,
|
||||
ConstData(numExtraSpillLocs))->getDst();
|
||||
|
||||
for (Block* block : trace->getBlocks()) {
|
||||
for (auto it = block->begin(); it != block->end(); ) {
|
||||
auto next = it; ++next;
|
||||
IRInstruction& inst = *it;
|
||||
Opcode opc = inst.op();
|
||||
if (opc == Call) {
|
||||
// Insert FreeSpill and AllocSpill around each Call.
|
||||
IRInstruction* allocSpill = m_irFactory->gen(AllocSpill, tmp);
|
||||
IRInstruction* freeSpill = m_irFactory->gen(FreeSpill, tmp);
|
||||
block->insert(it, freeSpill);
|
||||
block->insert(next, allocSpill);
|
||||
} else if (opc == ExitTrace || opc == ExitSlow || opc == ExitTraceCc ||
|
||||
opc == ExitSlowNoProgress || opc == ExitGuardFailure ||
|
||||
opc == LdRetAddr) {
|
||||
// Insert FreeSpill at trace exits.
|
||||
IRInstruction* freeSpill = m_irFactory->gen(FreeSpill, tmp);
|
||||
block->insert(it, freeSpill);
|
||||
}
|
||||
it = next;
|
||||
}
|
||||
}
|
||||
|
||||
// Insert AllocSpill at the start of the main trace.
|
||||
if (trace->isMain()) {
|
||||
trace->front()->prepend(m_irFactory->gen(AllocSpill, tmp));
|
||||
}
|
||||
}
|
||||
|
||||
void LinearScan::collectInfo(BlockList::iterator it, Trace* trace) {
|
||||
m_natives.clear();
|
||||
m_jmps.reset();
|
||||
@@ -967,18 +924,7 @@ RegAllocInfo LinearScan::allocRegs(Trace* trace, LifetimeInfo* lifetime) {
|
||||
++numSpillLocs;
|
||||
}
|
||||
if (numSpillLocs > (uint32_t)NumPreAllocatedSpillLocs) {
|
||||
/*
|
||||
* We only insert AllocSpill and FreeSpill when the pre-allocated
|
||||
* spill locations are not enough.
|
||||
*
|
||||
* AllocSpill and FreeSpill take the number of extra spill locations
|
||||
* besides the pre-allocated ones.
|
||||
*
|
||||
* TODO(#2044051) AllocSpill/FreeSpill are currently disabled
|
||||
* due to bugs.
|
||||
*/
|
||||
PUNT(LinearScan_AllocSpill);
|
||||
insertAllocFreeSpill(trace, numSpillLocs - NumPreAllocatedSpillLocs);
|
||||
PUNT(LinearScan_TooManySpills);
|
||||
}
|
||||
|
||||
if (m_slots.size()) genSpillStats(trace, numSpillLocs);
|
||||
|
||||
@@ -195,12 +195,8 @@ RegAllocInfo allocRegsForTrace(Trace*, IRFactory*, LifetimeInfo* = nullptr);
|
||||
// +---------------+
|
||||
// | return addr |
|
||||
// +---------------+
|
||||
// | extra | <-- spill[2]
|
||||
// | spill | <-- spill[1]
|
||||
// | locations | <-- spill[0]
|
||||
// +---------------+ <-- %rsp
|
||||
// If a spill location falls into the pre-allocated region, we
|
||||
// need to increase its index by 1 to avoid overwriting the
|
||||
//
|
||||
// We need to increase spill indexes by 1 to avoid overwriting the
|
||||
// return address.
|
||||
|
||||
/*
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário