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

Modify JVM interface functions for property initialization

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source, binary
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      The JVM_InitProperties function is an implementation specific entry point defined in jvm.h. The function is used solely by System initialization. There is no change in the behavior of the initialized properties.
    • Interface Kind:
      Other
    • Scope:
      Implementation

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rriggs Roger Riggs
              Reporter:
              mr Mark Reinhold
              Reviewed By:
              Brian Burkhalter, Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: