use of jdk.vm.ci.meta.Value in project graal by oracle.
the class AMD64HotSpotNodeLIRBuilder method emitPrologue.
@Override
protected void emitPrologue(StructuredGraph graph) {
CallingConvention incomingArguments = gen.getResult().getCallingConvention();
Value[] params = new Value[incomingArguments.getArgumentCount() + 1];
for (int i = 0; i < params.length - 1; i++) {
params[i] = incomingArguments.getArgument(i);
if (isStackSlot(params[i])) {
StackSlot slot = ValueUtil.asStackSlot(params[i]);
if (slot.isInCallerFrame() && !gen.getResult().getLIR().hasArgInCallerFrame()) {
gen.getResult().getLIR().setHasArgInCallerFrame();
}
}
}
params[params.length - 1] = rbp.asValue(LIRKind.value(AMD64Kind.QWORD));
gen.emitIncomingValues(params);
getGen().emitSaveRbp();
getGen().append(((HotSpotDebugInfoBuilder) getDebugInfoBuilder()).lockStack());
for (ParameterNode param : graph.getNodes(ParameterNode.TYPE)) {
Value paramValue = params[param.index()];
assert paramValue.getValueKind().equals(getLIRGeneratorTool().getLIRKind(param.stamp(NodeView.DEFAULT))) : paramValue.getValueKind() + " != " + param.stamp(NodeView.DEFAULT);
setResult(param, gen.emitMove(paramValue));
}
}
use of jdk.vm.ci.meta.Value in project graal by oracle.
the class LogicCompareAndSwapNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
assert getNewValue().stamp(NodeView.DEFAULT).isCompatible(getExpectedValue().stamp(NodeView.DEFAULT));
assert !this.canDeoptimize();
LIRGeneratorTool tool = gen.getLIRGeneratorTool();
LIRKind resultKind = tool.getLIRKind(stamp(NodeView.DEFAULT));
Value trueResult = tool.emitConstant(resultKind, JavaConstant.TRUE);
Value falseResult = tool.emitConstant(resultKind, JavaConstant.FALSE);
Value result = tool.emitLogicCompareAndSwap(gen.operand(getAddress()), gen.operand(getExpectedValue()), gen.operand(getNewValue()), trueResult, falseResult);
gen.setResult(this, result);
}
use of jdk.vm.ci.meta.Value in project graal by oracle.
the class AtomicReadAndAddNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
Value result = gen.getLIRGeneratorTool().emitAtomicReadAndAdd(gen.operand(address), gen.operand(delta));
gen.setResult(this, result);
}
use of jdk.vm.ci.meta.Value in project graal by oracle.
the class ResolveConstantStubCall method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
assert constant != null : "Expected the value to fold: " + value;
Value stringValue = gen.operand(string);
Value result;
LIRFrameState fs = gen.state(this);
assert fs != null : "The stateAfter is null";
if (constant instanceof HotSpotObjectConstant) {
result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitObjectConstantRetrieval(constant, stringValue, fs);
} else if (constant instanceof HotSpotMetaspaceConstant) {
if (action == HotSpotConstantLoadAction.RESOLVE) {
result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitMetaspaceConstantRetrieval(constant, stringValue, fs);
} else {
assert action == HotSpotConstantLoadAction.INITIALIZE;
result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitKlassInitializationAndRetrieval(constant, stringValue, fs);
}
} else {
throw new PermanentBailoutException("Unsupported constant type: " + constant);
}
gen.setResult(this, result);
}
use of jdk.vm.ci.meta.Value in project graal by oracle.
the class ResolveDynamicStubCall method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
assert constant != null : "Expected the value to fold: " + value;
Value result;
LIRFrameState fs = gen.state(this);
assert fs != null : "The stateAfter is null";
result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitResolveDynamicInvoke(constant, fs);
gen.setResult(this, result);
}
Aggregations