src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp

Print this page


   1 /*
   2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   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 // The VM_CMS_Operation is slightly different from
  26 // a VM_GC_Operation -- and would not have subclassed easily
  27 // to VM_GC_Operation without several changes to VM_GC_Operation.
  28 // To minimize the changes, we have replicated some of the VM_GC_Operation
  29 // functionality here. We will consolidate that back by doing subclassing
  30 // as appropriate in Dolphin.
  31 //
  32 //  VM_Operation
  33 //    VM_CMS_Operation
  34 //    - implements the common portion of work done in support
  35 //      of CMS' stop-world phases (initial mark and remark).
  36 //
  37 //      VM_CMS_Initial_Mark
  38 //      VM_CMS_Final_Mark
  39 //
  40 
  41 // Forward decl.
  42 class CMSCollector;
  43 
  44 class VM_CMS_Operation: public VM_Operation {


 119 
 120 // VM operation to invoke a concurrent collection of the heap as a
 121 // GenCollectedHeap heap.
 122 class VM_GenCollectFullConcurrent: public VM_GC_Operation {
 123  public:
 124   VM_GenCollectFullConcurrent(unsigned int gc_count_before,
 125                               unsigned int full_gc_count_before,
 126                               GCCause::Cause gc_cause)
 127     : VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */) {
 128     _gc_cause = gc_cause;
 129     assert(FullGCCount_lock != NULL, "Error");
 130     assert(UseAsyncConcMarkSweepGC, "Else will hang caller");
 131   }
 132   ~VM_GenCollectFullConcurrent() {}
 133   virtual VMOp_Type type() const { return VMOp_GenCollectFullConcurrent; }
 134   virtual void doit();
 135   virtual void doit_epilogue();
 136   virtual bool is_cheap_allocated() const { return false; }
 137   virtual bool evaluate_at_safepoint() const;
 138 };


   1 /*
   2  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   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_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP
  27 
  28 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
  29 #include "gc_implementation/shared/vmGCOperations.hpp"
  30 #include "gc_interface/gcCause.hpp"
  31 #include "runtime/vm_operations.hpp"
  32 
  33 // The VM_CMS_Operation is slightly different from
  34 // a VM_GC_Operation -- and would not have subclassed easily
  35 // to VM_GC_Operation without several changes to VM_GC_Operation.
  36 // To minimize the changes, we have replicated some of the VM_GC_Operation
  37 // functionality here. We will consolidate that back by doing subclassing
  38 // as appropriate in Dolphin.
  39 //
  40 //  VM_Operation
  41 //    VM_CMS_Operation
  42 //    - implements the common portion of work done in support
  43 //      of CMS' stop-world phases (initial mark and remark).
  44 //
  45 //      VM_CMS_Initial_Mark
  46 //      VM_CMS_Final_Mark
  47 //
  48 
  49 // Forward decl.
  50 class CMSCollector;
  51 
  52 class VM_CMS_Operation: public VM_Operation {


 127 
 128 // VM operation to invoke a concurrent collection of the heap as a
 129 // GenCollectedHeap heap.
 130 class VM_GenCollectFullConcurrent: public VM_GC_Operation {
 131  public:
 132   VM_GenCollectFullConcurrent(unsigned int gc_count_before,
 133                               unsigned int full_gc_count_before,
 134                               GCCause::Cause gc_cause)
 135     : VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */) {
 136     _gc_cause = gc_cause;
 137     assert(FullGCCount_lock != NULL, "Error");
 138     assert(UseAsyncConcMarkSweepGC, "Else will hang caller");
 139   }
 140   ~VM_GenCollectFullConcurrent() {}
 141   virtual VMOp_Type type() const { return VMOp_GenCollectFullConcurrent; }
 142   virtual void doit();
 143   virtual void doit_epilogue();
 144   virtual bool is_cheap_allocated() const { return false; }
 145   virtual bool evaluate_at_safepoint() const;
 146 };
 147 
 148 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP