use of jdk.vm.ci.meta.AllocatableValue 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);
}
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class WordCastNode method generate.
@Override
public void generate(NodeLIRBuilderTool generator) {
Value value = generator.operand(input);
ValueKind<?> kind = generator.getLIRGeneratorTool().getLIRKind(stamp(NodeView.DEFAULT));
assert kind.getPlatformKind().getSizeInBytes() == value.getPlatformKind().getSizeInBytes();
if (trackedPointer && LIRKind.isValue(kind) && !LIRKind.isValue(value)) {
// just change the PlatformKind, but don't drop reference information
kind = value.getValueKind().changeType(kind.getPlatformKind());
}
if (kind.equals(value.getValueKind()) && !(value instanceof ConstantValue)) {
generator.setResult(this, value);
} else {
AllocatableValue result = generator.getLIRGeneratorTool().newVariable(kind);
generator.getLIRGeneratorTool().emitMove(result, value);
generator.setResult(this, result);
}
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AArch64HotSpotLIRGenerator method emitUncompress.
@Override
public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
LIRKind inputKind = pointer.getValueKind(LIRKind.class);
assert inputKind.getPlatformKind() == AArch64Kind.DWORD;
if (inputKind.isReference(0)) {
// oop
Variable result = newVariable(LIRKind.reference(AArch64Kind.QWORD));
append(new AArch64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
return result;
} else {
// metaspace pointer
Variable result = newVariable(LIRKind.value(AArch64Kind.QWORD));
AllocatableValue base = Value.ILLEGAL;
if (encoding.hasBase()) {
base = emitLoadConstant(LIRKind.value(AArch64Kind.QWORD), JavaConstant.forLong(encoding.getBase()));
}
append(new AArch64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
return result;
}
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AArch64HotSpotLIRGenerator method emitCCall.
@Override
public void emitCCall(long address, CallingConvention nativeCallingConvention, Value[] args) {
Value[] argLocations = new Value[args.length];
getResult().getFrameMapBuilder().callsMethod(nativeCallingConvention);
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(AArch64Kind.QWORD), JavaConstant.forLong(address));
append(new AArch64CCall(nativeCallingConvention.getReturn(), ptr, argLocations));
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AArch64HotSpotNodeLIRBuilder method emitIndirectCall.
@Override
protected void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) {
Value metaspaceMethodSrc = operand(((HotSpotIndirectCallTargetNode) callTarget).metaspaceMethod());
Value targetAddressSrc = operand(callTarget.computedAddress());
AllocatableValue metaspaceMethodDst = metaspaceMethodRegister.asValue(metaspaceMethodSrc.getValueKind());
AllocatableValue targetAddressDst = inlineCacheRegister.asValue(targetAddressSrc.getValueKind());
gen.emitMove(metaspaceMethodDst, metaspaceMethodSrc);
gen.emitMove(targetAddressDst, targetAddressSrc);
append(new AArch64IndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethodDst, targetAddressDst, callState, getGen().config));
}
Aggregations