Review request for JDK-8007060
Hannes Wallnoefer
hannes.wallnoefer at oracle.com
Wed Jan 30 05:20:37 PST 2013
Please review http://cr.openjdk.java.net/~hannesw/8007060/
This removes the NashornInvocationTarget class whose purpose was to
track primitiveness of callsite targets and replaces it in two ways.
1) For functions invoked via ScriptRuntime.apply() (this includes
ordinary megamorphic callsites) we simply check function strictness and
this-argument primitiveness at runtime. We should have done that anyway,
I think there were several uses of this method that forgot to wrap
primitives when they should have.
2) For ordinary monomorphic callsites we check function strictness and
this-argument primitiveness at link time. If this is primitive we
install a wrapper methodhandle as argument filter. We then use a new
NonStrictFunctionGuard that in addition to the FunctionGuard check tests
whether primitiveness of this-argument has changed by doing one simple
instanceof check. (This should be very rare, as invocation of script
functions on JS primitives should generally be rare.
I've tested this with test, test262parallel, and octane. Haven't tested
node.jar yet. Haven't done any in-depth performance tests but I think
there should be no notable regression.
thanks,
Hannes
More information about the nashorn-dev
mailing list