Search in sources :

Example 1 with ObjectLocation

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

the class LocationTest method testOnlyObjectLocationForObject.

@Test
public void testOnlyObjectLocationForObject() {
    DynamicObject object = rootShape.newInstance();
    object.define("obj", new Object());
    Location location = object.getShape().getProperty("obj").getLocation();
    Assert.assertTrue(location instanceof ObjectLocation);
    DOTestAsserts.assertLocationFields(location, 0, 1);
    DOTestAsserts.assertShapeFields(object, 0, 1);
}
Also used : ObjectLocation(com.oracle.truffle.api.object.ObjectLocation) DynamicObject(com.oracle.truffle.api.object.DynamicObject) DynamicObject(com.oracle.truffle.api.object.DynamicObject) Location(com.oracle.truffle.api.object.Location) ObjectLocation(com.oracle.truffle.api.object.ObjectLocation) Test(org.junit.Test)

Aggregations

DynamicObject (com.oracle.truffle.api.object.DynamicObject)1 Location (com.oracle.truffle.api.object.Location)1 ObjectLocation (com.oracle.truffle.api.object.ObjectLocation)1 Test (org.junit.Test)1