Mercurial > hg > truffle
changeset 22145:72a6b0e49d31
remove DynamicObject#changeFlags convenience method
author | Andreas Woess <andreas.woess@oracle.com> |
---|---|
date | Sat, 12 Sep 2015 22:47:16 +0200 |
parents | 657d37ff352e |
children | 4125eb882b7e |
files | truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/DynamicObject.java truffle/com.oracle.truffle.object/src/com/oracle/truffle/object/DynamicObjectImpl.java |
diffstat | 2 files changed, 0 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- 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); - } }
--- 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); }