Review request for JDK-8006950
A. Sundararajan
sundararajan.athijegannathan at oracle.com
Tue Jan 29 02:43:28 PST 2013
While properties of prototypes are non-writable, non-configurable, I
think this one is still not correct. There may be more than global
instances per context instance- and this is exposed via jsr-223 API as
well. With two different global instances created per engine, code may
check "String.prototype instanceof Object" in both global scopes. Since
"Object" is different for different global scope, I think this check
will fail for one of the global scopes.. A solution could be to use
these maps from global instance and fetch global instance via
Global.instance() method
-Sundar
On Tuesday 29 January 2013 03:14 AM, Hannes Wallnoefer wrote:
> Please review webrev for JDK-8006950:
> http://cr.openjdk.java.net/~hannesw/8006950/
>
> The gist of this is that we can omit calling ScriptObject.setProto()
> in constructors of Nasgen-processed classes if we know the prototype
> has been set correctly in the object's $nasgenmap$ field. This is
> because Nasgen inserts $nasgenmap$ to all calls to zero-arg
> ScriptObject super-constructor. Also, prototype properties of native
> ES constructors are non-writable and non-configurable.
>
> The patch contains an incomplete array microbenchmark (only array
> creation covered so far), most of which now is roughly 3x faster.
>
> Hannes
More information about the nashorn-dev
mailing list