RFR(XS): 8030976: untaken paths should be more vigorously pruned at highest optimization level

Rickard Bäckman rickard.backman at oracle.com
Thu May 22 11:53:47 UTC 2014

Hi all,

can I please have reviews for this change.
The patch makes C2 place uncommon traps on previously untaken branches
much more aggressively (we are simply trusting the profiling more). 
This improves performance for a couple of different patterns.


class Test {
  public int[] array = new int[] = { 1, 1, 2, 3, 5, 8, 13 };

  public void some_method() {
    for (int i = 0; i < array.length; i++) {
      if (array[i] < 255) {
      } else {

Where we previously if the else branch had never been taken rarely would
inline the some_other_call and when array escapes we can't make
assumptions on non-changing lengths, call killing registers, etc.

On some of the Nashorn benchmark this patch increases score by 35%,
others don't see any change at all. No difference on SpecJBB 2005.
More performance numbers / microbenchmark in the comments of the bug.

Webrev: http://cr.openjdk.java.net/~rbackman/8030976/
Bug: https://bugs.openjdk.java.net/browse/JDK-8030976

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20140522/8a4ce882/signature.asc>

More information about the hotspot-compiler-dev mailing list