use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitCompress.
@Override
public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
LIRKind inputKind = pointer.getValueKind(LIRKind.class);
LIRKindTool lirKindTool = getLIRKindTool();
assert inputKind.getPlatformKind() == lirKindTool.getObjectKind().getPlatformKind();
if (inputKind.isReference(0)) {
// oop
Variable result = newVariable(lirKindTool.getNarrowOopKind());
append(new AMD64Move.CompressPointerOp(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull, getLIRKindTool()));
return result;
} else {
// metaspace pointer
Variable result = newVariable(lirKindTool.getNarrowPointerKind());
AllocatableValue base = Value.ILLEGAL;
OptionValues options = getResult().getLIR().getOptions();
if (encoding.hasBase() || GeneratePIC.getValue(options)) {
if (GeneratePIC.getValue(options)) {
Variable baseAddress = newVariable(lirKindTool.getWordKind());
AMD64HotSpotMove.BaseMove move = new AMD64HotSpotMove.BaseMove(baseAddress, config);
append(move);
base = baseAddress;
} else {
base = emitLoadConstant(lirKindTool.getWordKind(), JavaConstant.forLong(encoding.getBase()));
}
}
append(new AMD64Move.CompressPointerOp(result, asAllocatable(pointer), base, encoding, nonNull, getLIRKindTool()));
return result;
}
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class FarReturnLoweredNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
LIRGeneratorTool lirGenTool = gen.getLIRGeneratorTool();
AllocatableValue resultOperand = lirGenTool.resultOperandFor(result.getStackKind(), LIRKind.fromJavaKind(lirGenTool.target().arch, result.getStackKind()));
lirGenTool.emitMove(resultOperand, gen.operand(result));
((SubstrateLIRGenerator) lirGenTool).emitFarReturn(resultOperand, gen.operand(sp), gen.operand(ip));
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class HotSpotZapRegistersPhase method run.
@Override
protected void run(TargetDescription target, LIRGenerationResult lirGenRes, PostAllocationOptimizationContext context) {
Stub stub = ((HotSpotLIRGenerationResult) lirGenRes).getStub();
boolean zapRegisters = stub != null && !stub.preservesRegisters();
boolean zapStack = false;
for (AllocatableValue arg : lirGenRes.getCallingConvention().getArguments()) {
if (isStackSlot(arg)) {
zapStack = true;
break;
}
}
if (zapRegisters || zapStack) {
LIR lir = lirGenRes.getLIR();
processLIR(context.diagnosticLirGenTool, (HotSpotLIRGenerationResult) lirGenRes, lir, zapRegisters, zapStack);
}
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class GetObjectAddressNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
AllocatableValue obj = gen.getLIRGeneratorTool().newVariable(LIRKind.unknownReference(gen.getLIRGeneratorTool().target().arch.getWordKind()));
gen.getLIRGeneratorTool().emitMove(obj, gen.operand(object));
gen.setResult(this, obj);
}
use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitShift.
private Variable emitShift(AMD64Shift op, OperandSize size, Value a, Value b) {
Variable result = getLIRGen().newVariable(LIRKind.combine(a, b).changeType(a.getPlatformKind()));
AllocatableValue input = getLIRGen().asAllocatable(a);
if (isJavaConstant(b)) {
JavaConstant c = asJavaConstant(b);
if (c.asLong() == 1) {
getLIRGen().append(new AMD64Unary.MOp(op.m1Op, size, result, input));
} else {
/*
* c is implicitly masked to 5 or 6 bits by the CPU, so casting it to (int) is
* always correct, even without the NumUtil.is32bit() test.
*/
getLIRGen().append(new AMD64Binary.ConstOp(op.miOp, size, result, input, (int) c.asLong()));
}
} else {
getLIRGen().emitMove(RCX_I, b);
getLIRGen().append(new AMD64ShiftOp(op.mcOp, size, result, input, RCX_I));
}
return result;
}
Aggregations