use of org.graalvm.compiler.hotspot.HotSpotLIRGenerator 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 org.graalvm.compiler.hotspot.HotSpotLIRGenerator in project graal by oracle.
the class CurrentJavaThreadNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
Register rawThread = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).getProviders().getRegisters().getThreadRegister();
PlatformKind wordKind = gen.getLIRGeneratorTool().target().arch.getWordKind();
gen.setResult(this, rawThread.asValue(LIRKind.value(wordKind)));
}
use of org.graalvm.compiler.hotspot.HotSpotLIRGenerator in project graal by oracle.
the class BeginLockScopeNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
assert lockDepth != -1;
HotSpotLIRGenerator hsGen = (HotSpotLIRGenerator) gen.getLIRGeneratorTool();
VirtualStackSlot slot = hsGen.getLockSlot(lockDepth);
Value result = gen.getLIRGeneratorTool().emitAddress(slot);
gen.setResult(this, result);
}
use of org.graalvm.compiler.hotspot.HotSpotLIRGenerator in project graal by oracle.
the class InitializeKlassStubCall method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
assert constant != null : "Expected the value to fold: " + value;
Value stringValue = gen.operand(string);
LIRFrameState fs = gen.state(this);
assert fs != null : "Frame state should be set";
assert constant instanceof HotSpotMetaspaceConstant;
Value result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitKlassInitializationAndRetrieval(constant, stringValue, fs);
gen.setResult(this, result);
}
use of org.graalvm.compiler.hotspot.HotSpotLIRGenerator in project graal by oracle.
the class LoadConstantIndirectlyFixedNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
assert constant != null : "Expected the value to fold: " + value;
Value result;
if (constant instanceof HotSpotObjectConstant) {
result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitLoadObjectAddress(constant);
} else if (constant instanceof HotSpotMetaspaceConstant) {
result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitLoadMetaspaceAddress(constant, action);
} else {
throw new PermanentBailoutException("Unsupported constant type: " + constant);
}
gen.setResult(this, result);
}
Aggregations