use of org.graalvm.compiler.lir.VirtualStackSlot in project graal by oracle.
the class MonitorCounterNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
assert graph().getNodes().filter(MonitorCounterNode.class).count() == 1 : "monitor counters not canonicalized to single instance";
VirtualStackSlot counter = gen.getLIRGeneratorTool().getResult().getFrameMapBuilder().allocateStackSlots(1, new BitSet(0), null);
Value result = gen.getLIRGeneratorTool().emitAddress(counter);
gen.setResult(this, result);
}
use of org.graalvm.compiler.lir.VirtualStackSlot in project graal by oracle.
the class DimensionsNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
int size = rank.asJavaConstant().asInt() * 4;
int wordSize = gen.getLIRGeneratorTool().target().wordSize;
int slots = roundUp(size, wordSize) / wordSize;
VirtualStackSlot array = gen.getLIRGeneratorTool().getResult().getFrameMapBuilder().allocateStackSlots(slots, new BitSet(0), null);
Value result = gen.getLIRGeneratorTool().emitAddress(array);
gen.setResult(this, result);
}
use of org.graalvm.compiler.lir.VirtualStackSlot in project graal by oracle.
the class HotSpotDebugInfoBuilder method computeLockValue.
@Override
protected JavaValue computeLockValue(FrameState state, int lockIndex) {
int lockDepth = lockIndex;
if (state.outerFrameState() != null) {
lockDepth += state.outerFrameState().nestedLockDepth();
}
VirtualStackSlot slot = lockStack.makeLockSlot(lockDepth);
ValueNode lock = state.lockAt(lockIndex);
JavaValue object = toJavaValue(lock);
boolean eliminated = object instanceof VirtualObject || state.monitorIdAt(lockIndex).isEliminated();
assert state.monitorIdAt(lockIndex).getLockDepth() == lockDepth;
return new StackLockValue(object, slot, eliminated);
}
use of org.graalvm.compiler.lir.VirtualStackSlot in project graal by oracle.
the class DimensionsNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
LIRGeneratorTool lirGen = gen.getLIRGeneratorTool();
int size = rank * 4;
int wordSize = lirGen.target().wordSize;
int slots = roundUp(size, wordSize) / wordSize;
VirtualStackSlot array = lirGen.getResult().getFrameMapBuilder().allocateStackSlots(slots, new BitSet(0), null);
Value result = lirGen.emitAddress(array);
gen.setResult(this, result);
}
use of org.graalvm.compiler.lir.VirtualStackSlot in project graal by oracle.
the class BottomUpAllocator method allocateSpillSlot.
/**
* Returns a new spill slot or a cached entry if there is already one for the variable.
*/
private AllocatableValue allocateSpillSlot(Variable var) {
int variableIndex = var.index;
AllocatableValue cachedStackSlot = stackSlots[variableIndex];
if (cachedStackSlot != null) {
TraceRegisterAllocationPhase.globalStackSlots.increment(debug);
assert cachedStackSlot.getValueKind().equals(var.getValueKind()) : "CachedStackSlot: kind mismatch? " + var.getValueKind() + " vs. " + cachedStackSlot.getValueKind();
return cachedStackSlot;
}
VirtualStackSlot slot = lirGenRes.getFrameMapBuilder().allocateSpillSlot(var.getValueKind());
stackSlots[variableIndex] = slot;
TraceRegisterAllocationPhase.allocatedStackSlots.increment(debug);
return slot;
}
Aggregations