use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class InheritanceTest method testMiddleOperationsOnTop.
@Test
public void testMiddleOperationsOnTop() {
final DynamicObject object = TOP_LAYOUT.createTop(14, "foo", BigInteger.TEN);
Assert.assertEquals(14, MIDDLE_LAYOUT.getA(object));
MIDDLE_LAYOUT.setA(object, 22);
Assert.assertEquals(22, MIDDLE_LAYOUT.getA(object));
Assert.assertEquals("foo", MIDDLE_LAYOUT.getB(object));
MIDDLE_LAYOUT.setB(object, "bar");
Assert.assertEquals("bar", MIDDLE_LAYOUT.getB(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class InheritanceTest method testBaseGuardsOnTop.
@Test
public void testBaseGuardsOnTop() {
final DynamicObject object = TOP_LAYOUT.createTop(14, "foo", BigInteger.TEN);
Assert.assertTrue(BASE_LAYOUT.isBase(object));
Assert.assertTrue(BASE_LAYOUT.isBase((Object) object));
Assert.assertTrue(BASE_LAYOUT.isBase(object.getShape().getObjectType()));
Assert.assertTrue(BASE_LAYOUT.isBase(object));
Assert.assertTrue(BASE_LAYOUT.isBase((Object) object));
Assert.assertTrue(BASE_LAYOUT.isBase(object.getShape().getObjectType()));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class InheritanceTest method testBaseOperationsOnMiddle.
@Test
public void testBaseOperationsOnMiddle() {
final DynamicObject object = MIDDLE_LAYOUT.createMiddle(14, "foo");
Assert.assertEquals(14, BASE_LAYOUT.getA(object));
BASE_LAYOUT.setA(object, 22);
Assert.assertEquals(22, BASE_LAYOUT.getA(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class InheritanceTest method testTopGuardsOnTop.
@Test
public void testTopGuardsOnTop() {
final DynamicObject object = TOP_LAYOUT.createTop(14, "foo", BigInteger.TEN);
Assert.assertTrue(TOP_LAYOUT.isTop(object));
Assert.assertTrue(TOP_LAYOUT.isTop((Object) object));
Assert.assertTrue(TOP_LAYOUT.isTop(object.getShape().getObjectType()));
Assert.assertTrue(TOP_LAYOUT.isTop(object));
Assert.assertTrue(TOP_LAYOUT.isTop((Object) object));
Assert.assertTrue(TOP_LAYOUT.isTop(object.getShape().getObjectType()));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class InheritanceTest method testBase.
@Test
public void testBase() {
final DynamicObject object = BASE_LAYOUT.createBase(14);
Assert.assertEquals(14, BASE_LAYOUT.getA(object));
BASE_LAYOUT.setA(object, 22);
Assert.assertEquals(22, BASE_LAYOUT.getA(object));
}
Aggregations