8231606: _method_ordering is not set during CDS dynamic dump time

Add the missing DynamicDumpSharedSpaces check in sort_methods(); replace the (DumpSharedSpaces || DynamicDumpSharedSpaces) with the Arguments::is_dumping_archive() function call.

Reviewed-by: iklam, coleenp, jiangli
This commit is contained in:
Calvin Cheung 2019-10-02 16:55:08 -07:00
parent 72c2079fd0
commit b08a8c5cc3
24 changed files with 73 additions and 54 deletions

View file

@ -3004,7 +3004,7 @@ static const intArray* sort_methods(Array<Method*>* methods) {
// We temporarily use the vtable_index field in the Method* to store the
// class file index, so we can read in after calling qsort.
// Put the method ordering in the shared archive.
if (JvmtiExport::can_maintain_original_method_order() || DumpSharedSpaces) {
if (JvmtiExport::can_maintain_original_method_order() || Arguments::is_dumping_archive()) {
for (int index = 0; index < length; index++) {
Method* const m = methods->at(index);
assert(!m->valid_vtable_index(), "vtable index should not be set");
@ -3018,7 +3018,7 @@ static const intArray* sort_methods(Array<Method*>* methods) {
intArray* method_ordering = NULL;
// If JVMTI original method ordering or sharing is enabled construct int
// array remembering the original ordering
if (JvmtiExport::can_maintain_original_method_order() || DumpSharedSpaces) {
if (JvmtiExport::can_maintain_original_method_order() || Arguments::is_dumping_archive()) {
method_ordering = new intArray(length, length, -1);
for (int index = 0; index < length; index++) {
Method* const m = methods->at(index);