Mercurial > hg > truffle
diff truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Layout.java @ 22340:bb3c03f2442d
Layout: add polymorphic unboxing flag
author | Andreas Woess <andreas.woess@oracle.com> |
---|---|
date | Tue, 03 Nov 2015 14:09:13 +0100 |
parents | 414e82b9fc35 |
children |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Layout.java Fri Oct 30 20:09:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Layout.java Tue Nov 03 14:09:13 2015 +0100 @@ -121,6 +121,7 @@ */ public static final class Builder { private EnumSet<ImplicitCast> allowedImplicitCasts; + private boolean polymorphicUnboxing; /** * Create a new layout builder. @@ -155,9 +156,21 @@ this.allowedImplicitCasts.add(allowedImplicitCast); return this; } + + /** + * If {@code true}, try to keep properties with polymorphic primitive types unboxed. + */ + public Builder setPolymorphicUnboxing(boolean polymorphicUnboxing) { + this.polymorphicUnboxing = polymorphicUnboxing; + return this; + } } protected static EnumSet<ImplicitCast> getAllowedImplicitCasts(Builder builder) { return builder.allowedImplicitCasts; } + + protected static boolean getPolymorphicUnboxing(Builder builder) { + return builder.polymorphicUnboxing; + } }