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

MemorySegment::reinretpret should be force inlined

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • None
    • core-libs
    • None

      MemorySegment::reintrepret is a caller sensitive method. The caller of the method is determined by using Reflection.getCallerClass(). This method is fast when MemorySegment::reinterpret is inlined, since the caller essentially becomes a constant, but when MemorySegment::reinterpret is not inlined, getCallerClass falls back to a very slow stack walk to get the caller.

      Since MemorySegment::reinterpret can appear in performance critical sections of an application, we should mark these relatively small methods with @ForceInline, so that getCallerClass will always have a chance to be intrinsified, and we avoid the slower stack walk fallback.

            jvernee Jorn Vernee
            jvernee Jorn Vernee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: