Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/hotspot/share/cds/aotClassInitializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ bool AOTClassInitializer::can_archive_initialized_mirror(InstanceKlass* ik) {
return false;
}

#ifndef PRODUCT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use #ifdef ASSERT instead if you guard for debug VM.

if (AOTInitTestClass == nullptr && ArchiveHeapTestClass == nullptr) {
// The above flags (in debug builds only) allow user code to be executed in assembly phase,
// strictly for testing purposes. If these flags are not set, no user code will 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");
}
}
}
#endif // PRODUCT

// About "static field that may hold a different value" errors:
//
// Automatic selection for aot-inited classes
Expand Down