1 /* |
1 /* |
2 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2017, 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. |
173 |
173 |
174 PlaceholderTable::PlaceholderTable(int table_size) |
174 PlaceholderTable::PlaceholderTable(int table_size) |
175 : TwoOopHashtable<Symbol*, mtClass>(table_size, sizeof(PlaceholderEntry)) { |
175 : TwoOopHashtable<Symbol*, mtClass>(table_size, sizeof(PlaceholderEntry)) { |
176 } |
176 } |
177 |
177 |
178 |
|
179 void PlaceholderTable::classes_do(KlassClosure* f) { |
|
180 for (int index = 0; index < table_size(); index++) { |
|
181 for (PlaceholderEntry* probe = bucket(index); |
|
182 probe != NULL; |
|
183 probe = probe->next()) { |
|
184 probe->classes_do(f); |
|
185 } |
|
186 } |
|
187 } |
|
188 |
|
189 |
|
190 void PlaceholderEntry::classes_do(KlassClosure* closure) { |
|
191 assert(klassname() != NULL, "should have a non-null klass"); |
|
192 if (_instanceKlass != NULL) { |
|
193 closure->do_klass(instance_klass()); |
|
194 } |
|
195 } |
|
196 |
|
197 // do all entries in the placeholder table |
|
198 void PlaceholderTable::entries_do(void f(Symbol*)) { |
|
199 for (int index = 0; index < table_size(); index++) { |
|
200 for (PlaceholderEntry* probe = bucket(index); |
|
201 probe != NULL; |
|
202 probe = probe->next()) { |
|
203 f(probe->klassname()); |
|
204 } |
|
205 } |
|
206 } |
|
207 |
|
208 |
|
209 #ifndef PRODUCT |
178 #ifndef PRODUCT |
210 // Note, doesn't append a cr |
179 // Note, doesn't append a cr |
211 void PlaceholderEntry::print() const { |
180 void PlaceholderEntry::print() const { |
212 klassname()->print_value(); |
181 klassname()->print_value(); |
213 if (loader_data() != NULL) { |
182 if (loader_data() != NULL) { |