// Helper class to aid in root scanning and cleaning of weak oops in the VM. // // New containers of weak oops added to this class will automatically // be cleaned by all GCs, including the young generation GCs. class WeakProcessor : AllStatic { public: // Visit all oop*s and apply the keep_alive closure if the referenced // object is considered alive by the is_alive closure, otherwise do some // container specific cleanup of element holding the oop. staticvoid weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive);
// Visit all oop*s and apply the given closure. staticvoid oops_do(OopClosure* closure);
// Parallel version. Uses ergo_workers() to determine the number of // threads to use, limited by the total workers and phase_times' // max_threads. // IsAlive must be derived from BoolObjectClosure. // KeepAlive must be derived from OopClosure. template<typename IsAlive, typename KeepAlive> staticvoid weak_oops_do(WorkerThreads* workers,
IsAlive* is_alive,
KeepAlive* keep_alive,
WeakProcessorTimes* times);
// Convenience parallel version. Uses ergo_workers() to determine the // number of threads to use, limited by the total workers. Implicitly // logs phase times. // IsAlive must be derived from BoolObjectClosure. // KeepAlive must be derived from OopClosure. template<typename IsAlive, typename KeepAlive> staticvoid weak_oops_do(WorkerThreads* workers,
IsAlive* is_alive,
KeepAlive* keep_alive,
uint indent_log);
// Uses the total number of weak references and ReferencesPerThread to // determine the number of threads to use, limited by max_workers. static uint ergo_workers(uint max_workers);
class Task;
private: template<typename IsAlive, typename KeepAlive> class CountingClosure;
class WeakOopsDoTask;
};
class WeakProcessor::Task { typedef OopStorage::ParState<false, false> StorageState;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.