Tue, 23 Nov 2010 13:22:55 -0800
6989984: Use standard include model for Hospot
Summary: Replaced MakeDeps and the includeDB files with more standardized solutions.
Reviewed-by: coleenp, kvn, kamg
duke@435 | 1 | /* |
stefank@2314 | 2 | * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
stefank@2314 | 25 | #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP |
stefank@2314 | 26 | #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP |
stefank@2314 | 27 | |
stefank@2314 | 28 | #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" |
stefank@2314 | 29 | #include "gc_implementation/shared/vmGCOperations.hpp" |
stefank@2314 | 30 | #include "gc_interface/gcCause.hpp" |
stefank@2314 | 31 | #include "runtime/vm_operations.hpp" |
stefank@2314 | 32 | |
duke@435 | 33 | // The VM_CMS_Operation is slightly different from |
duke@435 | 34 | // a VM_GC_Operation -- and would not have subclassed easily |
duke@435 | 35 | // to VM_GC_Operation without several changes to VM_GC_Operation. |
duke@435 | 36 | // To minimize the changes, we have replicated some of the VM_GC_Operation |
duke@435 | 37 | // functionality here. We will consolidate that back by doing subclassing |
duke@435 | 38 | // as appropriate in Dolphin. |
duke@435 | 39 | // |
duke@435 | 40 | // VM_Operation |
duke@435 | 41 | // VM_CMS_Operation |
duke@435 | 42 | // - implements the common portion of work done in support |
duke@435 | 43 | // of CMS' stop-world phases (initial mark and remark). |
duke@435 | 44 | // |
duke@435 | 45 | // VM_CMS_Initial_Mark |
duke@435 | 46 | // VM_CMS_Final_Mark |
duke@435 | 47 | // |
duke@435 | 48 | |
duke@435 | 49 | // Forward decl. |
duke@435 | 50 | class CMSCollector; |
duke@435 | 51 | |
duke@435 | 52 | class VM_CMS_Operation: public VM_Operation { |
duke@435 | 53 | protected: |
duke@435 | 54 | CMSCollector* _collector; // associated collector |
duke@435 | 55 | bool _prologue_succeeded; // whether doit_prologue succeeded |
duke@435 | 56 | |
duke@435 | 57 | bool lost_race() const; |
duke@435 | 58 | |
duke@435 | 59 | // java.lang.ref.Reference support |
duke@435 | 60 | void acquire_pending_list_lock(); |
duke@435 | 61 | void release_and_notify_pending_list_lock(); |
duke@435 | 62 | |
duke@435 | 63 | public: |
duke@435 | 64 | VM_CMS_Operation(CMSCollector* collector): |
duke@435 | 65 | _collector(collector), |
duke@435 | 66 | _prologue_succeeded(false) {} |
duke@435 | 67 | ~VM_CMS_Operation() {} |
duke@435 | 68 | |
duke@435 | 69 | // The legal collector state for executing this CMS op. |
duke@435 | 70 | virtual const CMSCollector::CollectorState legal_state() const = 0; |
duke@435 | 71 | |
duke@435 | 72 | // Whether the pending list lock needs to be held |
duke@435 | 73 | virtual const bool needs_pll() const = 0; |
duke@435 | 74 | |
duke@435 | 75 | // Execute operations in the context of the caller, |
duke@435 | 76 | // prior to execution of the vm operation itself. |
duke@435 | 77 | virtual bool doit_prologue(); |
duke@435 | 78 | // Execute operations in the context of the caller, |
duke@435 | 79 | // following completion of the vm operation. |
duke@435 | 80 | virtual void doit_epilogue(); |
duke@435 | 81 | |
duke@435 | 82 | virtual bool evaluate_at_safepoint() const { return true; } |
duke@435 | 83 | virtual bool is_cheap_allocated() const { return false; } |
duke@435 | 84 | virtual bool allow_nested_vm_operations() const { return false; } |
duke@435 | 85 | bool prologue_succeeded() const { return _prologue_succeeded; } |
duke@435 | 86 | |
duke@435 | 87 | void verify_before_gc(); |
duke@435 | 88 | void verify_after_gc(); |
duke@435 | 89 | }; |
duke@435 | 90 | |
duke@435 | 91 | |
duke@435 | 92 | // VM_CMS_Operation for the initial marking phase of CMS. |
duke@435 | 93 | class VM_CMS_Initial_Mark: public VM_CMS_Operation { |
duke@435 | 94 | public: |
duke@435 | 95 | VM_CMS_Initial_Mark(CMSCollector* _collector) : |
duke@435 | 96 | VM_CMS_Operation(_collector) {} |
duke@435 | 97 | |
duke@435 | 98 | virtual VMOp_Type type() const { return VMOp_CMS_Initial_Mark; } |
duke@435 | 99 | virtual void doit(); |
duke@435 | 100 | |
duke@435 | 101 | virtual const CMSCollector::CollectorState legal_state() const { |
duke@435 | 102 | return CMSCollector::InitialMarking; |
duke@435 | 103 | } |
duke@435 | 104 | |
duke@435 | 105 | virtual const bool needs_pll() const { |
duke@435 | 106 | return false; |
duke@435 | 107 | } |
duke@435 | 108 | }; |
duke@435 | 109 | |
duke@435 | 110 | // VM_CMS_Operation for the final remark phase of CMS. |
duke@435 | 111 | class VM_CMS_Final_Remark: public VM_CMS_Operation { |
duke@435 | 112 | public: |
duke@435 | 113 | VM_CMS_Final_Remark(CMSCollector* _collector) : |
duke@435 | 114 | VM_CMS_Operation(_collector) {} |
duke@435 | 115 | virtual VMOp_Type type() const { return VMOp_CMS_Final_Remark; } |
duke@435 | 116 | virtual void doit(); |
duke@435 | 117 | |
duke@435 | 118 | virtual const CMSCollector::CollectorState legal_state() const { |
duke@435 | 119 | return CMSCollector::FinalMarking; |
duke@435 | 120 | } |
duke@435 | 121 | |
duke@435 | 122 | virtual const bool needs_pll() const { |
duke@435 | 123 | return true; |
duke@435 | 124 | } |
duke@435 | 125 | }; |
duke@435 | 126 | |
duke@435 | 127 | |
duke@435 | 128 | // VM operation to invoke a concurrent collection of the heap as a |
duke@435 | 129 | // GenCollectedHeap heap. |
duke@435 | 130 | class VM_GenCollectFullConcurrent: public VM_GC_Operation { |
duke@435 | 131 | public: |
duke@435 | 132 | VM_GenCollectFullConcurrent(unsigned int gc_count_before, |
duke@435 | 133 | unsigned int full_gc_count_before, |
duke@435 | 134 | GCCause::Cause gc_cause) |
duke@435 | 135 | : VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */) { |
duke@435 | 136 | _gc_cause = gc_cause; |
ysr@1875 | 137 | assert(FullGCCount_lock != NULL, "Error"); |
duke@435 | 138 | assert(UseAsyncConcMarkSweepGC, "Else will hang caller"); |
duke@435 | 139 | } |
duke@435 | 140 | ~VM_GenCollectFullConcurrent() {} |
duke@435 | 141 | virtual VMOp_Type type() const { return VMOp_GenCollectFullConcurrent; } |
duke@435 | 142 | virtual void doit(); |
duke@435 | 143 | virtual void doit_epilogue(); |
duke@435 | 144 | virtual bool is_cheap_allocated() const { return false; } |
duke@435 | 145 | virtual bool evaluate_at_safepoint() const; |
duke@435 | 146 | }; |
stefank@2314 | 147 | |
stefank@2314 | 148 | #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_VMCMSOPERATIONS_HPP |