use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitLoadMetaspaceAddress.
@Override
public Value emitLoadMetaspaceAddress(Constant constant, HotSpotConstantLoadAction action) {
HotSpotMetaspaceConstant metaspaceConstant = (HotSpotMetaspaceConstant) constant;
LIRKind kind = metaspaceConstant.isCompressed() ? getLIRKindTool().getNarrowPointerKind() : getLIRKindTool().getWordKind();
Variable result = newVariable(kind);
append(new AMD64HotSpotLoadAddressOp(result, constant, action));
return result;
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitLoadObjectAddress.
@Override
public Value emitLoadObjectAddress(Constant constant) {
HotSpotObjectConstant objectConstant = (HotSpotObjectConstant) constant;
LIRKind kind = objectConstant.isCompressed() ? getLIRKindTool().getNarrowOopKind() : getLIRKindTool().getObjectKind();
Variable result = newVariable(kind);
append(new AMD64HotSpotLoadAddressOp(result, constant, HotSpotConstantLoadAction.RESOLVE));
return result;
}
use of org.graalvm.compiler.core.common.LIRKind 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 org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class AArch64HotSpotLIRGenerator method moveValueToThread.
private void moveValueToThread(Value value, int offset) {
LIRKind wordKind = LIRKind.value(target().arch.getWordKind());
RegisterValue thread = getProviders().getRegisters().getThreadRegister().asValue(wordKind);
final int transferSize = value.getValueKind().getPlatformKind().getSizeInBytes();
AArch64AddressValue address = new AArch64AddressValue(value.getValueKind(), thread, Value.ILLEGAL, offset, transferSize, AddressingMode.IMMEDIATE_SCALED);
append(new StoreOp((AArch64Kind) value.getPlatformKind(), address, loadReg(value), null));
}
use of org.graalvm.compiler.core.common.LIRKind 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;
}
}
Aggregations