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

Store java.lang.Boolean.{TRUE,FALSE} in CDS archive

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • 24
    • None
    • hotspot

      This is a preparatory step for the Leyden project.

      Today, the CDS archive doesn't contain instances of java.lang.Boolean. However, this may change as we implement more Leyden optimizations.

      Going forward, in order to satisfy this requirement in the JLS

      ========
      https://docs.oracle.com/javase/specs/jls/se21/jls21.pdf

      § 5.1.7 Boxing Conversion
      If the value p being boxed is the result of evaluating a constant expression (§15.29) of type boolean, byte, char, short, int, or long, and the result is true, false, a character in the range '\u0000' to '\u007f' inclusive, or an integer in the range -128 to 127 inclusive, then let a and b be the results of any two boxing conversions of p. It is always the case that a == b.
      ========

      If we store an instance of Boolean in the CDS archive, we must also store Boolean.TRUE and Boolean.FALSE in the archive as well, in order for the (a == b) identity tests to work as expected.

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: