當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。