use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class VolatileTest method testGetAndSetVolatile.
@Test
public void testGetAndSetVolatile() {
final DynamicObject object = LAYOUT.createVolatileTest(14, null);
Assert.assertEquals(14, LAYOUT.getVolatileInt(object));
Assert.assertEquals(14, LAYOUT.getAndSetVolatileInt(object, 22));
Assert.assertEquals(22, LAYOUT.getVolatileInt(object));
Assert.assertNull(LAYOUT.getVolatileThread(object));
Assert.assertEquals(null, LAYOUT.getAndSetVolatileThread(object, Thread.currentThread()));
Assert.assertEquals(Thread.currentThread(), LAYOUT.getVolatileThread(object));
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class Snippets method inheritanceUse.
void inheritanceUse() {
// BEGIN: inheritanceuse
DynamicObject object = SuperImpl.INSTANCE.createSuper(14, 2);
BaseImpl.INSTANCE.isBase(object);
BaseImpl.INSTANCE.getA(object);
// END: inheritanceuse
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class ObjectTypeTest method objectTypeRespondsToIsArray.
@Test
public void objectTypeRespondsToIsArray() {
final Layout layout = Layout.newLayout().build();
final Shape rootShape = layout.createShape(OBJECT_TYPE);
final DynamicObject obj = rootShape.newInstance();
final boolean is = JavaInteropTest.isArray(obj);
assertFalse("It is not array", is);
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class BasicTest method testSet.
@Test
public void testSet() {
final DynamicObject object = LAYOUT.createBasicTest(14);
LAYOUT.setValue(object, 22);
}
use of com.oracle.truffle.api.object.DynamicObject in project graal by oracle.
the class BasicTest method testCreate.
@Test
public void testCreate() {
final DynamicObject object = LAYOUT.createBasicTest(14);
Assert.assertNotNull(object);
}
Aggregations