< prev index next >

src/share/vm/gc/shared/referenceProcessor.hpp

Print this page

        

*** 240,255 **** DiscoveredList* _discovered_refs; // Arrays of lists of oops, one per thread (pointers into master array above) DiscoveredList* _discoveredSoftRefs; DiscoveredList* _discoveredWeakRefs; DiscoveredList* _discoveredFinalRefs; DiscoveredList* _discoveredPhantomRefs; - DiscoveredList* _discoveredCleanerRefs; public: ! static int number_of_subclasses_of_ref() { return (REF_CLEANER - REF_OTHER); } uint num_q() { return _num_q; } uint max_num_q() { return _max_num_q; } void set_active_mt_degree(uint v) { _num_q = v; } --- 240,255 ---- DiscoveredList* _discovered_refs; // Arrays of lists of oops, one per thread (pointers into master array above) DiscoveredList* _discoveredSoftRefs; DiscoveredList* _discoveredWeakRefs; + DiscoveredList* _discoveredEphemerons; DiscoveredList* _discoveredFinalRefs; DiscoveredList* _discoveredPhantomRefs; public: ! static int number_of_subclasses_of_ref() { return (REF_PHANTOM - REF_OTHER); } uint num_q() { return _num_q; } uint max_num_q() { return _max_num_q; } void set_active_mt_degree(uint v) { _num_q = v; }
*** 269,278 **** --- 269,293 ---- BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc, AbstractRefProcTaskExecutor* task_executor); + // Balance ephemerons queues if needed + void balance_discovered_ephemerons(AbstractRefProcTaskExecutor* task_executor); + + // Process ephemerons, phase2 + void process_discovered_ephemerons_ph2(BoolObjectClosure* is_alive, + OopClosure* keep_alive, + VoidClosure* complete_gc, + AbstractRefProcTaskExecutor* task_executor); + + // Process ephemerons, phase3 + void process_discovered_ephemerons_ph3(BoolObjectClosure* is_alive, + OopClosure* keep_alive, + VoidClosure* complete_gc, + AbstractRefProcTaskExecutor* task_executor); + void process_phaseJNI(BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc); // Work methods used by the method process_discovered_reflist
*** 282,318 **** ReferencePolicy* policy, BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc); // Phase2: remove all those references whose referents are ! // reachable. ! inline void process_phase2(DiscoveredList& refs_list, BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc) { if (discovery_is_atomic()) { // complete_gc is ignored in this case for this phase pp2_work(refs_list, is_alive, keep_alive); } else { assert(complete_gc != NULL, "Error"); pp2_work_concurrent_discovery(refs_list, is_alive, keep_alive, complete_gc); } } // Work methods in support of process_phase2 void pp2_work(DiscoveredList& refs_list, BoolObjectClosure* is_alive, OopClosure* keep_alive); void pp2_work_concurrent_discovery( DiscoveredList& refs_list, BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc); // Phase3: process the referents by either clearing them // or keeping them alive (and their closure) void process_phase3(DiscoveredList& refs_list, bool clear_referent, BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc); // Enqueue references with a certain reachability level --- 297,356 ---- ReferencePolicy* policy, BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc); // Phase2: remove all those references whose referents are ! // reachable. Return true if any ephemerons were removed. ! inline bool process_phase2(DiscoveredList& refs_list, ! bool has_ephemerons, BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc) { + if (has_ephemerons) { + assert(complete_gc != NULL, "Error"); + if (discovery_is_atomic()) { + return pp2_ephemerons_work(refs_list, is_alive, keep_alive, complete_gc); + } else { + return pp2_ephemerons_work_concurrent_discovery(refs_list, is_alive, + keep_alive, complete_gc); + } + } else { if (discovery_is_atomic()) { // complete_gc is ignored in this case for this phase pp2_work(refs_list, is_alive, keep_alive); } else { assert(complete_gc != NULL, "Error"); pp2_work_concurrent_discovery(refs_list, is_alive, keep_alive, complete_gc); } + return false; + } } // Work methods in support of process_phase2 void pp2_work(DiscoveredList& refs_list, BoolObjectClosure* is_alive, OopClosure* keep_alive); void pp2_work_concurrent_discovery( DiscoveredList& refs_list, BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc); + bool pp2_ephemerons_work( + DiscoveredList& refs_list, + BoolObjectClosure* is_alive, + OopClosure* keep_alive, + VoidClosure* complete_gc); + bool pp2_ephemerons_work_concurrent_discovery( + DiscoveredList& refs_list, + BoolObjectClosure* is_alive, + OopClosure* keep_alive, + VoidClosure* complete_gc); // Phase3: process the referents by either clearing them // or keeping them alive (and their closure) void process_phase3(DiscoveredList& refs_list, bool clear_referent, + bool has_ephemerons, BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc); // Enqueue references with a certain reachability level
*** 346,355 **** --- 384,401 ---- void preclean_discovered_reflist(DiscoveredList& refs_list, BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc, YieldClosure* yield); + // The same as above, but specialized for ephemerons and returns true + // if any ephemerons were removed from the list. + bool preclean_discovered_ephemerons_reflist( + DiscoveredList& refs_list, + BoolObjectClosure* is_alive, + OopClosure* keep_alive, + VoidClosure* complete_gc, + YieldClosure* yield); // round-robin mod _num_q (not: _not_ mode _max_num_q) uint next_id() { uint id = _next_id; if (++_next_id == _num_q) {
< prev index next >