< prev index next >

src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp

Print this page
rev 8068 : imported patch parallelscavenge_cleanup


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP
  27 
  28 #include "gc_implementation/parallelScavenge/objectStartArray.hpp"

  29 #include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
  30 #include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
  31 #include "gc_implementation/shared/collectorCounters.hpp"
  32 #include "gc_implementation/shared/mutableSpace.hpp"
  33 #include "gc_interface/collectedHeap.hpp"
  34 #include "oops/oop.hpp"
  35 
  36 class ParallelScavengeHeap;
  37 class PSAdaptiveSizePolicy;
  38 class PSYoungGen;
  39 class PSOldGen;
  40 class ParCompactionManager;
  41 class ParallelTaskTerminator;
  42 class PSParallelCompact;
  43 class GCTaskManager;
  44 class GCTaskQueue;
  45 class PreGCValues;
  46 class MoveAndUpdateClosure;
  47 class RefProcTaskExecutor;
  48 class ParallelOldTracer;


1150     template <typename T> void do_oop_nv(T* p);
1151     virtual void do_oop(oop* p);
1152     virtual void do_oop(narrowOop* p);
1153 
1154     // This closure provides its own oop verification code.
1155     debug_only(virtual bool should_verify_oops() { return false; })
1156   };
1157 
1158   // The one and only place to start following the classes.
1159   // Should only be applied to the ClassLoaderData klasses list.
1160   class FollowKlassClosure : public KlassClosure {
1161    private:
1162     MarkAndPushClosure* _mark_and_push_closure;
1163    public:
1164     FollowKlassClosure(MarkAndPushClosure* mark_and_push_closure) :
1165         _mark_and_push_closure(mark_and_push_closure) { }
1166     void do_klass(Klass* klass);
1167   };
1168 
1169   PSParallelCompact();
1170 
1171   // Convenient accessor for Universe::heap().
1172   static ParallelScavengeHeap* gc_heap() {
1173     return (ParallelScavengeHeap*)Universe::heap();
1174   }
1175 
1176   static void invoke(bool maximum_heap_compaction);
1177   static bool invoke_no_policy(bool maximum_heap_compaction);
1178 
1179   static void post_initialize();
1180   // Perform initialization for PSParallelCompact that requires
1181   // allocations.  This should be called during the VM initialization
1182   // at a pointer where it would be appropriate to return a JNI_ENOMEM
1183   // in the event of a failure.
1184   static bool initialize();
1185 
1186   // Closure accessors
1187   static PSParallelCompact::AdjustPointerClosure* adjust_pointer_closure() {
1188     return &_adjust_pointer_closure;
1189   }
1190   static KlassClosure* adjust_klass_closure()      { return (KlassClosure*)&_adjust_klass_closure; }
1191   static BoolObjectClosure* is_alive_closure()     { return (BoolObjectClosure*)&_is_alive_closure; }
1192 
1193   // Public accessors
1194   static elapsedTimer* accumulated_time() { return &_accumulated_time; }




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP
  27 
  28 #include "gc_implementation/parallelScavenge/objectStartArray.hpp"
  29 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
  30 #include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
  31 #include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
  32 #include "gc_implementation/shared/collectorCounters.hpp"
  33 #include "gc_implementation/shared/mutableSpace.hpp"
  34 #include "gc_interface/collectedHeap.hpp"
  35 #include "oops/oop.hpp"
  36 
  37 class ParallelScavengeHeap;
  38 class PSAdaptiveSizePolicy;
  39 class PSYoungGen;
  40 class PSOldGen;
  41 class ParCompactionManager;
  42 class ParallelTaskTerminator;
  43 class PSParallelCompact;
  44 class GCTaskManager;
  45 class GCTaskQueue;
  46 class PreGCValues;
  47 class MoveAndUpdateClosure;
  48 class RefProcTaskExecutor;
  49 class ParallelOldTracer;


1151     template <typename T> void do_oop_nv(T* p);
1152     virtual void do_oop(oop* p);
1153     virtual void do_oop(narrowOop* p);
1154 
1155     // This closure provides its own oop verification code.
1156     debug_only(virtual bool should_verify_oops() { return false; })
1157   };
1158 
1159   // The one and only place to start following the classes.
1160   // Should only be applied to the ClassLoaderData klasses list.
1161   class FollowKlassClosure : public KlassClosure {
1162    private:
1163     MarkAndPushClosure* _mark_and_push_closure;
1164    public:
1165     FollowKlassClosure(MarkAndPushClosure* mark_and_push_closure) :
1166         _mark_and_push_closure(mark_and_push_closure) { }
1167     void do_klass(Klass* klass);
1168   };
1169 
1170   PSParallelCompact();





1171 
1172   static void invoke(bool maximum_heap_compaction);
1173   static bool invoke_no_policy(bool maximum_heap_compaction);
1174 
1175   static void post_initialize();
1176   // Perform initialization for PSParallelCompact that requires
1177   // allocations.  This should be called during the VM initialization
1178   // at a pointer where it would be appropriate to return a JNI_ENOMEM
1179   // in the event of a failure.
1180   static bool initialize();
1181 
1182   // Closure accessors
1183   static PSParallelCompact::AdjustPointerClosure* adjust_pointer_closure() {
1184     return &_adjust_pointer_closure;
1185   }
1186   static KlassClosure* adjust_klass_closure()      { return (KlassClosure*)&_adjust_klass_closure; }
1187   static BoolObjectClosure* is_alive_closure()     { return (BoolObjectClosure*)&_is_alive_closure; }
1188 
1189   // Public accessors
1190   static elapsedTimer* accumulated_time() { return &_accumulated_time; }


< prev index next >