src/share/vm/memory/referenceProcessor.hpp
Print this page
rev 2652 : 7085906: Replace the permgen allocated sentinelRef with a self-looped end
Summary: Remove the sentinelRef and let the last Reference in a discovered chain point back to itself.
Reviewed-by: TBD1, TBD2
*** 50,61 ****
class AbstractRefProcTaskExecutor;
class DiscoveredList;
class ReferenceProcessor : public CHeapObj {
protected:
- // End of list marker
- static oop _sentinelRef;
MemRegion _span; // (right-open) interval of heap
// subject to wkref discovery
bool _discovering_refs; // true when discovery enabled
bool _discovery_is_atomic; // if discovery is atomic wrt
// other collectors in configuration
--- 50,59 ----
*** 104,115 ****
public:
int num_q() { return _num_q; }
int max_num_q() { return _max_num_q; }
void set_active_mt_degree(int v) { _num_q = v; }
DiscoveredList* discovered_soft_refs() { return _discoveredSoftRefs; }
- static oop sentinel_ref() { return _sentinelRef; }
- static oop* adr_sentinel_ref() { return &_sentinelRef; }
ReferencePolicy* setup_policy(bool always_clear) {
_current_soft_ref_policy = always_clear ?
_always_clear_soft_ref_policy : _default_soft_ref_policy;
_current_soft_ref_policy->setup(); // snapshot the policy threshold
return _current_soft_ref_policy;
--- 102,111 ----
*** 228,237 ****
--- 224,234 ----
DiscoveredList* get_discovered_list(ReferenceType rt);
inline void add_to_discovered_list_mt(DiscoveredList& refs_list, oop obj,
HeapWord* discovered_addr);
void verify_ok_to_handle_reflists() PRODUCT_RETURN;
+ void clear_discovered_references(DiscoveredList& refs_list);
void abandon_partial_discovered_list(DiscoveredList& refs_list);
// Calculate the number of jni handles.
unsigned int count_jni_refs();
*** 312,322 ****
bool enqueuing_is_done() { return _enqueuing_is_done; }
void set_enqueuing_is_done(bool v) { _enqueuing_is_done = v; }
// iterate over oops
void weak_oops_do(OopClosure* f); // weak roots
- static void oops_do(OopClosure* f); // strong root(s)
// Balance each of the discovered lists.
void balance_all_queues();
// Discover a Reference object, using appropriate discovery criteria
--- 309,318 ----
*** 338,348 ****
void abandon_partial_discovery();
// debugging
void verify_no_references_recorded() PRODUCT_RETURN;
void verify_referent(oop obj) PRODUCT_RETURN;
- static void verify();
// clear the discovered lists (unlinking each entry).
void clear_discovered_references() PRODUCT_RETURN;
};
--- 334,343 ----
*** 522,547 ****
class AbstractRefProcTaskExecutor::EnqueueTask {
protected:
EnqueueTask(ReferenceProcessor& ref_processor,
DiscoveredList refs_lists[],
HeapWord* pending_list_addr,
- oop sentinel_ref,
int n_queues)
: _ref_processor(ref_processor),
_refs_lists(refs_lists),
_pending_list_addr(pending_list_addr),
- _sentinel_ref(sentinel_ref),
_n_queues(n_queues)
{ }
public:
virtual void work(unsigned int work_id) = 0;
protected:
ReferenceProcessor& _ref_processor;
DiscoveredList* _refs_lists;
HeapWord* _pending_list_addr;
- oop _sentinel_ref;
int _n_queues;
};
#endif // SHARE_VM_MEMORY_REFERENCEPROCESSOR_HPP
--- 517,539 ----