In InstanceKlass::verify_on for verifying the method ordering:
// Verify method ordering
if (method_ordering() != NULL) {
Array<int>* method_ordering = this->method_ordering();
int length = method_ordering->length();
if (JvmtiExport::can_maintain_original_method_order() ||
((UseSharedSpaces || DumpSharedSpaces) && length != 0)) {
guarantee(length == methods()->length(), "invalid method ordering length");
The (UseSharedSpaces || DumpSharedSpaces) condition covers the dynamic CDS dumping case as well because the UseSharedSpaces is set to true by default. To make the code easier to read, the DumpSharedSpaces should be changed to Arguments::is_dumping_archive().
// Verify method ordering
if (method_ordering() != NULL) {
Array<int>* method_ordering = this->method_ordering();
int length = method_ordering->length();
if (JvmtiExport::can_maintain_original_method_order() ||
((UseSharedSpaces || DumpSharedSpaces) && length != 0)) {
guarantee(length == methods()->length(), "invalid method ordering length");
The (UseSharedSpaces || DumpSharedSpaces) condition covers the dynamic CDS dumping case as well because the UseSharedSpaces is set to true by default. To make the code easier to read, the DumpSharedSpaces should be changed to Arguments::is_dumping_archive().