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

Add method to SystemABI for explicitly freeing upcall stubs

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-panama
    • Fix Version/s: repo-panama
    • Component/s: tools
    • Labels:

      Description

      The MemoryAddress returned by SystemABI::upcallStub is attached to a new MemorySegment that is tied to the current thread, and calls freeUpcallStub when the segment is closed.

      Tying the MemorySegment to the current thread is prohibitive, and practically unnecessary, since there should be no need to access the memory of this segment from Java, and thus there can be no race between accessing and closing the segment (at least not one we can detect).

      We can instead attach the returned address to the NOTHING segment, making the memory inaccessible, and add a method to SystemABI to explicitly free an upcall stub, given it's MemoryAddress, that can be used by any thread.

      This will also allow attaching the returned MemoryAddress to a Cleaner that calls this free method.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jvernee Jorn Vernee
                Reporter:
                jvernee Jorn Vernee
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: