use of org.graalvm.compiler.lir.framemap.SimpleVirtualStackSlot in project graal by oracle.
the class SimpleStackSlotAllocator method allocateStackSlots.
public void allocateStackSlots(FrameMapBuilderTool builder, LIRGenerationResult res) {
DebugContext debug = res.getLIR().getDebug();
StackSlot[] mapping = new StackSlot[builder.getNumberOfStackSlots()];
boolean allocatedFramesizeEnabled = allocatedFramesize.isEnabled(debug);
long currentFrameSize = allocatedFramesizeEnabled ? builder.getFrameMap().currentFrameSize() : 0;
for (VirtualStackSlot virtualSlot : builder.getStackSlots()) {
final StackSlot slot;
if (virtualSlot instanceof SimpleVirtualStackSlot) {
slot = mapSimpleVirtualStackSlot(builder, (SimpleVirtualStackSlot) virtualSlot);
virtualFramesize.add(debug, builder.getFrameMap().spillSlotSize(virtualSlot.getValueKind()));
} else if (virtualSlot instanceof VirtualStackSlotRange) {
VirtualStackSlotRange slotRange = (VirtualStackSlotRange) virtualSlot;
slot = mapVirtualStackSlotRange(builder, slotRange);
virtualFramesize.add(debug, builder.getFrameMap().spillSlotRangeSize(slotRange.getSlots()));
} else {
throw GraalError.shouldNotReachHere("Unknown VirtualStackSlot: " + virtualSlot);
}
allocatedSlots.increment(debug);
mapping[virtualSlot.getId()] = slot;
}
updateLIR(res, mapping);
if (allocatedFramesizeEnabled) {
allocatedFramesize.add(debug, builder.getFrameMap().currentFrameSize() - currentFrameSize);
}
}
Aggregations