Skip to content

Commit

Permalink
[GR-50090] Invalidate all code on compiler unit test.
Browse files Browse the repository at this point in the history
PullRequest: graal/17973
  • Loading branch information
davleopo committed Jun 20, 2024
2 parents b33c897 + ee0829f commit 911696d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,16 @@ protected LIRSuites createLIRSuites(OptionValues opts) {

private static final ThreadLocal<HashMap<ResolvedJavaMethod, InstalledCode>> cache = ThreadLocal.withInitial(HashMap::new);

/**
* Reset the entire {@linkplain #cache} of {@linkplain InstalledCode}. Additionally, invalidate
* all code that was installed before. Some tests install default methods for example and one
* test should never influence another one.
*/
@BeforeClass
public static void resetCodeCache() {
for (InstalledCode code : cache.get().values()) {
code.invalidate();
}
cache.get().clear();
}

Expand Down

0 comments on commit 911696d

Please sign in to comment.