< prev index next >

src/hotspot/share/gc/shared/gcVMOperations.hpp

Print this page
rev 57601 : [mq]: metaspace-improvement


  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_GC_SHARED_GCVMOPERATIONS_HPP
  26 #define SHARE_GC_SHARED_GCVMOPERATIONS_HPP
  27 
  28 #include "gc/shared/collectedHeap.hpp"
  29 #include "gc/shared/genCollectedHeap.hpp"
  30 #include "memory/heapInspection.hpp"

  31 #include "prims/jvmtiExport.hpp"
  32 #include "runtime/handles.hpp"
  33 #include "runtime/jniHandles.hpp"
  34 #include "runtime/synchronizer.hpp"
  35 #include "runtime/vmOperations.hpp"
  36 
  37 // The following class hierarchy represents
  38 // a set of operations (VM_Operation) related to GC.
  39 //
  40 //  VM_Operation
  41 //      VM_GC_Operation
  42 //          VM_GC_HeapInspection
  43 //          VM_GenCollectFull
  44 //          VM_GenCollectFullConcurrent
  45 //          VM_ParallelGCSystemGC
  46 //          VM_CollectForAllocation
  47 //              VM_GenCollectForAllocation
  48 //              VM_ParallelGCFailedAllocation
  49 //  VM_GC_Operation
  50 //   - implements methods common to all classes in the hierarchy:


 188 // GenCollectedHeap heap.
 189 class VM_GenCollectFull: public VM_GC_Operation {
 190  private:
 191   GenCollectedHeap::GenerationType _max_generation;
 192  public:
 193   VM_GenCollectFull(uint gc_count_before,
 194                     uint full_gc_count_before,
 195                     GCCause::Cause gc_cause,
 196                     GenCollectedHeap::GenerationType max_generation)
 197     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
 198       _max_generation(max_generation) { }
 199   ~VM_GenCollectFull() {}
 200   virtual VMOp_Type type() const { return VMOp_GenCollectFull; }
 201   virtual void doit();
 202 };
 203 
 204 class VM_CollectForMetadataAllocation: public VM_GC_Operation {
 205  private:
 206   MetaWord*                _result;
 207   size_t                   _size;     // size of object to be allocated
 208   Metaspace::MetadataType  _mdtype;
 209   ClassLoaderData*         _loader_data;
 210 
 211  public:
 212   VM_CollectForMetadataAllocation(ClassLoaderData* loader_data,
 213                                   size_t size,
 214                                   Metaspace::MetadataType mdtype,
 215                                   uint gc_count_before,
 216                                   uint full_gc_count_before,
 217                                   GCCause::Cause gc_cause);
 218 
 219   virtual VMOp_Type type() const { return VMOp_CollectForMetadataAllocation; }
 220   virtual void doit();
 221   MetaWord* result() const       { return _result; }
 222 
 223   bool initiate_concurrent_GC();
 224 };
 225 
 226 class SvcGCMarker : public StackObj {
 227  private:
 228   JvmtiGCMarker _jgcm;
 229  public:
 230   typedef enum { MINOR, FULL, CONCURRENT } reason_type;
 231 
 232   SvcGCMarker(reason_type reason ) {
 233     VM_GC_Operation::notify_gc_begin(reason == FULL);
 234   }


  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_GC_SHARED_GCVMOPERATIONS_HPP
  26 #define SHARE_GC_SHARED_GCVMOPERATIONS_HPP
  27 
  28 #include "gc/shared/collectedHeap.hpp"
  29 #include "gc/shared/genCollectedHeap.hpp"
  30 #include "memory/heapInspection.hpp"
  31 #include "memory/metaspace/metaspaceEnums.hpp"
  32 #include "prims/jvmtiExport.hpp"
  33 #include "runtime/handles.hpp"
  34 #include "runtime/jniHandles.hpp"
  35 #include "runtime/synchronizer.hpp"
  36 #include "runtime/vmOperations.hpp"
  37 
  38 // The following class hierarchy represents
  39 // a set of operations (VM_Operation) related to GC.
  40 //
  41 //  VM_Operation
  42 //      VM_GC_Operation
  43 //          VM_GC_HeapInspection
  44 //          VM_GenCollectFull
  45 //          VM_GenCollectFullConcurrent
  46 //          VM_ParallelGCSystemGC
  47 //          VM_CollectForAllocation
  48 //              VM_GenCollectForAllocation
  49 //              VM_ParallelGCFailedAllocation
  50 //  VM_GC_Operation
  51 //   - implements methods common to all classes in the hierarchy:


 189 // GenCollectedHeap heap.
 190 class VM_GenCollectFull: public VM_GC_Operation {
 191  private:
 192   GenCollectedHeap::GenerationType _max_generation;
 193  public:
 194   VM_GenCollectFull(uint gc_count_before,
 195                     uint full_gc_count_before,
 196                     GCCause::Cause gc_cause,
 197                     GenCollectedHeap::GenerationType max_generation)
 198     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
 199       _max_generation(max_generation) { }
 200   ~VM_GenCollectFull() {}
 201   virtual VMOp_Type type() const { return VMOp_GenCollectFull; }
 202   virtual void doit();
 203 };
 204 
 205 class VM_CollectForMetadataAllocation: public VM_GC_Operation {
 206  private:
 207   MetaWord*                _result;
 208   size_t                   _size;     // size of object to be allocated
 209   metaspace::MetadataType  _mdtype;
 210   ClassLoaderData*         _loader_data;
 211 
 212  public:
 213   VM_CollectForMetadataAllocation(ClassLoaderData* loader_data,
 214                                   size_t size,
 215                                   metaspace::MetadataType mdtype,
 216                                   uint gc_count_before,
 217                                   uint full_gc_count_before,
 218                                   GCCause::Cause gc_cause);
 219 
 220   virtual VMOp_Type type() const { return VMOp_CollectForMetadataAllocation; }
 221   virtual void doit();
 222   MetaWord* result() const       { return _result; }
 223 
 224   bool initiate_concurrent_GC();
 225 };
 226 
 227 class SvcGCMarker : public StackObj {
 228  private:
 229   JvmtiGCMarker _jgcm;
 230  public:
 231   typedef enum { MINOR, FULL, CONCURRENT } reason_type;
 232 
 233   SvcGCMarker(reason_type reason ) {
 234     VM_GC_Operation::notify_gc_begin(reason == FULL);
 235   }
< prev index next >