use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class ObjectTypePublicTest method testIsPublic.
@Test
public void testIsPublic() {
final DynamicObject instance = LAYOUT.createObjectTypePublicTest(14);
assertTrue(ObjectTypePublicTestLayoutImpl.ObjectTypePublicTestType.class.isAssignableFrom(instance.getShape().getObjectType().getClass()));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class ShapePropertiesTest method testObjectGetter.
@Test
public void testObjectGetter() {
final DynamicObjectFactory factory = LAYOUT.createShapePropertiesTestShape(14);
final DynamicObject object = LAYOUT.createShapePropertiesTest(factory, 22);
Assert.assertEquals(14, LAYOUT.getShapeProperty(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class TypesTest method testIntArrayArray.
@Test
public void testIntArrayArray() {
final DynamicObject object = create();
Assert.assertArrayEquals(new int[][] { { 1 }, { 2 } }, LAYOUT.getIaa(object));
LAYOUT.setIaa(object, new int[][] { { 11 }, { 22 } });
Assert.assertArrayEquals(new int[][] { { 11 }, { 22 } }, LAYOUT.getIaa(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class TypesTest method testBigInteger.
@Test
public void testBigInteger() {
final DynamicObject object = create();
Assert.assertEquals(BigInteger.TEN, LAYOUT.getBi(object));
LAYOUT.setBi(object, BigInteger.ONE);
Assert.assertEquals(BigInteger.ONE, LAYOUT.getBi(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class VolatileTest method testSetVolatile.
@Test
public void testSetVolatile() {
final DynamicObject object = LAYOUT.createVolatileTest(14, null);
Assert.assertEquals(14, LAYOUT.getVolatileInt(object));
LAYOUT.setVolatileInt(object, 22);
Assert.assertEquals(22, LAYOUT.getVolatileInt(object));
Assert.assertNull(LAYOUT.getVolatileThread(object));
LAYOUT.setVolatileThread(object, Thread.currentThread());
Assert.assertEquals(Thread.currentThread(), LAYOUT.getVolatileThread(object));
}
Aggregations