public abstract class PartialEvaluator extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ResolvedJavaMethod |
callInlined |
protected TruffleConstantFieldProvider |
compilationLocalConstantProvider |
protected TruffleCompilerConfiguration |
config |
protected InstrumentPhase.Instrumentation |
instrumentation
The instrumentation object is used by the Truffle instrumentation to count executions.
|
InstrumentPhase.InstrumentationConfiguration |
instrumentationCfg
Holds instrumentation options initialized in
PartialEvaluator.initialize(OptionValues) method before
the first compilation. |
protected org.graalvm.compiler.truffle.compiler.PartialEvaluator.PELoopExplosionPlugin |
loopExplosionPlugin |
| Constructor and Description |
|---|
PartialEvaluator(TruffleCompilerConfiguration config,
GraphBuilderConfiguration configForRoot,
KnownTruffleTypes knownFields) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendParsingNodePlugins(GraphBuilderConfiguration.Plugins plugins) |
static InlineInvokePlugin.InlineInfo |
asInlineInfo(ResolvedJavaMethod method) |
protected InvocationPlugins |
createDecodingInvocationPlugins(PartialEvaluatorConfiguration peConfig,
GraphBuilderConfiguration.Plugins parent,
Providers tierProviders)
Graph-decoding plugins are not shared between the first- and the second-tier compilations,
because the different tiers intrinsify the respective methods differently.
|
protected PEGraphDecoder |
createGraphDecoder(TruffleTierContext context,
InvocationPlugins invocationPlugins,
InlineInvokePlugin[] inlineInvokePlugins,
ParameterPlugin parameterPlugin,
NodePlugin[] nodePluginList,
SourceLanguagePositionProvider sourceLanguagePositionProvider,
org.graalvm.collections.EconomicMap<ResolvedJavaMethod,EncodedGraph> graphCache,
Supplier<AutoCloseable> createCachedGraphScope) |
protected NodePlugin[] |
createNodePlugins(GraphBuilderConfiguration.Plugins plugins) |
static SpeculationReason |
createTruffleBoundaryExceptionSpeculation(ResolvedJavaMethod targetMethod) |
protected StructuredGraph.Builder |
customizeStructuredGraphBuilder(StructuredGraph.Builder builder)
Hook for subclasses: customize the StructuredGraph.
|
void |
doGraphPE(TruffleTierContext context,
InlineInvokePlugin inlineInvokePlugin,
org.graalvm.collections.EconomicMap<ResolvedJavaMethod,EncodedGraph> graphCache) |
ResolvedJavaMethod |
getCallDirect() |
ResolvedJavaMethod |
getCallInlined() |
ResolvedJavaMethod[] |
getCompilationRootMethods() |
GraphBuilderConfiguration |
getConfig()
Returns the
GraphBuilderConfiguration used by parsing. |
GraphBuilderConfiguration |
getConfigPrototype()
Returns the root
GraphBuilderConfiguration. |
protected Supplier<AutoCloseable> |
getCreateCachedGraphScope(boolean persistentEncodedGraphCache)
Gets a closeable producer that will be used in a try-with-resources statement surrounding the
creation of encoded graphs.
|
InstrumentPhase.Instrumentation |
getInstrumentation()
Gets the instrumentation manager associated with this compiler, creating it first if
necessary.
|
KnownTruffleTypes |
getKnownTruffleTypes() |
ResolvedJavaMethod[] |
getNeverInlineMethods() |
org.graalvm.collections.EconomicMap<ResolvedJavaMethod,EncodedGraph> |
getOrCreateEncodedGraphCache(boolean persistentEncodedGraphCache) |
Providers |
getProviders() |
protected void |
initialize(org.graalvm.options.OptionValues options) |
ResolvedJavaMethod |
inlineRootForCallTarget(CompilableTruffleAST compilable)
Hook for subclasses: return a customized compilation root when inlining a specific call
target.
|
protected void |
registerGraphBuilderInvocationPlugins(InvocationPlugins invocationPlugins,
boolean canDelayIntrinsification) |
ResolvedJavaMethod |
rootForCallTarget(CompilableTruffleAST compilable)
Hook for subclasses: return a customized compilation root for a specific call target.
|
protected final TruffleCompilerConfiguration config
protected final ResolvedJavaMethod callInlined
protected final org.graalvm.compiler.truffle.compiler.PartialEvaluator.PELoopExplosionPlugin loopExplosionPlugin
public volatile InstrumentPhase.InstrumentationConfiguration instrumentationCfg
PartialEvaluator.initialize(OptionValues) method before
the first compilation. These options are not engine aware.protected volatile InstrumentPhase.Instrumentation instrumentation
protected final TruffleConstantFieldProvider compilationLocalConstantProvider
public PartialEvaluator(TruffleCompilerConfiguration config, GraphBuilderConfiguration configForRoot, KnownTruffleTypes knownFields)
protected void initialize(org.graalvm.options.OptionValues options)
public org.graalvm.collections.EconomicMap<ResolvedJavaMethod,EncodedGraph> getOrCreateEncodedGraphCache(boolean persistentEncodedGraphCache)
public InstrumentPhase.Instrumentation getInstrumentation()
public static InlineInvokePlugin.InlineInfo asInlineInfo(ResolvedJavaMethod method)
public Providers getProviders()
public GraphBuilderConfiguration getConfigPrototype()
GraphBuilderConfiguration. The root configuration provides plugins
used by this PartialEvaluator but it's not configured with engine options. The root
configuration should be used in image generation time where the PartialEvaluator is
not yet initialized with engine options. At runtime the PartialEvaluator.getConfig() should be used.public GraphBuilderConfiguration getConfig()
GraphBuilderConfiguration used by parsing. The returned configuration is
configured with engine options. In the image generation time the PartialEvaluator is
not yet initialized and the PartialEvaluator.getConfigPrototype() should be used instead.IllegalStateException - when called on non initialized PartialEvaluatorpublic KnownTruffleTypes getKnownTruffleTypes()
public ResolvedJavaMethod[] getCompilationRootMethods()
public ResolvedJavaMethod[] getNeverInlineMethods()
public ResolvedJavaMethod getCallDirect()
public ResolvedJavaMethod getCallInlined()
protected StructuredGraph.Builder customizeStructuredGraphBuilder(StructuredGraph.Builder builder)
public ResolvedJavaMethod rootForCallTarget(CompilableTruffleAST compilable)
compilable - the Truffle AST being compiled.public ResolvedJavaMethod inlineRootForCallTarget(CompilableTruffleAST compilable)
compilable - the Truffle AST being compiled.protected PEGraphDecoder createGraphDecoder(TruffleTierContext context, InvocationPlugins invocationPlugins, InlineInvokePlugin[] inlineInvokePlugins, ParameterPlugin parameterPlugin, NodePlugin[] nodePluginList, SourceLanguagePositionProvider sourceLanguagePositionProvider, org.graalvm.collections.EconomicMap<ResolvedJavaMethod,EncodedGraph> graphCache, Supplier<AutoCloseable> createCachedGraphScope)
public void doGraphPE(TruffleTierContext context, InlineInvokePlugin inlineInvokePlugin, org.graalvm.collections.EconomicMap<ResolvedJavaMethod,EncodedGraph> graphCache)
protected Supplier<AutoCloseable> getCreateCachedGraphScope(boolean persistentEncodedGraphCache)
protected void appendParsingNodePlugins(GraphBuilderConfiguration.Plugins plugins)
protected NodePlugin[] createNodePlugins(GraphBuilderConfiguration.Plugins plugins)
protected void registerGraphBuilderInvocationPlugins(InvocationPlugins invocationPlugins, boolean canDelayIntrinsification)
protected InvocationPlugins createDecodingInvocationPlugins(PartialEvaluatorConfiguration peConfig, GraphBuilderConfiguration.Plugins parent, Providers tierProviders)
public static SpeculationReason createTruffleBoundaryExceptionSpeculation(ResolvedJavaMethod targetMethod)