# HG changeset patch # User Andreas Woess # Date 1442090836 -7200 # Node ID 72a6b0e49d315376c55d0c04ac5cb4f2d66e1c92 # Parent 657d37ff352ebb1c12c308b6ffc4adef49fe8a7c remove DynamicObject#changeFlags convenience method diff -r 657d37ff352e -r 72a6b0e49d31 truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/DynamicObject.java --- a/truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/DynamicObject.java Sat Sep 12 22:37:38 2015 +0200 +++ b/truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/DynamicObject.java Sat Sep 12 22:47:16 2015 +0200 @@ -103,24 +103,6 @@ public abstract void define(Object key, Object value, int flags, LocationFactory locationFactory); /** - * Change property flags. - * - * @param key property identifier - * @param newFlags flags to be set - * @return {@code true} if successful or {@code false} if property not found - */ - public abstract boolean changeFlags(Object key, int newFlags); - - /** - * Change property flags. - * - * @param key property identifier - * @param flagsUpdateFunction function updating old flags to new flags - * @return {@code true} if successful or {@code false} if property not found - */ - public abstract boolean changeFlags(Object key, FlagsFunction flagsUpdateFunction); - - /** * Delete property. * * @param key property identifier @@ -167,14 +149,4 @@ * @param currentShape the object's current shape (must equal {@link #getShape()}) */ public abstract DynamicObject copy(Shape currentShape); - - /** - * Represents an operation on a single {@code int}-valued operand that produces an {@code int} - * -valued result. - * - * For Java 7 compatibility (equivalent to IntUnaryOperator). - */ - public interface FlagsFunction { - int apply(int t); - } } diff -r 657d37ff352e -r 72a6b0e49d31 truffle/com.oracle.truffle.object/src/com/oracle/truffle/object/DynamicObjectImpl.java --- a/truffle/com.oracle.truffle.object/src/com/oracle/truffle/object/DynamicObjectImpl.java Sat Sep 12 22:37:38 2015 +0200 +++ b/truffle/com.oracle.truffle.object/src/com/oracle/truffle/object/DynamicObjectImpl.java Sat Sep 12 22:47:16 2015 +0200 @@ -184,7 +184,6 @@ } } - @Override @TruffleBoundary public boolean changeFlags(Object id, int newFlags) { Shape oldShape = getShape(); @@ -201,24 +200,6 @@ } } - @Override - @TruffleBoundary - public boolean changeFlags(Object id, FlagsFunction updateFunction) { - Shape oldShape = getShape(); - Property existing = oldShape.getProperty(id); - if (existing != null) { - int newFlags = updateFunction.apply(existing.getFlags()); - if (existing.getFlags() != newFlags) { - Property newProperty = existing.copyWithFlags(newFlags); - Shape newShape = oldShape.replaceProperty(existing, newProperty); - this.setShape(newShape); - } - return true; - } else { - return false; - } - } - public String debugDump(int level) { return debugDump(0, level); }