3541 // RC_TRACE macro has an embedded ResourceMark |
3541 // RC_TRACE macro has an embedded ResourceMark |
3542 RC_TRACE(0x00000200, |
3542 RC_TRACE(0x00000200, |
3543 ("purge: %s(%s): prev method @%d in version @%d is alive", |
3543 ("purge: %s(%s): prev method @%d in version @%d is alive", |
3544 method->name()->as_C_string(), |
3544 method->name()->as_C_string(), |
3545 method->signature()->as_C_string(), j, version)); |
3545 method->signature()->as_C_string(), j, version)); |
|
3546 #ifdef ASSERT |
3546 if (method->method_data() != NULL) { |
3547 if (method->method_data() != NULL) { |
3547 // Clean out any weak method links for running methods |
3548 // Verify MethodData for running methods don't refer to old methods. |
3548 // (also should include not EMCP methods) |
3549 method->method_data()->verify_clean_weak_method_links(); |
3549 method->method_data()->clean_weak_method_links(); |
|
3550 } |
3550 } |
|
3551 #endif // ASSERT |
3551 } |
3552 } |
3552 } |
3553 } |
3553 } |
3554 } |
3554 // next previous version |
3555 // next previous version |
3555 last = pv_node; |
3556 last = pv_node; |
3559 RC_TRACE(0x00000200, |
3560 RC_TRACE(0x00000200, |
3560 ("purge: previous version stats: live=%d, deleted=%d", live_count, |
3561 ("purge: previous version stats: live=%d, deleted=%d", live_count, |
3561 deleted_count)); |
3562 deleted_count)); |
3562 } |
3563 } |
3563 |
3564 |
3564 // Clean MethodData of this class's methods so they don't refer to |
3565 #ifdef ASSERT |
|
3566 // Verify clean MethodData for this class's methods, e.g. they don't refer to |
3565 // old methods that are no longer running. |
3567 // old methods that are no longer running. |
3566 Array<Method*>* methods = ik->methods(); |
3568 Array<Method*>* methods = ik->methods(); |
3567 int num_methods = methods->length(); |
3569 int num_methods = methods->length(); |
3568 for (int index2 = 0; index2 < num_methods; ++index2) { |
3570 for (int index = 0; index < num_methods; ++index) { |
3569 if (methods->at(index2)->method_data() != NULL) { |
3571 if (methods->at(index)->method_data() != NULL) { |
3570 methods->at(index2)->method_data()->clean_weak_method_links(); |
3572 methods->at(index)->method_data()->verify_clean_weak_method_links(); |
3571 } |
3573 } |
3572 } |
3574 } |
|
3575 #endif // ASSERT |
3573 } |
3576 } |
3574 |
3577 |
3575 void InstanceKlass::mark_newly_obsolete_methods(Array<Method*>* old_methods, |
3578 void InstanceKlass::mark_newly_obsolete_methods(Array<Method*>* old_methods, |
3576 int emcp_method_count) { |
3579 int emcp_method_count) { |
3577 int obsolete_method_count = old_methods->length() - emcp_method_count; |
3580 int obsolete_method_count = old_methods->length() - emcp_method_count; |