src/share/vm/classfile/classLoaderData.cpp

changeset 4751
1fc4d4768b90
parent 4497
16fb9f942703
child 4866
16885e702c88
equal deleted inserted replaced
4750:39432a1cefdd 4751:1fc4d4768b90
103 } 103 }
104 104
105 void ClassLoaderData::classes_do(KlassClosure* klass_closure) { 105 void ClassLoaderData::classes_do(KlassClosure* klass_closure) {
106 for (Klass* k = _klasses; k != NULL; k = k->next_link()) { 106 for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
107 klass_closure->do_klass(k); 107 klass_closure->do_klass(k);
108 assert(k != k->next_link(), "no loops!");
108 } 109 }
109 } 110 }
110 111
111 void ClassLoaderData::classes_do(void f(InstanceKlass*)) { 112 void ClassLoaderData::classes_do(void f(InstanceKlass*)) {
112 for (Klass* k = _klasses; k != NULL; k = k->next_link()) { 113 for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
113 if (k->oop_is_instance()) { 114 if (k->oop_is_instance()) {
114 f(InstanceKlass::cast(k)); 115 f(InstanceKlass::cast(k));
115 } 116 }
117 assert(k != k->next_link(), "no loops!");
116 } 118 }
117 } 119 }
118 120
119 void ClassLoaderData::record_dependency(Klass* k, TRAPS) { 121 void ClassLoaderData::record_dependency(Klass* k, TRAPS) {
120 ClassLoaderData * const from_cld = this; 122 ClassLoaderData * const from_cld = this;
256 prev->set_next_link(next); 258 prev->set_next_link(next);
257 } 259 }
258 return; 260 return;
259 } 261 }
260 prev = k; 262 prev = k;
263 assert(k != k->next_link(), "no loops!");
261 } 264 }
262 ShouldNotReachHere(); // should have found this class!! 265 ShouldNotReachHere(); // should have found this class!!
263 } 266 }
264 267
265 void ClassLoaderData::unload() { 268 void ClassLoaderData::unload() {
437 ResourceMark rm; 440 ResourceMark rm;
438 Klass* k = _klasses; 441 Klass* k = _klasses;
439 while (k != NULL) { 442 while (k != NULL) {
440 out->print_cr("klass "PTR_FORMAT", %s, CT: %d, MUT: %d", k, k->name()->as_C_string(), 443 out->print_cr("klass "PTR_FORMAT", %s, CT: %d, MUT: %d", k, k->name()->as_C_string(),
441 k->has_modified_oops(), k->has_accumulated_modified_oops()); 444 k->has_modified_oops(), k->has_accumulated_modified_oops());
445 assert(k != k->next_link(), "no loops!");
442 k = k->next_link(); 446 k = k->next_link();
443 } 447 }
444 } 448 }
445 #endif // CLD_DUMP_KLASSES 449 #endif // CLD_DUMP_KLASSES
446 #undef CLD_DUMP_KLASSES 450 #undef CLD_DUMP_KLASSES
463 } 467 }
464 468
465 for (Klass* k = _klasses; k != NULL; k = k->next_link()) { 469 for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
466 guarantee(k->class_loader_data() == this, "Must be the same"); 470 guarantee(k->class_loader_data() == this, "Must be the same");
467 k->verify(); 471 k->verify();
472 assert(k != k->next_link(), "no loops!");
468 } 473 }
469 } 474 }
470 475
471 476
472 // GC root of class loader data created. 477 // GC root of class loader data created.

mercurial