use of com.oracle.truffle.api.object.DynamicObjectFactory in project graal by oracle.
the class InheritedShapePropertiesTest method testTop.
@Test
public void testTop() {
final DynamicObjectFactory factory = TOP_LAYOUT.createInheritedShapeTopShape(14, 2);
final DynamicObject object = TOP_LAYOUT.createInheritedShapeTop(factory);
Assert.assertEquals(14, TOP_LAYOUT.getA(object));
Assert.assertEquals(2, TOP_LAYOUT.getB(object));
}
use of com.oracle.truffle.api.object.DynamicObjectFactory in project graal by oracle.
the class InheritedShapePropertiesTest method testBase.
@Test
public void testBase() {
final DynamicObjectFactory factory = BASE_LAYOUT.createInheritedShapeBaseShape(14);
final DynamicObject object = BASE_LAYOUT.createInheritedShapeBase(factory);
Assert.assertEquals(14, BASE_LAYOUT.getA(object));
}
use of com.oracle.truffle.api.object.DynamicObjectFactory in project graal by oracle.
the class ShapePropertiesTest method testObjectSetter.
@Test
public void testObjectSetter() {
final DynamicObjectFactory factory = LAYOUT.createShapePropertiesTestShape(14);
final DynamicObject object = LAYOUT.createShapePropertiesTest(factory, 22);
Assert.assertEquals(14, LAYOUT.getShapeProperty(object));
LAYOUT.setShapeProperty(object, 44);
Assert.assertEquals(44, LAYOUT.getShapeProperty(object));
final DynamicObject newObject = LAYOUT.createShapePropertiesTest(factory, 22);
Assert.assertEquals(14, LAYOUT.getShapeProperty(newObject));
}
use of com.oracle.truffle.api.object.DynamicObjectFactory in project graal by oracle.
the class ShapePropertiesTest method testObjectTypeGetter.
@Test
public void testObjectTypeGetter() {
final DynamicObjectFactory factory = LAYOUT.createShapePropertiesTestShape(14);
final DynamicObject object = LAYOUT.createShapePropertiesTest(factory, 22);
Assert.assertEquals(14, LAYOUT.getShapeProperty(object.getShape().getObjectType()));
}
use of com.oracle.truffle.api.object.DynamicObjectFactory in project graal by oracle.
the class ShapePropertiesTest method testFactorySetter.
@Test
public void testFactorySetter() {
final DynamicObjectFactory factory = LAYOUT.createShapePropertiesTestShape(14);
Assert.assertEquals(14, LAYOUT.getShapeProperty(factory));
final DynamicObject object = LAYOUT.createShapePropertiesTest(factory, 22);
Assert.assertEquals(14, LAYOUT.getShapeProperty(object));
final DynamicObjectFactory newFactory = LAYOUT.setShapeProperty(factory, 44);
Assert.assertEquals(44, LAYOUT.getShapeProperty(newFactory));
final DynamicObject newObject = LAYOUT.createShapePropertiesTest(newFactory, 22);
Assert.assertEquals(44, LAYOUT.getShapeProperty(newObject));
}
Aggregations