src/share/vm/classfile/compactHashtable.cpp
Print this page
*** 219,228 ****
--- 219,252 ----
juint *end = _buckets + _table_end_offset;
return (const char*)end;
}
+ template <class T, class N> void CompactHashtable<T, N>::symbols_do(SymbolClosure *cl) {
+ assert(!DumpSharedSpaces, "run-time only");
+ for (juint i = 0; i < _bucket_count; i ++) {
+ juint bucket_info = _buckets[i];
+ juint bucket_offset = BUCKET_OFFSET(bucket_info);
+ int bucket_type = BUCKET_TYPE(bucket_info);
+ juint* bucket = _buckets + bucket_offset;
+ juint* bucket_end = _buckets;
+
+ Symbol* sym;
+ if (bucket_type == COMPACT_BUCKET_TYPE) {
+ sym = (Symbol*)((void*)(_base_address + bucket[0]));
+ cl->do_symbol(&sym);
+ } else {
+ bucket_end += BUCKET_OFFSET(_buckets[i + 1]);
+ while (bucket < bucket_end) {
+ sym = (Symbol*)((void*)(_base_address + bucket[1]));
+ cl->do_symbol(&sym);
+ bucket += 2;
+ }
+ }
+ }
+ }
+
// Explicitly instantiate these types
template class CompactHashtable<Symbol*, char>;
#ifndef O_BINARY // if defined (Win32) use binary files.
#define O_BINARY 0 // otherwise do nothing.