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

Support compiling `<primitive>.class` to a CONSTANT_Dynamic

    XMLWordPrintable

Details

    • Enhancement
    • Status: New
    • P4
    • Resolution: Unresolved
    • 19
    • None
    • tools
    • generic
    • generic

    Description

      A DESCRIPTION OF THE PROBLEM :
      Currently, all references to `<primitive>.class` get compiled to `getstatic java/lang/<Wrapper>.TYPE`, e.g.: `int.class` → `Integer.TYPE`.
      I propose to compile them to a CONSTANT_Dynamic which uses `java.lang.invoke.ConstantBootstraps::primitiveClass` instead.

      However, just like with JEP 280, it will be necessary to keep compiling `java.base` with the old method (and/or do a search‑and‑replace) to avoid circularities in the JDK.

      ## See also:
      - https://bugs.openjdk.java.net/browse/JDK-8085796 (JEP 280)
      - https://bugs.openjdk.java.net/browse/JDK-8187742


      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: