< prev index next >
src/hotspot/share/oops/klass.cpp
Print this page
*** 41,53 ****
#include "runtime/atomic.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "trace/traceMacros.hpp"
#include "utilities/macros.hpp"
#include "utilities/stack.inline.hpp"
! #if INCLUDE_ALL_GCS
! #include "gc/g1/g1SATBCardTableModRefBS.hpp"
! #endif // INCLUDE_ALL_GCS
bool Klass::is_cloneable() const {
return _access_flags.is_cloneable_fast() ||
is_subtype_of(SystemDictionary::Cloneable_klass());
}
--- 41,62 ----
#include "runtime/atomic.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "trace/traceMacros.hpp"
#include "utilities/macros.hpp"
#include "utilities/stack.inline.hpp"
!
! void Klass::set_java_mirror(Handle m) {
! if (m.is_null()) {
! _java_mirror = NULL;
! } else {
! _java_mirror = class_loader_data()->add_handle(m);
! }
! }
!
! oop Klass::java_mirror() const {
! return _java_mirror.resolve();
! }
bool Klass::is_cloneable() const {
return _access_flags.is_cloneable_fast() ||
is_subtype_of(SystemDictionary::Cloneable_klass());
}
*** 439,493 ****
}
}
}
}
- void Klass::klass_update_barrier_set(oop v) {
- record_modified_oops();
- }
-
- // This barrier is used by G1 to remember the old oop values, so
- // that we don't forget any objects that were live at the snapshot at
- // the beginning. This function is only used when we write oops into Klasses.
- void Klass::klass_update_barrier_set_pre(oop* p, oop v) {
- #if INCLUDE_ALL_GCS
- if (UseG1GC) {
- oop obj = *p;
- if (obj != NULL) {
- G1SATBCardTableModRefBS::enqueue(obj);
- }
- }
- #endif
- }
-
- void Klass::klass_oop_store(oop* p, oop v) {
- assert(!Universe::heap()->is_in_reserved((void*)p), "Should store pointer into metadata");
- assert(v == NULL || Universe::heap()->is_in_reserved((void*)v), "Should store pointer to an object");
-
- // do the store
- if (always_do_update_barrier) {
- klass_oop_store((volatile oop*)p, v);
- } else {
- klass_update_barrier_set_pre(p, v);
- *p = v;
- klass_update_barrier_set(v);
- }
- }
-
- void Klass::klass_oop_store(volatile oop* p, oop v) {
- assert(!Universe::heap()->is_in_reserved((void*)p), "Should store pointer into metadata");
- assert(v == NULL || Universe::heap()->is_in_reserved((void*)v), "Should store pointer to an object");
-
- klass_update_barrier_set_pre((oop*)p, v); // Cast away volatile.
- OrderAccess::release_store_ptr(p, v);
- klass_update_barrier_set(v);
- }
-
- void Klass::oops_do(OopClosure* cl) {
- cl->do_oop(&_java_mirror);
- }
-
void Klass::metaspace_pointers_do(MetaspaceClosure* it) {
if (log_is_enabled(Trace, cds)) {
ResourceMark rm;
log_trace(cds)("Iter(Klass): %p (%s)", this, external_name());
}
--- 448,457 ----
*** 530,540 ****
assert (DumpSharedSpaces, "only called for DumpSharedSpaces");
if (log_is_enabled(Trace, cds, unshareable)) {
ResourceMark rm;
log_trace(cds, unshareable)("remove java_mirror: %s", external_name());
}
! set_java_mirror(NULL);
}
void Klass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS) {
assert(is_klass(), "ensure C++ vtable is restored");
assert(is_shared(), "must be set");
--- 494,505 ----
assert (DumpSharedSpaces, "only called for DumpSharedSpaces");
if (log_is_enabled(Trace, cds, unshareable)) {
ResourceMark rm;
log_trace(cds, unshareable)("remove java_mirror: %s", external_name());
}
! // Just null out the mirror. The class_loader_data() no longer exists.
! _java_mirror = NULL;
}
void Klass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS) {
assert(is_klass(), "ensure C++ vtable is restored");
assert(is_shared(), "must be set");
< prev index next >