From b5f04edb5235c19bce586d01efa6a388cc7af403 Mon Sep 17 00:00:00 2001 From: Matias Saavedra Silva Date: Thu, 26 Mar 2026 12:33:21 -0400 Subject: [PATCH] Coleen comments --- src/hotspot/share/cds/aotClassInitializer.cpp | 11 ++++------- test/lib/jdk/test/lib/cds/CDSTestUtils.java | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/cds/aotClassInitializer.cpp b/src/hotspot/share/cds/aotClassInitializer.cpp index 6b88ce6afdb..a7250dcdc7f 100644 --- a/src/hotspot/share/cds/aotClassInitializer.cpp +++ b/src/hotspot/share/cds/aotClassInitializer.cpp @@ -61,15 +61,12 @@ bool AOTClassInitializer::can_archive_initialized_mirror(InstanceKlass* ik) { #ifdef ASSERT if (AOTInitTestClass == nullptr && ArchiveHeapTestClass == nullptr) { - // The above flags (in debug builds only) allow java code to be executed in assembly phase, - // strictly for testing purposes. If these flags are not set, no java code will be executed + // The above flags (in debug builds only) allow Java code to be executed in assembly phase, + // strictly for testing purposes. If these flags are not set, no Java code should be executed // in assembly phase. if (ik->class_loader() != nullptr && !ik->is_hidden()) { - if (ik->is_interface() && !ik->interface_needs_clinit_execution_as_super()) { - // TODO: why are these interfaces marked as initialized?? - } else { - assert(false, "cannot execute user code"); - } + // Interfaces with default methods and also execute Java code. + assert(ik->is_interface() && !ik->interface_needs_clinit_execution_as_super(), "cannot execute Java code in assembly phase, %d %d", ik->is_interface(), ik->interface_needs_clinit_execution_as_super()); } } #endif // ASSERT diff --git a/test/lib/jdk/test/lib/cds/CDSTestUtils.java b/test/lib/jdk/test/lib/cds/CDSTestUtils.java index 1c51a693907..59e4a1bbbde 100644 --- a/test/lib/jdk/test/lib/cds/CDSTestUtils.java +++ b/test/lib/jdk/test/lib/cds/CDSTestUtils.java @@ -324,7 +324,7 @@ public class CDSTestUtils { public static void checkCommonExecExceptions(OutputAnalyzer output, Exception e) throws Exception { if (output.getStdout().contains("https://bugreport.java.com/bugreport/crash.jsp")) { - throw new RuntimeException("Hotspot crashed"); + throw new RuntimeException(getCrashMessage(output.getStdout())); } if (output.getStdout().contains("TEST FAILED")) { throw new RuntimeException("Test Failed");