Review request for JDK-8006766: Array-like access to characters of a string is slow
Marcus Lagergren
marcus.lagergren at oracle.com
Thu Jan 24 07:55:33 PST 2013
Most of the changes seem to be passing around the entire LinkRequest. The rest is fairly simple to understand. +1 from me.
/M
On Jan 24, 2013, at 3:35 PM, Hannes Wallnoefer <hannes.wallnoefer at oracle.com> wrote:
> Please review JDK-8006766 (Array-like access to characters of a string is slow) at
>
> http://cr.openjdk.java.net/~hannesw/8006766/
>
> This overrides ScriptObject.findGetIndexMethod() in NativeString to avoid creating a NativeString wrapper for array-like access to the characters of a string (e.g. "foo"[0]). Performance gain as measured by test/examples/string-micro.js is about 3x.
>
> The larger part of this patch involves changing the signature of ScriptObject.lookup() and related methods to take the LinkRequest object as second parameter.
>
> This is necessary to make sure we're actually dealing with a primitive JS string vs. a wrapped String object in NativeString.findGetIndexMethod(). It also helped rewrite my patch for JDK-8006570 (this-value for non-strict functions should be converted to object) in a much nicer way, doing it locally in ScriptFunction.findCallMethod() rather than centrally in NashornLinker.getGuardedInvocation().
>
> Hannes
>
More information about the nashorn-dev
mailing list