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

Enable RewriteBytecodes when VM runs with CDS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 9
    • hotspot
    • None
    • b64
    • generic
    • generic

    Backports

      Description

        The ConstMethods in a CDS image are mapped read-only. Currently when CDS is enabled, RewriteBytecodes and RewriteFrequentPairs are disabled to avoid modifying bytecodes in the CDS image. However, this causes the interpreter to run more slowly, for all methods, even those that are not located inside CDS.

        Interpreter speed is important for C2 compiler, which tends to execute more bytecodes in interpreter mode before compiling them. As a result, some benchmarks showed 2% degradation when running under C2 and with CDS enabled.

        We should try to enable RewriteBytecodes and RewriteFrequentPairs, at least for methods that are not stored in CDS, to improve interpreter speed.

        The fix is to add new bytecodes such as _nofast_getfield. All _getfield bytecodes in CDS are rewritten to _nofast_getfield during CDS dump time. During run time, when a _getfield bytecode is encountered by the interpreter, we know that this bytecode is stored outside of CDS, and thus can be rewritten at runtime.

        In the interpreter, the bytecode handler for _nofast_getfield works exactly as the handler for _getfield; the only exception is that the former does not rewrite the bytecode at runtime.

        Attachments

          Issue Links

            Activity

              People

                minqi Yumin Qi
                minqi Yumin Qi
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: