Skip to content

Commit a5ae8d8

Browse files
committed
improve documentation
1 parent a8eaf53 commit a5ae8d8

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,17 @@ public class GraalHotSpotVMConfig extends GraalHotSpotVMConfigAccess {
5151
* {@link GraalHotSpotVMConfig} parameter to a {@linkplain Fold foldable} method.
5252
*/
5353
public static final GraalHotSpotVMConfig INJECTED_VMCONFIG = null;
54+
55+
/**
56+
* Sentinel value to use for an {@linkplain InjectedParameter injected}
57+
* {@link MetaAccessProvider} parameter to a {@linkplain Fold foldable} method.
58+
*/
5459
public static final MetaAccessProvider INJECTED_METAACCESS = null;
60+
61+
/**
62+
* Sentinel value to use for an {@linkplain InjectedParameter injected} {@link OptionValues}
63+
* parameter to a {@linkplain Fold foldable} method.
64+
*/
5565
public static final OptionValues INJECTED_OPTIONVALUES = null;
5666

5767
GraalHotSpotVMConfig(HotSpotVMConfigStore store) {

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/SymbolicSnippetEncoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import java.util.Set;
4343
import java.util.function.BiFunction;
4444

45+
import jdk.graal.compiler.serviceprovider.GraalServices;
4546
import org.graalvm.collections.EconomicMap;
4647
import org.graalvm.collections.EconomicSet;
4748
import org.graalvm.collections.MapCursor;
@@ -142,8 +143,7 @@
142143
* method references into a symbolic form that can be resolved at graph decode time using
143144
* {@link SymbolicJVMCIReference}.
144145
* <p>
145-
* An instance of this class only exist when
146-
* {@link org.graalvm.nativeimage.ImageInfo#inImageBuildtimeCode()} is true.
146+
* An instance of this class only exist when {@link GraalServices#isBuildingLibgraal()} is true.
147147
*/
148148
public class SymbolicSnippetEncoder {
149149

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ public void run() {
278278

279279
});
280280
if (!inImageRuntimeCode()) {
281-
// In libgraal, all NodeIntrinsics have been converted into special nodes so the plugins
282-
// aren't needed.
281+
// In libgraal, all NodeIntrinsics have already been converted into nodes.
283282
NodeIntrinsificationProvider nodeIntrinsificationProvider = new NodeIntrinsificationProvider(metaAccess, snippetReflection, foreignCalls, wordTypes, target);
284283
invocationPlugins.defer(() -> {
285284
for (GeneratedPluginFactory factory : GraalServices.load(GeneratedPluginFactory.class)) {

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/graphbuilderconf/GeneratedPluginFactory.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,22 @@
2424
*/
2525
package jdk.graal.compiler.nodes.graphbuilderconf;
2626

27+
import jdk.graal.compiler.api.replacements.Fold;
28+
import jdk.graal.compiler.graph.Node.NodeIntrinsic;
2729
import jdk.graal.compiler.serviceprovider.LibGraalService;
2830

31+
/**
32+
* Interface implemented by a (generated) class that can register a set of
33+
* {@link GeneratedInvocationPlugin}s. The set of plugins are typically for the
34+
* {@link NodeIntrinsic} and {@link Fold} methods in a single top-level class.
35+
*/
2936
@LibGraalService
3037
public interface GeneratedPluginFactory {
3138

39+
/**
40+
* Registers a set of {@link InvocationPlugin}s with {@code plugins}.
41+
*
42+
* @param injection provides values for injected parameters
43+
*/
3244
void registerPlugins(InvocationPlugins plugins, GeneratedPluginInjectionProvider injection);
3345
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/graphbuilderconf/GeneratedPluginInjectionProvider.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@
2626

2727
import jdk.graal.compiler.core.common.type.Stamp;
2828

29+
/**
30+
* A provider for {@link jdk.graal.compiler.api.replacements.Fold.InjectedParameter injected
31+
* parameters} of a method.
32+
*/
2933
public interface GeneratedPluginInjectionProvider {
3034

35+
/**
36+
* Gets an injected value of type {@code type}. There will be at most one parameter of this type
37+
* in the annotated method.
38+
*/
3139
<T> T getInjectedArgument(Class<T> type);
3240

3341
/**

0 commit comments

Comments
 (0)