@SuppressWarnings("deprecation") @Override protected final void reshape(ShapeImpl newShape) { ShapeImpl oldShape = (ShapeImpl) getShape(); ShapeImpl commonAncestor = ShapeImpl.findCommonAncestor(oldShape, newShape); if (com.oracle.truffle.object.ObjectStorageOptions.TraceReshape) { int limit = 200; PrintStream out = System.out; out.printf("RESHAPE\nOLD %s\nNEW %s\nLCA %s\nDIFF %s\n---\n", oldShape.toStringLimit(limit), newShape.toStringLimit(limit), commonAncestor.toStringLimit(limit), ShapeImpl.diff(oldShape, newShape)); } DynamicObject original = this.cloneWithShape(oldShape); setShapeAndGrow(oldShape, newShape); assert !((newShape.hasPrimitiveArray() && newShape.getPrimitiveArrayCapacity() == 0)) || getPrimitiveStore(newShape) == null; copyProperties(original, commonAncestor); assert checkExtensionArrayInvariants(newShape); }
protected final void reshape(ShapeImpl newShape) { reshapeCount.inc(); ShapeImpl oldShape = getShape(); ShapeImpl commonAncestor = ShapeImpl.findCommonAncestor(oldShape, newShape); if (ObjectStorageOptions.TraceReshape) { int limit = 150; System.out.printf("RESHAPE\nOLD %s\nNEW %s\nLCA %s\nDIFF %s\n---\n", oldShape.toStringLimit(limit), newShape.toStringLimit(limit), commonAncestor.toStringLimit(limit), ShapeImpl.diff(oldShape, newShape)); } DynamicObject original = this.cloneWithShape(oldShape); setShapeAndGrow(oldShape, newShape); assert !((newShape.hasPrimitiveArray() && newShape.getPrimitiveArrayCapacity() == 0)) || getPrimitiveStore(newShape) == null; copyProperties(original, commonAncestor); assert checkExtensionArrayInvariants(newShape); }
@Override protected final void reshape(ShapeImpl newShape) { reshapeCount.inc(); ShapeImpl oldShape = getShape(); ShapeImpl commonAncestor = ShapeImpl.findCommonAncestor(oldShape, newShape); if (ObjectStorageOptions.TraceReshape) { int limit = 200; PrintStream out = System.out; out.printf("RESHAPE\nOLD %s\nNEW %s\nLCA %s\nDIFF %s\n---\n", oldShape.toStringLimit(limit), newShape.toStringLimit(limit), commonAncestor.toStringLimit(limit), ShapeImpl.diff(oldShape, newShape)); } DynamicObject original = this.cloneWithShape(oldShape); setShapeAndGrow(oldShape, newShape); assert !((newShape.hasPrimitiveArray() && newShape.getPrimitiveArrayCapacity() == 0)) || getPrimitiveStore(newShape) == null; copyProperties(original, commonAncestor); assert checkExtensionArrayInvariants(newShape); }