use of jdk.vm.ci.meta.Value in project graal by oracle.
the class SPARCHotSpotLIRGenerator method emitForeignCall.
@Override
public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState state, Value... args) {
HotSpotForeignCallLinkage hotspotLinkage = (HotSpotForeignCallLinkage) linkage;
Variable result;
LIRFrameState debugInfo = null;
if (hotspotLinkage.needsDebugInfo()) {
debugInfo = state;
assert debugInfo != null || getStub() != null;
}
if (linkage.destroysRegisters() || hotspotLinkage.needsJavaFrameAnchor()) {
HotSpotRegistersProvider registers = getProviders().getRegisters();
Register thread = registers.getThreadRegister();
Value threadTemp = newVariable(LIRKind.value(SPARCKind.XWORD));
Register stackPointer = registers.getStackPointerRegister();
Variable spScratch = newVariable(LIRKind.value(target().arch.getWordKind()));
append(new SPARCHotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread, stackPointer, threadTemp, spScratch));
result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
append(new SPARCHotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaPcOffset(), config.threadJavaFrameAnchorFlagsOffset(), thread, threadTemp));
} else {
result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
}
return result;
}
use of jdk.vm.ci.meta.Value in project graal by oracle.
the class SPARCHotSpotLIRGenerator method emitCompare.
@Override
protected boolean emitCompare(SPARCKind cmpKind, Value a, Value b) {
Value localA = a;
Value localB = b;
if (isConstantValue(a)) {
Constant c = asConstant(a);
if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) {
localA = SPARC.g0.asValue(LIRKind.value(WORD));
} else if (c instanceof HotSpotObjectConstant) {
localA = load(localA);
}
}
if (isConstantValue(b)) {
Constant c = asConstant(b);
if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) {
localB = SPARC.g0.asValue(LIRKind.value(WORD));
} else if (c instanceof HotSpotObjectConstant) {
localB = load(localB);
}
}
return super.emitCompare(cmpKind, localA, localB);
}
use of jdk.vm.ci.meta.Value in project graal by oracle.
the class SPARCHotSpotNodeLIRBuilder method emitIndirectCall.
@Override
protected void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) {
Value metaspaceMethodSrc = operand(((HotSpotIndirectCallTargetNode) callTarget).metaspaceMethod());
AllocatableValue metaspaceMethod = g5.asValue(metaspaceMethodSrc.getValueKind());
gen.emitMove(metaspaceMethod, metaspaceMethodSrc);
Value targetAddressSrc = operand(callTarget.computedAddress());
AllocatableValue targetAddress = o7.asValue(targetAddressSrc.getValueKind());
gen.emitMove(targetAddress, targetAddressSrc);
append(new SPARCIndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethod, targetAddress, callState, getGen().config));
}
use of jdk.vm.ci.meta.Value in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitNullCheck.
@Override
public void emitNullCheck(Value address, LIRFrameState state) {
if (address.getValueKind().getPlatformKind() == getLIRKindTool().getNarrowOopKind().getPlatformKind()) {
CompressEncoding encoding = config.getOopEncoding();
Value uncompressed;
if (encoding.getShift() <= 3) {
LIRKind wordKind = LIRKind.unknownReference(target().arch.getWordKind());
uncompressed = new AMD64AddressValue(wordKind, getProviders().getRegisters().getHeapBaseRegister().asValue(wordKind), asAllocatable(address), Scale.fromInt(1 << encoding.getShift()), 0);
} else {
uncompressed = emitUncompress(address, encoding, false);
}
append(new AMD64Move.NullCheckOp(asAddressValue(uncompressed), state));
return;
}
super.emitNullCheck(address, state);
}
use of jdk.vm.ci.meta.Value in project graal by oracle.
the class AMD64HotSpotNodeLIRBuilder method emitIndirectCall.
@Override
protected void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) {
if (callTarget instanceof HotSpotIndirectCallTargetNode) {
Value metaspaceMethodSrc = operand(((HotSpotIndirectCallTargetNode) callTarget).metaspaceMethod());
Value targetAddressSrc = operand(callTarget.computedAddress());
AllocatableValue metaspaceMethodDst = AMD64.rbx.asValue(metaspaceMethodSrc.getValueKind());
AllocatableValue targetAddressDst = AMD64.rax.asValue(targetAddressSrc.getValueKind());
gen.emitMove(metaspaceMethodDst, metaspaceMethodSrc);
gen.emitMove(targetAddressDst, targetAddressSrc);
append(new AMD64IndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethodDst, targetAddressDst, callState, getGen().config));
} else {
super.emitIndirectCall(callTarget, result, parameters, temps, callState);
}
}
Aggregations