Skip to content

Commit e22e123

Browse files
committed
svm: Add @BasedOnJDKFile annotations to Module native substitutions
1 parent fbb3778 commit e22e123

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_lang_Module.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.oracle.svm.core.annotate.Substitute;
3434
import com.oracle.svm.core.annotate.TargetClass;
3535
import com.oracle.svm.core.annotate.TargetElement;
36+
import com.oracle.svm.core.util.BasedOnJDKFile;
3637

3738
@SuppressWarnings("unused")
3839
@TargetClass(value = java.lang.Module.class)
@@ -53,6 +54,7 @@ public boolean isNativeAccessEnabled() {
5354
public native void ensureNativeAccess(Class<?> owner, String methodName, Class<?> currentClass);
5455

5556
@Substitute
57+
@BasedOnJDKFile("src/hotspot/share/classfile/modules.cpp#L275-L479")
5658
private static void defineModule0(Module module, boolean isOpen, String version, String location, Object[] pns) {
5759
if (Arrays.stream(pns).anyMatch(Objects::isNull)) {
5860
throw new IllegalArgumentException("Bad package name");
@@ -62,13 +64,15 @@ private static void defineModule0(Module module, boolean isOpen, String version,
6264
}
6365

6466
@Substitute
67+
@BasedOnJDKFile("src/hotspot/share/classfile/modules.cpp#L763-L799")
6568
private static void addReads0(Module from, Module to) {
6669
if (Objects.isNull(from)) {
6770
throw new NullPointerException("The from_module is null");
6871
}
6972
}
7073

7174
@Substitute
75+
@BasedOnJDKFile("src/hotspot/share/classfile/modules.cpp#L753-L761")
7276
private static void addExports0(Module from, String pn, Module to) {
7377
if (Objects.isNull(to)) {
7478
throw new NullPointerException("The to_module is null");
@@ -79,12 +83,14 @@ private static void addExports0(Module from, String pn, Module to) {
7983
}
8084

8185
@Substitute
86+
@BasedOnJDKFile("src/hotspot/share/classfile/modules.cpp#L686-L750")
8287
private static void addExportsToAll0(Module from, String pn) {
8388
ModuleUtil.checkFromModuleAndPackageNullability(from, pn);
8489
ModuleUtil.checkIsPackageContainedInModule(pn, from);
8590
}
8691

8792
@Substitute
93+
@BasedOnJDKFile("src/hotspot/share/classfile/modules.cpp#L869-L918")
8894
private static void addExportsToAllUnnamed0(Module from, String pn) {
8995
ModuleUtil.checkFromModuleAndPackageNullability(from, pn);
9096
if (from.isNamed()) {

0 commit comments

Comments
 (0)