File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
com.oracle.svm.core.jdk11/src/com/oracle/svm/core/jdk11
com.oracle.svm.hosted.jdk11/src/com/oracle/svm/hosted Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 2424 */
2525package com .oracle .svm .core .jdk11 ;
2626
27- import com .oracle .svm .core .annotate .UnknownObjectField ;
2827import org .graalvm .nativeimage .ImageSingletons ;
2928import org .graalvm .nativeimage .Platform ;
3029import org .graalvm .nativeimage .Platforms ;
@@ -35,7 +34,6 @@ public static BootModuleLayerSupport instance() {
3534 return ImageSingletons .lookup (BootModuleLayerSupport .class );
3635 }
3736
38- @ UnknownObjectField (types = ModuleLayer .class )
3937 private ModuleLayer bootLayer ;
4038
4139 @ Platforms (Platform .HOSTED_ONLY .class )
Original file line number Diff line number Diff line change 3030import com .oracle .svm .core .jdk .JDK11OrLater ;
3131import com .oracle .svm .core .util .VMError ;
3232import com .oracle .svm .util .ReflectionUtil ;
33- import jdk .internal .module .ModuleReferenceImpl ;
3433import org .graalvm .nativeimage .ImageSingletons ;
3534import org .graalvm .nativeimage .Platform ;
3635import org .graalvm .nativeimage .Platforms ;
@@ -107,12 +106,12 @@ public void afterRegistration(AfterRegistrationAccess access) {
107106
108107 @ Override
109108 public void beforeAnalysis (BeforeAnalysisAccess access ) {
110- // Because we synthesize the boot layer after analysis, we need to
111- // register every type in ModuleLayer's object graph as in heap
112- access . registerAsInHeap ( ModuleLayer . class );
113- access . registerAsInHeap ( Configuration . class );
114- access . registerAsInHeap ( ResolvedModule . class );
115- access . registerAsInHeap ( ModuleReferenceImpl . class );
109+ FeatureImpl . BeforeAnalysisAccessImpl accessImpl = ( FeatureImpl . BeforeAnalysisAccessImpl ) access ;
110+ Map < String , Module > baseModules = ModuleLayer . boot (). modules ()
111+ . stream ()
112+ . collect ( Collectors . toMap ( Module :: getName , m -> m ) );
113+ ModuleLayer runtimeBootLayer = synthesizeRuntimeBootLayer ( accessImpl . imageClassLoader , baseModules );
114+ BootModuleLayerSupport . instance (). setBootLayer ( runtimeBootLayer );
116115 }
117116
118117 @ Override
You can’t perform that action at this time.
0 commit comments