Consider moving Linker::methodType as FunctionDescriptor::toMethodType

XMLWordPrintable

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

            Assignee:
            Jorn Vernee
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: