String.lastIndexOf confused by unpaired trailing surrogate

Ulf Zibis Ulf.Zibis at gmx.de
Sun Mar 21 13:35:33 UTC 2010


>
>>
>> On Sun, Mar 21, 2010 at 03:24, Ulf Zibis<Ulf.Zibis at gmx.de>  wrote:
>>> Am 21.03.2010 09:05, schrieb Martin Buchholz:
>>>> On Sat, Mar 20, 2010 at 15:50, Ulf Zibis<Ulf.Zibis at gmx.de>    wrote:
>>> I think, we should not define a distinct method for this once-used 
>>> 3-liner:
>>>              for (; i<  max-1; i++)
>>>                  if (v[i] == high&&  v[i+1] == low)
>>>                          return i - offset;
>>>
>>> HotSpots resources should not be over-stressed to inline such 
>>> things, having
>>> more reserves for more important things.
>> On the contrary -
>> normally the above code snippet will rarely be executed,
>> and so will normally not be inlined into the caller,
>> which makes it easier for hotspot to inline
>> the caller into its caller.  Separate cold code into
>> separate methods.
>
> Thanks, I got the idea.
>
> But Isn't the push-call-pop-return overhead comparable with those 3 
> lines here, not to forget the repeated cache-3-values-once-more?

And additionally the slow rarely used branch would stay in stone, even 
if after some time, the inline threshhold becomes reached, as JIT, 
AFAIK, can't count the frequency of compiled code usage.

-Ulf





More information about the core-libs-dev mailing list