Review request for JDK-8067215: Disable dual fields when not using optimistic types
Hannes Wallnoefer
hannes.wallnoefer at oracle.com
Thu Apr 9 08:58:40 UTC 2015
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