Search in sources :

Example 1 with ValueLocation

use of com.oracle.truffle.object.Locations.ValueLocation in project graal by oracle.

the class ShapeImpl method createFactory.

/**
 * @since 0.17 or earlier
 */
@Override
public final DynamicObjectFactory createFactory() {
    List<Property> properties = getPropertyListInternal(true);
    List<Property> filtered = null;
    for (ListIterator<Property> iterator = properties.listIterator(); iterator.hasNext(); ) {
        Property property = iterator.next();
        // skip non-instance fields
        assert property.getLocation() != layout.getPrimitiveArrayLocation();
        if (property.getLocation() instanceof ValueLocation) {
            if (filtered == null) {
                filtered = new ArrayList<>();
                filtered.addAll(properties.subList(0, iterator.previousIndex()));
            }
        } else if (filtered != null) {
            filtered.add(property);
        }
    }
    if (filtered != null) {
        properties = filtered;
    }
    return new DynamicObjectFactoryImpl(this, properties);
}
Also used : Property(com.oracle.truffle.api.object.Property) ValueLocation(com.oracle.truffle.object.Locations.ValueLocation)

Aggregations

Property (com.oracle.truffle.api.object.Property)1 ValueLocation (com.oracle.truffle.object.Locations.ValueLocation)1