@Override
@TruffleBoundary
public void define(Object id, Object value, int flags) {
ShapeImpl oldShape = getShape();
Property existing = oldShape.getProperty(id);
if (existing == null) {
updateShape();
oldShape = getShape();
Shape newShape = oldShape.addProperty(Property.create(id, oldShape.allocator().locationForValue(value, true, true), flags));
updateShape();
newShape.getLastProperty().setGeneric(this, value, oldShape, newShape);
} else {
defineExisting(id, value, flags, existing, oldShape);
}
}