void Dictionary::verify() { guarantee(number_of_entries() >= 0, "Verify of system dictionary failed"); int element_count = 0; for (int index = 0; index < table_size(); index++) { for (DictionaryEntry* probe = bucket(index); probe != NULL; probe = probe->next()) { Klass* e = probe->klass(); ClassLoaderData* loader_data = probe->loader_data(); guarantee(e->oop_is_instance(), "Verify of system dictionary failed"); // class loader must be present; a null class loader is the // boostrap loader guarantee(loader_data != NULL || DumpSharedSpaces || loader_data->class_loader() == NULL || loader_data->class_loader()->is_instance(), "checking type of class_loader"); e->verify(); probe->verify_protection_domain_set(); element_count++; } } guarantee(number_of_entries() == element_count, "Verify of system dictionary failed"); debug_only(verify_lookup_length((double)number_of_entries() / table_size())); _pd_cache_table->verify(); }
/// Adds a symbol and returns its ID. Can also be used to look-up a symbol. ID add_symbol(Symbol new_symbol) { ID result = resolve_symbol(new_symbol); if (result >= 0) { // the new symbol does already exist return result; } else { // add symbol to signature VLOG(9) << "Signature: New mapping added: '" << new_symbol << "' <-> " << number_of_entries(); external_to_internal[new_symbol] = number_of_entries(); internal_to_external.push_back(new_symbol); return number_of_entries() - 1; } }
void ProtectionDomainCacheTable::verify() { int element_count = 0; for (int index = 0; index < table_size(); index++) { for (ProtectionDomainCacheEntry* probe = bucket(index); probe != NULL; probe = probe->next()) { probe->verify(); element_count++; } } guarantee(number_of_entries() == element_count, "Verify of protection domain cache table failed"); debug_only(verify_lookup_length((double)number_of_entries() / table_size())); }
/// Returns the symbol for a given ID or an empty symbol Symbol resolve_id(ID const & unknown_id) const { static const Symbol NoSymbol; if (unknown_id >= number_of_entries() || unknown_id < 0) { return NoSymbol; } return internal_to_external[unknown_id]; }
void Dictionary::print() { ResourceMark rm; HandleMark hm; tty->print_cr("Java system dictionary (table_size=%d, classes=%d)", table_size(), number_of_entries()); tty->print_cr("^ indicates that initiating loader is different from " "defining loader"); for (int index = 0; index < table_size(); index++) { for (DictionaryEntry* probe = bucket(index); probe != NULL; probe = probe->next()) { if (Verbose) tty->print("%4d: ", index); Klass* e = probe->klass(); ClassLoaderData* loader_data = probe->loader_data(); bool is_defining_class = (loader_data == InstanceKlass::cast(e)->class_loader_data()); tty->print("%s%s", is_defining_class ? " " : "^", e->external_name()); tty->print(", loader "); loader_data->print_value(); tty->cr(); } } tty->cr(); _pd_cache_table->print(); tty->cr(); }
void ciTypeStackSlotEntries::print_data_on(outputStream* st) const { for (int i = 0; i < number_of_entries(); i++) { _pd->tab(st); st->print("%d: stack (%u) ", i, stack_slot(i)); print_ciklass(st, type(i)); st->cr(); } }
void ProtectionDomainCacheTable::print() { tty->print_cr("Protection domain cache table (table_size=%d, classes=%d)", table_size(), number_of_entries()); for (int index = 0; index < table_size(); index++) { for (ProtectionDomainCacheEntry* probe = bucket(index); probe != NULL; probe = probe->next()) { probe->print(); } } }
void PlaceholderTable::verify() { int element_count = 0; for (int pindex = 0; pindex < table_size(); pindex++) { for (PlaceholderEntry* probe = bucket(pindex); probe != NULL; probe = probe->next()) { probe->verify(); element_count++; // both klasses and place holders count } } guarantee(number_of_entries() == element_count, "Verify of system dictionary failed"); }
void InterpreterOopMap::print() { int n = number_of_entries(); tty->print("oop map for "); method()->print_value(); tty->print(" @ %d = [%d] { ", bci(), n); for (int i = 0; i < n; i++) { #ifdef ENABLE_ZAP_DEAD_LOCALS if (is_dead(i)) tty->print("%d+ ", i); else #endif if (is_oop(i)) tty->print("%d ", i); } tty->print_cr("}"); }
void InterpreterOopMap::iterate_oop(OffsetClosure* oop_closure) { int n = number_of_entries(); int word_index = 0; uintptr_t value = 0; uintptr_t mask = 0; // iterate over entries for (int i = 0; i < n; i++, mask <<= bits_per_entry) { // get current word if (mask == 0) { value = bit_mask()[word_index++]; mask = 1; } // test for oop if ((value & (mask << oop_bit_number)) != 0) oop_closure->offset_do(i); } }
void InterpreterOopMap::iterate_all(OffsetClosure* oop_closure, OffsetClosure* value_closure, OffsetClosure* dead_closure) { int n = number_of_entries(); int word_index = 0; uintptr_t value = 0; uintptr_t mask = 0; // iterate over entries for (int i = 0; i < n; i++, mask <<= bits_per_entry) { // get current word if (mask == 0) { value = bit_mask()[word_index++]; mask = 1; } // test for dead values & oops, and for live values if ((value & (mask << dead_bit_number)) != 0) dead_closure->offset_do(i); // call this for all dead values or oops else if ((value & (mask << oop_bit_number)) != 0) oop_closure->offset_do(i); // call this for all live oops else value_closure->offset_do(i); // call this for all live values } }
void ciTypeStackSlotEntries::translate_type_data_from(const TypeStackSlotEntries* entries) { for (int i = 0; i < number_of_entries(); i++) { intptr_t k = entries->type(i); TypeStackSlotEntries::set_type(i, translate_klass(k)); } }
/// Returns true, if the given ID does exist in the signature bool containsID(const ID & id) const { return id < number_of_entries(); }