use of jdk.vm.ci.meta.MemoryAccessProvider in project graal by oracle.
the class StampMemoryAccessTest method testReadObject.
@Ignore("not all JVMCI versions are safe yet")
@Test
public void testReadObject() {
MemoryAccessProvider memory = getConstantReflection().getMemoryAccessProvider();
JavaConstant base = getSnippetReflection().forObject("");
Stamp stamp = StampFactory.forKind(JavaKind.Object);
assertTrue(stamp.readConstant(memory, base, 128) == null);
}
use of jdk.vm.ci.meta.MemoryAccessProvider in project graal by oracle.
the class StampMemoryAccessTest method testReadPrimitive.
@Ignore("not all JVMCI versions are safe yet")
@Test
public void testReadPrimitive() {
MemoryAccessProvider memory = getConstantReflection().getMemoryAccessProvider();
JavaConstant base = getSnippetReflection().forObject("");
Stamp stamp = StampFactory.forKind(JavaKind.Long);
assertTrue(stamp.readConstant(memory, base, 128) == null);
}
use of jdk.vm.ci.meta.MemoryAccessProvider 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);
}
use of jdk.vm.ci.meta.MemoryAccessProvider in project graal by oracle.
the class HotSpotStampMemoryAccessTest method testReadNarrowObject.
@Ignore("not all versions are safe yet")
@Test
public void testReadNarrowObject() {
CompressEncoding oopEncoding = runtime().getVMConfig().getOopEncoding();
Assume.assumeTrue("Compressed oops must be enabled", runtime().getVMConfig().useCompressedOops);
MemoryAccessProvider memory = getConstantReflection().getMemoryAccessProvider();
JavaConstant base = getSnippetReflection().forObject("");
ObjectStamp stamp = (ObjectStamp) StampFactory.forKind(JavaKind.Object);
Stamp narrowStamp = HotSpotNarrowOopStamp.compressed(stamp, oopEncoding);
assertTrue(narrowStamp.readConstant(memory, base, 128) == null);
}
Aggregations