use of org.graalvm.compiler.lir.VirtualStackSlot in project graal by oracle.
the class BeginLockScopeNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
assert lockDepth != -1;
HotSpotLIRGenerator hsGen = (HotSpotLIRGenerator) gen.getLIRGeneratorTool();
VirtualStackSlot slot = hsGen.getLockSlot(lockDepth);
Value result = gen.getLIRGeneratorTool().emitAddress(slot);
gen.setResult(this, result);
}
use of org.graalvm.compiler.lir.VirtualStackSlot in project graal by oracle.
the class CurrentLockNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
assert lockDepth != -1;
HotSpotLIRGenerator hsGen = (HotSpotLIRGenerator) gen.getLIRGeneratorTool();
VirtualStackSlot slot = hsGen.getLockSlot(lockDepth);
// The register allocator cannot handle stack -> register moves so we use an LEA here
Value result = gen.getLIRGeneratorTool().emitAddress(slot);
gen.setResult(this, result);
}
use of org.graalvm.compiler.lir.VirtualStackSlot in project graal by oracle.
the class TraceLocalMoveResolver method breakCycle.
protected void breakCycle(int spillCandidate) {
if (spillCandidate != -1) {
// (e.g. r1 . r2, r2 . r1), so one interval must be spilled to memory
assert spillCandidate != -1 : "no interval in register for spilling found";
// create a new spill interval and assign a stack slot to it
TraceInterval fromInterval1 = mappingFrom.get(spillCandidate);
// do not allocate a new spill slot for temporary interval, but
// use spill slot assigned to fromInterval. Otherwise moves from
// one stack slot to another can happen (not allowed by LIRAssembler
AllocatableValue spillSlot1 = fromInterval1.spillSlot();
if (spillSlot1 == null) {
spillSlot1 = getAllocator().getFrameMapBuilder().allocateSpillSlot(allocator.getKind(fromInterval1));
fromInterval1.setSpillSlot(spillSlot1);
cycleBreakingSlotsAllocated.increment(debug);
}
spillInterval(spillCandidate, fromInterval1, spillSlot1);
return;
}
assert mappingFromSize() > 1;
// Arbitrarily select the first entry for spilling.
int stackSpillCandidate = 0;
TraceInterval fromInterval = getMappingFrom(stackSpillCandidate);
// allocate new stack slot
VirtualStackSlot spillSlot = getAllocator().getFrameMapBuilder().allocateSpillSlot(allocator.getKind(fromInterval));
spillInterval(stackSpillCandidate, fromInterval, spillSlot);
}
use of org.graalvm.compiler.lir.VirtualStackSlot in project graal by oracle.
the class StackIntervalDumper method printInterval.
private static void printInterval(StackInterval interval, IntervalVisitor visitor) {
Value hint = interval.locationHint() != null ? interval.locationHint().getOperand() : null;
VirtualStackSlot operand = interval.getOperand();
String type = operand.getValueKind().getPlatformKind().toString();
visitor.visitIntervalStart(operand, operand, interval.location(), hint, type);
// print ranges
visitor.visitRange(interval.from(), interval.to());
// no use positions
visitor.visitIntervalEnd("NOT_SUPPORTED");
}
Aggregations