RFR(S): 8007986: GrowableArray should implement binary search

Vitaly Davidovich vitalyd at gmail.com
Thu Mar 26 13:45:38 UTC 2015


Hi Roland,

Just a couple of notes in passing.

1) may be worthwhile to compute mid in a way that avoids possible signed
overflow? I'm guessing this class is not used with sizes that large, but
just a precaution.

2) perhaps store the result of calling f() in a local to avoid calling it
twice?

$.02

sent from my phone
On Mar 26, 2015 9:34 AM, "Roland Westrelin" <roland.westrelin at oracle.com>
wrote:

http://cr.openjdk.java.net/~roland/8007986/webrev.00/

The same binary search code on GrowableArray is used in 3 places (in the
compilers). This moves that code in GrowableArray.

Roland.


More information about the hotspot-dev mailing list