mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8048248: G1 Class Unloading after completing a concurrent mark cycle
Reviewed-by: tschatzl, ehelin, brutisso, coleenp, roland, iveresov
This commit is contained in:
parent
b0138be158
commit
8c3aced316
75 changed files with 2169 additions and 874 deletions
|
@ -46,6 +46,9 @@
|
|||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/oop.inline2.hpp"
|
||||
#include "runtime/fieldType.hpp"
|
||||
#if INCLUDE_ALL_GCS
|
||||
# include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
|
||||
#endif
|
||||
|
||||
// ciObjectFactory
|
||||
//
|
||||
|
@ -374,6 +377,37 @@ ciMetadata* ciObjectFactory::create_new_object(Metadata* o) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciObjectFactory::ensure_metadata_alive
|
||||
//
|
||||
// Ensure that the metadata wrapped by the ciMetadata is kept alive by GC.
|
||||
// This is primarily useful for metadata which is considered as weak roots
|
||||
// by the GC but need to be strong roots if reachable from a current compilation.
|
||||
//
|
||||
void ciObjectFactory::ensure_metadata_alive(ciMetadata* m) {
|
||||
ASSERT_IN_VM; // We're handling raw oops here.
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
if (!UseG1GC) {
|
||||
return;
|
||||
}
|
||||
Klass* metadata_owner_klass;
|
||||
if (m->is_klass()) {
|
||||
metadata_owner_klass = m->as_klass()->get_Klass();
|
||||
} else if (m->is_method()) {
|
||||
metadata_owner_klass = m->as_method()->get_Method()->constants()->pool_holder();
|
||||
} else {
|
||||
fatal("Not implemented for other types of metadata");
|
||||
}
|
||||
|
||||
oop metadata_holder = metadata_owner_klass->klass_holder();
|
||||
if (metadata_holder != NULL) {
|
||||
G1SATBCardTableModRefBS::enqueue(metadata_holder);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// ciObjectFactory::get_unloaded_method
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue