/** * Simpler version of {@link #resizeObjectStore} when the object is only increasing in size. */ @Override protected final void growObjectStore(Shape oldShape, Shape newShape) { int oldObjectArrayCapacity = ((ShapeImpl) oldShape).getObjectArrayCapacity(); int newObjectArrayCapacity = ((ShapeImpl) newShape).getObjectArrayCapacity(); if (oldObjectArrayCapacity != newObjectArrayCapacity) { growObjectStoreIntl(oldObjectArrayCapacity, newObjectArrayCapacity, oldShape); } }
/** * Simpler version of {@link #resizeObjectStore} when the object is only increasing in size. */ @Override protected final void growObjectStore(Shape oldShape, Shape newShape) { int oldObjectArrayCapacity = ((ShapeImpl) oldShape).getObjectArrayCapacity(); int newObjectArrayCapacity = ((ShapeImpl) newShape).getObjectArrayCapacity(); if (oldObjectArrayCapacity != newObjectArrayCapacity) { growObjectStoreIntl(oldObjectArrayCapacity, newObjectArrayCapacity, oldShape); } }
/** * Simpler version of {@link #resizeObjectStore} when the object is only increasing in size. */ @Override protected final void growObjectStore(Shape oldShape, Shape newShape) { int oldObjectArrayCapacity = ((ShapeImpl) oldShape).getObjectArrayCapacity(); int newObjectArrayCapacity = ((ShapeImpl) newShape).getObjectArrayCapacity(); if (oldObjectArrayCapacity != newObjectArrayCapacity) { growObjectStoreIntl(oldObjectArrayCapacity, newObjectArrayCapacity, oldShape); } }
@Override protected final void resizeObjectStore(Shape oldShape, Shape newShape) { Object[] newObjectStore = null; int destinationCapacity = ((ShapeImpl) newShape).getObjectArrayCapacity(); if (destinationCapacity != 0) { newObjectStore = new Object[destinationCapacity]; int sourceCapacity = ((ShapeImpl) oldShape).getObjectArrayCapacity(); if (sourceCapacity != 0) { Object[] oldObjectStore = getObjectStore(newShape); for (int i = 0; i < Math.min(sourceCapacity, destinationCapacity); ++i) { newObjectStore[i] = oldObjectStore[i]; } } } this.setObjectStore(newObjectStore, newShape); }
@Override protected final void resizeObjectStore(Shape oldShape, Shape newShape) { Object[] newObjectStore = null; int destinationCapacity = ((ShapeImpl) newShape).getObjectArrayCapacity(); if (destinationCapacity != 0) { newObjectStore = new Object[destinationCapacity]; int sourceCapacity = ((ShapeImpl) oldShape).getObjectArrayCapacity(); if (sourceCapacity != 0) { Object[] oldObjectStore = getObjectStore(newShape); for (int i = 0; i < Math.min(sourceCapacity, destinationCapacity); ++i) { newObjectStore[i] = oldObjectStore[i]; } } } this.setObjectStore(newObjectStore, newShape); }
@Override protected final void initialize(Shape shape) { assert getObjectStore(shape) == null; int capacity = ((ShapeImpl) shape).getObjectArrayCapacity(); if (capacity != 0) { this.setObjectStore(new Object[capacity], shape); } if (((ShapeImpl) shape).getPrimitiveArrayCapacity() != 0) { this.setPrimitiveStore(new long[((ShapeImpl) shape).getPrimitiveArrayCapacity()], shape); } }
public void profile(Shape shape) { objects++; oac += ((ShapeImpl) shape).getObjectArrayCapacity(); oas += ((ShapeImpl) shape).getObjectArraySize(); ofs += ((ShapeImpl) shape).getObjectFieldSize(); pac += ((ShapeImpl) shape).getPrimitiveArrayCapacity(); pas += ((ShapeImpl) shape).getPrimitiveArraySize(); pfs += ((ShapeImpl) shape).getPrimitiveFieldSize(); }
@Override protected final void initialize(Shape shape) { assert getObjectStore(shape) == null; int capacity = ((ShapeImpl) shape).getObjectArrayCapacity(); if (capacity != 0) { this.setObjectStore(new Object[capacity], shape); } if (((ShapeImpl) shape).getPrimitiveArrayCapacity() != 0) { this.setPrimitiveStore(new long[((ShapeImpl) shape).getPrimitiveArrayCapacity()], shape); } }
public void profile(Shape shape) { objects++; oac += ((ShapeImpl) shape).getObjectArrayCapacity(); oas += ((ShapeImpl) shape).getObjectArraySize(); ofs += ((ShapeImpl) shape).getObjectFieldSize(); pac += ((ShapeImpl) shape).getPrimitiveArrayCapacity(); pas += ((ShapeImpl) shape).getPrimitiveArraySize(); pfs += ((ShapeImpl) shape).getPrimitiveFieldSize(); }
@Override protected final void initialize(Shape shape) { assert getObjectStore(shape) == null; int capacity = ((ShapeImpl) shape).getObjectArrayCapacity(); if (capacity != 0) { this.setObjectStore(new Object[capacity], shape); } if (((ShapeImpl) shape).getPrimitiveArrayCapacity() != 0) { this.setPrimitiveStore(new long[((ShapeImpl) shape).getPrimitiveArrayCapacity()], shape); } }
/** * Check whether the extension arrays are in accordance with the description in the shape. */ @Override protected final boolean checkExtensionArrayInvariants(Shape newShape) { assert getShape() == newShape; assert (getObjectStore(newShape) == null && ((ShapeImpl) newShape).getObjectArrayCapacity() == 0) || (getObjectStore(newShape) != null && getObjectStore(newShape).length == ((ShapeImpl) newShape).getObjectArrayCapacity()); if (((ShapeImpl) newShape).hasPrimitiveArray()) { assert (getPrimitiveStore(newShape) == null && ((ShapeImpl) newShape).getPrimitiveArrayCapacity() == 0) || (getPrimitiveStore(newShape) != null && getPrimitiveStore(newShape).length == ((ShapeImpl) newShape).getPrimitiveArrayCapacity()); } return true; }
/** * Check whether the extension arrays are in accordance with the description in the shape. */ @Override protected final boolean checkExtensionArrayInvariants(Shape newShape) { assert getShape() == newShape; assert (getObjectStore(newShape) == null && ((ShapeImpl) newShape).getObjectArrayCapacity() == 0) || (getObjectStore(newShape) != null && getObjectStore(newShape).length == ((ShapeImpl) newShape).getObjectArrayCapacity()); if (((ShapeImpl) newShape).hasPrimitiveArray()) { assert (getPrimitiveStore(newShape) == null && ((ShapeImpl) newShape).getPrimitiveArrayCapacity() == 0) || (getPrimitiveStore(newShape) != null && getPrimitiveStore(newShape).length == ((ShapeImpl) newShape).getPrimitiveArrayCapacity()); } return true; }