Sponsor for 6666666: A better implementation of Character.isSupplementaryCodePoint

Ulf Zibis Ulf.Zibis at gmx.de
Fri Mar 12 13:04:39 UTC 2010


Am 12.03.2010 02:46, schrieb Martin Buchholz:
> http://mercurial.selenic.com/wiki/MqExtension
> http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html
>    

Ah, I see mq is part of hg. Another thing to learn, but sounds good. 
Unfortunately there seems no GUI for it. I run TortoiseHG on my Windows.

>
> I propose the following small improvement on your own
> version of isISOControl:
>
>      public static boolean isISOControl(int codePoint) {
>          // Optimized form of:
>          //     (codePoint>= 0x0000&&  codePoint<= 0x001F) ||
>          //     (codePoint>= 0x007F&&  codePoint<= 0x009F);
>          return codePoint<= 0x009F&&
>              (codePoint>= 0x007F || (codePoint>>>  5 == 0));
>      }
>
> Because non-ASCII chars get away with only one comparison.
>    

+1 thanks.
Because here we are talking about ASCII values, I would prefer 2-digit 
values or complete code points e.g. 0x0000007F.

>
> Alright, you've talked me into it,
> I can't resist your love of micro-optimizations.
>    

Is that sentence correct english grammar? I'm afraid to misunderstand.

By the way, I've filed some bugs against HotSpot to optimize those cases:
6932837 <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6932837> - 
Better use unsigned jump if one of the range limits is 0
6932855 <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6932855> - 
Save superfluous CMP instruction from while loop
6933327 <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6933327> - 
Use shifted addressing modes instead of shift instuctions
6933324 <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6933324> - 
Always inline methods, which have only 1 call site

If they would be accepted and fixed, some of our twiddling would become 
superfluous, at least using c2, but maybe not for interpreter and c1.

-Ulf

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20100312/257abcc9/attachment.html>


More information about the core-libs-dev mailing list