mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8268364: jmethod clearing should be done during unloading
Reviewed-by: dcubed, eosterlund
This commit is contained in:
parent
53ad903a82
commit
3d84398d12
2 changed files with 23 additions and 16 deletions
|
@ -2254,10 +2254,15 @@ bool Method::is_method_id(jmethodID mid) {
|
|||
Method* Method::checked_resolve_jmethod_id(jmethodID mid) {
|
||||
if (mid == NULL) return NULL;
|
||||
Method* o = resolve_jmethod_id(mid);
|
||||
if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
|
||||
if (o == NULL || o == JNIMethodBlock::_free_method) {
|
||||
return NULL;
|
||||
}
|
||||
return o;
|
||||
// Method should otherwise be valid. Assert for testing.
|
||||
assert(is_valid_method(o), "should be valid jmethodid");
|
||||
// If the method's class holder object is unreferenced, but not yet marked as
|
||||
// unloaded, we need to return NULL here too because after a safepoint, its memory
|
||||
// will be reclaimed.
|
||||
return o->method_holder()->is_loader_alive() ? o : NULL;
|
||||
};
|
||||
|
||||
void Method::set_on_stack(const bool value) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue