Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/memory/referenceProcessor.hpp
          +++ new/src/share/vm/memory/referenceProcessor.hpp
↓ open down ↓ 44 lines elided ↑ open up ↑
  45   45  // apart, there seems to be no reason it couldn't be extended
  46   46  // (with appropriate modifications) to any "non-convex interval".
  47   47  
  48   48  // forward references
  49   49  class ReferencePolicy;
  50   50  class AbstractRefProcTaskExecutor;
  51   51  class DiscoveredList;
  52   52  
  53   53  class ReferenceProcessor : public CHeapObj {
  54   54   protected:
       55 +  // Compatibility with pre-4965777 JDK's
       56 +  static bool _pending_list_uses_discovered_field;
  55   57    MemRegion   _span; // (right-open) interval of heap
  56   58                       // subject to wkref discovery
  57   59    bool        _discovering_refs;      // true when discovery enabled
  58   60    bool        _discovery_is_atomic;   // if discovery is atomic wrt
  59   61                                        // other collectors in configuration
  60   62    bool        _discovery_is_mt;       // true if reference discovery is MT.
  61   63    // If true, setting "next" field of a discovered refs list requires
  62   64    // write barrier(s).  (Must be true if used in a collector in which
  63   65    // elements of a discovered list may be moved during discovery: for
  64   66    // example, a collector like Garbage-First that moves objects during a
↓ open down ↓ 39 lines elided ↑ open up ↑
 104  106    int max_num_q()                        { return _max_num_q; }
 105  107    void set_active_mt_degree(int v)       { _num_q = v; }
 106  108    DiscoveredList* discovered_soft_refs() { return _discoveredSoftRefs; }
 107  109    ReferencePolicy* setup_policy(bool always_clear) {
 108  110      _current_soft_ref_policy = always_clear ?
 109  111        _always_clear_soft_ref_policy : _default_soft_ref_policy;
 110  112      _current_soft_ref_policy->setup();   // snapshot the policy threshold
 111  113      return _current_soft_ref_policy;
 112  114    }
 113  115  
 114      - public:
 115  116    // Process references with a certain reachability level.
 116  117    void process_discovered_reflist(DiscoveredList               refs_lists[],
 117  118                                    ReferencePolicy*             policy,
 118  119                                    bool                         clear_referent,
 119  120                                    BoolObjectClosure*           is_alive,
 120  121                                    OopClosure*                  keep_alive,
 121  122                                    VoidClosure*                 complete_gc,
 122  123                                    AbstractRefProcTaskExecutor* task_executor);
 123  124  
 124  125    void process_phaseJNI(BoolObjectClosure* is_alive,
↓ open down ↓ 165 lines elided ↑ open up ↑
 290  291  
 291  292    // start and stop weak ref discovery
 292  293    void enable_discovery()   { _discovering_refs = true;  }
 293  294    void disable_discovery()  { _discovering_refs = false; }
 294  295    bool discovery_enabled()  { return _discovering_refs;  }
 295  296  
 296  297    // whether discovery is atomic wrt other collectors
 297  298    bool discovery_is_atomic() const { return _discovery_is_atomic; }
 298  299    void set_atomic_discovery(bool atomic) { _discovery_is_atomic = atomic; }
 299  300  
      301 +  // whether the JDK in which we are embedded is a pre-4965777 JDK,
      302 +  // and thus whether ir not it uses the discovered field to chain
      303 +  // the entries in the pending list.
      304 +  static bool pending_list_uses_discovered_field() {
      305 +    return _pending_list_uses_discovered_field;
      306 +  }
      307 +
 300  308    // whether discovery is done by multiple threads same-old-timeously
 301  309    bool discovery_is_mt() const { return _discovery_is_mt; }
 302  310    void set_mt_discovery(bool mt) { _discovery_is_mt = mt; }
 303  311  
 304  312    // Whether we are in a phase when _processing_ is MT.
 305  313    bool processing_is_mt() const { return _processing_is_mt; }
 306  314    void set_mt_processing(bool mt) { _processing_is_mt = mt; }
 307  315  
 308  316    // whether all enqueuing of weak references is complete
 309  317    bool enqueuing_is_done()  { return _enqueuing_is_done; }
↓ open down ↓ 230 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX