Search in sources :

Example 6 with Layout

use of com.oracle.truffle.api.object.Layout in project graal by oracle.

the class ObjectTypeTest method objectTypeRespondsToIsNull.

@Test
public void objectTypeRespondsToIsNull() {
    final Layout layout = Layout.newLayout().build();
    final Shape rootShape = layout.createShape(OBJECT_TYPE);
    final DynamicObject obj = rootShape.newInstance();
    final boolean is = JavaInteropTest.isNull(obj);
    assertFalse("It is not null", is);
}
Also used : Shape(com.oracle.truffle.api.object.Shape) DynamicObject(com.oracle.truffle.api.object.DynamicObject) Layout(com.oracle.truffle.api.object.Layout) Test(org.junit.Test)

Example 7 with Layout

use of com.oracle.truffle.api.object.Layout in project graal by oracle.

the class ObjectTypeTest method objectTypeRespondsToIsBoxed.

@Test
public void objectTypeRespondsToIsBoxed() {
    final Layout layout = Layout.newLayout().build();
    final Shape rootShape = layout.createShape(OBJECT_TYPE);
    final DynamicObject obj = rootShape.newInstance();
    final boolean is = JavaInteropTest.isBoxed(obj);
    assertFalse("It is not boxed", is);
}
Also used : Shape(com.oracle.truffle.api.object.Shape) DynamicObject(com.oracle.truffle.api.object.DynamicObject) Layout(com.oracle.truffle.api.object.Layout) Test(org.junit.Test)

Aggregations

Layout (com.oracle.truffle.api.object.Layout)7 Test (org.junit.Test)6 Shape (com.oracle.truffle.api.object.Shape)5 DynamicObject (com.oracle.truffle.api.object.DynamicObject)4 ObjectType (com.oracle.truffle.api.object.ObjectType)2 DefaultLayoutFactory (com.oracle.truffle.object.basic.DefaultLayoutFactory)2 Location (com.oracle.truffle.api.object.Location)1 Property (com.oracle.truffle.api.object.Property)1 PropertyMap (com.oracle.truffle.object.PropertyMap)1 PropertyModel (com.oracle.truffle.object.dsl.processor.model.PropertyModel)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 Random (java.util.Random)1