Skip to content

[GR-59445] Ensure Word fields are saturated when unavailable. #9995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import com.oracle.graal.pointsto.meta.AnalysisMetaAccess;
import com.oracle.graal.pointsto.meta.AnalysisType;
import com.oracle.graal.pointsto.meta.AnalysisUniverse;
import com.oracle.graal.pointsto.meta.PointsToAnalysisField;
import com.oracle.graal.pointsto.util.AnalysisError;
import com.oracle.graal.pointsto.util.AnalysisFuture;
import com.oracle.graal.pointsto.util.CompletionExecutor;
Expand Down Expand Up @@ -139,8 +140,10 @@ public void onFieldRead(AnalysisField field) {
*
* GR-52421: the field state needs to be serialized from the base layer analysis
*/
if (field.getJavaKind().isObject()) {
if (field.getStorageKind().isObject()) {
bb.injectFieldTypes(field, List.of(field.getType()), true);
} else if (bb.trackPrimitiveValues() && field.getStorageKind().isPrimitive()) {
((PointsToAnalysisField) field).saturatePrimitiveField();
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void handleField(AnalysisField field) {
*/
assert field.isAccessed();
if (fieldValueInterceptionSupport.hasFieldValueTransformer(field)) {
if (field.getJavaKind().isObject() && !fieldValueInterceptionSupport.isValueAvailable(field)) {
if (field.getStorageKind().isObject() && !fieldValueInterceptionSupport.isValueAvailable(field)) {
injectFieldTypes(field, List.of(field.getType()), true);
} else if (bb.trackPrimitiveValues() && field.getStorageKind().isPrimitive() && field instanceof PointsToAnalysisField ptaField) {
ptaField.saturatePrimitiveField();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public NativeImageReachabilityAnalysisEngine(OptionValues options, AnalysisUnive
this.unknownFieldHandler = new CustomTypeFieldHandler(this, metaAccess) {
@Override
public void injectFieldTypes(AnalysisField aField, List<AnalysisType> declaredTypes, boolean canBeNull) {
assert aField.getJavaKind().isObject();
assert aField.getStorageKind().isObject();
aField.registerAsAccessed("@UnknownObjectField annotated field.");
for (AnalysisType declaredType : declaredTypes) {
declaredType.registerAsReachable("injected field types for unknown annotated field " + aField.format("%H.%n"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public PointsToCustomTypeFieldHandler(BigBang bb, AnalysisMetaAccess metaAccess)
public void injectFieldTypes(AnalysisField aField, List<AnalysisType> customTypes, boolean canBeNull) {
NativeImagePointsToAnalysis analysis = (NativeImagePointsToAnalysis) bb;

assert aField.getJavaKind().isObject();
assert aField.getStorageKind().isObject();

/* Link the field with all declared types. */
for (AnalysisType type : customTypes) {
Expand Down