Review request for JDK-8007060
A. Sundararajan
sundararajan.athijegannathan at oracle.com
Wed Jan 30 06:00:40 PST 2013
+1
-Sundar
On Wednesday 30 January 2013 06:50 PM, Hannes Wallnoefer wrote:
> 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