use of com.oracle.svm.hosted.substitute.ComputedValueField in project graal by oracle.
the class UniverseBuilder method build.
/**
* This step is single threaded, i.e., all the maps are modified only by a single thread, so no
* synchronization is necessary. Accesses (the lookup methods) are multi-threaded.
*/
@SuppressWarnings("try")
public void build(DebugContext debug) {
for (AnalysisField aField : aUniverse.getFields()) {
if (aField.wrapped instanceof ComputedValueField) {
((ComputedValueField) aField.wrapped).processAnalysis(aMetaAccess);
}
}
aUniverse.seal();
try (Indent indent = debug.logAndIndent("build universe")) {
for (AnalysisType aType : aUniverse.getTypes()) {
makeType(aType);
}
for (AnalysisField aField : aUniverse.getFields()) {
makeField(aField);
}
for (AnalysisMethod aMethod : aUniverse.getMethods()) {
makeMethod(aMethod);
}
BigBang bb = staticAnalysisResultsBuilder.getBigBang();
ForkJoinTask<?> profilingInformationBuildTask = ForkJoinTask.adapt(this::buildProfilingInformation).fork();
buildSubTypes();
buildOrderedTypes();
buildTypeCheckIDs();
collectDeclaredMethods();
collectMonitorFieldInfo(bb);
collectHashCodeFieldInfo(bb);
layoutInstanceFields();
layoutStaticFields();
collectMethodImplementations();
buildVTables();
buildHubs();
setConstantFieldValues();
hUniverse.orderedMethods = new ArrayList<>(hUniverse.methods.values());
Collections.sort(hUniverse.orderedMethods);
hUniverse.orderedFields = new ArrayList<>(hUniverse.fields.values());
Collections.sort(hUniverse.orderedFields);
profilingInformationBuildTask.join();
}
}
use of com.oracle.svm.hosted.substitute.ComputedValueField in project graal by oracle.
the class SVMMethodTypeFlowBuilder method checkUnsafeOffset.
@Override
protected void checkUnsafeOffset(ValueNode offsetNode) {
if (!NativeImageOptions.ThrowUnsafeOffsetErrors.getValue()) {
/* Skip the checks bellow. */
return;
}
if (offsetNode instanceof LoadFieldNode) {
LoadFieldNode offsetLoadNode = (LoadFieldNode) offsetNode;
AnalysisField field = (AnalysisField) offsetLoadNode.field();
if (!(field.wrapped instanceof ComputedValueField)) {
UnsafeOffsetError.report("Field " + field + " is used as an offset in an unsafe operation, but no value recomputation found. \n Wrapped field: " + field.wrapped);
}
} else if (NativeImageOptions.ReportUnsafeOffsetWarnings.getValue()) {
String message = "Offset used in an unsafe operation. Cannot determine if the offset value is recomputed.";
message += "Location: " + offsetNode.getNodeSourcePosition() + "\n";
message += "Node class: " + offsetNode.getClass().getName() + "\n";
if (NativeImageOptions.UnsafeOffsetWarningsAreFatal.getValue()) {
UnsafeOffsetError.report(message);
} else {
System.out.println(message);
}
}
}
Aggregations