With JDK-8232080, a jlink plugin to modify vendor specific system properties in runtime images created with jlink was introduced.
The plugin modifies the bytecode of class java.lang.VersionProps to initialize certain properties to a configurable value.
The static class initializer is rewritten, using java-asm, to intercept the putstatic bytecode that loads the field value, pops the top operand of the stack and emits another ldc instruction to load the new value from the constant pool.
This can be optimized to replace the original ldc instruction with the ldc that loads the new value, removing the additonal pop and ldc bytecodes.
The plugin modifies the bytecode of class java.lang.VersionProps to initialize certain properties to a configurable value.
The static class initializer is rewritten, using java-asm, to intercept the putstatic bytecode that loads the field value, pops the top operand of the stack and emits another ldc instruction to load the new value from the constant pool.
This can be optimized to replace the original ldc instruction with the ldc that loads the new value, removing the additonal pop and ldc bytecodes.