Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8221355

Performance regression after JDK-8155635 backport into 8u

XMLWordPrintable

    • master

        Tom Rodriguez wrote in a comment on JDK-8181822:

        Why is the version of this fix for 8 different than what's in 9 and later?

        // Can base be NULL? Otherwise, always on-heap access.
           bool can_access_non_heap = TypePtr::NULL_PTR->higher_equal(_gvn.type(heap_base_oop));
        + if (can_access_non_heap && type == T_OBJECT) {
        + return false; // off-heap oop accesses are not supported
        + }

        means that if the base pointer hasn't been null checked before the Unsafe.getObject then it won't be intrinsified at all. 9 and later don't have this check. http://hg.openjdk.java.net/jdk9/jdk9/hotspot/file/b756e7a2ec33/src/share/vm/opto/library_call.cpp#l2324 We see a huge slowdown in some code using Unsafe for reflection as a result of this change.

        I attached a microbenchmark showing the difference. On 8u192, 9 and 11 the loop runs in about 40ms but with 8u202 it takes about 3000ms.

              dbuck David Buck
              vlivanov Vladimir Ivanov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: