120 vm_exit_during_initialization("CompactHashtableWriter::dump_table: Overflow! "
121 "Too many symbols.");
122 }
123 summary->add(bucket_size);
124 }
125 // Mark the end of the table
126 compact_table[_num_buckets] = BUCKET_INFO(offset, TABLEEND_BUCKET_TYPE);
127
128 return compact_table;
129 }
130
131 // Write the compact table's entries
132 juint* CompactHashtableWriter::dump_buckets(juint* compact_table, juint* p,
133 NumberSeq* summary) {
134 uintx base_address = 0;
135 uintx max_delta = 0;
136 int num_compact_buckets = 0;
137 if (_type == CompactHashtable<Symbol*, char>::_symbol_table) {
138 base_address = uintx(MetaspaceShared::shared_rs()->base());
139 max_delta = uintx(MetaspaceShared::shared_rs()->size());
140 assert(max_delta <= 0x7fffffff, "range check");
141 } else {
142 assert((_type == CompactHashtable<oop, char>::_string_table), "unknown table");
143 assert(UseCompressedOops, "UseCompressedOops is required");
144 }
145
146 assert(p != NULL, "sanity");
147 for (int index = 0; index < _num_buckets; index++) {
148 juint count = 0;
149 int bucket_size = _bucket_sizes[index];
150 int bucket_type = BUCKET_TYPE(compact_table[index]);
151
152 if (bucket_size == 1) {
153 assert(bucket_type == COMPACT_BUCKET_TYPE, "Bad bucket type");
154 num_compact_buckets ++;
155 }
156 for (Entry* tent = _buckets[index]; tent;
157 tent = tent->next()) {
158 if (bucket_type == REGULAR_BUCKET_TYPE) {
159 *p++ = juint(tent->hash()); // write entry hash
160 }
|
120 vm_exit_during_initialization("CompactHashtableWriter::dump_table: Overflow! "
121 "Too many symbols.");
122 }
123 summary->add(bucket_size);
124 }
125 // Mark the end of the table
126 compact_table[_num_buckets] = BUCKET_INFO(offset, TABLEEND_BUCKET_TYPE);
127
128 return compact_table;
129 }
130
131 // Write the compact table's entries
132 juint* CompactHashtableWriter::dump_buckets(juint* compact_table, juint* p,
133 NumberSeq* summary) {
134 uintx base_address = 0;
135 uintx max_delta = 0;
136 int num_compact_buckets = 0;
137 if (_type == CompactHashtable<Symbol*, char>::_symbol_table) {
138 base_address = uintx(MetaspaceShared::shared_rs()->base());
139 max_delta = uintx(MetaspaceShared::shared_rs()->size());
140 assert(max_delta <= MAX_SHARED_DELTA, "range check");
141 } else {
142 assert((_type == CompactHashtable<oop, char>::_string_table), "unknown table");
143 assert(UseCompressedOops, "UseCompressedOops is required");
144 }
145
146 assert(p != NULL, "sanity");
147 for (int index = 0; index < _num_buckets; index++) {
148 juint count = 0;
149 int bucket_size = _bucket_sizes[index];
150 int bucket_type = BUCKET_TYPE(compact_table[index]);
151
152 if (bucket_size == 1) {
153 assert(bucket_type == COMPACT_BUCKET_TYPE, "Bad bucket type");
154 num_compact_buckets ++;
155 }
156 for (Entry* tent = _buckets[index]; tent;
157 tent = tent->next()) {
158 if (bucket_type == REGULAR_BUCKET_TYPE) {
159 *p++ = juint(tent->hash()); // write entry hash
160 }
|