On Fri, 4 Aug 2023 19:45:56 GMT, Leonid Mesnik <lmes...@openjdk.org> wrote:
>> The fix adds posting VmObjectAlloc events by >> Unsafe.allocateInstance(Class<?> cls). The previous attempt to post event >> directly from 'LibraryCallKit::inline_unsafe_allocate()' cause performance >> regression even if jvmti event is not enabled. Some optimizations have been >> disabled just because possible usage and escaping of newly allocated object. >> So event posting is doing by returning to interpreter if events are enabled. >> >> I verified that that performance (run locally only) of >> org.renaissance.jdk.streams.JmhScrabble.runOperation >> doesn't change if events are not enabled. >> >> There might be other intrinsics like >> 'LibraryCallKit::inline_unsafe_newArray()' where VM allocate memory. I'm >> going to file separate issue to find and fix them. >> >> Many thanks to Tobias H. for proposed solution. >> >> Testing with all tiers. > > Leonid Mesnik has updated the pull request incrementally with one additional > commit since the last revision: > > The too many deopts check should be first. Looks good to me. src/hotspot/share/opto/library_call.cpp line 2845: > 2843: } > 2844: if (stopped()) > 2845: return true; Suggestion: if (stopped()) { return true; } ------------- Marked as reviewed by thartmann (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15110#pullrequestreview-1568773710 PR Review Comment: https://git.openjdk.org/jdk/pull/15110#discussion_r1287968367