use of org.graalvm.compiler.lir.gen.LIRGeneratorTool in project graal by oracle.
the class DeoptimizeNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
LIRGeneratorTool tool = gen.getLIRGeneratorTool();
Value actionAndReason = tool.emitJavaConstant(tool.getMetaAccess().encodeDeoptActionAndReason(action, reason, getDebugId()));
Value speculationValue = tool.emitJavaConstant(speculation);
gen.getLIRGeneratorTool().emitDeoptimize(actionAndReason, speculationValue, gen.state(this));
}
use of org.graalvm.compiler.lir.gen.LIRGeneratorTool in project graal by oracle.
the class CompressionNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
boolean nonNull;
if (value.stamp(NodeView.DEFAULT) instanceof AbstractObjectStamp) {
nonNull = StampTool.isPointerNonNull(value.stamp(NodeView.DEFAULT));
} else {
// metaspace pointers are never null
nonNull = true;
}
LIRGeneratorTool tool = gen.getLIRGeneratorTool();
Value result;
switch(op) {
case Compress:
result = tool.emitCompress(gen.operand(value), encoding, nonNull);
break;
case Uncompress:
result = tool.emitUncompress(gen.operand(value), encoding, nonNull);
break;
default:
throw GraalError.shouldNotReachHere();
}
gen.setResult(this, result);
}
use of org.graalvm.compiler.lir.gen.LIRGeneratorTool in project graal by oracle.
the class DynamicCounterNode method generate.
@Override
public void generate(NodeLIRBuilderTool generator) {
LIRGeneratorTool lirGen = generator.getLIRGeneratorTool();
String nameWithContext;
if (isWithContext()) {
nameWithContext = getName() + " @ ";
if (graph().method() != null) {
StackTraceElement stackTraceElement = graph().method().asStackTraceElement(0);
if (stackTraceElement != null) {
nameWithContext += " " + stackTraceElement.toString();
} else {
nameWithContext += graph().method().format("%h.%n");
}
}
if (graph().name != null) {
nameWithContext += " (" + graph().name + ")";
}
} else {
nameWithContext = getName();
}
LIRInstruction counterOp = lirGen.createBenchmarkCounter(nameWithContext, getGroup(), generator.operand(increment));
if (counterOp != null) {
lirGen.append(counterOp);
} else {
throw GraalError.unimplemented("Benchmark counters not enabled or not implemented by the back end.");
}
}
use of org.graalvm.compiler.lir.gen.LIRGeneratorTool in project graal by oracle.
the class ExceptionStateNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
LIRGeneratorTool lirGenTool = gen.getLIRGeneratorTool();
Value returnRegister = lirGenTool.getRegisterConfig().getReturnRegister(getStackKind()).asValue(LIRKind.fromJavaKind(lirGenTool.target().arch, getStackKind()));
lirGenTool.emitIncomingValues(new Value[] { returnRegister });
gen.setResult(this, lirGenTool.emitMove(returnRegister));
}
use of org.graalvm.compiler.lir.gen.LIRGeneratorTool in project graal by oracle.
the class WriteCurrentVMThreadNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
LIRGeneratorTool tool = gen.getLIRGeneratorTool();
SubstrateRegisterConfig registerConfig = (SubstrateRegisterConfig) tool.getRegisterConfig();
gen.getLIRGeneratorTool().emitMove(registerConfig.getThreadRegister().asValue(tool.getLIRKind(FrameAccess.getWordStamp())), gen.operand(value));
}
Aggregations