private static final class LSStackSlotAllocator.Allocator extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
LSStackSlotAllocator.Allocator.SlotSize |
Modifier and Type | Field and Description |
---|---|
private PriorityQueue<StackInterval> |
active |
(package private) ValueProcedure |
assignSlot |
private FrameMapBuilderTool |
frameMapBuilder |
private EnumMap<LSStackSlotAllocator.Allocator.SlotSize,Deque<StackSlot>> |
freeSlots |
private LIR |
lir |
private int |
maxOpId |
private List<? extends AbstractBlockBase<?>> |
sortedBlocks |
private StackInterval[] |
stackSlotMap |
private PriorityQueue<StackInterval> |
unhandled |
Modifier | Constructor and Description |
---|---|
private |
Allocator(LIR lir,
FrameMapBuilderTool frameMapBuilder) |
Modifier and Type | Method and Description |
---|---|
private StackInterval |
activateNext()
Gets the next unhandled interval and finishes handled intervals.
|
private int |
activePeekId()
Gets the lowest
end position of all active intervals. |
private void |
allocate() |
private void |
allocateSlot(StackInterval current) |
private void |
allocateStackSlots() |
private void |
assignStackSlots(Set<LIRInstruction> usePos) |
private Set<LIRInstruction> |
buildIntervals() |
private void |
dumpIntervals(String label) |
private StackSlot |
findFreeSlot(SimpleVirtualStackSlot slot)
Gets a free stack slot for
slot or null if there is none. |
private void |
finished(StackInterval interval)
Finishes
interval by adding its location to the list of free stack slots. |
private void |
forEachInterval(Consumer<StackInterval> proc) |
private LSStackSlotAllocator.Allocator.SlotSize |
forKind(LIRKind kind) |
private void |
freeSlot(StackSlot slot)
Adds a stack slot to the list of free slots.
|
private StackInterval |
get(VirtualStackSlot stackSlot) |
private Deque<StackSlot> |
getOrInitFreeSlots(LSStackSlotAllocator.Allocator.SlotSize size) |
private Deque<StackSlot> |
getOrNullFreeSlots(LSStackSlotAllocator.Allocator.SlotSize size) |
private int |
maxOpId()
Gets the highest instruction id.
|
private static int |
numberInstructions(LIR lir,
List<? extends AbstractBlockBase<?>> sortedBlocks)
Numbers all instructions in all blocks.
|
private void |
verifyIntervals() |
private final FrameMapBuilderTool frameMapBuilder
private final StackInterval[] stackSlotMap
private final PriorityQueue<StackInterval> unhandled
private final PriorityQueue<StackInterval> active
private final List<? extends AbstractBlockBase<?>> sortedBlocks
private final int maxOpId
private EnumMap<LSStackSlotAllocator.Allocator.SlotSize,Deque<StackSlot>> freeSlots
ValueProcedure assignSlot
private Allocator(LIR lir, FrameMapBuilderTool frameMapBuilder)
private void allocate()
private static int numberInstructions(LIR lir, List<? extends AbstractBlockBase<?>> sortedBlocks)
private Set<LIRInstruction> buildIntervals()
private void verifyIntervals()
private void allocateStackSlots()
private void allocateSlot(StackInterval current)
private LSStackSlotAllocator.Allocator.SlotSize forKind(LIRKind kind)
private Deque<StackSlot> getOrNullFreeSlots(LSStackSlotAllocator.Allocator.SlotSize size)
size
or null
if there is none.private Deque<StackSlot> getOrInitFreeSlots(LSStackSlotAllocator.Allocator.SlotSize size)
size
. If there is none a list is
created.private StackSlot findFreeSlot(SimpleVirtualStackSlot slot)
slot
or null
if there is none.private StackInterval activateNext()
private int activePeekId()
end position
of all active intervals. If there
is none Integer.MAX_VALUE
is returned.private void finished(StackInterval interval)
interval
by adding its location to the list of free stack slots.private void assignStackSlots(Set<LIRInstruction> usePos)
private int maxOpId()
private StackInterval get(VirtualStackSlot stackSlot)
private void forEachInterval(Consumer<StackInterval> proc)
private void dumpIntervals(String label)