Review request for JDK-8067215: Disable dual fields when not using optimistic types

Attila Szegedi attila.szegedi at oracle.com
Fri Apr 10 07:11:01 UTC 2015


+1

> On Apr 9, 2015, at 10:58 AM, Hannes Wallnoefer <hannes.wallnoefer at oracle.com> wrote:
> 
> Please review JDK-8067215: Disable dual fields when not using optimistic types:
> 
> http://cr.openjdk.java.net/~hannesw/8067215/
> 
> This makes single or dual field representation dependent on optimistic types setting (can be overridden with system properties).
> 
> Since both dual and single field objects can coexist in the same VM and class loader and both have to be distinguishable at runtime (e.g. for caching getter and setter methodhandles in AccessorProperty) I had to use separate class names for both. I introduced jdk.nashorn.internal.scripts.JD for dual fields while using the existing JO name scheme for single field representation. I also added a new property flag as a property with dual fields must not be equal to the same property with object only fields.
> 
> On the other hand, nasgen-generated properties always use their native type, i.e. primitive accessors if their type is primitive and object accessors otherwise. This is because nasgen-generated property maps are static and have to work in both modes, and using them in non-optimistic mode requires boxing/unboxing anyway.
> 
> I also did some cleanup in related areas such as not creating a primitive spill in single field mode and removing ScriptObject.spillLength field which was not really needed. I see an improvement in non-optimistic performance with octane. As expected, optimistic performance does not seem to be affected.
> 
> Thanks,
> Hannes



More information about the nashorn-dev mailing list