JDK-8144693 : Intrinsify StringCoding.hasNegatives() on SPARC
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: sparc
  • Submitted: 2015-12-04
  • Updated: 2016-04-14
  • Resolved: 2016-03-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
9 b114Fixed
Related Reports
Relates :  
Relates :  
The CompactStrings JEP added intrinsic support for StringCoding.hasNegatives() on x86. We should implement an intrinsic for SPARC as well since CompactStrings is enabled by default.

The hasNegatives intrinsic is used to determine if a String in an ASCII-compatible encoding (for example, ISO-8859-1 (Latin1) or UTF-8) has only ASCII characters. If so, we can use a simple Arraycopy for some encodings/decodings. For example:

- Decoding from an ASCII-compatible representation to a Latin1 String can be done by a simple arraycopy if the input has only 7-bit ASCII characters.
- Encoding to an ASCII-compatible representation from a Latin1 String can be done by a simple arraycopy if the input has only 7-bit ASCII characters.
Post review webrevs: http://cr.openjdk.java.net/~thartmann/8144693/hotspot/webrev.02/ http://cr.openjdk.java.net/~thartmann/8144693/jdk/webrev.01/ (minor jdk changes were to enable direct testing of the intrinsic)

Guy Delamarter will be working on this. You can find the Compact Strings related JMH microbenchmarks here: http://cr.openjdk.java.net/~shade/density/string-density-bench.jar http://cr.openjdk.java.net/~shade/density/string-density-bench.zip The encoding/decoding benchmarks are sufficient for this intrinsic. Here are the results from our last full run on Sparc: http://cr.openjdk.java.net/~thartmann/compact_strings/microbenchmarks/Sparc_090915.pdf For reference, here is the x86 hasNegatives intrinsic developed by Intel: http://hg.openjdk.java.net/jdk9/sandbox/hotspot/rev/b12d3263cf16