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

bootstrap method data needs to be moved from constant pool to a classfile attribute

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • hs20
    • 7
    • hotspot
    • b04
    • generic
    • generic
    • Verified

        Currently, as a result of changes in 6964498, bootstrap information in a CONSTANT_InvokeDynamic constant pool entry is "inlined" into each such entry. This makes constant pool parsing somewhat more complex, due to the larger number (> 2) of constant pool entry fields. This will burden some JVM implementations, like IBM's, for which 32 bits is a hard limit on constant pool entry size.

        We propose instead to move the BSM and its optional arguemnts to a new classfile attribute, BootstrapMethods. The CONSTANT_InvokeDynamic entry will contain (1) a 16-bit index into the BootstrapMethods table

        struct BootstrapMethods_attr {
          u2 name;
          u4 size;
          u2 bootstrap_method_count;
          struct {
            u2 bootstrap_method_ref; // CONSTANT_MethodHandle pool index
            u2 bootstrap_argument_count;
            u2 bootstrap_arguments[bootstrap_argument_count]; // constant pool indexes
          } bootstrap_methods[bootstrap_method_count];
        }

        When an invokedynamic instruction is linked, its bootstrap method is called as documented in the JDK 7 package-info javadoc.

              jrose John Rose
              jrose John Rose
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: