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


Java DebugInfo类代码示例

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


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

示例1: test

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
protected void test(DebugInfoCompiler compiler, Method method, int bci, JavaKind... slotKinds) {
    ResolvedJavaMethod resolvedMethod = metaAccess.lookupJavaMethod(method);

    int numLocals = resolvedMethod.getMaxLocals();
    int numStack = slotKinds.length - numLocals;
    JavaValue[] values = new JavaValue[slotKinds.length];
    test(asm -> {
        VirtualObject[] vobjs = compiler.compile(asm, values);

        BytecodeFrame frame = new BytecodeFrame(null, resolvedMethod, bci, false, false, values, slotKinds, numLocals, numStack, 0);
        DebugInfo info = new DebugInfo(frame, vobjs);
        info.setReferenceMap(new HotSpotReferenceMap(new Location[0], new Location[0], new int[0], 8));

        asm.emitTrap(info);
    }, method);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:17,代码来源:DebugInfoTest.java

示例2: printLIRInstruction

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
private void printLIRInstruction(LIRInstruction inst) {
    if (inst == null) {
        out.print("nr   -1 ").print(COLUMN_END).print(" instruction ").print("<deleted>").print(COLUMN_END);
        out.println(COLUMN_END);
    } else {
        out.printf("nr %4d ", inst.id()).print(COLUMN_END);

        final StringBuilder stateString = new StringBuilder();
        inst.forEachState(state -> {
            if (state.hasDebugInfo()) {
                DebugInfo di = state.debugInfo();
                stateString.append(debugInfoToString(di.getBytecodePosition(), di.getReferenceMap(), state.getLiveBasePointers(), di.getCalleeSaveInfo()));
            } else {
                stateString.append(debugInfoToString(state.topFrame, null, state.getLiveBasePointers(), null));
            }
        });
        if (stateString.length() > 0) {
            int level = out.indentationLevel();
            out.adjustIndentation(-level);
            out.print(" st ").print(HOVER_START).print("st").print(HOVER_SEP).print(stateString.toString()).print(HOVER_END).print(COLUMN_END);
            out.adjustIndentation(level);
        }

        out.print(" instruction ").print(inst.toString(res)).print(COLUMN_END);
        out.println(COLUMN_END);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:CFGPrinter.java

示例3: appendDebugInfo

import jdk.vm.ci.code.DebugInfo; //导入依赖的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

示例4: emitTrap

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
@Override
public void emitTrap(DebugInfo info) {
    recordImplicitException(info);
    // MOV rax, [0]
    code.emitByte(0x8B);
    code.emitByte(0x04);
    code.emitByte(0x25);
    code.emitInt(0);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:AMD64TestAssembler.java

示例5: printLIRInstruction

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
private void printLIRInstruction(LIRInstruction inst) {
    if (inst == null) {
        out.print("nr   -1 ").print(COLUMN_END).print(" instruction ").print("<deleted>").print(COLUMN_END);
        out.println(COLUMN_END);
    } else {
        out.printf("nr %4d ", inst.id()).print(COLUMN_END);

        final StringBuilder stateString = new StringBuilder();
        inst.forEachState(state -> {
            if (state.hasDebugInfo()) {
                DebugInfo di = state.debugInfo();
                stateString.append(debugInfoToString(di.getBytecodePosition(), di.getReferenceMap(), state.getLiveBasePointers(), di.getCalleeSaveInfo()));
            } else {
                stateString.append(debugInfoToString(state.topFrame, null, state.getLiveBasePointers(), null));
            }
        });
        if (stateString.length() > 0) {
            int level = out.indentationLevel();
            out.adjustIndentation(-level);
            out.print(" st ").print(HOVER_START).print("st").print(HOVER_SEP).print(stateString.toString()).print(HOVER_END).print(COLUMN_END);
            out.adjustIndentation(level);
        }

        out.print(" instruction ").print(inst.toString()).print(COLUMN_END);
        out.println(COLUMN_END);
    }
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:28,代码来源:CFGPrinter.java

示例6: debugInfo

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
public DebugInfo debugInfo() {
    assert debugInfo != null : "debug info not allocated yet";
    return debugInfo;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:LIRFrameState.java

示例7: recordDirectCall

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
public void recordDirectCall(int posBefore, int posAfter, InvokeTarget callTarget, LIRFrameState info) {
    DebugInfo debugInfo = info != null ? info.debugInfo() : null;
    compilationResult.recordCall(posBefore, posAfter - posBefore, callTarget, debugInfo, true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:CompilationResultBuilder.java

示例8: recordIndirectCall

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
public void recordIndirectCall(int posBefore, int posAfter, InvokeTarget callTarget, LIRFrameState info) {
    DebugInfo debugInfo = info != null ? info.debugInfo() : null;
    compilationResult.recordCall(posBefore, posAfter - posBefore, callTarget, debugInfo, false);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:CompilationResultBuilder.java

示例9: recordInfopoint

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
public void recordInfopoint(int pos, LIRFrameState info, InfopointReason reason) {
    // infopoints always need debug info
    DebugInfo debugInfo = info.debugInfo();
    recordInfopoint(pos, debugInfo, reason);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:CompilationResultBuilder.java

示例10: Call

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
public Call(InvokeTarget target, int pcOffset, int size, boolean direct, DebugInfo debugInfo) {
    super(pcOffset, debugInfo, InfopointReason.CALL);
    this.size = size;
    this.target = target;
    this.direct = direct;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:Call.java

示例11: Infopoint

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
public Infopoint(int pcOffset, DebugInfo debugInfo, InfopointReason reason) {
    super(pcOffset);
    this.debugInfo = debugInfo;
    this.reason = reason;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:Infopoint.java

示例12: test

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
private void test(VirtualObject[] vobj, JavaValue[] values, JavaKind[] slotKinds, int locals, int stack, int locks, StackSlot deoptRescueSlot) {
    BytecodeFrame frame = new BytecodeFrame(null, dummyMethod, 0, false, false, values, slotKinds, locals, stack, locks);
    DebugInfo info = new DebugInfo(frame, vobj);
    info.setReferenceMap(new HotSpotReferenceMap(new Location[0], new Location[0], new int[0], 8));
    installEmptyCode(new Site[]{new Infopoint(0, info, InfopointReason.SAFEPOINT)}, new Assumption[0], new Comment[0], 16, new DataPatch[0], deoptRescueSlot);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:TestInvalidDebugInfo.java

示例13: test

import jdk.vm.ci.code.DebugInfo; //导入依赖的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

示例14: test

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
protected void test(DebugInfoCompiler compiler, Method method, int bci, Location[] objects, Location[] derivedBase, int[] sizeInBytes, JavaKind... slotKinds) {
    ResolvedJavaMethod resolvedMethod = metaAccess.lookupJavaMethod(method);

    int numLocals = resolvedMethod.getMaxLocals();
    int numStack = slotKinds.length - numLocals;
    JavaValue[] values = new JavaValue[slotKinds.length];
    test(asm -> {
        /*
         * Ensure that any objects mentioned in the VirtualObjects are also in the OopMap.
         */
        List<Location> newLocations = new ArrayList<Location>(Arrays.asList(objects));
        List<Location> newDerived = new ArrayList<Location>(Arrays.asList(derivedBase));
        int[] newSizeInBytes = sizeInBytes;
        VirtualObject[] vobjs = compiler.compile(asm, values);
        if (vobjs != null) {
            for (VirtualObject obj : vobjs) {
                JavaValue[] objValues = obj.getValues();
                for (int i = 0; i < objValues.length; i++) {
                        if (obj.getSlotKind(i) == JavaKind.Object) {
                                Location oopLocation = null;
                                int bytes = -1;
                                if (objValues[i] instanceof RegisterValue) {
                                        RegisterValue reg = (RegisterValue) objValues[i];
                                        oopLocation = Location.register(reg.getRegister());
                                        bytes = reg.getValueKind().getPlatformKind().getSizeInBytes();
                                } else if (objValues[i] instanceof StackSlot) {
                                        StackSlot slot = (StackSlot) objValues[i];
                                        oopLocation = Location.stack(asm.getOffset(slot));
                                        bytes = slot.getValueKind().getPlatformKind().getSizeInBytes();
                                }
                                if (oopLocation != null && !newLocations.contains(oopLocation)) {
                                        newLocations.add(oopLocation);
                                        newDerived.add(null);
                                        newSizeInBytes = Arrays.copyOf(newSizeInBytes, newSizeInBytes.length + 1);
                                    newSizeInBytes[newSizeInBytes.length - 1] = bytes;
                            }
                    }
                }
            }
        }

        BytecodeFrame frame = new BytecodeFrame(null, resolvedMethod, bci, false, false, values, slotKinds, numLocals, numStack, 0);
        DebugInfo info = new DebugInfo(frame, vobjs);
        info.setReferenceMap(new HotSpotReferenceMap(newLocations.toArray(new Location[0]), newDerived.toArray(new Location[0]), newSizeInBytes, 8));

        asm.emitTrap(info);
    }, method);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:49,代码来源:DebugInfoTest.java

示例15: recordCall

import jdk.vm.ci.code.DebugInfo; //导入依赖的package包/类
protected void recordCall(InvokeTarget target, int size, boolean direct, DebugInfo debugInfo) {
    sites.add(new Call(target, code.position(), size, direct, debugInfo));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:TestAssembler.java


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