use of com.oracle.graal.pointsto.meta.AnalysisMethod in project graal by oracle.
the class RuntimeStrengthenStampsPhase method requireFrameInformationForMethod.
public SubstrateMethod requireFrameInformationForMethod(ResolvedJavaMethod method) {
AnalysisMethod aMethod = (AnalysisMethod) method;
SubstrateMethod sMethod = objectReplacer.createMethod(aMethod);
CompilationInfoSupport.singleton().registerFrameInformationRequired(aMethod);
return sMethod;
}
use of com.oracle.graal.pointsto.meta.AnalysisMethod in project graal by oracle.
the class RuntimeStrengthenStampsPhase method prepareMethodForRuntimeCompilation.
public SubstrateMethod prepareMethodForRuntimeCompilation(ResolvedJavaMethod method, BeforeAnalysisAccessImpl config) {
AnalysisMethod aMethod = (AnalysisMethod) method;
SubstrateMethod sMethod = objectReplacer.createMethod(aMethod);
assert !methods.containsKey(aMethod);
methods.put(aMethod, new CallTreeNode(aMethod, aMethod, null, 0, ""));
config.registerAsInvoked(aMethod);
return sMethod;
}
use of com.oracle.graal.pointsto.meta.AnalysisMethod in project graal by oracle.
the class GraalObjectReplacer method createMethod.
public SubstrateMethod createMethod(ResolvedJavaMethod original) {
AnalysisMethod aMethod;
if (original instanceof AnalysisMethod) {
aMethod = (AnalysisMethod) original;
} else if (original instanceof HostedMethod) {
aMethod = ((HostedMethod) original).wrapped;
} else {
aMethod = aUniverse.lookup(original);
}
SubstrateMethod sMethod = methods.get(aMethod);
if (sMethod == null) {
assert !(original instanceof HostedMethod) : "too late to create new method";
sMethod = new SubstrateMethod(aMethod, stringTable);
methods.put(aMethod, sMethod);
/*
* The links to other meta objects must be set after adding to the methods to avoid
* infinite recursion.
*/
sMethod.setLinks(createSignature(aMethod.getSignature()), createType(aMethod.getDeclaringClass()));
/*
* Annotations are updated in every analysis iteration, but this is a starting point. It
* also ensures that all types used by annotations are created eagerly.
*/
sMethod.setAnnotationsEncoding(Inflation.encodeAnnotations(aMetaAccess, aMethod.getAnnotations(), null));
}
return sMethod;
}
use of com.oracle.graal.pointsto.meta.AnalysisMethod in project graal by oracle.
the class GraalObjectReplacer method updateSubstrateDataAfterHeapLayout.
public void updateSubstrateDataAfterHeapLayout(HostedUniverse hUniverse) {
for (Map.Entry<AnalysisMethod, SubstrateMethod> entry : methods.entrySet()) {
AnalysisMethod aMethod = entry.getKey();
SubstrateMethod sMethod = entry.getValue();
HostedMethod hMethod = hUniverse.lookup(aMethod);
int vTableIndex = (hMethod.hasVTableIndex() ? hMethod.getVTableIndex() : -1);
/*
* We access the offset of methods in the image code section here. Therefore, this code
* can only run after the heap and code cache layout was done.
*/
sMethod.setSubstrateData(vTableIndex, hMethod.isCodeAddressOffsetValid() ? hMethod.getCodeAddressOffset() : 0, hMethod.getDeoptOffsetInImage());
}
}
use of com.oracle.graal.pointsto.meta.AnalysisMethod in project graal by oracle.
the class ObjectScanner method scanMethod.
private void scanMethod(AnalysisMethod method) {
try {
StreamSupport.stream(method.getTypeFlow().getGraph().getNodes().spliterator(), false).filter(n -> n instanceof ConstantNode).forEach(n -> {
ConstantNode cn = (ConstantNode) n;
JavaConstant c = (JavaConstant) cn.getValue();
if (c.getJavaKind() == JavaKind.Object) {
scanConstant(c, method);
}
});
} catch (UnsupportedFeatureException ex) {
bb.getUnsupportedFeatures().addMessage(method.format("%H.%n(%p)"), method, ex.getMessage(), null, ex);
}
}
Aggregations