A DESCRIPTION OF THE REQUEST :
On comparing a signed integer against a range, if one of the range limits is 0, the test on less or greater than 0 should be ommited by HotSpot compiler.
Instead use unsigned compare against the remaining limit.
JUSTIFICATION :
See example in SOURCE section and HotSpot compiled code in EXPECTED and ACTUAL section.
The unsigned compare would need the half of bytes and execution time than the actual 2 signed compares.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
HotSpot compiler result:
0x00001000: cmp $0x10000,%ebp
0x00001006: jb 0x00001040
ACTUAL -
HotSpot compiler result:
0x00001000: test %ebp,%ebp
0x00001002: jl 0x0000100c
0x00001004: cmp $0x10000,%ebp
0x0000100a: jl 0x00001044
---------- BEGIN SOURCE ----------
int c = ...;
if (c >= Character.MIN_CODE_POINT &&
c < Character.MIN_SUPPLEMENTARY_CODE_POINT)
---------- END SOURCE ----------