src/hotspot/share/gc/cms/cmsVMOperations.hpp
author coleenp
Thu, 10 Jan 2019 15:13:51 -0500
changeset 53244 9807daeb47c4
parent 52877 9e041366c764
permissions -rw-r--r--
8216167: Update include guards to reflect correct directories Summary: Use script and some manual fixup to fix directores names in include guards. Reviewed-by: lfoltan, eosterlund, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52877
diff changeset
     2
 * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5433
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5433
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5433
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52877
diff changeset
    25
#ifndef SHARE_GC_CMS_CMSVMOPERATIONS_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52877
diff changeset
    26
#define SHARE_GC_CMS_CMSVMOPERATIONS_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29078
diff changeset
    28
#include "gc/cms/concurrentMarkSweepGeneration.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29078
diff changeset
    29
#include "gc/shared/gcCause.hpp"
33107
77bf0d2069a3 8134953: Make the GC ID available in a central place
brutisso
parents: 30764
diff changeset
    30
#include "gc/shared/gcId.hpp"
52876
2d17750d41e7 8214791: Consistently name gc files containing VM operations
tschatzl
parents: 47216
diff changeset
    31
#include "gc/shared/gcVMOperations.hpp"
52877
9e041366c764 8214850: Rename vm_operations.?pp files to vmOperations.?pp files
tschatzl
parents: 52876
diff changeset
    32
#include "runtime/vmOperations.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    33
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// The VM_CMS_Operation is slightly different from
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
// a VM_GC_Operation -- and would not have subclassed easily
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// to VM_GC_Operation without several changes to VM_GC_Operation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// To minimize the changes, we have replicated some of the VM_GC_Operation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
// functionality here. We will consolidate that back by doing subclassing
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
// as appropriate in Dolphin.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
//  VM_Operation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
//    VM_CMS_Operation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
//    - implements the common portion of work done in support
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
//      of CMS' stop-world phases (initial mark and remark).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
//      VM_CMS_Initial_Mark
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
//      VM_CMS_Final_Mark
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
// Forward decl.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
class CMSCollector;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
class VM_CMS_Operation: public VM_Operation {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  CMSCollector*  _collector;                 // associated collector
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  bool           _prologue_succeeded;     // whether doit_prologue succeeded
33107
77bf0d2069a3 8134953: Make the GC ID available in a central place
brutisso
parents: 30764
diff changeset
    57
  uint           _gc_id;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  bool lost_race() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  VM_CMS_Operation(CMSCollector* collector):
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
    _collector(collector),
33107
77bf0d2069a3 8134953: Make the GC ID available in a central place
brutisso
parents: 30764
diff changeset
    64
    _prologue_succeeded(false),
77bf0d2069a3 8134953: Make the GC ID available in a central place
brutisso
parents: 30764
diff changeset
    65
    _gc_id(GCId::current()) {}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  ~VM_CMS_Operation() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  // The legal collector state for executing this CMS op.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  virtual const CMSCollector::CollectorState legal_state() const = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  // Whether the pending list lock needs to be held
37129
af29e306e50b 8151601: Cleanup locking of the Reference pending list
pliden
parents: 33587
diff changeset
    72
  virtual const bool needs_pending_list_lock() const = 0;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  // Execute operations in the context of the caller,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  // prior to execution of the vm operation itself.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  virtual bool doit_prologue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  // Execute operations in the context of the caller,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  // following completion of the vm operation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  virtual void doit_epilogue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  virtual bool evaluate_at_safepoint() const { return true; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  virtual bool is_cheap_allocated() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  virtual bool allow_nested_vm_operations() const  { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  bool prologue_succeeded() const { return _prologue_succeeded; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  void verify_before_gc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  void verify_after_gc();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
// VM_CMS_Operation for the initial marking phase of CMS.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
class VM_CMS_Initial_Mark: public VM_CMS_Operation {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  VM_CMS_Initial_Mark(CMSCollector* _collector) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
    VM_CMS_Operation(_collector) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  virtual VMOp_Type type() const { return VMOp_CMS_Initial_Mark; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  virtual void doit();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  virtual const CMSCollector::CollectorState legal_state() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
    return CMSCollector::InitialMarking;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
37129
af29e306e50b 8151601: Cleanup locking of the Reference pending list
pliden
parents: 33587
diff changeset
   104
  virtual const bool needs_pending_list_lock() const {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
// VM_CMS_Operation for the final remark phase of CMS.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
class VM_CMS_Final_Remark: public VM_CMS_Operation {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  VM_CMS_Final_Remark(CMSCollector* _collector) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
    VM_CMS_Operation(_collector) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  virtual VMOp_Type type() const { return VMOp_CMS_Final_Remark; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  virtual void doit();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  virtual const CMSCollector::CollectorState legal_state() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    return CMSCollector::FinalMarking;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
37129
af29e306e50b 8151601: Cleanup locking of the Reference pending list
pliden
parents: 33587
diff changeset
   121
  virtual const bool needs_pending_list_lock() const {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
    return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
// VM operation to invoke a concurrent collection of the heap as a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
// GenCollectedHeap heap.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
class VM_GenCollectFullConcurrent: public VM_GC_Operation {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
 public:
29078
3b7dd035c20b 8072621: Clean up around VM_GC_Operations
mlarsson
parents: 27625
diff changeset
   131
  VM_GenCollectFullConcurrent(uint gc_count_before,
3b7dd035c20b 8072621: Clean up around VM_GC_Operations
mlarsson
parents: 27625
diff changeset
   132
                              uint full_gc_count_before,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
                              GCCause::Cause gc_cause)
27625
07829380b8cd 8061308: Remove iCMS
brutisso
parents: 8684
diff changeset
   134
    : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */)
8684
7ebbd0b3e295 6987703: iCMS: Intermittent hang with gc/gctests/CallGC/CallGC01 and +ExplicitGCInvokesConcurrent
ysr
parents: 8295
diff changeset
   135
  {
5433
c182d4c3039e 6919638: CMS: ExplicitGCInvokesConcurrent misinteracts with gc locker
ysr
parents: 1
diff changeset
   136
    assert(FullGCCount_lock != NULL, "Error");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  ~VM_GenCollectFullConcurrent() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  virtual VMOp_Type type() const { return VMOp_GenCollectFullConcurrent; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  virtual void doit();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  virtual void doit_epilogue();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  virtual bool is_cheap_allocated() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  virtual bool evaluate_at_safepoint() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   145
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52877
diff changeset
   146
#endif // SHARE_GC_CMS_CMSVMOPERATIONS_HPP