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


Java ReferenceMap类代码示例

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


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

示例1: appendDebugInfo

import jdk.vm.ci.code.ReferenceMap; //导入依赖的package包/类
protected static void appendDebugInfo(StringBuilder sb, DebugInfo info) {
    if (info != null) {
        ReferenceMap refMap = info.getReferenceMap();
        if (refMap != null) {
            sb.append(refMap.toString());
            sb.append(']');
        }
        RegisterSaveLayout calleeSaveInfo = info.getCalleeSaveInfo();
        if (calleeSaveInfo != null) {
            sb.append(" callee-save-info[");
            String sep = "";
            for (Map.Entry<Register, Integer> e : calleeSaveInfo.registersToSlots(true).entrySet()) {
                sb.append(sep).append(e.getKey()).append("->").append(e.getValue());
                sep = ", ";
            }
            sb.append(']');
        }
        BytecodePosition codePos = info.getBytecodePosition();
        if (codePos != null) {
            MetaUtil.appendLocation(sb.append(" "), codePos.getMethod(), codePos.getBCI());
            if (info.hasFrame()) {
                sb.append(" #locals=").append(info.frame().numLocals).append(" #expr=").append(info.frame().numStack);
                if (info.frame().numLocks > 0) {
                    sb.append(" #locks=").append(info.frame().numLocks);
                }
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:Infopoint.java

示例2: debugInfoToString

import jdk.vm.ci.code.ReferenceMap; //导入依赖的package包/类
/**
 * Formats given debug info as a multi line string.
 */
protected String debugInfoToString(BytecodePosition codePos, ReferenceMap refMap, IndexedValueMap liveBasePointers, RegisterSaveLayout calleeSaveInfo) {
    StringBuilder sb = new StringBuilder();
    if (refMap != null) {
        sb.append("reference-map: ");
        sb.append(refMap.toString());
        sb.append("\n");
    }
    if (liveBasePointers != null) {
        sb.append("live-base-pointers: ");
        sb.append(liveBasePointers);
        sb.append("\n");
    }

    if (calleeSaveInfo != null) {
        sb.append("callee-save-info:");
        for (Map.Entry<Register, Integer> e : calleeSaveInfo.registersToSlots(true).entrySet()) {
            sb.append(" " + e.getKey() + " -> s" + e.getValue());
        }
        sb.append("\n");
    }

    if (codePos != null) {
        BytecodePosition curCodePos = codePos;
        List<VirtualObject> virtualObjects = new ArrayList<>();
        do {
            sb.append(MetaUtil.toLocation(curCodePos.getMethod(), curCodePos.getBCI()));
            sb.append('\n');
            if (curCodePos instanceof BytecodeFrame) {
                BytecodeFrame frame = (BytecodeFrame) curCodePos;
                if (frame.numStack > 0) {
                    sb.append("stack: ");
                    for (int i = 0; i < frame.numStack; i++) {
                        sb.append(valueToString(frame.getStackValue(i), virtualObjects)).append(' ');
                    }
                    sb.append("\n");
                }
                sb.append("locals: ");
                for (int i = 0; i < frame.numLocals; i++) {
                    sb.append(valueToString(frame.getLocalValue(i), virtualObjects)).append(' ');
                }
                sb.append("\n");
                if (frame.numLocks > 0) {
                    sb.append("locks: ");
                    for (int i = 0; i < frame.numLocks; ++i) {
                        sb.append(valueToString(frame.getLockValue(i), virtualObjects)).append(' ');
                    }
                    sb.append("\n");
                }

            }
            curCodePos = curCodePos.getCaller();
        } while (curCodePos != null);

        for (int i = 0; i < virtualObjects.size(); i++) {
            VirtualObject obj = virtualObjects.get(i);
            sb.append(obj).append(" ").append(obj.getType().getName()).append(" ");
            for (int j = 0; j < obj.getValues().length; j++) {
                sb.append(valueToString(obj.getValues()[j], virtualObjects)).append(' ');
            }
            sb.append("\n");

        }
    }
    return sb.toString();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:69,代码来源:CompilationPrinter.java

示例3: finish

import jdk.vm.ci.code.ReferenceMap; //导入依赖的package包/类
@Override
public ReferenceMap finish(LIRFrameState state) {
    Location[] objects;
    Location[] derivedBase;
    int[] sizeInBytes;
    if (objectCount == 0) {
        objects = NO_LOCATIONS;
        derivedBase = NO_LOCATIONS;
        sizeInBytes = NO_SIZES;
    } else {
        objects = new Location[objectCount];
        derivedBase = new Location[objectCount];
        sizeInBytes = new int[objectCount];
    }
    int idx = 0;
    for (Value obj : objectValues) {
        LIRKind kind = (LIRKind) obj.getValueKind();
        int bytes = bytesPerElement(kind);
        if (kind.isUnknownReference()) {
            throw GraalError.shouldNotReachHere(String.format("unknown reference alive across safepoint: %s", obj));
        } else {
            Location base = null;
            if (kind.isDerivedReference()) {
                Variable baseVariable = (Variable) kind.getDerivedReferenceBase();
                Value baseValue = state.getLiveBasePointers().get(baseVariable.index);
                assert baseValue.getPlatformKind().getVectorLength() == 1 && ((LIRKind) baseValue.getValueKind()).isReference(0) && !((LIRKind) baseValue.getValueKind()).isDerivedReference();
                base = toLocation(baseValue, 0);
            }

            for (int i = 0; i < kind.getPlatformKind().getVectorLength(); i++) {
                if (kind.isReference(i)) {
                    objects[idx] = toLocation(obj, i * bytes);
                    derivedBase[idx] = base;
                    sizeInBytes[idx] = bytes;
                    idx++;
                }
            }
        }
    }

    return new HotSpotReferenceMap(objects, derivedBase, sizeInBytes, maxRegisterSize);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:43,代码来源:HotSpotReferenceMapBuilder.java

示例4: test

import jdk.vm.ci.code.ReferenceMap; //导入依赖的package包/类
private void test(ReferenceMap refMap) {
    BytecodePosition pos = new BytecodePosition(null, dummyMethod, 0);
    DebugInfo info = new DebugInfo(pos);
    info.setReferenceMap(refMap);
    installEmptyCode(new Site[]{new Infopoint(0, info, InfopointReason.SAFEPOINT)}, new Assumption[0], new Comment[0], 16, new DataPatch[0], StackSlot.get(null, 0, true));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:TestInvalidOopMap.java

示例5: finish

import jdk.vm.ci.code.ReferenceMap; //导入依赖的package包/类
public abstract ReferenceMap finish(LIRFrameState state); 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:2,代码来源:ReferenceMapBuilder.java


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