hotspot/src/share/vm/memory/referencePolicy.hpp
changeset 1610 5dddd195cc86
parent 1606 dcf9714addbe
child 1623 a0dd9009e992
equal deleted inserted replaced
1608:0a375b5fb8e1 1610:5dddd195cc86
    28 
    28 
    29 class ReferencePolicy : public CHeapObj {
    29 class ReferencePolicy : public CHeapObj {
    30  public:
    30  public:
    31   virtual bool should_clear_reference(oop p)       { ShouldNotReachHere(); return true; }
    31   virtual bool should_clear_reference(oop p)       { ShouldNotReachHere(); return true; }
    32   // Capture state (of-the-VM) information needed to evaluate the policy
    32   // Capture state (of-the-VM) information needed to evaluate the policy
    33   virtual void snap() { /* do nothing */ }
    33   virtual void setup() { /* do nothing */ }
    34 };
    34 };
    35 
    35 
    36 class NeverClearPolicy : public ReferencePolicy {
    36 class NeverClearPolicy : public ReferencePolicy {
    37  public:
    37  public:
    38   bool should_clear_reference(oop p) { return false; }
    38   bool should_clear_reference(oop p) { return false; }
    49 
    49 
    50  public:
    50  public:
    51   LRUCurrentHeapPolicy();
    51   LRUCurrentHeapPolicy();
    52 
    52 
    53   // Capture state (of-the-VM) information needed to evaluate the policy
    53   // Capture state (of-the-VM) information needed to evaluate the policy
    54   void snap();
    54   void setup();
    55   bool should_clear_reference(oop p);
    55   bool should_clear_reference(oop p);
    56 };
    56 };
    57 
    57 
    58 class LRUMaxHeapPolicy : public ReferencePolicy {
    58 class LRUMaxHeapPolicy : public ReferencePolicy {
    59  private:
    59  private:
    61 
    61 
    62  public:
    62  public:
    63   LRUMaxHeapPolicy();
    63   LRUMaxHeapPolicy();
    64 
    64 
    65   // Capture state (of-the-VM) information needed to evaluate the policy
    65   // Capture state (of-the-VM) information needed to evaluate the policy
    66   void snap();
    66   void setup();
    67   bool should_clear_reference(oop p);
    67   bool should_clear_reference(oop p);
    68 };
    68 };