use of com.oracle.svm.graal.meta.SubstrateMethod 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.svm.graal.meta.SubstrateMethod in project graal by oracle.
the class GraalObjectReplacer method updateDataDuringAnalysis.
/**
* Some meta data must be updated during analysis. This is done here.
*/
public boolean updateDataDuringAnalysis(AnalysisMetaAccess metaAccess) {
boolean result = false;
List<AnalysisMethod> aMethods = new ArrayList<>();
aMethods.addAll(methods.keySet());
int index = 0;
while (index < aMethods.size()) {
AnalysisMethod aMethod = aMethods.get(index++);
SubstrateMethod sMethod = methods.get(aMethod);
SubstrateMethod[] implementations = new SubstrateMethod[aMethod.getImplementations().length];
int idx = 0;
for (AnalysisMethod impl : aMethod.getImplementations()) {
SubstrateMethod sImpl = methods.get(impl);
if (sImpl == null) {
sImpl = createMethod(impl);
aMethods.add(impl);
result = true;
}
implementations[idx++] = sImpl;
}
if (sMethod.setImplementations(implementations)) {
result = true;
}
}
for (Map.Entry<AnalysisMethod, SubstrateMethod> entry : methods.entrySet()) {
if (entry.getValue().setAnnotationsEncoding(Inflation.encodeAnnotations(metaAccess, entry.getKey().getAnnotations(), entry.getValue().getAnnotationsEncoding()))) {
result = true;
}
}
for (Map.Entry<AnalysisField, SubstrateField> entry : fields.entrySet()) {
if (entry.getValue().setAnnotationsEncoding(Inflation.encodeAnnotations(metaAccess, entry.getKey().getAnnotations(), entry.getValue().getAnnotationsEncoding()))) {
result = true;
}
}
return result;
}
Aggregations