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);
}
}
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);
}
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));
});
}
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);
}
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);
}
}
Aggregations