@@ -438,9 +438,6 @@ private void maybeExitVM(ExceptionAction action) {
438438 private static final long COMPILATION_FAILURE_DETECTION_PERIOD_NS = TimeUnit .SECONDS .toNanos (2 );
439439 private static final int MIN_COMPILATIONS_FOR_FAILURE_DETECTION = 25 ;
440440
441- // Ensures the system compilation failure warning is printed once per VM process.
442- private static final GlobalAtomicLong SYSTEMIC_COMPILATION_FAILURE_WARNED = new GlobalAtomicLong ("SYSTEMIC_COMPILATION_FAILURE_WARNED" , 0L );
443-
444441 /**
445442 * Gets the start of the current compilation period, initializing it to {@code initialValue} if
446443 * this is the first period.
@@ -492,22 +489,20 @@ private static boolean detectCompilationFailureRateTooHigh(OptionValues options,
492489 // Wait for period to expire or some minimum amount of compilations
493490 // before detecting systemic failure.
494491 if (rate > maxRate && (periodExpired || total > MIN_COMPILATIONS_FOR_FAILURE_DETECTION )) {
495- if (SYSTEMIC_COMPILATION_FAILURE_WARNED .compareAndSet (0L , 1L )) {
496- Formatter msg = new Formatter ();
497- String option = GraalCompilerOptions .SystemicCompilationFailureRate .getName ();
498- msg .format ("Warning: Systemic Graal compilation failure detected: %d of %d (%d%%) of compilations failed during last %d ms [max rate set by %s is %d%%]. " ,
499- failed , total , rate , TimeUnit .NANOSECONDS .toMillis (periodNS ), option , maxRateValue );
500- msg .format ("To mitigate systemic compilation failure detection, set %s to a higher value. " , option );
501- msg .format ("To disable systemic compilation failure detection, set %s to 0. " , option );
502- StringWriter sw = new StringWriter ();
503- cause .printStackTrace (new PrintWriter (sw ));
504- msg .format ("Current failure: %s" , sw );
505- TTY .println (msg .toString ());
506-
507- if (maxRateValue < 0 ) {
508- // A negative value means the VM should be exited
509- return true ;
510- }
492+ Formatter msg = new Formatter ();
493+ String option = GraalCompilerOptions .SystemicCompilationFailureRate .getName ();
494+ msg .format ("Warning: Systemic Graal compilation failure detected: %d of %d (%d%%) of compilations failed during last %d ms [max rate set by %s is %d%%]. " ,
495+ failed , total , rate , TimeUnit .NANOSECONDS .toMillis (periodNS ), option , maxRateValue );
496+ msg .format ("To mitigate systemic compilation failure detection, set %s to a higher value. " , option );
497+ msg .format ("To disable systemic compilation failure detection, set %s to 0. " , option );
498+ StringWriter sw = new StringWriter ();
499+ cause .printStackTrace (new PrintWriter (sw ));
500+ msg .format ("Current failure: %s" , sw );
501+ TTY .println (msg .toString ());
502+
503+ if (maxRateValue < 0 ) {
504+ // A negative value means the VM should be exited
505+ return true ;
511506 }
512507 periodExpired = true ;
513508 }
0 commit comments