JDK-8213895 : Modify JVM interface functions for property initialization
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Submitted: 2018-11-14
  • Updated: 2018-11-27
  • Resolved: 2018-11-27
Related Reports
CSR :  
Description
Summary
-------

The initialization of the system properties in System.initPhase1 is inefficient due to the number of upcalls to Properties set/get/remove methods. Replacing the current JVM_initProperties function with JVM_getProperties removes the cost of the upcalls.

Problem
-------

The code that initializes system properties, which is partly in the libraries
(src/share/native/java/lang/System.c and the various java_props*.[ch] files)
and partly in HotSpot, does (almost) one JNI upcall for each system property defined.  The JVM_initProperties function builds a dependency into native code on the System Properties instance and the initialization is split between java and native code.

Solution
--------

The upcalls can be replaced by assembling the properties into a single String array returned from a single JNI call.  The array can be processed to resolve defaults and overrides in java code to create the Properties instance.  The native code no longer depends on the implementation of Properties.

Specification
-------------

The JVM_InitProperties function is removed from jvm.h and its implementation.

The JVM_GetProperties function is added to jvm.h to return the JVM supplied properties in a String array with alternating property names and values.


Comments
Moving to Approved. My sense is a release note is not warranted for this change.
27-11-2018

This CSR is not strictly required since JVM_InitProperties is a private interface between hotspot and the library implementation. This is the runtime team's policy to document any change in jvm.h. I think the scope should be Implementation.
20-11-2018