Skip to content

Commit ddbf8fe

Browse files
committed
[GR-10538] Eagerly resolve fields when creating an AnalysisType.
PullRequest: graal/1978
2 parents a3c1c0e + 7160356 commit ddbf8fe

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

+11
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,17 @@ public class AnalysisType implements WrappedJavaType, OriginalClassProvider, Com
173173
*/
174174
wrapped.getEnclosingType();
175175

176+
/*
177+
* Eagerly resolve the instance fields. The wrapped type caches the result, so when
178+
* AnalysisType.getInstanceFields(boolean) is called it will use that cached result. We
179+
* cannot call AnalysisType.getInstanceFields(boolean), and create the corresponding
180+
* AnalysisField objects, directly here because that could lead to a deadlock.
181+
*/
182+
for (ResolvedJavaField field : wrapped.getInstanceFields(false)) {
183+
/* Eagerly resolve the field declared type. */
184+
field.getType();
185+
}
186+
176187
/* Ensure the super types as well as the component type (for arrays) is created too. */
177188
getSuperclass();
178189
interfaces = convertTypes(wrapped.getInterfaces());

0 commit comments

Comments
 (0)