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

JEP 399: Intermediate-Representation Graph Serialization

    XMLWordPrintable

    Details

    • Type: JEP
    • Status: Candidate
    • Priority: P4
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: hotspot
    • Author:
      Igor Ignatyev
    • JEP Type:
      Feature
    • Exposure:
      Open
    • Subcomponent:
    • Scope:
      Implementation
    • Discussion:
      hotspot dash compiler dash dev at openjdk dot java dot net
    • Effort:
      M
    • Duration:
      M
    • JEP Number:
      399

      Description

      Summary

      To aid in testing, create a facility to serialize and deserialize the intermediate-representation (IR) graphs used in the HotSpot run-time compilers.

      Non-Goals

      It is not a goal to provide a means to serialize IR graphs for purposes other than testing.

      Motivation

      It is not possible, today, for HotSpot run-time compiler tests to test compiler optimizations directly. To test a specific optimization, they resort to manipulating the JVM into a state in which that optimization will be performed. These are “gray box” tests, since they depend upon HotSpot implementation details but do not have access to HotSpot internals. They are fragile, since a change in the implementation can render a test useless.

      Most run-time compiler optimizations operate upon an IR graph. If we could load a graph into the JVM, perform a specific optimization on it, and then export it for analysis then we could write stable and robust optimizer tests that do not depend upon HotSpot implementation details. This would also simplify the development of optimizer regression tests.

      Description

      We propose to introduce new HotSpot WhiteBox APIs to import an IR graph, perform a specific optimization on it, and then export it:

      • IRHandle import(InputStream)
      • IRHandle optimize(IRHandle, OptimizationEnum)
      • InputStream export(IRHandle)

      where IRHandle is a reference to an IR graph object and OptimizationEnum is an enumeration of all supported optimizations.

      There is already a serial format for the C2 IR, namely the XML format used by the Ideal Graph Visualizer (IGV). We propose to use that format, extending it as necessary for the C1 IR. Using the IGV format will also allow us to enhance the IGV tool so that it can serve as a WSYIWYG-editor for IR graphs.

      Risks and Assumptions

      Adding this code to product builds will slightly increase the size of libjvm.so. If that becomes an issue then we can move it into a separate dynamically-linked library.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              epavlova Ekaterina Pavlova
              Reporter:
              iignatyev Igor Ignatyev (Inactive)
              Owner:
              Igor Ignatyev Igor Ignatyev (Inactive)
              Reviewed By:
              Aleksandre Iline, Mikael Vidstedt, Vladimir Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

                Dates

                Created:
                Updated: