public abstract class StrengthenGraphs extends AbstractAnalysisResultsBuilder
Graal IR
used
to build the type flow graph.
It uses a CanonicalizerPhase.CustomSimplification
for the CanonicalizerPhase
, because that provides
all the framework for iterative stamp propagation and adding/removing control flow nodes while
processing the graph.
From the single-method view that the compiler has when later compiling the graph, static analysis
results appear "out of thin air": At some some random point in the graph, we suddenly have a more
precise type (= stamp) for a value. Since many nodes are floating, and even currently fixed nodes
might float later, we need to be careful that all information coming from the type flow graph
remains properly anchored to the point where the static analysis actually proved the information.
So we cannot just change the stamp of, e.g., the parameter of a method invocation, to a more
precise stamp. We need to do that indirectly by adding a PiNode
that is anchored using a
ValueAnchorNode
.bb, converter
Constructor and Description |
---|
StrengthenGraphs(BigBang bb,
Universe converter) |
Modifier and Type | Method and Description |
---|---|
protected abstract org.graalvm.compiler.nodes.FixedNode |
createUnreachable(org.graalvm.compiler.nodes.StructuredGraph graph,
org.graalvm.compiler.nodes.spi.CoreProviders providers,
Supplier<String> message) |
protected abstract AnalysisType |
getSingleImplementorType(AnalysisType originalType) |
protected abstract AnalysisType |
getStrengthenStampType(AnalysisType originalType) |
StaticAnalysisResults |
makeOrApplyResults(AnalysisMethod method) |
jdk.vm.ci.meta.JavaTypeProfile |
makeTypeProfile(AnalysisField field) |
protected abstract void |
setInvokeProfiles(org.graalvm.compiler.nodes.Invoke invoke,
jdk.vm.ci.meta.JavaTypeProfile typeProfile,
jdk.vm.ci.meta.JavaMethodProfile methodProfile) |
getBigBang, makeMethodProfile, makeTypeProfile
public StaticAnalysisResults makeOrApplyResults(AnalysisMethod method)
makeOrApplyResults
in class AbstractAnalysisResultsBuilder
public jdk.vm.ci.meta.JavaTypeProfile makeTypeProfile(AnalysisField field)
makeTypeProfile
in class AbstractAnalysisResultsBuilder
protected abstract AnalysisType getSingleImplementorType(AnalysisType originalType)
protected abstract AnalysisType getStrengthenStampType(AnalysisType originalType)
protected abstract org.graalvm.compiler.nodes.FixedNode createUnreachable(org.graalvm.compiler.nodes.StructuredGraph graph, org.graalvm.compiler.nodes.spi.CoreProviders providers, Supplier<String> message)
protected abstract void setInvokeProfiles(org.graalvm.compiler.nodes.Invoke invoke, jdk.vm.ci.meta.JavaTypeProfile typeProfile, jdk.vm.ci.meta.JavaMethodProfile methodProfile)