RFR(S): 8237524: AArch64: String.compareTo() may return incorrect result
Pengfei Li
Pengfei.Li at arm.com
Tue Jan 21 10:13:30 UTC 2020
Hi Andrew,
> Is this really a bug? The test case is violating the protections provided by the
> Java runtime, and the programmer deserves everything that happens.
To be honest, I don't know what kind of incorrect result should be classified as a bug. Indeed, I found this issue several months ago but didn't want to fix it because it doesn't break real Java workloads except the ones that use non-public string constructors.
But now I post this RFR with this thought: If the case that two strings with different encodings share the same memory cannot happen in normal applications, why don't we remove the redundant check to save 4 instructions in the generated intrinsics code? From this point, it's likely that this JBS should be classified as an enhancement instead of a bug.
--
Thanks,
Pengfei
More information about the hotspot-compiler-dev
mailing list