author | stefank |
Mon, 28 Oct 2019 11:27:27 +0100 | |
changeset 58815 | a4cdca87152b |
parent 57658 | 0022b39ae5ae |
permissions | -rw-r--r-- |
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
1 |
/* |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
2 |
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
4 |
* |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
8 |
* |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
13 |
* accompanied this code). |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
14 |
* |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
18 |
* |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
21 |
* questions. |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
22 |
*/ |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
23 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
24 |
#include "precompiled.hpp" |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
25 |
#include "classfile/classLoaderData.hpp" |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
26 |
#include "gc/z/zAddress.hpp" |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
27 |
#include "gc/z/zHeap.inline.hpp" |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
28 |
#include "gc/z/zOop.hpp" |
58815
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
29 |
#include "gc/z/zPageAllocator.hpp" |
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
30 |
#include "gc/z/zResurrection.hpp" |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
31 |
#include "gc/z/zRootsIterator.hpp" |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
32 |
#include "gc/z/zStat.hpp" |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
33 |
#include "gc/z/zVerify.hpp" |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
34 |
#include "memory/iterator.inline.hpp" |
57658 | 35 |
#include "oops/oop.hpp" |
36 |
||
37 |
#define BAD_OOP_ARG(o, p) "Bad oop " PTR_FORMAT " found at " PTR_FORMAT, p2i(o), p2i(p) |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
38 |
|
57658 | 39 |
static void verify_oop(oop* p) { |
40 |
const oop o = RawAccess<>::oop_load(p); |
|
41 |
if (o != NULL) { |
|
42 |
const uintptr_t addr = ZOop::to_address(o); |
|
43 |
guarantee(ZAddress::is_good(addr), BAD_OOP_ARG(o, p)); |
|
44 |
guarantee(oopDesc::is_oop(ZOop::from_address(addr)), BAD_OOP_ARG(o, p)); |
|
45 |
} |
|
46 |
} |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
47 |
|
57658 | 48 |
static void verify_possibly_weak_oop(oop* p) { |
49 |
const oop o = RawAccess<>::oop_load(p); |
|
50 |
if (o != NULL) { |
|
51 |
const uintptr_t addr = ZOop::to_address(o); |
|
52 |
guarantee(ZAddress::is_good(addr) || ZAddress::is_finalizable_good(addr), BAD_OOP_ARG(o, p)); |
|
53 |
guarantee(oopDesc::is_oop(ZOop::from_address(ZAddress::good(addr))), BAD_OOP_ARG(o, p)); |
|
54 |
} |
|
55 |
} |
|
56 |
||
57 |
class ZVerifyRootClosure : public ZRootsIteratorClosure { |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
58 |
public: |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
59 |
virtual void do_oop(oop* p) { |
57658 | 60 |
verify_oop(p); |
61 |
} |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
62 |
|
57658 | 63 |
virtual void do_oop(narrowOop*) { |
64 |
ShouldNotReachHere(); |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
65 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
66 |
}; |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
67 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
68 |
class ZVerifyOopClosure : public ClaimMetadataVisitingOopIterateClosure, public ZRootsIteratorClosure { |
57658 | 69 |
private: |
70 |
const bool _verify_weaks; |
|
71 |
||
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
72 |
public: |
57658 | 73 |
ZVerifyOopClosure(bool verify_weaks) : |
74 |
ClaimMetadataVisitingOopIterateClosure(ClassLoaderData::_claim_other), |
|
75 |
_verify_weaks(verify_weaks) {} |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
76 |
|
57658 | 77 |
virtual void do_oop(oop* p) { |
78 |
if (_verify_weaks) { |
|
79 |
verify_possibly_weak_oop(p); |
|
80 |
} else { |
|
81 |
// We should never encounter finalizable oops through strong |
|
82 |
// paths. This assumes we have only visited strong roots. |
|
83 |
verify_oop(p); |
|
84 |
} |
|
85 |
} |
|
86 |
||
87 |
virtual void do_oop(narrowOop* p) { |
|
88 |
ShouldNotReachHere(); |
|
89 |
} |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
90 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
91 |
virtual ReferenceIterationMode reference_iteration_mode() { |
57658 | 92 |
return _verify_weaks ? DO_FIELDS : DO_FIELDS_EXCEPT_REFERENT; |
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
93 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
94 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
95 |
#ifdef ASSERT |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
96 |
// Verification handled by the closure itself |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
97 |
virtual bool should_verify_oops() { |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
98 |
return false; |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
99 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
100 |
#endif |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
101 |
}; |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
102 |
|
57658 | 103 |
template <typename RootsIterator> |
104 |
void ZVerify::roots() { |
|
105 |
assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); |
|
106 |
assert(!ZResurrection::is_blocked(), "Invalid phase"); |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
107 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
108 |
if (ZVerifyRoots) { |
57658 | 109 |
ZVerifyRootClosure cl; |
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
110 |
RootsIterator iter; |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
111 |
iter.oops_do(&cl); |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
112 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
113 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
114 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
115 |
void ZVerify::roots_strong() { |
57658 | 116 |
roots<ZRootsIterator>(); |
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
117 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
118 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
119 |
void ZVerify::roots_weak() { |
57658 | 120 |
roots<ZWeakRootsIterator>(); |
121 |
} |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
122 |
|
57658 | 123 |
void ZVerify::roots_concurrent_strong() { |
124 |
roots<ZConcurrentRootsIteratorClaimNone>(); |
|
125 |
} |
|
126 |
||
127 |
void ZVerify::roots_concurrent_weak() { |
|
128 |
roots<ZConcurrentWeakRootsIterator>(); |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
129 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
130 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
131 |
void ZVerify::roots(bool verify_weaks) { |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
132 |
roots_strong(); |
57658 | 133 |
roots_concurrent_strong(); |
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
134 |
if (verify_weaks) { |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
135 |
roots_weak(); |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
136 |
roots_concurrent_weak(); |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
137 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
138 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
139 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
140 |
void ZVerify::objects(bool verify_weaks) { |
57658 | 141 |
assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); |
142 |
assert(ZGlobalPhase == ZPhaseMarkCompleted, "Invalid phase"); |
|
143 |
assert(!ZResurrection::is_blocked(), "Invalid phase"); |
|
144 |
||
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
145 |
if (ZVerifyObjects) { |
57658 | 146 |
ZVerifyOopClosure cl(verify_weaks); |
147 |
ObjectToOopClosure object_cl(&cl); |
|
148 |
ZHeap::heap()->object_iterate(&object_cl, verify_weaks); |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
149 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
150 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
151 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
152 |
void ZVerify::roots_and_objects(bool verify_weaks) { |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
153 |
roots(verify_weaks); |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
154 |
objects(verify_weaks); |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
155 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
156 |
|
57656
9429ecaee2e0
8229135: ZGC: Adding missing ZStatTimerDisable before call to ZVerify::roots_strong()
pliden
parents:
55603
diff
changeset
|
157 |
void ZVerify::before_zoperation() { |
9429ecaee2e0
8229135: ZGC: Adding missing ZStatTimerDisable before call to ZVerify::roots_strong()
pliden
parents:
55603
diff
changeset
|
158 |
// Verify strong roots |
9429ecaee2e0
8229135: ZGC: Adding missing ZStatTimerDisable before call to ZVerify::roots_strong()
pliden
parents:
55603
diff
changeset
|
159 |
ZStatTimerDisable disable; |
9429ecaee2e0
8229135: ZGC: Adding missing ZStatTimerDisable before call to ZVerify::roots_strong()
pliden
parents:
55603
diff
changeset
|
160 |
roots_strong(); |
9429ecaee2e0
8229135: ZGC: Adding missing ZStatTimerDisable before call to ZVerify::roots_strong()
pliden
parents:
55603
diff
changeset
|
161 |
} |
9429ecaee2e0
8229135: ZGC: Adding missing ZStatTimerDisable before call to ZVerify::roots_strong()
pliden
parents:
55603
diff
changeset
|
162 |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
163 |
void ZVerify::after_mark() { |
57658 | 164 |
// Verify all strong roots and strong references |
165 |
ZStatTimerDisable disable; |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
166 |
roots_and_objects(false /* verify_weaks */); |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
167 |
} |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
168 |
|
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
169 |
void ZVerify::after_weak_processing() { |
57658 | 170 |
// Verify all roots and all references |
171 |
ZStatTimerDisable disable; |
|
55603
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
172 |
roots_and_objects(true /* verify_weaks */); |
3868dde58ebb
8227175: ZGC: ZHeapIterator visits potentially dead objects
stefank
parents:
diff
changeset
|
173 |
} |
58815
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
174 |
|
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
175 |
template <bool Map> |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
176 |
class ZPageDebugMapOrUnmapClosure : public ZPageClosure { |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
177 |
private: |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
178 |
const ZPageAllocator* const _allocator; |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
179 |
|
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
180 |
public: |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
181 |
ZPageDebugMapOrUnmapClosure(const ZPageAllocator* allocator) : |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
182 |
_allocator(allocator) {} |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
183 |
|
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
184 |
void do_page(const ZPage* page) { |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
185 |
if (Map) { |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
186 |
_allocator->debug_map_page(page); |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
187 |
} else { |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
188 |
_allocator->debug_unmap_page(page); |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
189 |
} |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
190 |
} |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
191 |
}; |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
192 |
|
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
193 |
ZVerifyViewsFlip::ZVerifyViewsFlip(const ZPageAllocator* allocator) : |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
194 |
_allocator(allocator) { |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
195 |
if (ZVerifyViews) { |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
196 |
// Unmap all pages |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
197 |
ZPageDebugMapOrUnmapClosure<false /* Map */> cl(_allocator); |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
198 |
ZHeap::heap()->pages_do(&cl); |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
199 |
} |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
200 |
} |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
201 |
|
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
202 |
ZVerifyViewsFlip::~ZVerifyViewsFlip() { |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
203 |
if (ZVerifyViews) { |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
204 |
// Map all pages |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
205 |
ZPageDebugMapOrUnmapClosure<true /* Map */> cl(_allocator); |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
206 |
ZHeap::heap()->pages_do(&cl); |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
207 |
} |
a4cdca87152b
8232604: ZGC: Make ZVerifyViews mapping and unmapping precise
stefank
parents:
57658
diff
changeset
|
208 |
} |