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

Consider moving Linker::methodType as FunctionDescriptor::toMethodType

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • None
    • repo-panama
    • core-libs

      Now that we have only one way to map function descriptors to method types, we should consider having the transformation be an instance method in FunctionDescriptor.

      A related point is that the Linker API seems biased against sequence layouts, and this is probably a result of the fact that C arrays cannot be passed to functions, if not by reference.

      But Panama doesn't have to be constrained in the same way. After all, a sequence layout is just a different way to describe a group layout - e.g. this:

      MemoryLayout.groupLayout(
          JAVA_INT, JAVA_INT
      )

      is roughly similar to this:

      MemoryLayout.sequenceLayout(2, JAVA_INT)

      Supporting sequence layouts would make the API more symmetric, and most function descriptors (except those containing padding arguments/returns) could be turned into a valid method type.

            jvernee Jorn Vernee
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: