< prev index next >

src/hotspot/share/gc/serial/markSweep.hpp

Print this page
*** 37,10 ***
--- 37,11 ---
  #include "utilities/stack.hpp"
  
  class ReferenceProcessor;
  class DataLayout;
  class SerialOldTracer;
+ class SlidingForwarding;
  class STWGCTimer;
  
  // MarkSweep takes care of global mark-compact garbage collection for a
  // GenCollectedHeap using a four-phase pointer forwarding algorithm.  All
  // generations are assumed to support marking; those that can also support

*** 124,12 ***
    static IsAliveClosure       is_alive;
    static FollowRootClosure    follow_root_closure;
    static MarkAndPushClosure   mark_and_push_closure;
    static FollowStackClosure   follow_stack_closure;
    static CLDToOopClosure      follow_cld_closure;
-   static AdjustPointerClosure adjust_pointer_closure;
-   static CLDToOopClosure      adjust_cld_closure;
  
    // Accessors
    static uint total_invocations() { return _total_invocations; }
  
    // Reference Processing
--- 125,10 ---

*** 142,19 ***
    static void preserve_mark(oop p, markWord mark);
                                  // Save the mark word so it can be restored later
    static void adjust_marks();   // Adjust the pointers in the preserved marks table
    static void restore_marks();  // Restore the marks that we saved in preserve_mark
  
!   static size_t adjust_pointers(oop obj);
  
    static void follow_stack();   // Empty marking stack.
  
    static void follow_klass(Klass* klass);
  
    static void follow_cld(ClassLoaderData* cld);
  
!   template <class T> static inline void adjust_pointer(T* p);
  
    // Check mark and maybe push on marking stack
    template <class T> static void mark_and_push(T* p);
  
   private:
--- 141,19 ---
    static void preserve_mark(oop p, markWord mark);
                                  // Save the mark word so it can be restored later
    static void adjust_marks();   // Adjust the pointers in the preserved marks table
    static void restore_marks();  // Restore the marks that we saved in preserve_mark
  
!   static size_t adjust_pointers(const SlidingForwarding* const forwarding, oop obj);
  
    static void follow_stack();   // Empty marking stack.
  
    static void follow_klass(Klass* klass);
  
    static void follow_cld(ClassLoaderData* cld);
  
!   template <class T> static inline void adjust_pointer(const SlidingForwarding* const forwarding, T* p);
  
    // Check mark and maybe push on marking stack
    template <class T> static void mark_and_push(T* p);
  
   private:

*** 186,11 ***
--- 185,14 ---
      set_ref_discoverer_internal(rd);
    }
  };
  
  class AdjustPointerClosure: public BasicOopIterateClosure {
+ private:
+   const SlidingForwarding* const _forwarding;
   public:
+   AdjustPointerClosure(const SlidingForwarding* forwarding) : _forwarding(forwarding) {}
    template <typename T> void do_oop_work(T* p);
    virtual void do_oop(oop* p);
    virtual void do_oop(narrowOop* p);
    virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; }
  };

*** 200,10 ***
    oop _obj;
    markWord _mark;
  
  public:
    PreservedMark(oop obj, markWord mark) : _obj(obj), _mark(mark) {}
!   void adjust_pointer();
    void restore();
  };
  
  #endif // SHARE_GC_SERIAL_MARKSWEEP_HPP
--- 202,10 ---
    oop _obj;
    markWord _mark;
  
  public:
    PreservedMark(oop obj, markWord mark) : _obj(obj), _mark(mark) {}
!   void adjust_pointer(const SlidingForwarding* const forwarding);
    void restore();
  };
  
  #endif // SHARE_GC_SERIAL_MARKSWEEP_HPP
< prev index next >