use of org.graalvm.compiler.hotspot.GraalHotSpotVMConfig in project graal by oracle.
the class DefaultHotSpotLoweringProvider method lowerHubGetClassNode.
private void lowerHubGetClassNode(HubGetClassNode n, LoweringTool tool) {
if (tool.getLoweringStage() == LoweringTool.StandardLoweringStage.HIGH_TIER) {
return;
}
ValueNode hub = n.getHub();
GraalHotSpotVMConfig vmConfig = runtime.getVMConfig();
StructuredGraph graph = n.graph();
assert !hub.isConstant() || GraalOptions.ImmutableCode.getValue(graph.getOptions());
AddressNode mirrorAddress = createOffsetAddress(graph, hub, vmConfig.classMirrorOffset);
FloatingReadNode read = graph.unique(new FloatingReadNode(mirrorAddress, CLASS_MIRROR_LOCATION, null, vmConfig.classMirrorIsHandle ? StampFactory.forKind(target.wordJavaKind) : n.stamp(NodeView.DEFAULT), null, BarrierType.NONE));
if (vmConfig.classMirrorIsHandle) {
AddressNode address = createOffsetAddress(graph, read, 0);
read = graph.unique(new FloatingReadNode(address, CLASS_MIRROR_HANDLE_LOCATION, null, n.stamp(NodeView.DEFAULT), null, BarrierType.NONE));
}
n.replaceAtUsagesAndDelete(read);
}
use of org.graalvm.compiler.hotspot.GraalHotSpotVMConfig in project graal by oracle.
the class HotSpotResolvedJavaFieldTest method jvmFieldModifiers.
/**
* Same as {@code HotSpotModifiers.jvmFieldModifiers()} but works when using a JVMCI version
* prior to the introduction of that method.
*/
private int jvmFieldModifiers() {
GraalHotSpotVMConfig config = runtime().getVMConfig();
int accEnum = config.getConstant("JVM_ACC_ENUM", Integer.class, 0x4000);
int accSynthetic = config.getConstant("JVM_ACC_SYNTHETIC", Integer.class, 0x1000);
return PUBLIC | PRIVATE | PROTECTED | STATIC | FINAL | VOLATILE | TRANSIENT | accEnum | accSynthetic;
}
use of org.graalvm.compiler.hotspot.GraalHotSpotVMConfig in project graal by oracle.
the class HotSpotResolvedObjectTypeTest method testKlassLayoutHelper.
@Test
public void testKlassLayoutHelper() {
Constant klass = HotSpotResolvedObjectType.fromObjectClass(this.getClass()).klass();
MemoryAccessProvider memoryAccess = getProviders().getConstantReflection().getMemoryAccessProvider();
GraalHotSpotVMConfig config = runtime().getVMConfig();
Constant c = StampFactory.forKind(JavaKind.Int).readConstant(memoryAccess, klass, config.klassLayoutHelperOffset);
assertTrue(c.toString(), c.getClass() == PrimitiveConstant.class);
PrimitiveConstant pc = (PrimitiveConstant) c;
assertTrue(pc.toString(), pc.getJavaKind() == JavaKind.Int);
}
Aggregations