Skip to content

Commit 55f41cd

Browse files
committed
Track fields of tracked types across layers
1 parent 1892b1b commit 55f41cd

File tree

1 file changed

+11
-0
lines changed
  • substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta

1 file changed

+11
-0
lines changed

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisType.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,17 @@ protected void onTrackedAcrossLayers(Object reason) {
630630
* is not reached through other paths.
631631
*/
632632
}
633+
/*
634+
* Track fields of tracked types to ensure the analysis results are transferred across
635+
* layers. This is important for things such as object layout decisions made in later
636+
* layers.
637+
*/
638+
for (var field : getInstanceFields(true)) {
639+
((AnalysisField) field).registerAsTrackedAcrossLayers(reason);
640+
}
641+
for (var field : getStaticFields()) {
642+
((AnalysisField) field).registerAsTrackedAcrossLayers(reason);
643+
}
633644
}
634645

635646
/** Prepare information that {@link AnalysisMethod#collectMethodImplementations} needs. */

0 commit comments

Comments
 (0)