Search in sources :

Example 1 with Allocator

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

the class LocationTest method testLocationDecoratorEquals.

@Test
public void testLocationDecoratorEquals() {
    Allocator allocator = rootShape.allocator();
    Location intLocation1 = allocator.locationForType(int.class);
    Location intLocation2 = allocator.locationForType(int.class);
    Assert.assertEquals(intLocation1.getClass(), intLocation2.getClass());
    Assert.assertNotEquals(intLocation1, intLocation2);
}
Also used : Allocator(com.oracle.truffle.api.object.Shape.Allocator) Location(com.oracle.truffle.api.object.Location) ObjectLocation(com.oracle.truffle.api.object.ObjectLocation) Test(org.junit.Test)

Example 2 with Allocator

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

the class BasicLayout method createAllocator.

@Override
public Allocator createAllocator() {
    LayoutImpl layout = this;
    Allocator allocator = getStrategy().createAllocator(layout);
    return allocator;
}
Also used : LayoutImpl(com.oracle.truffle.object.LayoutImpl) Allocator(com.oracle.truffle.api.object.Shape.Allocator)

Aggregations

Allocator (com.oracle.truffle.api.object.Shape.Allocator)2 Location (com.oracle.truffle.api.object.Location)1 ObjectLocation (com.oracle.truffle.api.object.ObjectLocation)1 LayoutImpl (com.oracle.truffle.object.LayoutImpl)1 Test (org.junit.Test)1