603 // NMT can walk the stack before code cache is created
604 if (_heaps != NULL && !_heaps->is_empty()) {
605 FOR_ALL_HEAPS(heap) {
606 CodeBlob* result = (*heap)->find_blob_unsafe(start);
607 if (result != NULL) {
608 return result;
609 }
610 }
611 }
612 return NULL;
613 }
614
615 nmethod* CodeCache::find_nmethod(void* start) {
616 CodeBlob* cb = find_blob(start);
617 assert(cb->is_nmethod(), "did not find an nmethod");
618 return (nmethod*)cb;
619 }
620
621 void CodeCache::blobs_do(void f(CodeBlob* nm)) {
622 assert_locked_or_safepoint(CodeCache_lock);
623 FOR_ALL_NMETHOD_HEAPS(heap) {
624 FOR_ALL_BLOBS(cb, *heap) {
625 f(cb);
626 }
627 }
628 }
629
630 void CodeCache::nmethods_do(void f(nmethod* nm)) {
631 assert_locked_or_safepoint(CodeCache_lock);
632 NMethodIterator iter;
633 while(iter.next()) {
634 f(iter.method());
635 }
636 }
637
638 void CodeCache::metadata_do(void f(Metadata* m)) {
639 assert_locked_or_safepoint(CodeCache_lock);
640 NMethodIterator iter;
641 while(iter.next_alive()) {
642 iter.method()->metadata_do(f);
643 }
|
603 // NMT can walk the stack before code cache is created
604 if (_heaps != NULL && !_heaps->is_empty()) {
605 FOR_ALL_HEAPS(heap) {
606 CodeBlob* result = (*heap)->find_blob_unsafe(start);
607 if (result != NULL) {
608 return result;
609 }
610 }
611 }
612 return NULL;
613 }
614
615 nmethod* CodeCache::find_nmethod(void* start) {
616 CodeBlob* cb = find_blob(start);
617 assert(cb->is_nmethod(), "did not find an nmethod");
618 return (nmethod*)cb;
619 }
620
621 void CodeCache::blobs_do(void f(CodeBlob* nm)) {
622 assert_locked_or_safepoint(CodeCache_lock);
623 FOR_ALL_HEAPS(heap) {
624 FOR_ALL_BLOBS(cb, *heap) {
625 f(cb);
626 }
627 }
628 }
629
630 void CodeCache::nmethods_do(void f(nmethod* nm)) {
631 assert_locked_or_safepoint(CodeCache_lock);
632 NMethodIterator iter;
633 while(iter.next()) {
634 f(iter.method());
635 }
636 }
637
638 void CodeCache::metadata_do(void f(Metadata* m)) {
639 assert_locked_or_safepoint(CodeCache_lock);
640 NMethodIterator iter;
641 while(iter.next_alive()) {
642 iter.method()->metadata_do(f);
643 }
|