Review request for JDK-8019157 - Avoid calling ScriptObject.setProto() if possible
A. Sundararajan
sundararajan.athijegannathan at oracle.com
Wed Jun 26 05:30:15 PDT 2013
+1
On Wednesday 26 June 2013 04:42 PM, Jim Laskey (Oracle) wrote:
> +1
>
> On 2013-06-26, at 6:44 AM, Hannes Wallnoefer <hannes.wallnoefer at oracle.com> wrote:
>
>> Please review JDK-8019157 - Avoid calling ScriptObject.setProto() if possible:
>>
>> http://cr.openjdk.java.net/~hannesw/8019157/
>>
>> Bug description pasted below for your convenience.
>>
>> Calling ScriptObject.setProto() is quite expensive. One expensive part is invalidating the object's property map, which involves a WeakHashMap lookup in PropertyMap.checkProtoHistory().
>>
>> Invaliding the property map is necessary if the property map may be in use with other prototypes. However, many built-in objects including arrays (in fact all built-ins except for Object) are always constructed with the same combination of prototype and property map.
>>
>> In this case we can significantly improve object creation overhead by providing a way to directly set both prototype and property map.
>>
>> Thanks,
>> Hannes
More information about the nashorn-dev
mailing list