hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp
changeset 29078 3b7dd035c20b
parent 27250 cc55c7b61f08
child 29079 832d35c45d0b
equal deleted inserted replaced
28940:c314cf1db3fa 29078:3b7dd035c20b
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    42   HeapWord* _result;
    42   HeapWord* _result;
    43   bool      _pause_succeeded;
    43   bool      _pause_succeeded;
    44   AllocationContext_t _allocation_context;
    44   AllocationContext_t _allocation_context;
    45 
    45 
    46 public:
    46 public:
    47   VM_G1OperationWithAllocRequest(unsigned int gc_count_before,
    47   VM_G1OperationWithAllocRequest(uint           gc_count_before,
    48                                  size_t       word_size,
    48                                  size_t         word_size,
    49                                  GCCause::Cause gc_cause)
    49                                  GCCause::Cause gc_cause)
    50     : VM_GC_Operation(gc_count_before, gc_cause),
    50     : VM_GC_Operation(gc_count_before, gc_cause),
    51       _word_size(word_size), _result(NULL), _pause_succeeded(false) { }
    51       _word_size(word_size), _result(NULL), _pause_succeeded(false) { }
    52   HeapWord* result() { return _result; }
    52   HeapWord* result() { return _result; }
    53   bool pause_succeeded() { return _pause_succeeded; }
    53   bool pause_succeeded() { return _pause_succeeded; }
    55   AllocationContext_t  allocation_context() { return _allocation_context; }
    55   AllocationContext_t  allocation_context() { return _allocation_context; }
    56 };
    56 };
    57 
    57 
    58 class VM_G1CollectFull: public VM_GC_Operation {
    58 class VM_G1CollectFull: public VM_GC_Operation {
    59 public:
    59 public:
    60   VM_G1CollectFull(unsigned int gc_count_before,
    60   VM_G1CollectFull(uint gc_count_before,
    61                    unsigned int full_gc_count_before,
    61                    uint full_gc_count_before,
    62                    GCCause::Cause cause)
    62                    GCCause::Cause cause)
    63     : VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
    63     : VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
    64   virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
    64   virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
    65   virtual void doit();
    65   virtual void doit();
    66   virtual const char* name() const {
    66   virtual const char* name() const {
    68   }
    68   }
    69 };
    69 };
    70 
    70 
    71 class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest {
    71 class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest {
    72 public:
    72 public:
    73   VM_G1CollectForAllocation(unsigned int gc_count_before,
    73   VM_G1CollectForAllocation(uint         gc_count_before,
    74                             size_t       word_size);
    74                             size_t       word_size);
    75   virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; }
    75   virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; }
    76   virtual void doit();
    76   virtual void doit();
    77   virtual const char* name() const {
    77   virtual const char* name() const {
    78     return "garbage-first collection to satisfy allocation";
    78     return "garbage-first collection to satisfy allocation";
    82 class VM_G1IncCollectionPause: public VM_G1OperationWithAllocRequest {
    82 class VM_G1IncCollectionPause: public VM_G1OperationWithAllocRequest {
    83 private:
    83 private:
    84   bool         _should_initiate_conc_mark;
    84   bool         _should_initiate_conc_mark;
    85   bool         _should_retry_gc;
    85   bool         _should_retry_gc;
    86   double       _target_pause_time_ms;
    86   double       _target_pause_time_ms;
    87   unsigned int _old_marking_cycles_completed_before;
    87   uint         _old_marking_cycles_completed_before;
    88 public:
    88 public:
    89   VM_G1IncCollectionPause(unsigned int   gc_count_before,
    89   VM_G1IncCollectionPause(uint           gc_count_before,
    90                           size_t         word_size,
    90                           size_t         word_size,
    91                           bool           should_initiate_conc_mark,
    91                           bool           should_initiate_conc_mark,
    92                           double         target_pause_time_ms,
    92                           double         target_pause_time_ms,
    93                           GCCause::Cause gc_cause);
    93                           GCCause::Cause gc_cause);
    94   virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; }
    94   virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; }