public abstract class HostVM extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ClassLoader |
classLoader |
protected List<BiConsumer<AnalysisMethod,org.graalvm.compiler.nodes.StructuredGraph>> |
methodAfterParsingListeners |
protected org.graalvm.compiler.options.OptionValues |
options |
| Modifier | Constructor and Description |
|---|---|
protected |
HostVM(org.graalvm.compiler.options.OptionValues options,
ClassLoader classLoader) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMethodAfterParsingListener(BiConsumer<AnalysisMethod,org.graalvm.compiler.nodes.StructuredGraph> methodAfterParsingHook) |
void |
checkForbidden(AnalysisType type,
AnalysisType.UsageKind kind)
Check if the type is allowed.
|
void |
checkType(ResolvedJavaType type,
AnalysisUniverse universe)
Run additional checks on a type before the corresponding
AnalysisType is created. |
void |
clearInThread() |
abstract org.graalvm.compiler.java.GraphBuilderPhase.Instance |
createGraphBuilderPhase(HostedProviders providers,
org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration graphBuilderConfig,
org.graalvm.compiler.phases.OptimisticOptimizations optimisticOpts,
org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext initialIntrinsicContext) |
Object |
getConfiguration() |
String |
getImageName()
Gets the name of the native image being built.
|
Optional<AnalysisMethod> |
handleForeignCall(org.graalvm.compiler.core.common.spi.ForeignCallDescriptor foreignCallDescriptor,
org.graalvm.compiler.core.common.spi.ForeignCallsProvider foreignCallsProvider)
Hook for handling foreign calls.
|
boolean |
hasNeverInlineDirective(ResolvedJavaMethod method)
Check if the method can be inlined.
|
abstract void |
initializeType(AnalysisType newValue)
Run initialization tasks for a newly created
AnalysisType. |
InlineBeforeAnalysisPolicy<?> |
inlineBeforeAnalysisPolicy() |
void |
installInThread(Object vmConfig) |
abstract boolean |
isInitialized(AnalysisType type)
Check if an
AnalysisType is initialized. |
boolean |
isRelocatedPointer(Object originalObject)
Check if the provided object is a relocated pointer.
|
void |
methodAfterParsingHook(BigBang bb,
AnalysisMethod method,
org.graalvm.compiler.nodes.StructuredGraph graph)
Can be overwritten to run code after a method is parsed.
|
void |
methodBeforeTypeFlowCreationHook(PointsToAnalysis bb,
AnalysisMethod method,
org.graalvm.compiler.nodes.StructuredGraph graph)
Can be overwritten to run code before a method is created.
|
void |
notifyClassReachabilityListener(AnalysisUniverse universe,
org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess access) |
org.graalvm.compiler.options.OptionValues |
options() |
boolean |
platformSupported(AnnotatedElement element)
Check if the element is supported on current platform.
|
void |
registerClassReachabilityListener(BiConsumer<org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess,Class<?>> listener) |
void |
registerType(AnalysisType newValue)
Register newly created type.
|
boolean |
skipInterface(AnalysisUniverse universe,
ResolvedJavaType interfaceType,
ResolvedJavaType implementingType) |
org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration |
updateGraphBuilderConfiguration(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration config,
AnalysisMethod method)
Hook to change the
GraphBuilderConfiguration used for parsing a method during
analysis. |
protected final org.graalvm.compiler.options.OptionValues options
protected final ClassLoader classLoader
protected final List<BiConsumer<AnalysisMethod,org.graalvm.compiler.nodes.StructuredGraph>> methodAfterParsingListeners
protected HostVM(org.graalvm.compiler.options.OptionValues options,
ClassLoader classLoader)
public org.graalvm.compiler.options.OptionValues options()
public boolean isRelocatedPointer(Object originalObject)
originalObject - the object to checkpublic Optional<AnalysisMethod> handleForeignCall(org.graalvm.compiler.core.common.spi.ForeignCallDescriptor foreignCallDescriptor, org.graalvm.compiler.core.common.spi.ForeignCallsProvider foreignCallsProvider)
foreignCallDescriptor - the foreign call descriptorforeignCallsProvider - the foreign calls providerAnalysisMethod modeling the foreign call, if supportedpublic void registerClassReachabilityListener(BiConsumer<org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess,Class<?>> listener)
public void notifyClassReachabilityListener(AnalysisUniverse universe, org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess access)
public void checkForbidden(AnalysisType type, AnalysisType.UsageKind kind)
type - the type to checkkind - usage kindpublic void registerType(AnalysisType newValue)
newValue - the type to registerpublic void checkType(ResolvedJavaType type,
AnalysisUniverse universe)
AnalysisType is created.type - the hosted typeuniverse - the analysis universepublic abstract void initializeType(AnalysisType newValue)
AnalysisType.newValue - the type to initializepublic abstract boolean isInitialized(AnalysisType type)
AnalysisType is initialized.public org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration updateGraphBuilderConfiguration(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration config,
AnalysisMethod method)
GraphBuilderConfiguration used for parsing a method during
analysis.config - The default configuration used by the static analysis.method - The method that is going to be parsed with the returned configuration.public abstract org.graalvm.compiler.java.GraphBuilderPhase.Instance createGraphBuilderPhase(HostedProviders providers, org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration graphBuilderConfig, org.graalvm.compiler.phases.OptimisticOptimizations optimisticOpts, org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext initialIntrinsicContext)
public String getImageName()
null if this VM is not being used in the context of building a native imagepublic void addMethodAfterParsingListener(BiConsumer<AnalysisMethod,org.graalvm.compiler.nodes.StructuredGraph> methodAfterParsingHook)
public void methodAfterParsingHook(BigBang bb, AnalysisMethod method, org.graalvm.compiler.nodes.StructuredGraph graph)
bb - the analysis enginemethod - the newly parsed methodgraph - the method graphpublic void methodBeforeTypeFlowCreationHook(PointsToAnalysis bb, AnalysisMethod method, org.graalvm.compiler.nodes.StructuredGraph graph)
bb - the analysis enginemethod - the newly created methodgraph - the method graphpublic boolean hasNeverInlineDirective(ResolvedJavaMethod method)
method - the target methodpublic InlineBeforeAnalysisPolicy<?> inlineBeforeAnalysisPolicy()
public boolean skipInterface(AnalysisUniverse universe, ResolvedJavaType interfaceType, ResolvedJavaType implementingType)
public boolean platformSupported(AnnotatedElement element)
element - the AnnotatedElement to checkpublic void installInThread(Object vmConfig)
public void clearInThread()
public Object getConfiguration()