Search in sources :

Example 6 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.

the class LocationMarker method processInstructionBottomUp.

/**
 * Process all values of an instruction bottom-up, i.e. definitions before usages. Values that
 * start or end at the current operation are not included.
 */
@SuppressWarnings("try")
private void processInstructionBottomUp(LIRInstruction op) {
    DebugContext debug = lir.getDebug();
    try (Indent indent = debug.logAndIndent("handle op %d, %s", op.id(), op)) {
        // kills
        op.visitEachTemp(defConsumer);
        op.visitEachOutput(defConsumer);
        if (frameMap != null && op.destroysCallerSavedRegisters()) {
            for (Register reg : frameMap.getRegisterConfig().getCallerSaveRegisters()) {
                PlatformKind kind = frameMap.getTarget().arch.getLargestStorableKind(reg.getRegisterCategory());
                defConsumer.visitValue(reg.asValue(LIRKind.value(kind)), OperandMode.TEMP, REGISTER_FLAG_SET);
            }
        }
        // gen - values that are considered alive for this state
        op.visitEachAlive(useConsumer);
        op.visitEachState(useConsumer);
        // mark locations
        op.forEachState(stateConsumer);
        // gen
        op.visitEachInput(useConsumer);
    }
}
Also used : Indent(org.graalvm.compiler.debug.Indent) Register(jdk.vm.ci.code.Register) DebugContext(org.graalvm.compiler.debug.DebugContext) PlatformKind(jdk.vm.ci.meta.PlatformKind)

Example 7 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.

the class NodeLIRBuilder method emitCompareBranch.

public void emitCompareBranch(CompareNode compare, LabelRef trueSuccessor, LabelRef falseSuccessor, double trueSuccessorProbability) {
    PlatformKind kind = gen.getLIRKind(compare.getX().stamp(NodeView.DEFAULT)).getPlatformKind();
    gen.emitCompareBranch(kind, operand(compare.getX()), operand(compare.getY()), compare.condition().asCondition(), compare.unorderedIsTrue(), trueSuccessor, falseSuccessor, trueSuccessorProbability);
}
Also used : PlatformKind(jdk.vm.ci.meta.PlatformKind)

Example 8 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.

the class JVMCIInfopointErrorTest method testInvalidShortDerivedOop.

@Test(expected = Error.class)
public void testInvalidShortDerivedOop() {
    test((tool, state, safepoint) -> {
        Variable baseOop = tool.newVariable(LIRKind.fromJavaKind(tool.target().arch, JavaKind.Object));
        tool.append(new ValueDef(baseOop));
        PlatformKind kind = tool.target().arch.getPlatformKind(JavaKind.Short);
        LIRKind lirKind = LIRKind.derivedReference(kind, baseOop, false);
        Variable var = tool.newVariable(lirKind);
        tool.append(new ValueDef(var));
        safepoint.accept(state);
        tool.append(new ValueUse(var));
    });
}
Also used : Variable(org.graalvm.compiler.lir.Variable) PlatformKind(jdk.vm.ci.meta.PlatformKind) LIRKind(org.graalvm.compiler.core.common.LIRKind) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest) Test(org.junit.Test)

Example 9 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.

the class SPARCHotSpotForeignCallsProvider method initialize.

