Mercurial > hg > graal-compiler
annotate src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp @ 21811:22ac20a25842
8055479: TLAB stability
Reviewed-by: brutisso, stefank, ahgross
author | mgerdin |
---|---|
date | Thu, 09 Oct 2014 15:42:23 +0200 |
parents | 78bbf4d43a14 |
children | 82693fb204a5 |
rev | line source |
---|---|
17753
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
1 /* |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
4 * |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
8 * |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
13 * accompanied this code). |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
14 * |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
18 * |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
21 * questions. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
22 * |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
23 */ |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
24 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
25 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
26 #include "precompiled.hpp" |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
27 #include "code/nmethod.hpp" |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
28 #include "gc_implementation/g1/g1CodeCacheRemSet.hpp" |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
29 #include "memory/iterator.hpp" |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
30 |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17753
diff
changeset
|
31 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC |
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17753
diff
changeset
|
32 |
17753
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
33 G1CodeRootChunk::G1CodeRootChunk() : _top(NULL), _next(NULL), _prev(NULL) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
34 _top = bottom(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
35 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
36 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
37 void G1CodeRootChunk::reset() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
38 _next = _prev = NULL; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
39 _top = bottom(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
40 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
41 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
42 void G1CodeRootChunk::nmethods_do(CodeBlobClosure* cl) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
43 nmethod** cur = bottom(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
44 while (cur != _top) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
45 cl->do_code_blob(*cur); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
46 cur++; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
47 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
48 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
49 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
50 FreeList<G1CodeRootChunk> G1CodeRootSet::_free_list; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
51 size_t G1CodeRootSet::_num_chunks_handed_out = 0; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
52 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
53 G1CodeRootChunk* G1CodeRootSet::new_chunk() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
54 G1CodeRootChunk* result = _free_list.get_chunk_at_head(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
55 if (result == NULL) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
56 result = new G1CodeRootChunk(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
57 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
58 G1CodeRootSet::_num_chunks_handed_out++; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
59 result->reset(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
60 return result; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
61 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
62 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
63 void G1CodeRootSet::free_chunk(G1CodeRootChunk* chunk) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
64 _free_list.return_chunk_at_head(chunk); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
65 G1CodeRootSet::_num_chunks_handed_out--; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
66 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
67 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
68 void G1CodeRootSet::free_all_chunks(FreeList<G1CodeRootChunk>* list) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
69 G1CodeRootSet::_num_chunks_handed_out -= list->count(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
70 _free_list.prepend(list); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
71 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
72 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
73 void G1CodeRootSet::purge_chunks(size_t keep_ratio) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
74 size_t keep = G1CodeRootSet::_num_chunks_handed_out * keep_ratio / 100; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
75 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
76 if (keep >= (size_t)_free_list.count()) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
77 return; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
78 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
79 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
80 FreeList<G1CodeRootChunk> temp; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
81 temp.initialize(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
82 temp.set_size(G1CodeRootChunk::word_size()); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
83 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
84 _free_list.getFirstNChunksFromList((size_t)_free_list.count() - keep, &temp); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
85 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
86 G1CodeRootChunk* cur = temp.get_chunk_at_head(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
87 while (cur != NULL) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
88 delete cur; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
89 cur = temp.get_chunk_at_head(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
90 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
91 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
92 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
93 size_t G1CodeRootSet::static_mem_size() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
94 return sizeof(_free_list) + sizeof(_num_chunks_handed_out); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
95 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
96 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
97 size_t G1CodeRootSet::fl_mem_size() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
98 return _free_list.count() * _free_list.size(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
99 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
100 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
101 void G1CodeRootSet::initialize() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
102 _free_list.initialize(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
103 _free_list.set_size(G1CodeRootChunk::word_size()); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
104 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
105 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
106 G1CodeRootSet::G1CodeRootSet() : _list(), _length(0) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
107 _list.initialize(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
108 _list.set_size(G1CodeRootChunk::word_size()); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
109 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
110 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
111 G1CodeRootSet::~G1CodeRootSet() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
112 clear(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
113 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
114 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
115 void G1CodeRootSet::add(nmethod* method) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
116 if (!contains(method)) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
117 // Try to add the nmethod. If there is not enough space, get a new chunk. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
118 if (_list.head() == NULL || _list.head()->is_full()) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
119 G1CodeRootChunk* cur = new_chunk(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
120 _list.return_chunk_at_head(cur); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
121 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
122 bool result = _list.head()->add(method); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
123 guarantee(result, err_msg("Not able to add nmethod "PTR_FORMAT" to newly allocated chunk.", method)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
124 _length++; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
125 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
126 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
127 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
128 void G1CodeRootSet::remove(nmethod* method) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
129 G1CodeRootChunk* found = find(method); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
130 if (found != NULL) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
131 bool result = found->remove(method); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
132 guarantee(result, err_msg("could not find nmethod "PTR_FORMAT" during removal although we previously found it", method)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
133 // eventually free completely emptied chunk |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
134 if (found->is_empty()) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
135 _list.remove_chunk(found); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
136 free(found); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
137 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
138 _length--; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
139 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
140 assert(!contains(method), err_msg(PTR_FORMAT" still contains nmethod "PTR_FORMAT, this, method)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
141 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
142 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
143 nmethod* G1CodeRootSet::pop() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
144 do { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
145 G1CodeRootChunk* cur = _list.head(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
146 if (cur == NULL) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
147 assert(_length == 0, "when there are no chunks, there should be no elements"); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
148 return NULL; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
149 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
150 nmethod* result = cur->pop(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
151 if (result != NULL) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
152 _length--; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
153 return result; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
154 } else { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
155 free(_list.get_chunk_at_head()); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
156 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
157 } while (true); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
158 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
159 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
160 G1CodeRootChunk* G1CodeRootSet::find(nmethod* method) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
161 G1CodeRootChunk* cur = _list.head(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
162 while (cur != NULL) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
163 if (cur->contains(method)) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
164 return cur; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
165 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
166 cur = (G1CodeRootChunk*)cur->next(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
167 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
168 return NULL; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
169 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
170 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
171 void G1CodeRootSet::free(G1CodeRootChunk* chunk) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
172 free_chunk(chunk); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
173 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
174 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
175 bool G1CodeRootSet::contains(nmethod* method) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
176 return find(method) != NULL; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
177 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
178 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
179 void G1CodeRootSet::clear() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
180 free_all_chunks(&_list); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
181 _length = 0; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
182 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
183 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
184 void G1CodeRootSet::nmethods_do(CodeBlobClosure* blk) const { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
185 G1CodeRootChunk* cur = _list.head(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
186 while (cur != NULL) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
187 cur->nmethods_do(blk); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
188 cur = (G1CodeRootChunk*)cur->next(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
189 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
190 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
191 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
192 size_t G1CodeRootSet::mem_size() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
193 return sizeof(this) + _list.count() * _list.size(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
194 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
195 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
196 #ifndef PRODUCT |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
197 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
198 void G1CodeRootSet::test() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
199 initialize(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
200 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
201 assert(_free_list.count() == 0, "Free List must be empty"); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
202 assert(_num_chunks_handed_out == 0, "No elements must have been handed out yet"); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
203 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
204 // The number of chunks that we allocate for purge testing. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
205 size_t const num_chunks = 10; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
206 { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
207 G1CodeRootSet set1; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
208 assert(set1.is_empty(), "Code root set must be initially empty but is not."); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
209 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
210 set1.add((nmethod*)1); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
211 assert(_num_chunks_handed_out == 1, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
212 err_msg("Must have allocated and handed out one chunk, but handed out " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
213 SIZE_FORMAT" chunks", _num_chunks_handed_out)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
214 assert(set1.length() == 1, err_msg("Added exactly one element, but set contains " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
215 SIZE_FORMAT" elements", set1.length())); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
216 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
217 // G1CodeRootChunk::word_size() is larger than G1CodeRootChunk::num_entries which |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
218 // we cannot access. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
219 for (uint i = 0; i < G1CodeRootChunk::word_size() + 1; i++) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
220 set1.add((nmethod*)1); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
221 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
222 assert(_num_chunks_handed_out == 1, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
223 err_msg("Duplicate detection must have prevented allocation of further " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
224 "chunks but contains "SIZE_FORMAT, _num_chunks_handed_out)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
225 assert(set1.length() == 1, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
226 err_msg("Duplicate detection should not have increased the set size but " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
227 "is "SIZE_FORMAT, set1.length())); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
228 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
229 size_t num_total_after_add = G1CodeRootChunk::word_size() + 1; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
230 for (size_t i = 0; i < num_total_after_add - 1; i++) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
231 set1.add((nmethod*)(2 + i)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
232 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
233 assert(_num_chunks_handed_out > 1, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
234 "After adding more code roots, more than one chunks should have been handed out"); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
235 assert(set1.length() == num_total_after_add, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
236 err_msg("After adding in total "SIZE_FORMAT" distinct code roots, they " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
237 "need to be in the set, but there are only "SIZE_FORMAT, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
238 num_total_after_add, set1.length())); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
239 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
240 size_t num_popped = 0; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
241 while (set1.pop() != NULL) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
242 num_popped++; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
243 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
244 assert(num_popped == num_total_after_add, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
245 err_msg("Managed to pop "SIZE_FORMAT" code roots, but only "SIZE_FORMAT" " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
246 "were added", num_popped, num_total_after_add)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
247 assert(_num_chunks_handed_out == 0, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
248 err_msg("After popping all elements, all chunks must have been returned " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
249 "but are still "SIZE_FORMAT, _num_chunks_handed_out)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
250 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
251 purge_chunks(0); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
252 assert(_free_list.count() == 0, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
253 err_msg("After purging everything, the free list must be empty but still " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
254 "contains "SIZE_FORMAT" chunks", _free_list.count())); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
255 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
256 // Add some more handed out chunks. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
257 size_t i = 0; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
258 while (_num_chunks_handed_out < num_chunks) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
259 set1.add((nmethod*)i); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
260 i++; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
261 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
262 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
263 { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
264 // Generate chunks on the free list. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
265 G1CodeRootSet set2; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
266 size_t i = 0; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
267 while (_num_chunks_handed_out < num_chunks * 2) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
268 set2.add((nmethod*)i); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
269 i++; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
270 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
271 // Exit of the scope of the set2 object will call the destructor that generates |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
272 // num_chunks elements on the free list. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
273 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
274 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
275 assert(_num_chunks_handed_out == num_chunks, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
276 err_msg("Deletion of the second set must have resulted in giving back " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
277 "those, but there is still "SIZE_FORMAT" handed out, expecting " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
278 SIZE_FORMAT, _num_chunks_handed_out, num_chunks)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
279 assert((size_t)_free_list.count() == num_chunks, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
280 err_msg("After freeing "SIZE_FORMAT" chunks, they must be on the free list " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
281 "but there are only "SIZE_FORMAT, num_chunks, _free_list.count())); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
282 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
283 size_t const test_percentage = 50; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
284 purge_chunks(test_percentage); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
285 assert(_num_chunks_handed_out == num_chunks, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
286 err_msg("Purging must not hand out chunks but there are "SIZE_FORMAT, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
287 _num_chunks_handed_out)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
288 assert((size_t)_free_list.count() == (ssize_t)(num_chunks * test_percentage / 100), |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
289 err_msg("Must have purged "SIZE_FORMAT" percent of "SIZE_FORMAT" chunks" |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
290 "but there are "SSIZE_FORMAT, test_percentage, num_chunks, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
291 _free_list.count())); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
292 // Purge the remainder of the chunks on the free list. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
293 purge_chunks(0); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
294 assert(_free_list.count() == 0, "Free List must be empty"); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
295 assert(_num_chunks_handed_out == num_chunks, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
296 err_msg("Expected to be "SIZE_FORMAT" chunks handed out from the first set " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
297 "but there are "SIZE_FORMAT, num_chunks, _num_chunks_handed_out)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
298 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
299 // Exit of the scope of the set1 object will call the destructor that generates |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
300 // num_chunks additional elements on the free list. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
301 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
302 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
303 assert(_num_chunks_handed_out == 0, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
304 err_msg("Deletion of the only set must have resulted in no chunks handed " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
305 "out, but there is still "SIZE_FORMAT" handed out", _num_chunks_handed_out)); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
306 assert((size_t)_free_list.count() == num_chunks, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
307 err_msg("After freeing "SIZE_FORMAT" chunks, they must be on the free list " |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
308 "but there are only "SSIZE_FORMAT, num_chunks, _free_list.count())); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
309 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
310 // Restore initial state. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
311 purge_chunks(0); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
312 assert(_free_list.count() == 0, "Free List must be empty"); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
313 assert(_num_chunks_handed_out == 0, "No elements must have been handed out yet"); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
314 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
315 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
316 void TestCodeCacheRemSet_test() { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
317 G1CodeRootSet::test(); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
318 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
319 #endif |