当前位置: 首页>>代码示例>>Java>>正文


Java StackSlot类代码示例

本文整理汇总了Java中jdk.vm.ci.code.StackSlot的典型用法代码示例。如果您正苦于以下问题:Java StackSlot类的具体用法?Java StackSlot怎么用?Java StackSlot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StackSlot类属于jdk.vm.ci.code包,在下文中一共展示了StackSlot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getStateIdx

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
/**
 * Returns the index to the state arrays in BlockData for a specific location.
 */
private int getStateIdx(Value location) {
    if (isRegister(location)) {
        int regNum = ((RegisterValue) location).getRegister().number;
        if (regNum < numRegs) {
            return eligibleRegs[regNum];
        }
        return -1;
    }
    if (isStackSlot(location)) {
        StackSlot slot = (StackSlot) location;
        Integer index = stackIndices.get(getOffset(slot));
        if (index != null) {
            return index.intValue() + numRegs;
        }
    }
    return -1;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:RedundantMoveElimination.java

示例2: allocateStackSlots

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:SimpleStackSlotAllocator.java

示例3: getOrInitFreeSlots

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
/**
 * @return the list of free stack slots for {@code size}. If there is none a list is
 *         created.
 */
private Deque<StackSlot> getOrInitFreeSlots(SlotSize size) {
    assert size != SlotSize.Illegal;
    Deque<StackSlot> freeList;
    if (freeSlots != null) {
        freeList = freeSlots.get(size);
    } else {
        freeSlots = new EnumMap<>(SlotSize.class);
        freeList = null;
    }
    if (freeList == null) {
        freeList = new ArrayDeque<>();
        freeSlots.put(size, freeList);
    }
    assert freeList != null;
    return freeList;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:LSStackSlotAllocator.java

示例4: HotSpotCompiledCode

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
@SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "caller transfers ownership of `sites`, `targetCode`, `comments`, `methods`, `dataSection`, `dataSectionPatches` and `assumptions`")
public HotSpotCompiledCode(String name, byte[] targetCode, int targetCodeSize, Site[] sites, Assumption[] assumptions, ResolvedJavaMethod[] methods, Comment[] comments, byte[] dataSection,
                int dataSectionAlignment, DataPatch[] dataSectionPatches, boolean isImmutablePIC, int totalFrameSize, StackSlot deoptRescueSlot) {
    this.name = name;
    this.targetCode = targetCode;
    this.targetCodeSize = targetCodeSize;
    this.sites = sites;
    this.assumptions = assumptions;
    this.methods = methods;

    this.comments = comments;
    this.dataSection = dataSection;
    this.dataSectionAlignment = dataSectionAlignment;
    this.dataSectionPatches = dataSectionPatches;
    this.isImmutablePIC = isImmutablePIC;
    this.totalFrameSize = totalFrameSize;
    this.deoptRescueSlot = deoptRescueSlot;

    assert validateFrames();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:HotSpotCompiledCode.java

示例5: emitStore

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
private void emitStore(int op3, Register a, StackSlot ret) {
    Register base;
    if (ret.getRawOffset() < 0) {
        base = SPARC.fp;
    } else {
        base = SPARC.sp;
    }
    int offset = ret.getRawOffset() + SPARC.STACK_BIAS;
    if (isSimm(offset, 13)) {
        // op3 a, [sp+offset]
        emitOp3(0b11, a, op3, base, offset);
    } else {
        assert a != SPARC.g3;
        Register r = SPARC.g3;
        loadLongToRegister(offset, r);
        // op3 a, [sp+g3]
        emitOp3(0b11, a, op3, base, r);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:SPARCTestAssembler.java

示例6: HotSpotCompiledCode

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
public HotSpotCompiledCode(String name, byte[] targetCode, int targetCodeSize, Site[] sites, Assumption[] assumptions, ResolvedJavaMethod[] methods, Comment[] comments, byte[] dataSection,
                int dataSectionAlignment, DataPatch[] dataSectionPatches, boolean isImmutablePIC, int totalFrameSize, StackSlot deoptRescueSlot) {
    this.name = name;
    this.targetCode = targetCode;
    this.targetCodeSize = targetCodeSize;
    this.sites = sites;
    this.assumptions = assumptions;
    this.methods = methods;

    this.comments = comments;
    this.dataSection = dataSection;
    this.dataSectionAlignment = dataSectionAlignment;
    this.dataSectionPatches = dataSectionPatches;
    this.isImmutablePIC = isImmutablePIC;
    this.totalFrameSize = totalFrameSize;
    this.deoptRescueSlot = deoptRescueSlot;

    assert validateFrames();
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:20,代码来源:HotSpotCompiledCode.java

示例7: allocateStackSlots

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
public void allocateStackSlots(FrameMapBuilderTool builder, LIRGenerationResult res) {
    StackSlot[] mapping = new StackSlot[builder.getNumberOfStackSlots()];
    long currentFrameSize = allocatedFramesize.isEnabled() ? builder.getFrameMap().currentFrameSize() : 0;
    for (VirtualStackSlot virtualSlot : builder.getStackSlots()) {
        final StackSlot slot;
        if (virtualSlot instanceof SimpleVirtualStackSlot) {
            slot = mapSimpleVirtualStackSlot(builder, (SimpleVirtualStackSlot) virtualSlot);
            virtualFramesize.add(builder.getFrameMap().spillSlotSize(virtualSlot.getValueKind()));
        } else if (virtualSlot instanceof VirtualStackSlotRange) {
            VirtualStackSlotRange slotRange = (VirtualStackSlotRange) virtualSlot;
            slot = mapVirtualStackSlotRange(builder, slotRange);
            virtualFramesize.add(builder.getFrameMap().spillSlotRangeSize(slotRange.getSlots()));
        } else {
            throw GraalError.shouldNotReachHere("Unknown VirtualStackSlot: " + virtualSlot);
        }
        allocatedSlots.increment();
        mapping[virtualSlot.getId()] = slot;
    }
    updateLIR(res, mapping);
    if (allocatedFramesize.isEnabled()) {
        allocatedFramesize.add(builder.getFrameMap().currentFrameSize() - currentFrameSize);
    }
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:24,代码来源:SimpleStackSlotAllocator.java

示例8: updateLIR

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
@SuppressWarnings("try")
protected void updateLIR(LIRGenerationResult res, StackSlot[] mapping) {
    try (Scope scope = Debug.scope("StackSlotMappingLIR")) {
        ValueProcedure updateProc = (value, mode, flags) -> {
            if (isVirtualStackSlot(value)) {
                StackSlot stackSlot = mapping[asVirtualStackSlot(value).getId()];
                Debug.log("map %s -> %s", value, stackSlot);
                return stackSlot;
            }
            return value;
        };
        for (AbstractBlockBase<?> block : res.getLIR().getControlFlowGraph().getBlocks()) {
            try (Indent indent0 = Debug.logAndIndent("block: %s", block)) {
                for (LIRInstruction inst : res.getLIR().getLIRforBlock(block)) {
                    try (Indent indent1 = Debug.logAndIndent("Inst: %d: %s", inst.id(), inst)) {
                        inst.forEachAlive(updateProc);
                        inst.forEachInput(updateProc);
                        inst.forEachOutput(updateProc);
                        inst.forEachTemp(updateProc);
                        inst.forEachState(updateProc);
                    }
                }
            }
        }
    }
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:27,代码来源:SimpleStackSlotAllocator.java

示例9: emitCode

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
@Override
public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) {
    if (isRegister(result)) {
        const2reg(crb, masm, result, constant);
    } else if (isStackSlot(result)) {
        StackSlot slot = asStackSlot(result);
        const2stack(crb, masm, slot, constant);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:AArch64Move.java

示例10: const2stack

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
private static void const2stack(CompilationResultBuilder crb, AArch64MacroAssembler masm, Value result, JavaConstant constant) {
    try (ScratchRegister addrReg = masm.getScratchRegister()) {
        StackSlot slot = (StackSlot) result;
        AArch64Address resultAddress = loadStackSlotAddress(crb, masm, slot, addrReg.getRegister());
        if (constant.isDefaultForKind() || constant.isNull()) {
            emitStore(crb, masm, (AArch64Kind) result.getPlatformKind(), resultAddress, zr.asValue(LIRKind.combine(result)));
        } else {
            try (ScratchRegister sc = masm.getScratchRegister()) {
                Value scratchRegisterValue = sc.getRegister().asValue(LIRKind.combine(result));
                const2reg(crb, masm, scratchRegisterValue, constant);
                emitStore(crb, masm, (AArch64Kind) result.getPlatformKind(), resultAddress, scratchRegisterValue);
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:AArch64Move.java

示例11: emitCode

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
@Override
public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
    for (int i = 0; i < zappedStack.length; i++) {
        StackSlot slot = zappedStack[i];
        if (slot != null) {
            AMD64Move.const2stack(crb, masm, slot, zapValues[i]);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:AMD64ZapStackOp.java

示例12: offsetForStackSlot

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
@Override
public int offsetForStackSlot(StackSlot slot) {
    // @formatter:off
    assert (!slot.getRawAddFrameSize() && slot.getRawOffset() <  outgoingSize) ||
           (slot.getRawAddFrameSize() && slot.getRawOffset()  <  0 && -slot.getRawOffset() <= spillSize) ||
           (slot.getRawAddFrameSize() && slot.getRawOffset()  >= 0) :
               String.format("RawAddFrameSize: %b RawOffset: 0x%x spillSize: 0x%x outgoingSize: 0x%x", slot.getRawAddFrameSize(), slot.getRawOffset(), spillSize, outgoingSize);
    // @formatter:on
    return super.offsetForStackSlot(slot);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:AMD64FrameMap.java

示例13: allocateRBPSpillSlot

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
/**
 * For non-leaf methods, RBP is preserved in the special stack slot required by the HotSpot
 * runtime for walking/inspecting frames of such methods.
 */
StackSlot allocateRBPSpillSlot() {
    assert spillSize == initialSpillSize : "RBP spill slot must be the first allocated stack slots";
    rbpSpillSlot = allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD));
    assert asStackSlot(rbpSpillSlot).getRawOffset() == -16 : asStackSlot(rbpSpillSlot).getRawOffset();
    return rbpSpillSlot;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:AMD64FrameMap.java

示例14: emitCode

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
@Override
public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
    if (isRegister(result)) {
        const2reg(crb, masm, result, g0, constant, getDelayedControlTransfer());
    } else if (isStackSlot(result)) {
        StackSlot slot = asStackSlot(result);
        const2stack(crb, masm, slot, g0, getDelayedControlTransfer(), constant);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:SPARCMove.java

示例15: offsetForStackSlot

import jdk.vm.ci.code.StackSlot; //导入依赖的package包/类
@Override
public int offsetForStackSlot(StackSlot slot) {
    // @formatter:off
    assert (!slot.getRawAddFrameSize() && slot.getRawOffset() <  outgoingSize + SPARC.REGISTER_SAFE_AREA_SIZE) ||
           (slot.getRawAddFrameSize() && slot.getRawOffset()  <  0 && -slot.getRawOffset() <= spillSize) ||
           (slot.getRawAddFrameSize() && slot.getRawOffset()  >= 0) :
               String.format("RawAddFrameSize: %b RawOffset: 0x%x spillSize: 0x%x outgoingSize: 0x%x", slot.getRawAddFrameSize(), slot.getRawOffset(), spillSize, outgoingSize);
    // @formatter:on
    return super.offsetForStackSlot(slot);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:SPARCFrameMap.java


注:本文中的jdk.vm.ci.code.StackSlot类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。