@@ -657,8 +657,8 @@ public int maxInvocationCount() {
657657 @ Override
658658 @ RestrictHeapAccess (access = RestrictHeapAccess .Access .NO_ALLOCATION , reason = "Must not allocate while printing diagnostics." )
659659 public void printDiagnostics (Log log , ErrorContext context , int maxDiagnosticLevel , int invocationCount ) {
660- boolean allowJavaHeapAccess = DiagnosticLevel .javaHeapAccessAllowed (maxDiagnosticLevel ) && invocationCount < 3 ;
661- boolean allowUnsafeOperations = DiagnosticLevel .unsafeOperationsAllowed (maxDiagnosticLevel ) && invocationCount < 2 ;
660+ boolean allowJavaHeapAccess = DiagnosticLevel .javaHeapAccessAllowed (maxDiagnosticLevel ) && invocationCount < 2 ;
661+ boolean allowUnsafeOperations = DiagnosticLevel .unsafeOperationsAllowed (maxDiagnosticLevel ) && invocationCount < 3 ;
662662 /*
663663 * If we are not at a safepoint, then it is unsafe to access the thread locals of
664664 * another thread as the IsolateThread could be freed at any time.
@@ -680,9 +680,13 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev
680680
681681 if (allowJavaHeapAccess ) {
682682 Thread threadObj = PlatformThreads .fromVMThread (thread );
683- log .string (" \" " ).string (threadObj .getName ()).string ("\" - " ).zhex (Word .objectToUntrackedPointer (threadObj ));
684- if (threadObj != null && threadObj .isDaemon ()) {
685- log .string (", daemon" );
683+ if (threadObj == null ) {
684+ log .string (" null" );
685+ } else {
686+ log .string (" \" " ).string (threadObj .getName ()).string ("\" - " ).zhex (Word .objectToUntrackedPointer (threadObj ));
687+ if (threadObj .isDaemon ()) {
688+ log .string (", daemon" );
689+ }
686690 }
687691 }
688692 log .string (", stack(" ).zhex (VMThreads .StackEnd .get (thread )).string ("," ).zhex (VMThreads .StackBase .get (thread )).string (")" );
0 commit comments