SQE is OK with this fix

Pavel

On 01.11.2013 18:22, Attila Szegedi wrote:
Please review JDK-8027236 at 
http://cr.openjdk.java.net/~attila/8027236/webrev.00

This change makes sure that ConsString is no longer observable from outside the 
Nashorn engine internals.

I also made some improvements to conversion mechanism where I spotted them. 
Namely, JSType.toJavaArray() used to always do getArray().asObjectArray() and 
then convert that to target type. This was very inefficient in cases where we 
had an IntArrayData/LongArrayData/NumberArrayData, and the requested array type 
was int[]/long[]/double[], respectively -- in these cases we could've just used 
a direct copy of the underlying array. Funnily enough, even though we had this 
mechanism in place in form of ArrayData.asArrayOfType(...), it was just sitting 
there unused; I guess we accidentally cut it out at some point.

Most small changes to various classes have to do with the fact that whenever we 
used to go directly to the BeansLinker for some functionality (e.g. bound 
methods, static method linking etc.) we now must make sure that we route those 
calls through the new ConsString-converting logic.

I'm still not 100% happy with the result, I feel like Dynalink should have a 
facility for linkers to declare such filters for internal objects that should 
never leave the engine and figure out where to apply them, but I don't think I 
have enough time in the Java 8 timeframe to figure out the correct design (but 
once I do, we can easily retrofit).

Thanks,
   Attila.

Reply via email to