diff src/share/vm/gc_implementation/shared/markSweep.hpp @ 6948:e522a00b91aa

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Nov 2012 23:14:12 +0100
parents da91efe96a93
children b735136e0d82
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/markSweep.hpp	Mon Nov 12 18:11:17 2012 +0100
+++ b/src/share/vm/gc_implementation/shared/markSweep.hpp	Mon Nov 12 23:14:12 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,8 +76,17 @@
    public:
     virtual void do_oop(oop* p);
     virtual void do_oop(narrowOop* p);
-    virtual const bool should_remember_mdo() const { return true; }
-    virtual void remember_mdo(DataLayout* p) { MarkSweep::revisit_mdo(p); }
+  };
+
+  // The one and only place to start following the classes.
+  // Should only be applied to the ClassLoaderData klasses list.
+  class FollowKlassClosure : public KlassClosure {
+   public:
+    void do_klass(Klass* klass);
+  };
+  class AdjustKlassClosure : public KlassClosure {
+   public:
+    void do_klass(Klass* klass);
   };
 
   class FollowStackClosure: public VoidClosure {
@@ -121,13 +130,12 @@
   // Vars
   //
  protected:
+  // Total invocations of a MarkSweep collection
+  static unsigned int _total_invocations;
+
   // Traversal stacks used during phase1
   static Stack<oop, mtGC>                      _marking_stack;
   static Stack<ObjArrayTask, mtGC>             _objarray_stack;
-  // Stack for live klasses to revisit at end of marking phase
-  static Stack<Klass*, mtGC>                   _revisit_klass_stack;
-  // Set (stack) of MDO's to revisit at end of marking phase
-  static Stack<DataLayout*, mtGC>              _revisit_mdo_stack;
 
   // Space for storing/restoring mark word
   static Stack<markOop, mtGC>                  _preserved_mark_stack;
@@ -167,27 +175,25 @@
 #endif
 
   // Non public closures
-  static IsAliveClosure   is_alive;
   static KeepAliveClosure keep_alive;
 
-  // Class unloading. Update subklass/sibling/implementor links at end of marking phase.
-  static void follow_weak_klass_links();
-
-  // Class unloading. Clear weak refs in MDO's (ProfileData)
-  // at the end of the marking phase.
-  static void follow_mdo_weak_refs();
-
   // Debugging
   static void trace(const char* msg) PRODUCT_RETURN;
 
  public:
   // Public closures
+  static IsAliveClosure       is_alive;
   static FollowRootClosure    follow_root_closure;
   static CodeBlobToOopClosure follow_code_root_closure; // => follow_root_closure
   static MarkAndPushClosure   mark_and_push_closure;
+  static FollowKlassClosure   follow_klass_closure;
   static FollowStackClosure   follow_stack_closure;
   static AdjustPointerClosure adjust_root_pointer_closure;
   static AdjustPointerClosure adjust_pointer_closure;
+  static AdjustKlassClosure   adjust_klass_closure;
+
+  // Accessors
+  static unsigned int total_invocations() { return _total_invocations; }
 
   // Reference Processing
   static ReferenceProcessor* const ref_processor() { return _ref_processor; }
@@ -196,12 +202,20 @@
   static void mark_object(oop obj);
   // Mark pointer and follow contents.  Empty marking stack afterwards.
   template <class T> static inline void follow_root(T* p);
+
   // Check mark and maybe push on marking stack
-  template <class T> static inline void mark_and_push(T* p);
+  template <class T> static void mark_and_push(T* p);
+
   static inline void push_objarray(oop obj, size_t index);
 
   static void follow_stack();   // Empty marking stack.
 
+  static void follow_klass(Klass* klass);
+  static void adjust_klass(Klass* klass);
+
+  static void follow_class_loader(ClassLoaderData* cld);
+  static void adjust_class_loader(ClassLoaderData* cld);
+
   static void preserve_mark(oop p, markOop mark);
                                 // Save the mark word so it can be restored later
   static void adjust_marks();   // Adjust the pointers in the preserved marks table
@@ -219,7 +233,7 @@
   static void track_interior_pointers(oop obj);
   static void check_interior_pointers();
 
-  static void reset_live_oop_tracking(bool at_perm);
+  static void reset_live_oop_tracking();
   static void register_live_oop(oop p, size_t size);
   static void validate_live_oop(oop p, size_t size);
   static void live_oop_moved_to(HeapWord* q, size_t size, HeapWord* compaction_top);
@@ -231,12 +245,6 @@
   // tracking down heap stomps.
   static void print_new_location_of_heap_address(HeapWord* q);
 #endif
-
-  // Call backs for class unloading
-  // Update subklass/sibling/implementor links at end of marking.
-  static void revisit_weak_klass_link(Klass* k);
-  // For weak refs clearing in MDO's
-  static void revisit_mdo(DataLayout* p);
 };
 
 class PreservedMark VALUE_OBJ_CLASS_SPEC {