src/share/vm/classfile/loaderConstraints.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File

## src/share/vm/classfile/loaderConstraints.cpp

Print this page

     424   *pp2 = p2->next();
     425   FREE_C_HEAP_ARRAY(oop, p2->loaders(), mtClass);
     426   free_entry(p2);
     427   return;
     428 }
     429
     430
     431 void LoaderConstraintTable::verify(Dictionary* dictionary,
     432                                    PlaceholderTable* placeholders) {
     433   Thread *thread = Thread::current();
     434   for (int cindex = 0; cindex < _loader_constraint_size; cindex++) {
     435     for (LoaderConstraintEntry* probe = bucket(cindex);
     436                                 probe != NULL;
     437                                 probe = probe->next()) {
     438       if (probe->klass() != NULL) {
     439         InstanceKlass* ik = InstanceKlass::cast(probe->klass());
     440         guarantee(ik->name() == probe->name(), "name should match");
     441         Symbol* name = ik->name();
     442         ClassLoaderData* loader_data = ik->class_loader_data();
     443         unsigned int d_hash = dictionary->compute_hash(name, loader_data);
     444         int d_index = dictionary->hash_to_index(d_hash);
     445         Klass* k = dictionary->find_class(d_index, d_hash, name, loader_data);
     446         if (k != NULL) {
     447           // We found the class in the system dictionary, so we should
     448           // make sure that the Klass* matches what we already have.
     449           guarantee(k == probe->klass(), "klass should be in dictionary");
     450         } else {
     451           // If we don't find the class in the system dictionary, it
     452           // has to be in the placeholders table.
     453           unsigned int p_hash = placeholders->compute_hash(name, loader_data);
     454           int p_index = placeholders->hash_to_index(p_hash);
     455           PlaceholderEntry* entry = placeholders->get_entry(p_index, p_hash,
     456                                                             name, loader_data);
     457
     458           // The InstanceKlass might not be on the entry, so the only
     459           // thing we can check here is whether we were successful in
     460           // finding the class in the placeholders table.
     461           guarantee(entry != NULL, "klass should be in the placeholders");
     462         }
     463       }
     464       for (int n = 0; n< probe->num_loaders(); n++) {
     465         assert(ClassLoaderDataGraph::contains_loader_data(probe->loader_data(n)), "The loader is missing");
     424   *pp2 = p2->next();
     425   FREE_C_HEAP_ARRAY(oop, p2->loaders(), mtClass);
     426   free_entry(p2);
     427   return;
     428 }
     429
     430
     431 void LoaderConstraintTable::verify(Dictionary* dictionary,
     432                                    PlaceholderTable* placeholders) {
     433   Thread *thread = Thread::current();
     434   for (int cindex = 0; cindex < _loader_constraint_size; cindex++) {
     435     for (LoaderConstraintEntry* probe = bucket(cindex);
     436                                 probe != NULL;
     437                                 probe = probe->next()) {
     438       if (probe->klass() != NULL) {
     439         InstanceKlass* ik = InstanceKlass::cast(probe->klass());
     440         guarantee(ik->name() == probe->name(), "name should match");
     441         Symbol* name = ik->name();
     442         ClassLoaderData* loader_data = ik->class_loader_data();
     443         unsigned int d_hash = dictionary->compute_hash(name, loader_data);
     444         Klass* k = dictionary->find_class(d_hash, name, loader_data);

     445         if (k != NULL) {
     446           // We found the class in the system dictionary, so we should
     447           // make sure that the Klass* matches what we already have.
     448           guarantee(k == probe->klass(), "klass should be in dictionary");
     449         } else {
     450           // If we don't find the class in the system dictionary, it
     451           // has to be in the placeholders table.
     452           unsigned int p_hash = placeholders->compute_hash(name, loader_data);
     453           int p_index = placeholders->hash_to_index(p_hash);
     454           PlaceholderEntry* entry = placeholders->get_entry(p_index, p_hash,
     455                                                             name, loader_data);
     456
     457           // The InstanceKlass might not be on the entry, so the only
     458           // thing we can check here is whether we were successful in
     459           // finding the class in the placeholders table.
     460           guarantee(entry != NULL, "klass should be in the placeholders");
     461         }
     462       }
     463       for (int n = 0; n< probe->num_loaders(); n++) {
     464         assert(ClassLoaderDataGraph::contains_loader_data(probe->loader_data(n)), "The loader is missing");

src/share/vm/classfile/loaderConstraints.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File