mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 03:54:33 +02:00
Merge
This commit is contained in:
commit
40d52710f6
99 changed files with 66717 additions and 1266 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
class CodeBlob;
|
||||
class ReferenceProcessor;
|
||||
class DataLayout;
|
||||
|
||||
// Closure provides abortability.
|
||||
|
||||
|
@ -55,9 +56,23 @@ class OopClosure : public Closure {
|
|||
|
||||
// In support of post-processing of weak links of KlassKlass objects;
|
||||
// see KlassKlass::oop_oop_iterate().
|
||||
virtual const bool should_remember_klasses() const { return false; }
|
||||
|
||||
virtual const bool should_remember_klasses() const {
|
||||
assert(!must_remember_klasses(), "Should have overriden this method.");
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void remember_klass(Klass* k) { /* do nothing */ }
|
||||
|
||||
// In support of post-processing of weak references in
|
||||
// ProfileData (MethodDataOop) objects; see, for example,
|
||||
// VirtualCallData::oop_iterate().
|
||||
virtual const bool should_remember_mdo() const { return false; }
|
||||
virtual void remember_mdo(DataLayout* v) { /* do nothing */ }
|
||||
|
||||
// If "true", invoke on nmethods (when scanning compiled frames).
|
||||
virtual const bool do_nmethods() const { return false; }
|
||||
|
||||
// The methods below control how object iterations invoking this closure
|
||||
// should be performed:
|
||||
|
||||
|
@ -72,6 +87,12 @@ class OopClosure : public Closure {
|
|||
// location without an intervening "major reset" (like the end of a GC).
|
||||
virtual bool idempotent() { return false; }
|
||||
virtual bool apply_to_weak_ref_discovered_field() { return false; }
|
||||
|
||||
#ifdef ASSERT
|
||||
static bool _must_remember_klasses;
|
||||
static bool must_remember_klasses();
|
||||
static void set_must_remember_klasses(bool v);
|
||||
#endif
|
||||
};
|
||||
|
||||
// ObjectClosure is used for iterating through an object space
|
||||
|
@ -262,3 +283,38 @@ public:
|
|||
// correct length.
|
||||
virtual void do_tag(int tag) = 0;
|
||||
};
|
||||
|
||||
#ifdef ASSERT
|
||||
// This class is used to flag phases of a collection that
|
||||
// can unload classes and which should override the
|
||||
// should_remember_klasses() and remember_klass() of OopClosure.
|
||||
// The _must_remember_klasses is set in the contructor and restored
|
||||
// in the destructor. _must_remember_klasses is checked in assertions
|
||||
// in the OopClosure implementations of should_remember_klasses() and
|
||||
// remember_klass() and the expectation is that the OopClosure
|
||||
// implementation should not be in use if _must_remember_klasses is set.
|
||||
// Instances of RememberKlassesChecker can be place in
|
||||
// marking phases of collections which can do class unloading.
|
||||
// RememberKlassesChecker can be passed "false" to turn off checking.
|
||||
// It is used by CMS when CMS yields to a different collector.
|
||||
class RememberKlassesChecker: StackObj {
|
||||
bool _state;
|
||||
bool _skip;
|
||||
public:
|
||||
RememberKlassesChecker(bool checking_on) : _state(false), _skip(false) {
|
||||
_skip = !(ClassUnloading && !UseConcMarkSweepGC ||
|
||||
CMSClassUnloadingEnabled && UseConcMarkSweepGC);
|
||||
if (_skip) {
|
||||
return;
|
||||
}
|
||||
_state = OopClosure::must_remember_klasses();
|
||||
OopClosure::set_must_remember_klasses(checking_on);
|
||||
}
|
||||
~RememberKlassesChecker() {
|
||||
if (_skip) {
|
||||
return;
|
||||
}
|
||||
OopClosure::set_must_remember_klasses(_state);
|
||||
}
|
||||
};
|
||||
#endif // ASSERT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue