Skip to content

Commit

Permalink
[GR-10538] Eagerly resolve fields when creating an AnalysisType.
Browse files Browse the repository at this point in the history
PullRequest: graal/1978
  • Loading branch information
cstancu committed Aug 9, 2018
2 parents a3c1c0e + 7160356 commit ddbf8fe
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ public class AnalysisType implements WrappedJavaType, OriginalClassProvider, Com
*/
wrapped.getEnclosingType();

/*
* Eagerly resolve the instance fields. The wrapped type caches the result, so when
* AnalysisType.getInstanceFields(boolean) is called it will use that cached result. We
* cannot call AnalysisType.getInstanceFields(boolean), and create the corresponding
* AnalysisField objects, directly here because that could lead to a deadlock.
*/
for (ResolvedJavaField field : wrapped.getInstanceFields(false)) {
/* Eagerly resolve the field declared type. */
field.getType();
}

/* Ensure the super types as well as the component type (for arrays) is created too. */
getSuperclass();
interfaces = convertTypes(wrapped.getInterfaces());
Expand Down

0 comments on commit ddbf8fe

Please sign in to comment.