Skip to content

Commit d20905b

Browse files
committed
[GR-58203]
PullRequest: graal/18825
2 parents 4c77bc1 + 71d7168 commit d20905b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/ProfileReplaySupport.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.nio.file.Path;
3939
import java.nio.file.Paths;
4040
import java.util.Objects;
41+
import java.util.concurrent.atomic.AtomicBoolean;
4142
import java.util.stream.Collectors;
4243
import java.util.stream.Stream;
4344

@@ -202,14 +203,23 @@ public String formatLamdaName(ResolvedJavaMethod m) {
202203
throw GraalError.shouldNotReachHere(String.format("No file for method %s found in %s, strict profiles, abort", s, loadDir)); // ExcludeFromJacocoGeneratedReport
203204
}
204205
} catch (IOException e) {
205-
e.printStackTrace();
206+
boolean wasSet = profileReplayPrologueExceptionPrinted.getAndSet(true);
207+
if (!wasSet) {
208+
e.printStackTrace();
209+
}
206210
}
207211
}
208212
return new ProfileReplaySupport(lambdaNameFormatter, expectedResult, expectedCodeSignature, expectedGraphSignature, profileFilter, profileSaveFilter);
209213
}
210214
return null;
211215
}
212216

217+
/**
218+
* Guard to prevent flood of stack traces when CTRL-C'ing tasks such as
219+
* {@code mx benchmark compile-all:fuzzedClasses}.
220+
*/
221+
private static final AtomicBoolean profileReplayPrologueExceptionPrinted = new AtomicBoolean();
222+
213223
/**
214224
* Finishes a previously started profile record/replay (see {@link #profileReplayPrologue}.
215225
* Both, for record and replay, the method validates various expectations (see

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/libgraal/RunTime.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public static long compileMethod(long methodHandle, boolean useProfilingInfo,
124124
HotSpotResolvedJavaMethod method = runtime.unhand(HotSpotResolvedJavaMethod.class, methodHandle);
125125
HotSpotCompilationRequest request = new HotSpotCompilationRequest(method, entryBCI, 0L);
126126
try (CompilationContext ignored = HotSpotGraalServices.openLocalCompilationContext(request)) {
127-
CompilationTask task = new CompilationTask(runtime, compiler, request, useProfilingInfo, false, eagerResolving, installAsDefault);
127+
CompilationTask task = new CompilationTask(runtime, compiler, request, useProfilingInfo, false, false, eagerResolving, installAsDefault);
128128
long allocatedBytesBefore = 0;
129129
long timeBefore = 0;
130130
if (timeAndMemConsumer != null) {

0 commit comments

Comments
 (0)