use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AArch64HotSpotLIRGenerator method emitCompress.
@Override
public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
LIRKind inputKind = pointer.getValueKind(LIRKind.class);
assert inputKind.getPlatformKind() == AArch64Kind.QWORD;
if (inputKind.isReference(0)) {
// oop
Variable result = newVariable(LIRKind.compressedReference(AArch64Kind.DWORD));
append(new AArch64HotSpotMove.CompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
return result;
} else {
// metaspace pointer
Variable result = newVariable(LIRKind.value(AArch64Kind.DWORD));
AllocatableValue base = Value.ILLEGAL;
if (encoding.hasBase()) {
base = emitLoadConstant(LIRKind.value(AArch64Kind.QWORD), JavaConstant.forLong(encoding.getBase()));
}
append(new AArch64HotSpotMove.CompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
return result;
}
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AArch64HotSpotLIRGenerator method emitReturn.
@Override
public void emitReturn(JavaKind kind, Value input) {
AllocatableValue operand = Value.ILLEGAL;
if (input != null) {
operand = resultOperandFor(kind, input.getValueKind());
emitMove(operand, input);
}
Register thread = getProviders().getRegisters().getThreadRegister();
append(new AArch64HotSpotReturnOp(operand, getStub() != null, config, thread));
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitConstantRetrieval.
private Value emitConstantRetrieval(ForeignCallDescriptor foreignCall, Object[] notes, Constant[] constants, AllocatableValue[] constantDescriptions, LIRFrameState frameState) {
ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(foreignCall);
append(new AMD64HotSpotConstantRetrievalOp(constants, constantDescriptions, frameState, linkage, notes));
AllocatableValue result = linkage.getOutgoingCallingConvention().getReturn();
return emitMove(result);
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitCCall.
@Override
public void emitCCall(long address, CallingConvention nativeCallingConvention, Value[] args, int numberOfFloatingPointArguments) {
Value[] argLocations = new Value[args.length];
getResult().getFrameMapBuilder().callsMethod(nativeCallingConvention);
// TODO(mg): in case a native function uses floating point varargs, the ABI requires that
// RAX contains the length of the varargs
PrimitiveConstant intConst = JavaConstant.forInt(numberOfFloatingPointArguments);
AllocatableValue numberOfFloatingPointArgumentsRegister = AMD64.rax.asValue(LIRKind.value(AMD64Kind.DWORD));
emitMoveConstant(numberOfFloatingPointArgumentsRegister, intConst);
for (int i = 0; i < args.length; i++) {
Value arg = args[i];
AllocatableValue loc = nativeCallingConvention.getArgument(i);
emitMove(loc, arg);
argLocations[i] = loc;
}
Value ptr = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(address));
append(new AMD64CCall(nativeCallingConvention.getReturn(), ptr, numberOfFloatingPointArgumentsRegister, argLocations));
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitUncompress.
@Override
public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
LIRKind inputKind = pointer.getValueKind(LIRKind.class);
LIRKindTool lirKindTool = getLIRKindTool();
assert inputKind.getPlatformKind() == lirKindTool.getNarrowOopKind().getPlatformKind();
if (inputKind.isReference(0)) {
// oop
Variable result = newVariable(lirKindTool.getObjectKind());
append(new AMD64Move.UncompressPointerOp(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull, lirKindTool));
return result;
} else {
// metaspace pointer
LIRKind uncompressedKind = lirKindTool.getWordKind();
Variable result = newVariable(uncompressedKind);
AllocatableValue base = Value.ILLEGAL;
OptionValues options = getResult().getLIR().getOptions();
if (encoding.hasBase() || GeneratePIC.getValue(options)) {
if (GeneratePIC.getValue(options)) {
Variable baseAddress = newVariable(uncompressedKind);
AMD64HotSpotMove.BaseMove move = new AMD64HotSpotMove.BaseMove(baseAddress, config);
append(move);
base = baseAddress;
} else {
base = emitLoadConstant(uncompressedKind, JavaConstant.forLong(encoding.getBase()));
}
}
append(new AMD64Move.UncompressPointerOp(result, asAllocatable(pointer), base, encoding, nonNull, lirKindTool));
return result;
}
}
Aggregations