diff -r 13588c901957 -r 9cf78a70fa4f src/hotspot/share/prims/jvmtiRedefineClasses.cpp --- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp Thu Oct 17 20:27:44 2019 +0100 +++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp Thu Oct 17 20:53:35 2019 +0100 @@ -232,12 +232,9 @@ ResolvedMethodTable::adjust_method_entries(&trace_name_printed); } - // Disable any dependent concurrent compilations - SystemDictionary::notice_modification(); - - // Set flag indicating that some invariants are no longer true. + // Increment flag indicating that some invariants are no longer true. // See jvmtiExport.hpp for detailed explanation. - JvmtiExport::set_has_redefined_a_class(); + JvmtiExport::increment_redefinition_count(); // check_class() is optionally called for product bits, but is // always called for non-product bits. @@ -1626,6 +1623,11 @@ return JVMTI_ERROR_INTERNAL; } + if (old_cp->has_dynamic_constant()) { + merge_cp->set_has_dynamic_constant(); + scratch_cp->set_has_dynamic_constant(); + } + log_info(redefine, class, constantpool)("merge_cp_len=%d, index_map_len=%d", merge_cp_length, _index_map_count); if (_index_map_count == 0) { @@ -3249,6 +3251,10 @@ // reference to the cp holder is needed for copy_operands() smaller_cp->set_pool_holder(scratch_class); + if (scratch_cp->has_dynamic_constant()) { + smaller_cp->set_has_dynamic_constant(); + } + scratch_cp->copy_cp_to(1, scratch_cp_length - 1, smaller_cp, 1, THREAD); if (HAS_PENDING_EXCEPTION) { // Exception is handled in the caller @@ -3522,15 +3528,6 @@ "should be replaced"); } } - // Update deleted jmethodID - for (int j = 0; j < _deleted_methods_length; ++j) { - Method* old_method = _deleted_methods[j]; - jmethodID jmid = old_method->find_jmethod_id_or_null(); - if (jmid != NULL) { - // Change the jmethodID to point to NSME. - Method::change_method_associated_with_jmethod_id(jmid, Universe::throw_no_such_method_error()); - } - } } int VM_RedefineClasses::check_methods_and_mark_as_obsolete() {