Declare private constructors for FFM internal Architecture implementations

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • None
    • Affects Version/s: None
    • Component/s: core-libs
    • None

      Both the implementations of [jdk.internal.foreign.abi.Architecture] are singletons but do not have a privat constructor and is not final. This means a default constructor is generated:

        public jdk.internal.foreign.abi.x64.X86_64Architecture();
          Code:
             0: aload_0
             1: invokespecial #1 // Method java/lang/Object."<init>":()V
             4: return

      Declaring the class final and introduce a private constructor would save 5 byte byte code and might potentially unlock other optimisations.

            Assignee:
            Per-Ake Minborg
            Reporter:
            Per-Ake Minborg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: