Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/classLoaderData.cpp @ 20193:bc61effc5298
8047812: Ensure ClassLoaderDataGraph::classes_unloading_do only delivers klasses from CLDs with non-reclaimed class loader oops
Reviewed-by: coleenp, sspitsyn, ehelin
author | mgronlun |
---|---|
date | Tue, 01 Jul 2014 10:36:19 +0200 |
parents | 78bbf4d43a14 |
children | 52b4284cb496 556a06aec3fa |
comparison
equal
deleted
inserted
replaced
20192:581e70386ec9 | 20193:bc61effc5298 |
---|---|
529 | 529 |
530 | 530 |
531 // GC root of class loader data created. | 531 // GC root of class loader data created. |
532 ClassLoaderData* ClassLoaderDataGraph::_head = NULL; | 532 ClassLoaderData* ClassLoaderDataGraph::_head = NULL; |
533 ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL; | 533 ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL; |
534 ClassLoaderData* ClassLoaderDataGraph::_saved_unloading = NULL; | |
534 ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL; | 535 ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL; |
535 | 536 |
536 bool ClassLoaderDataGraph::_should_purge = false; | 537 bool ClassLoaderDataGraph::_should_purge = false; |
537 | 538 |
538 // Add a new class loader data node to the list. Assign the newly created | 539 // Add a new class loader data node to the list. Assign the newly created |
626 } | 627 } |
627 } | 628 } |
628 | 629 |
629 void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) { | 630 void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) { |
630 assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!"); | 631 assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!"); |
631 for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) { | 632 // Only walk the head until any clds not purged from prior unloading |
633 // (CMS doesn't purge right away). | |
634 for (ClassLoaderData* cld = _unloading; cld != _saved_unloading; cld = cld->next()) { | |
632 cld->classes_do(f); | 635 cld->classes_do(f); |
633 } | 636 } |
634 } | 637 } |
635 | 638 |
636 GrowableArray<ClassLoaderData*>* ClassLoaderDataGraph::new_clds() { | 639 GrowableArray<ClassLoaderData*>* ClassLoaderDataGraph::new_clds() { |
674 // and deallocation later. | 677 // and deallocation later. |
675 bool ClassLoaderDataGraph::do_unloading(BoolObjectClosure* is_alive_closure) { | 678 bool ClassLoaderDataGraph::do_unloading(BoolObjectClosure* is_alive_closure) { |
676 ClassLoaderData* data = _head; | 679 ClassLoaderData* data = _head; |
677 ClassLoaderData* prev = NULL; | 680 ClassLoaderData* prev = NULL; |
678 bool seen_dead_loader = false; | 681 bool seen_dead_loader = false; |
682 | |
683 // Save previous _unloading pointer for CMS which may add to unloading list before | |
684 // purging and we don't want to rewalk the previously unloaded class loader data. | |
685 _saved_unloading = _unloading; | |
686 | |
679 // mark metadata seen on the stack and code cache so we can delete | 687 // mark metadata seen on the stack and code cache so we can delete |
680 // unneeded entries. | 688 // unneeded entries. |
681 bool has_redefined_a_class = JvmtiExport::has_redefined_a_class(); | 689 bool has_redefined_a_class = JvmtiExport::has_redefined_a_class(); |
682 MetadataOnStackMark md_on_stack; | 690 MetadataOnStackMark md_on_stack; |
683 while (data != NULL) { | 691 while (data != NULL) { |