RFR 8062180: MethodHandleImpl.makeArrays throws and swallows java.lang.NoSuchFieldError in normal flow

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Nov 5 09:43:34 UTC 2014


On 11/05/2014 12:23 PM, Claes Redestad wrote:
> On 2014-11-04 22:25, Aleksey Shipilev wrote:
>> On 04.11.2014 23:57, Claes Redestad wrote:
>>   - Would we be better off asserting (mh == null) instead of breaking and
>> asserting afterwards?
> 
> assert(mh != null) does makes it more readable...
> 
>>   - Would we save a few more bytecodes by using the method-local "final
>> int ARRAYS_COUNT" to handle the magic number, instead of doing a
>> full-blown field? Ditto for FILL_ARRAYS_COUNT.
> 
> ... and renders ARRAYS_COUNT redundant.
> 
> The FILL_ARRAYS_COUNT is already used elsewhere, though.
> 
> New webrev: http://cr.openjdk.java.net/~redestad/8062180/webrev.01

Looks good to me.

I would still introduce a final local variable for magic number 11, but
that's a matter of personal style.


> Ran with the updated code, 20k forks get the error down and establish
> the improvement statistically:
> 
> Benchmark    Mode  Samples   Score  Score error  Units
> loadMethodHandleImplLazy      ss    20000  40.257        0.102 ms
> loadMethodHandleImplLazy      ss    20000  39.340        0.095 ms

Now we are talking.

-Aleksey.




More information about the core-libs-dev mailing list