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


Java Architecture类代码示例

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


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

示例1: verifyEncoding

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
/**
 * Verification code that checks that the decoding of an encode graph is the same as the
 * original graph.
 */
@SuppressWarnings("try")
public static boolean verifyEncoding(StructuredGraph originalGraph, EncodedGraph encodedGraph, Architecture architecture) {
    DebugContext debug = originalGraph.getDebug();
    StructuredGraph decodedGraph = new StructuredGraph.Builder(originalGraph.getOptions(), debug, AllowAssumptions.YES).method(originalGraph.method()).build();
    GraphDecoder decoder = new GraphDecoder(architecture, decodedGraph);
    decoder.decode(encodedGraph);

    decodedGraph.verify();
    try {
        GraphComparison.verifyGraphsEqual(originalGraph, decodedGraph);
    } catch (Throwable ex) {
        originalGraph.getDebug();
        try (DebugContext.Scope scope = debug.scope("GraphEncoder")) {
            debug.dump(DebugContext.VERBOSE_LEVEL, originalGraph, "Original Graph");
            debug.dump(DebugContext.VERBOSE_LEVEL, decodedGraph, "Decoded Graph");
        }
        throw ex;
    }
    return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:GraphEncoder.java

示例2: TraceGlobalMoveResolver

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
public TraceGlobalMoveResolver(LIRGenerationResult res, MoveFactory spillMoveFactory, RegisterAllocationConfig registerAllocationConfig, Architecture arch) {

        this.mappingFrom = new ArrayList<>(8);
        this.mappingFromStack = new ArrayList<>(8);
        this.mappingTo = new ArrayList<>(8);
        this.insertIdx = -1;
        this.insertionBuffer = new LIRInsertionBuffer();

        this.frameMapBuilder = res.getFrameMapBuilder();
        this.spillMoveFactory = spillMoveFactory;
        this.registerBlocked = new int[arch.getRegisters().size()];
        this.registerAllocationConfig = registerAllocationConfig;

        FrameMapBuilderTool frameMapBuilderTool = (FrameMapBuilderTool) frameMapBuilder;
        this.stackBlocked = new int[frameMapBuilderTool.getNumberOfStackSlots()];

        FrameMap frameMap = frameMapBuilderTool.getFrameMap();
        this.firstVirtualStackIndex = !frameMap.frameNeedsAllocating() ? 0 : frameMap.currentFrameSize() + 1;
        this.res = res;
        LIR lir = res.getLIR();
        this.options = lir.getOptions();
        this.debug = lir.getDebug();
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:TraceGlobalMoveResolver.java

示例3: saveAtEntry

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
private static RegisterMap<Variable> saveAtEntry(LIR lir, LIRGeneratorTool lirGen, LIRGenerationResult lirGenRes, RegisterArray calleeSaveRegisters, Architecture arch) {
    AbstractBlockBase<?> startBlock = lir.getControlFlowGraph().getStartBlock();
    ArrayList<LIRInstruction> instructions = lir.getLIRforBlock(startBlock);
    int insertionIndex = 1;
    LIRInsertionBuffer buffer = new LIRInsertionBuffer();
    buffer.init(instructions);
    StandardOp.LabelOp entry = (StandardOp.LabelOp) instructions.get(insertionIndex - 1);
    RegisterValue[] savedRegisterValues = new RegisterValue[calleeSaveRegisters.size()];
    int savedRegisterValueIndex = 0;
    RegisterMap<Variable> saveMap = new RegisterMap<>(arch);
    for (Register register : calleeSaveRegisters) {
        PlatformKind registerPlatformKind = arch.getLargestStorableKind(register.getRegisterCategory());
        LIRKind lirKind = LIRKind.value(registerPlatformKind);
        RegisterValue registerValue = register.asValue(lirKind);
        Variable saveVariable = lirGen.newVariable(lirKind);
        LIRInstruction save = lirGen.getSpillMoveFactory().createMove(saveVariable, registerValue);
        buffer.append(insertionIndex, save);
        save.setComment(lirGenRes, "SaveCalleeSavedRegisters: saveAtEntry");
        saveMap.put(register, saveVariable);
        savedRegisterValues[savedRegisterValueIndex++] = registerValue;
    }
    entry.addIncomingValues(savedRegisterValues);
    buffer.finish();
    return saveMap;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:SaveCalleeSaveRegisters.java

示例4: initAllocatable

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
private static RegisterArray initAllocatable(Architecture arch, boolean reserveForHeapBase) {
    RegisterArray allRegisters = arch.getAvailableValueRegisters();
    Register[] registers = new Register[allRegisters.size() - reservedRegisters.size() - (reserveForHeapBase ? 1 : 0)];
    List<Register> reservedRegistersList = reservedRegisters.asList();

    int idx = 0;
    for (Register reg : allRegisters) {
        if (reservedRegistersList.contains(reg)) {
            // skip reserved registers
            continue;
        }
        assert !(reg.equals(threadRegister) || reg.equals(fp) || reg.equals(lr) || reg.equals(r31) || reg.equals(zr) || reg.equals(sp));
        if (reserveForHeapBase && reg.equals(heapBaseRegister)) {
            // skip heap base register
            continue;
        }

        registers[idx++] = reg;
    }

    assert idx == registers.length;
    return new RegisterArray(registers);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:AArch64HotSpotRegisterConfig.java

示例5: initAllocatable

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
private static RegisterArray initAllocatable(Architecture arch, boolean reserveForHeapBase) {
    RegisterArray allRegisters = arch.getAvailableValueRegisters();
    Register[] registers = new Register[allRegisters.size() - reservedRegisters.size() - (reserveForHeapBase ? 1 : 0)];
    List<Register> reservedRegistersList = reservedRegisters.asList();

    int idx = 0;
    for (Register reg : allRegisters) {
        if (reservedRegistersList.contains(reg)) {
            // skip reserved registers
            continue;
        }
        if (reserveForHeapBase && reg.equals(r12)) {
            // skip heap base register
            continue;
        }

        registers[idx++] = reg;
    }

    assert idx == registers.length;
    return new RegisterArray(registers);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:AMD64HotSpotRegisterConfig.java

示例6: initAllocatable

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
private static RegisterArray initAllocatable(Architecture arch, boolean reserveForHeapBase) {
    RegisterArray allRegisters = arch.getAvailableValueRegisters();
    Register[] registers = new Register[allRegisters.size() - reservedRegisters.size() - (reserveForHeapBase ? 1 : 0)];
    List<Register> reservedRegistersList = reservedRegisters.asList();

    int idx = 0;
    for (Register reg : allRegisters) {
        if (reservedRegistersList.contains(reg)) {
            // skip reserved registers
            continue;
        }
        if (reserveForHeapBase && reg.equals(g6)) {
            // skip heap base register
            continue;
        }

        registers[idx++] = reg;
    }

    assert idx == registers.length;
    return new RegisterArray(registers);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:SPARCHotSpotRegisterConfig.java

示例7: initAllocatable

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
private static Register[] initAllocatable(Architecture arch, boolean reserveForHeapBase) {
    Register[] allRegisters = arch.getAvailableValueRegisters();
    Register[] registers = new Register[allRegisters.length - reservedRegisters.length - (reserveForHeapBase ? 1 : 0)];
    List<Register> reservedRegistersList = Arrays.asList(reservedRegisters);

    int idx = 0;
    for (Register reg : allRegisters) {
        if (reservedRegistersList.contains(reg)) {
            // skip reserved registers
            continue;
        }
        assert !(reg.equals(threadRegister) || reg.equals(fp) || reg.equals(lr) || reg.equals(r31) || reg.equals(zr) || reg.equals(sp));
        if (reserveForHeapBase && reg.equals(heapBaseRegister)) {
            // skip heap base register
            continue;
        }

        registers[idx++] = reg;
    }

    assert idx == registers.length;
    return registers;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:24,代码来源:AArch64HotSpotRegisterConfig.java

示例8: initAllocatable

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
private static Register[] initAllocatable(Architecture arch, boolean reserveForHeapBase) {
    Register[] allRegisters = arch.getAvailableValueRegisters();
    Register[] registers = new Register[allRegisters.length - reservedRegisters.length - (reserveForHeapBase ? 1 : 0)];
    List<Register> reservedRegistersList = Arrays.asList(reservedRegisters);

    int idx = 0;
    for (Register reg : allRegisters) {
        if (reservedRegistersList.contains(reg)) {
            // skip reserved registers
            continue;
        }
        if (reserveForHeapBase && reg.equals(r12)) {
            // skip heap base register
            continue;
        }

        registers[idx++] = reg;
    }

    assert idx == registers.length;
    return registers;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:23,代码来源:AMD64HotSpotRegisterConfig.java

示例9: AMD64HotSpotRegisterConfig

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
public AMD64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config, Register[] allocatable) {
    this.architecture = architecture;
    this.maxFrameSize = config.maxFrameSize;

    if (config.windowsOs) {
        javaGeneralParameterRegisters = new Register[]{rdx, r8, r9, rdi, rsi, rcx};
        nativeGeneralParameterRegisters = new Register[]{rcx, rdx, r8, r9};
        this.needsNativeStackHomeSpace = true;
    } else {
        javaGeneralParameterRegisters = new Register[]{rsi, rdx, rcx, r8, r9, rdi};
        nativeGeneralParameterRegisters = new Register[]{rdi, rsi, rdx, rcx, r8, r9};
        this.needsNativeStackHomeSpace = false;
    }

    this.allocatable = allocatable;
    Set<Register> callerSaveSet = new HashSet<>();
    Collections.addAll(callerSaveSet, allocatable);
    Collections.addAll(callerSaveSet, xmmParameterRegisters);
    Collections.addAll(callerSaveSet, javaGeneralParameterRegisters);
    Collections.addAll(callerSaveSet, nativeGeneralParameterRegisters);
    callerSaved = callerSaveSet.toArray(new Register[callerSaveSet.size()]);

    allAllocatableAreCallerSaved = true;
    attributesMap = RegisterAttributes.createMap(this, architecture.getRegisters());
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:26,代码来源:AMD64HotSpotRegisterConfig.java

示例10: initAllocatable

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
private static Register[] initAllocatable(Architecture arch, boolean reserveForHeapBase) {
    Register[] allRegisters = arch.getAvailableValueRegisters();
    Register[] registers = new Register[allRegisters.length - reservedRegisters.length - (reserveForHeapBase ? 1 : 0)];
    List<Register> reservedRegistersList = Arrays.asList(reservedRegisters);

    int idx = 0;
    for (Register reg : allRegisters) {
        if (reservedRegistersList.contains(reg)) {
            // skip reserved registers
            continue;
        }
        if (reserveForHeapBase && reg.equals(g6)) {
            // skip heap base register
            continue;
        }

        registers[idx++] = reg;
    }

    assert idx == registers.length;
    return registers;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:23,代码来源:SPARCHotSpotRegisterConfig.java

示例11: PartialEvaluator

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
public PartialEvaluator(Providers providers, GraphBuilderConfiguration configForRoot, SnippetReflectionProvider snippetReflection, Architecture architecture,
                InstrumentPhase.Instrumentation instrumentation) {
    this.providers = providers;
    this.architecture = architecture;
    this.canonicalizer = new CanonicalizerPhase();
    this.snippetReflection = snippetReflection;
    this.callDirectMethod = providers.getMetaAccess().lookupJavaMethod(OptimizedCallTarget.getCallDirectMethod());
    this.callInlinedMethod = providers.getMetaAccess().lookupJavaMethod(OptimizedCallTarget.getCallInlinedMethod());
    this.callSiteProxyMethod = providers.getMetaAccess().lookupJavaMethod(GraalFrameInstance.CALL_NODE_METHOD);
    this.instrumentation = instrumentation;

    try {
        callRootMethod = providers.getMetaAccess().lookupJavaMethod(OptimizedCallTarget.class.getDeclaredMethod("callRoot", Object[].class));
    } catch (NoSuchMethodException ex) {
        throw new RuntimeException(ex);
    }

    this.configForParsing = createGraphBuilderConfig(configForRoot, true);
    this.decodingInvocationPlugins = createDecodingInvocationPlugins(configForRoot.getPlugins());
    this.nodePlugins = createNodePlugins(configForRoot.getPlugins());
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:22,代码来源:PartialEvaluator.java

示例12: verifyEncoding

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
/**
 * Verification code that checks that the decoding of an encode graph is the same as the
 * original graph.
 */
@SuppressWarnings("try")
public static boolean verifyEncoding(StructuredGraph originalGraph, EncodedGraph encodedGraph, Architecture architecture) {
    StructuredGraph decodedGraph = new StructuredGraph.Builder(originalGraph.getOptions(), AllowAssumptions.YES).method(originalGraph.method()).build();
    GraphDecoder decoder = new GraphDecoder(architecture, decodedGraph);
    decoder.decode(encodedGraph);

    decodedGraph.verify();
    try {
        GraphComparison.verifyGraphsEqual(originalGraph, decodedGraph);
    } catch (Throwable ex) {
        try (Debug.Scope scope = Debug.scope("GraphEncoder")) {
            Debug.dump(Debug.VERBOSE_LEVEL, originalGraph, "Original Graph");
            Debug.dump(Debug.VERBOSE_LEVEL, decodedGraph, "Decoded Graph");
        }
        throw ex;
    }
    return true;
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:23,代码来源:GraphEncoder.java

示例13: TraceGlobalMoveResolver

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
public TraceGlobalMoveResolver(LIRGenerationResult res, MoveFactory spillMoveFactory, Architecture arch) {

        this.mappingFrom = new ArrayList<>(8);
        this.mappingFromStack = new ArrayList<>(8);
        this.mappingTo = new ArrayList<>(8);
        this.insertIdx = -1;
        this.insertionBuffer = new LIRInsertionBuffer();

        this.frameMapBuilder = res.getFrameMapBuilder();
        this.spillMoveFactory = spillMoveFactory;
        this.registerBlocked = new int[arch.getRegisters().size()];

        FrameMapBuilderTool frameMapBuilderTool = (FrameMapBuilderTool) frameMapBuilder;
        this.stackBlocked = new int[frameMapBuilderTool.getNumberOfStackSlots()];

        FrameMap frameMap = frameMapBuilderTool.getFrameMap();
        this.firstVirtualStackIndex = !frameMap.frameNeedsAllocating() ? 0 : frameMap.currentFrameSize() + 1;
        this.options = res.getLIR().getOptions();
    }
 
开发者ID:graalvm,项目名称:graal-core,代码行数:20,代码来源:TraceGlobalMoveResolver.java

示例14: saveAtEntry

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
private static RegisterMap<Variable> saveAtEntry(LIR lir, LIRGeneratorTool lirGen, RegisterArray calleeSaveRegisters, Architecture arch) {
    AbstractBlockBase<?> startBlock = lir.getControlFlowGraph().getStartBlock();
    ArrayList<LIRInstruction> instructions = lir.getLIRforBlock(startBlock);
    int insertionIndex = 1;
    LIRInsertionBuffer buffer = new LIRInsertionBuffer();
    buffer.init(instructions);
    StandardOp.LabelOp entry = (StandardOp.LabelOp) instructions.get(insertionIndex - 1);
    RegisterValue[] savedRegisterValues = new RegisterValue[calleeSaveRegisters.size()];
    int savedRegisterValueIndex = 0;
    RegisterMap<Variable> saveMap = new RegisterMap<>(arch);
    for (Register register : calleeSaveRegisters) {
        PlatformKind registerPlatformKind = arch.getLargestStorableKind(register.getRegisterCategory());
        LIRKind lirKind = LIRKind.value(registerPlatformKind);
        RegisterValue registerValue = register.asValue(lirKind);
        Variable saveVariable = lirGen.newVariable(lirKind);
        LIRInstruction save = lirGen.getSpillMoveFactory().createMove(saveVariable, registerValue);
        buffer.append(insertionIndex, save);
        saveMap.put(register, saveVariable);
        savedRegisterValues[savedRegisterValueIndex++] = registerValue;
    }
    entry.addIncomingValues(savedRegisterValues);
    buffer.finish();
    return saveMap;
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:25,代码来源:SaveCalleeSaveRegisters.java

示例15: getELFMacroAssembler

import jdk.vm.ci.code.Architecture; //导入依赖的package包/类
public static ELFMacroAssembler getELFMacroAssembler(TargetDescription target) {
    Architecture architecture = target.arch;
    if (architecture instanceof AMD64) {
        return new AMD64ELFMacroAssembler(target);
    } else {
        throw new InternalError("Unsupported architecture " + architecture);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:ELFMacroAssembler.java


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