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

[JVMCI] Limit ServiceLoader to class initializers

XMLWordPrintable

    • b11

      In the context of libgraal, the current use of ServiceLoader in JVMCI is problematic as libgraal does all class loading at image build time. There are static fields such as JVMCIServiceLocator.cachedLocators that need to be initialized via reflection[1] when building libgraal. This can be avoided if JVMCI performs all ServiceLoader usage in <clinit> as <clinit> is executed when building a native image.

      [1] https://github.com/oracle/graal/blob/30492c3f7847a13ae7f8dc50663a5a039e49a8e7/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/libgraal/BuildTime.java#L175-L180

            dnsimon Douglas Simon
            dnsimon Douglas Simon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: