Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8082574 | emb-9 | Yumin Qi | P3 | Resolved | Fixed | team |
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.
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.
- backported by
-
JDK-8082574 Enable RewriteBytecodes when VM runs with CDS
-
- Resolved
-
- relates to
-
JDK-8152356 Change to -Xshare:auto for 32-bit platforms
-
- Closed
-
-
JDK-8157189 'iload_w' in shared class is not interpreted correctly
-
- Resolved
-
-
JDK-8174995 SA: clhsdb 'where -a' throws Assertion Failure with illegal code 236 when CDS is used
-
- Resolved
-
-
JDK-8188105 Make -Xshare:auto the default for server VM
-
- Resolved
-