Mercurial > hg > truffle
diff truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Shape.java @ 22288:47172a9b40ac
Object model refactoring, add Shape#defineProperty
author | Andreas Woess <andreas.woess@oracle.com> |
---|---|
date | Wed, 07 Oct 2015 19:15:14 +0200 |
parents | dc83cc1f94f2 |
children |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Shape.java Wed Oct 07 20:27:40 2015 +0200 +++ b/truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Shape.java Wed Oct 07 19:15:14 2015 +0200 @@ -25,6 +25,7 @@ package com.oracle.truffle.api.object; import com.oracle.truffle.api.Assumption; + import java.util.EnumSet; import java.util.List; @@ -57,6 +58,20 @@ public abstract Shape addProperty(Property property); /** + * Add or change property in the map, yielding a new or cached Shape object. + * + * @return the shape after defining the property + */ + public abstract Shape defineProperty(Object key, Object value, int flags); + + /** + * Add or change property in the map, yielding a new or cached Shape object. + * + * @return the shape after defining the property + */ + public abstract Shape defineProperty(Object key, Object value, int flags, LocationFactory locationFactory); + + /** * An {@link Iterable} over the shape's properties in insertion order. */ public abstract Iterable<Property> getProperties();