Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
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.