|
42 | 42 | import jdk.vm.ci.meta.ResolvedJavaMethod;
|
43 | 43 | import org.graalvm.collections.EconomicMap;
|
44 | 44 | import org.graalvm.collections.EconomicSet;
|
45 |
| -import org.graalvm.collections.UnmodifiableEconomicSet; |
46 | 45 | import org.graalvm.nativeimage.ImageSingletons;
|
47 | 46 |
|
| 47 | +import java.io.File; |
48 | 48 | import java.io.IOException;
|
49 | 49 | import java.io.PrintWriter;
|
50 | 50 | import java.nio.file.Files;
|
@@ -107,15 +107,15 @@ public ConcurrentLinkedQueue<String> getMethodCallLocations(String methodName) {
|
107 | 107 | "java.lang.reflect.Array.newInstance",
|
108 | 108 | "java.lang.ClassLoader.loadClass");
|
109 | 109 |
|
110 |
| - public static final String GRAAL_SUBPATH = "/graal/"; |
| 110 | + public static final String GRAAL_SUBPATH = File.separator + "graal" + File.separator; |
111 | 111 | public static final String TRACK_ALL = "all";
|
112 | 112 |
|
113 | 113 | private static final String OUTPUT_DIR_NAME = "dynamic-access";
|
114 | 114 | private static final String TRACK_NONE = "none";
|
115 | 115 | private static final String TO_CONSOLE = "to-console";
|
116 | 116 | private static final String NO_DUMP = "no-dump";
|
117 | 117 |
|
118 |
| - private UnmodifiableEconomicSet<String> sourceEntries; // Class path entries and module or |
| 118 | + private EconomicSet<String> sourceEntries; // Class path entries and module or |
119 | 119 | // package names
|
120 | 120 | private final Map<String, MethodsByAccessKind> callsBySourceEntry;
|
121 | 121 | private final Set<FoldEntry> foldEntries = ConcurrentHashMap.newKeySet();
|
@@ -144,12 +144,12 @@ public MethodsByAccessKind getMethodsByAccessKind(String entry) {
|
144 | 144 | return callsBySourceEntry.computeIfAbsent(entry, k -> new MethodsByAccessKind());
|
145 | 145 | }
|
146 | 146 |
|
147 |
| - public UnmodifiableEconomicSet<String> getSourceEntries() { |
| 147 | + public EconomicSet<String> getSourceEntries() { |
148 | 148 | return sourceEntries;
|
149 | 149 | }
|
150 | 150 |
|
151 | 151 | public static String getEntryName(String path) {
|
152 |
| - String fileName = path.substring(path.lastIndexOf("/") + 1); |
| 152 | + String fileName = path.substring(path.lastIndexOf(File.separator) + 1); |
153 | 153 | if (fileName.endsWith(".jar")) {
|
154 | 154 | fileName = fileName.substring(0, fileName.lastIndexOf('.'));
|
155 | 155 | }
|
@@ -321,6 +321,13 @@ public void afterRegistration(AfterRegistrationAccess access) {
|
321 | 321 | public void beforeCompilation(BeforeCompilationAccess access) {
|
322 | 322 | DynamicAccessDetectionFeature.instance().reportDynamicAccess();
|
323 | 323 | DynamicAccessDetectionPhase.clearMethodSignatures();
|
| 324 | + foldEntries.clear(); |
| 325 | + } |
| 326 | + |
| 327 | + @Override |
| 328 | + public void beforeHeapLayout(BeforeHeapLayoutAccess access) { |
| 329 | + callsBySourceEntry.clear(); |
| 330 | + sourceEntries.clear(); |
324 | 331 | }
|
325 | 332 |
|
326 | 333 | @Override
|
|
0 commit comments