Skip to content

Commit b4acd92

Browse files
committed
Add code comments for clarification
1 parent e09cd51 commit b4acd92

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ public boolean consume(ArgumentQueue args) {
269269
NativeImage.showWarning("Ignoring server-mode native-image argument " + headArg + ".");
270270
String serverOptionCommand = headArg.substring(serverOptionPrefix.length());
271271
if (!serverOptionCommand.startsWith("session=")) {
272+
/*
273+
* All but the --server-session=... option used to exit(0). We want to simulate that
274+
* behaviour for proper backward compatibility.
275+
*/
272276
System.exit(0);
273277
}
274278
return true;

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/phases/AnalysisGraphBuilderPhase.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ protected boolean tryInvocationPlugin(InvokeKind invokeKind, ValueNode[] args, R
7474
@Override
7575
protected boolean applyInvocationPlugin(InvokeKind invokeKind, ValueNode[] args, ResolvedJavaMethod targetMethod, JavaKind resultType, InvocationPlugin plugin) {
7676
Class<? extends InvocationPlugin> accessingClass = plugin.getClass();
77+
/*
78+
* The annotation-processor creates InvocationPlugins in classes in modules that e.g.
79+
* use the @Fold annotation. This way InvocationPlugins can be in various classes in
80+
* various modules. For these InvocationPlugins to do their work they need access to
81+
* bits of graal. Thus the modules that contain such plugins need to be allowed such
82+
* access.
83+
*/
7784
ModuleSupport.exportAndOpenPackageToClass("jdk.internal.vm.ci", "jdk.vm.ci.meta", false, accessingClass);
7885
ModuleSupport.exportAndOpenPackageToClass("jdk.internal.vm.compiler", "org.graalvm.compiler.nodes", false, accessingClass);
7986
return super.applyInvocationPlugin(invokeKind, args, targetMethod, resultType, plugin);

0 commit comments

Comments
 (0)