equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2016, 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. |
26 #define SHARE_VM_GC_CMS_VMCMSOPERATIONS_HPP |
26 #define SHARE_VM_GC_CMS_VMCMSOPERATIONS_HPP |
27 |
27 |
28 #include "gc/cms/concurrentMarkSweepGeneration.hpp" |
28 #include "gc/cms/concurrentMarkSweepGeneration.hpp" |
29 #include "gc/shared/gcCause.hpp" |
29 #include "gc/shared/gcCause.hpp" |
30 #include "gc/shared/gcId.hpp" |
30 #include "gc/shared/gcId.hpp" |
|
31 #include "gc/shared/referencePendingListLocker.hpp" |
31 #include "gc/shared/vmGCOperations.hpp" |
32 #include "gc/shared/vmGCOperations.hpp" |
32 #include "runtime/vm_operations.hpp" |
33 #include "runtime/vm_operations.hpp" |
33 |
34 |
34 // The VM_CMS_Operation is slightly different from |
35 // The VM_CMS_Operation is slightly different from |
35 // a VM_GC_Operation -- and would not have subclassed easily |
36 // a VM_GC_Operation -- and would not have subclassed easily |
49 |
50 |
50 // Forward decl. |
51 // Forward decl. |
51 class CMSCollector; |
52 class CMSCollector; |
52 |
53 |
53 class VM_CMS_Operation: public VM_Operation { |
54 class VM_CMS_Operation: public VM_Operation { |
|
55 private: |
|
56 ReferencePendingListLocker _pending_list_locker; |
|
57 |
54 protected: |
58 protected: |
55 CMSCollector* _collector; // associated collector |
59 CMSCollector* _collector; // associated collector |
56 bool _prologue_succeeded; // whether doit_prologue succeeded |
60 bool _prologue_succeeded; // whether doit_prologue succeeded |
57 uint _gc_id; |
61 uint _gc_id; |
58 |
62 |
71 |
75 |
72 // The legal collector state for executing this CMS op. |
76 // The legal collector state for executing this CMS op. |
73 virtual const CMSCollector::CollectorState legal_state() const = 0; |
77 virtual const CMSCollector::CollectorState legal_state() const = 0; |
74 |
78 |
75 // Whether the pending list lock needs to be held |
79 // Whether the pending list lock needs to be held |
76 virtual const bool needs_pll() const = 0; |
80 virtual const bool needs_pending_list_lock() const = 0; |
77 |
81 |
78 // Execute operations in the context of the caller, |
82 // Execute operations in the context of the caller, |
79 // prior to execution of the vm operation itself. |
83 // prior to execution of the vm operation itself. |
80 virtual bool doit_prologue(); |
84 virtual bool doit_prologue(); |
81 // Execute operations in the context of the caller, |
85 // Execute operations in the context of the caller, |
103 |
107 |
104 virtual const CMSCollector::CollectorState legal_state() const { |
108 virtual const CMSCollector::CollectorState legal_state() const { |
105 return CMSCollector::InitialMarking; |
109 return CMSCollector::InitialMarking; |
106 } |
110 } |
107 |
111 |
108 virtual const bool needs_pll() const { |
112 virtual const bool needs_pending_list_lock() const { |
109 return false; |
113 return false; |
110 } |
114 } |
111 }; |
115 }; |
112 |
116 |
113 // VM_CMS_Operation for the final remark phase of CMS. |
117 // VM_CMS_Operation for the final remark phase of CMS. |
120 |
124 |
121 virtual const CMSCollector::CollectorState legal_state() const { |
125 virtual const CMSCollector::CollectorState legal_state() const { |
122 return CMSCollector::FinalMarking; |
126 return CMSCollector::FinalMarking; |
123 } |
127 } |
124 |
128 |
125 virtual const bool needs_pll() const { |
129 virtual const bool needs_pending_list_lock() const { |
126 return true; |
130 return true; |
127 } |
131 } |
128 }; |
132 }; |
129 |
133 |
130 |
134 |