@Override
public void initialize(HotSpotProviders providers, OptionValues options) {
    GraalHotSpotVMConfig config = runtime.getVMConfig();
    TargetDescription target = providers.getCodeCache().getTarget();
    PlatformKind word = target.arch.getWordKind();
    // The calling convention for the exception handler stub is (only?) defined in
    // TemplateInterpreterGenerator::generate_throw_exception()
    // in templateInterpreter_sparc.cpp around line 1925
    RegisterValue outgoingException = o0.asValue(LIRKind.fromJavaKind(target.arch, JavaKind.Object));
    RegisterValue outgoingExceptionPc = o1.asValue(LIRKind.value(word));
    RegisterValue incomingException = i0.asValue(LIRKind.fromJavaKind(target.arch, JavaKind.Object));
    RegisterValue incomingExceptionPc = i1.asValue(LIRKind.value(word));
    CallingConvention outgoingExceptionCc = new CallingConvention(0, ILLEGAL, outgoingException, outgoingExceptionPc);
    CallingConvention incomingExceptionCc = new CallingConvention(0, ILLEGAL, incomingException, incomingExceptionPc);
    register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF_NOFP, outgoingExceptionCc, incomingExceptionCc, NOT_REEXECUTABLE, any()));
    register(new HotSpotForeignCallLinkageImpl(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF_NOFP, outgoingExceptionCc, incomingExceptionCc, NOT_REEXECUTABLE, any()));
    if (config.useCRC32Intrinsics) {
        // This stub does callee saving
        registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, any());
    }
    if (config.useCRC32CIntrinsics) {
        registerForeignCall(UPDATE_BYTES_CRC32C, config.updateBytesCRC32C, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, NOT_REEXECUTABLE, any());
    }
    super.initialize(providers, options);
}
Also used : CallingConvention(jdk.vm.ci.code.CallingConvention) RegisterValue(jdk.vm.ci.code.RegisterValue) HotSpotForeignCallLinkageImpl(org.graalvm.compiler.hotspot.HotSpotForeignCallLinkageImpl) TargetDescription(jdk.vm.ci.code.TargetDescription) PlatformKind(jdk.vm.ci.meta.PlatformKind) GraalHotSpotVMConfig(org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)

Example 10 with PlatformKind

use of jdk.vm.ci.meta.PlatformKind in project graal by oracle.

the class SPARCHotSpotLIRGenerator method emitNullCheck.

@Override
public void emitNullCheck(Value address, LIRFrameState state) {
    PlatformKind kind = address.getPlatformKind();
    if (kind == WORD) {
        CompressEncoding encoding = config.getOopEncoding();
        Value uncompressed = emitUncompress(address, encoding, false);
        append(new NullCheckOp(asAddressValue(uncompressed), state));
    } else {
        super.emitNullCheck(address, state);
    }
}
Also used : NullCheckOp(org.graalvm.compiler.lir.sparc.SPARCMove.NullCheckOp) CompressEncoding(org.graalvm.compiler.core.common.CompressEncoding) LIRValueUtil.isConstantValue(org.graalvm.compiler.lir.LIRValueUtil.isConstantValue) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) SPARCImmediateAddressValue(org.graalvm.compiler.lir.sparc.SPARCImmediateAddressValue) RegisterValue(jdk.vm.ci.code.RegisterValue) SPARCAddressValue(org.graalvm.compiler.lir.sparc.SPARCAddressValue) PlatformKind(jdk.vm.ci.meta.PlatformKind)

Aggregations

PlatformKind (jdk.vm.ci.meta.PlatformKind)20 Register (jdk.vm.ci.code.Register)6 LIRKind (org.graalvm.compiler.core.common.LIRKind)6 RegisterValue (jdk.vm.ci.code.RegisterValue)5 Variable (org.graalvm.compiler.lir.Variable)5 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)4 CallingConvention (jdk.vm.ci.code.CallingConvention)3 TargetDescription (jdk.vm.ci.code.TargetDescription)3 GraalHotSpotVMConfig (org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)3 HotSpotForeignCallLinkageImpl (org.graalvm.compiler.hotspot.HotSpotForeignCallLinkageImpl)3 ValueUtil.asRegister (jdk.vm.ci.code.ValueUtil.asRegister)2 ValueUtil.isRegister (jdk.vm.ci.code.ValueUtil.isRegister)2 JavaConstant (jdk.vm.ci.meta.JavaConstant)2 Value (jdk.vm.ci.meta.Value)2 GraalCompilerTest (org.graalvm.compiler.core.test.GraalCompilerTest)2 NullCheckOp (org.graalvm.compiler.lir.sparc.SPARCMove.NullCheckOp)2 Test (org.junit.Test)2 StackSlot (jdk.vm.ci.code.StackSlot)1 ValueUtil.asAllocatableValue (jdk.vm.ci.code.ValueUtil.asAllocatableValue)1 ValueUtil.isAllocatableValue (jdk.vm.ci.code.ValueUtil.isAllocatableValue)1