Search in sources :

Example 1 with VirtualStackSlot

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);
}
Also used : BitSet(java.util.BitSet) Value(jdk.vm.ci.meta.Value) VirtualStackSlot(org.graalvm.compiler.lir.VirtualStackSlot)

Example 2 with VirtualStackSlot

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);
}
Also used : BitSet(java.util.BitSet) Value(jdk.vm.ci.meta.Value) VirtualStackSlot(org.graalvm.compiler.lir.VirtualStackSlot)

Example 3 with VirtualStackSlot

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);
}
Also used : VirtualObject(jdk.vm.ci.code.VirtualObject) JavaValue(jdk.vm.ci.meta.JavaValue) ValueNode(org.graalvm.compiler.nodes.ValueNode) StackLockValue(jdk.vm.ci.code.StackLockValue) VirtualStackSlot(org.graalvm.compiler.lir.VirtualStackSlot)

Example 4 with VirtualStackSlot

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);
}
Also used : BitSet(java.util.BitSet) Value(jdk.vm.ci.meta.Value) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool) VirtualStackSlot(org.graalvm.compiler.lir.VirtualStackSlot)

Example 5 with VirtualStackSlot

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;
}
Also used : ValueUtil.asAllocatableValue(jdk.vm.ci.code.ValueUtil.asAllocatableValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) VirtualStackSlot(org.graalvm.compiler.lir.VirtualStackSlot)

Aggregations

VirtualStackSlot (org.graalvm.compiler.lir.VirtualStackSlot)14 Value (jdk.vm.ci.meta.Value)7 BitSet (java.util.BitSet)4 LIRValueUtil.asVirtualStackSlot (org.graalvm.compiler.lir.LIRValueUtil.asVirtualStackSlot)3 LIRValueUtil.isVirtualStackSlot (org.graalvm.compiler.lir.LIRValueUtil.isVirtualStackSlot)3 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)2 HotSpotLIRGenerator (org.graalvm.compiler.hotspot.HotSpotLIRGenerator)2 AMD64Kind (jdk.vm.ci.amd64.AMD64Kind)1 Register (jdk.vm.ci.code.Register)1 StackLockValue (jdk.vm.ci.code.StackLockValue)1 StackSlot (jdk.vm.ci.code.StackSlot)1 ValueUtil.asAllocatableValue (jdk.vm.ci.code.ValueUtil.asAllocatableValue)1 VirtualObject (jdk.vm.ci.code.VirtualObject)1 JavaValue (jdk.vm.ci.meta.JavaValue)1 DebugContext (org.graalvm.compiler.debug.DebugContext)1 ConstantValue (org.graalvm.compiler.lir.ConstantValue)1 Interval (org.graalvm.compiler.lir.alloc.lsra.Interval)1 AMD64PushPopStackMove (org.graalvm.compiler.lir.amd64.AMD64Move.AMD64PushPopStackMove)1 SimpleVirtualStackSlot (org.graalvm.compiler.lir.framemap.SimpleVirtualStackSlot)1 VirtualStackSlotRange (org.graalvm.compiler.lir.framemap.VirtualStackSlotRange)1