< prev index next >

src/hotspot/share/prims/jvmtiRedefineClasses.cpp

Print this page




3511       cp_cache = pv_node->constants()->cache();
3512       if (cp_cache != NULL) {
3513         cp_cache->adjust_method_entries(&trace_name_printed);
3514       }
3515     }
3516   }
3517 }
3518 
3519 void VM_RedefineClasses::update_jmethod_ids() {
3520   for (int j = 0; j < _matching_methods_length; ++j) {
3521     Method* old_method = _matching_old_methods[j];
3522     jmethodID jmid = old_method->find_jmethod_id_or_null();
3523     if (jmid != NULL) {
3524       // There is a jmethodID, change it to point to the new method
3525       methodHandle new_method_h(_matching_new_methods[j]);
3526       Method::change_method_associated_with_jmethod_id(jmid, new_method_h());
3527       assert(Method::resolve_jmethod_id(jmid) == _matching_new_methods[j],
3528              "should be replaced");
3529     }
3530   }
3531   // Update deleted jmethodID
3532   for (int j = 0; j < _deleted_methods_length; ++j) {
3533     Method* old_method = _deleted_methods[j];
3534     jmethodID jmid = old_method->find_jmethod_id_or_null();
3535     if (jmid != NULL) {
3536       // Change the jmethodID to point to NSME.
3537       Method::change_method_associated_with_jmethod_id(jmid, Universe::throw_no_such_method_error());
3538     }
3539   }
3540 }
3541 
3542 int VM_RedefineClasses::check_methods_and_mark_as_obsolete() {
3543   int emcp_method_count = 0;
3544   int obsolete_count = 0;
3545   int old_index = 0;
3546   for (int j = 0; j < _matching_methods_length; ++j, ++old_index) {
3547     Method* old_method = _matching_old_methods[j];
3548     Method* new_method = _matching_new_methods[j];
3549     Method* old_array_method;
3550 
3551     // Maintain an old_index into the _old_methods array by skipping
3552     // deleted methods
3553     while ((old_array_method = _old_methods->at(old_index)) != old_method) {
3554       ++old_index;
3555     }
3556 
3557     if (MethodComparator::methods_EMCP(old_method, new_method)) {
3558       // The EMCP definition from JSR-163 requires the bytecodes to be
3559       // the same with the exception of constant pool indices which may




3511       cp_cache = pv_node->constants()->cache();
3512       if (cp_cache != NULL) {
3513         cp_cache->adjust_method_entries(&trace_name_printed);
3514       }
3515     }
3516   }
3517 }
3518 
3519 void VM_RedefineClasses::update_jmethod_ids() {
3520   for (int j = 0; j < _matching_methods_length; ++j) {
3521     Method* old_method = _matching_old_methods[j];
3522     jmethodID jmid = old_method->find_jmethod_id_or_null();
3523     if (jmid != NULL) {
3524       // There is a jmethodID, change it to point to the new method
3525       methodHandle new_method_h(_matching_new_methods[j]);
3526       Method::change_method_associated_with_jmethod_id(jmid, new_method_h());
3527       assert(Method::resolve_jmethod_id(jmid) == _matching_new_methods[j],
3528              "should be replaced");
3529     }
3530   }









3531 }
3532 
3533 int VM_RedefineClasses::check_methods_and_mark_as_obsolete() {
3534   int emcp_method_count = 0;
3535   int obsolete_count = 0;
3536   int old_index = 0;
3537   for (int j = 0; j < _matching_methods_length; ++j, ++old_index) {
3538     Method* old_method = _matching_old_methods[j];
3539     Method* new_method = _matching_new_methods[j];
3540     Method* old_array_method;
3541 
3542     // Maintain an old_index into the _old_methods array by skipping
3543     // deleted methods
3544     while ((old_array_method = _old_methods->at(old_index)) != old_method) {
3545       ++old_index;
3546     }
3547 
3548     if (MethodComparator::methods_EMCP(old_method, new_method)) {
3549       // The EMCP definition from JSR-163 requires the bytecodes to be
3550       // the same with the exception of constant pool indices which may


< prev index next >