< prev index next >

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

Print this page
@@ -48,11 +48,10 @@
  // Class unloading will only occur when a full gc is invoked.
  
  // declared at end
  class PreservedMark;
  class MarkAndPushClosure;
- class AdjustPointerClosure;
  
  class MarkSweep : AllStatic {
    //
    // Inline closure decls
    //

@@ -82,11 +81,10 @@
    };
  
    //
    // Friend decls
    //
-   friend class AdjustPointerClosure;
    friend class KeepAliveClosure;
    friend class VM_MarkSweep;
  
    //
    // Vars

@@ -122,12 +120,10 @@
    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

@@ -137,22 +133,26 @@
    static STWGCTimer* gc_timer() { return _gc_timer; }
    static SerialOldTracer* gc_tracer() { return _gc_tracer; }
  
    static void preserve_mark(oop p, markWord mark);
                                  // Save the mark word so it can be restored later
+   template <bool ALT_FWD>
+   static void adjust_marks_impl();   // Adjust the pointers in the preserved marks table
    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
  
+   template <bool ALT_FWD>
    static int 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);
+   template <bool ALT_FWD, 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:

@@ -183,10 +183,11 @@
    void set_ref_discoverer(ReferenceDiscoverer* rd) {
      set_ref_discoverer_internal(rd);
    }
  };
  
+ template <bool ALT_FWD>
  class AdjustPointerClosure: public BasicOopIterateClosure {
   public:
    template <typename T> void do_oop_work(T* p);
    virtual void do_oop(oop* p);
    virtual void do_oop(narrowOop* p);

@@ -202,10 +203,11 @@
    void init(oop obj, markWord mark) {
      _obj = obj;
      _mark = mark;
    }
  
+   template <bool ALT_FWD>
    void adjust_pointer();
    void restore();
  };
  
  #endif // SHARE_GC_SERIAL_MARKSWEEP_HPP
< prev index next >