/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_MEMORY_CARDTABLERS_HPP
#define SHARE_VM_MEMORY_CARDTABLERS_HPP
#include "memory/cardTableModRefBS.hpp"
#include "memory/genRemSet.hpp"
#include "memory/memRegion.hpp"
class Space;
class OopsInGenClosure;
// This kind of "GenRemSet" uses a card table both as shared data structure
// for a mod ref barrier set and for the rem set information.
friend class VMStructs;
// Below are private classes used in impl.
friend class VerifyCTSpaceClosure;
friend class ClearNoncleanCardWrapper;
return CardTableModRefBS::clean_card;
}
return CardTableModRefBS::clean_card_row;
}
static bool
}
enum ExtendedCardValue {
// These are for parallel collection.
// There are three P (parallel) youngergen card values. In general, this
// needs to be more than the number of generations (including the perm
// gen) that might have younger_refs_do invoked on them separately. So
// if we add more gens, we have to add more values.
};
// An array that contains, for each generation, the card table value last
// used as the current value for a younger_refs_do iteration of that
// portion of the table. (The perm gen is index 0; other gens are at
// their level plus 1. They youngest gen is in the table, but will
// always have the value "clean_card".)
int _regions_to_iterate;
return _cur_youngergen_card_val;
}
}
return
youngergen_card <= v &&
v != _cur_youngergen_card_val;
}
// Return a youngergen_card_value that is not currently in use.
public:
// *** GenRemSet functions.
// Override.
void prepare_for_younger_refs_iterate(bool parallel);
// Card table entries are cleared before application; "blk" is
// responsible for dirtying if the oop is still older-to-younger after
// closure application.
*byte = youngergen_card;
}
}
// Override. Might want to devirtualize this in the same fashion as
// above. Ensures that the value of the card for field says that it's
// a younger card in the current collection.
}
void verify();
}
return CardTableModRefBS::ct_max_alignment_constraint();
}
return
youngergen_card <= v &&
v != _cur_youngergen_card_val;
}
}
};
bool _is_par;
private:
// Clears the given card, return true if the corresponding card should be
// processed.
// Work methods called by the clear_card()
// check alignment of pointer
public:
};
#endif // SHARE_VM_MEMORY_CARDTABLERS_HPP