8227175: ZGC: ZHeapIterator visits potentially dead objects

Reviewed-by: zgu, eosterlund
This commit is contained in:
Stefan Karlsson 2019-06-10 13:04:12 +02:00
parent 24f58a0ac0
commit 02a31bf561
23 changed files with 395 additions and 187 deletions

View file

@ -206,16 +206,17 @@ class ClassLoaderData : public CHeapObj<mtClass> {
// The "claim" is typically used to check if oops_do needs to be applied on
// the CLD or not. Most GCs only perform strong marking during the marking phase.
enum {
_claim_none = 0,
_claim_finalizable = 2,
_claim_strong = 3
enum Claim {
_claim_none = 0,
_claim_finalizable = 2,
_claim_strong = 3,
_claim_other = 4
};
void clear_claim() { _claim = 0; }
void clear_claim(int claim);
bool claimed() const { return _claim != 0; }
bool claimed(int claim) const { return (_claim & claim) == claim; }
bool try_claim(int claim);
int get_claim() const { return _claim; }
void set_claim(int claim) { _claim = claim; }
// Computes if the CLD is alive or not. This is safe to call in concurrent
// contexts.