MemorySegment::reinretpret should be force inlined

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 25
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: