diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index 8d135d9..c167e0b 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -657,7 +657,7 @@ void CodeCache::blobs_do(void f(CodeBlob* nm)) { void CodeCache::nmethods_do(void f(nmethod* nm)) { assert_locked_or_safepoint(CodeCache_lock); - NMethodIterator iter(false /* only_alive */, false /* only_not_unloading */); + NMethodIterator iter(NMethodIterator::all_blobs); while(iter.next()) { f(iter.method()); } @@ -665,7 +665,7 @@ void CodeCache::nmethods_do(void f(nmethod* nm)) { void CodeCache::metadata_do(void f(Metadata* m)) { assert_locked_or_safepoint(CodeCache_lock); - NMethodIterator iter(true /* only_alive */, true /* only_not_unloading */); + NMethodIterator iter(NMethodIterator::only_alive_and_not_unloading); while(iter.next()) { iter.method()->metadata_do(f); } @@ -684,7 +684,7 @@ int CodeCache::alignment_offset() { void CodeCache::do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred) { assert_locked_or_safepoint(CodeCache_lock); UnloadingScope scope(is_alive); - CompiledMethodIterator iter(true /* only_alive */, false /* only_not_unloading */); + CompiledMethodIterator iter(CompiledMethodIterator::only_alive); while(iter.next()) { iter.method()->do_unloading(unloading_occurred); } @@ -842,7 +842,7 @@ void CodeCache::asserted_non_scavengable_nmethods_do(CodeBlobClosure* f) { // Temporarily mark nmethods that are claimed to be on the scavenge list. void CodeCache::mark_scavenge_root_nmethods() { - NMethodIterator iter(true /* only_alive */, false /* only_not_unloading */); + NMethodIterator iter(NMethodIterator::only_alive); while(iter.next()) { nmethod* nm = iter.method(); assert(nm->scavenge_root_not_marked(), "clean state"); @@ -854,7 +854,7 @@ void CodeCache::mark_scavenge_root_nmethods() { // If the closure is given, run it on the unlisted nmethods. // Also make sure that the effects of mark_scavenge_root_nmethods is gone. void CodeCache::verify_perm_nmethods(CodeBlobClosure* f_or_null) { - NMethodIterator iter(true /* only_alive */, false /* only_not_unloading */); + NMethodIterator iter(NMethodIterator::only_alive); while(iter.next()) { nmethod* nm = iter.method(); bool call_f = (f_or_null != NULL); @@ -869,7 +869,7 @@ void CodeCache::verify_perm_nmethods(CodeBlobClosure* f_or_null) { void CodeCache::verify_clean_inline_caches() { #ifdef ASSERT - NMethodIterator iter(true /* only_alive */, true /* only_not_unloading */); + NMethodIterator iter(NMethodIterator::only_alive_and_not_unloading); while(iter.next()) { nmethod* nm = iter.method(); assert(!nm->is_unloaded(), "Tautology"); @@ -943,7 +943,7 @@ void CodeCache::increment_unloading_cycle() { void CodeCache::verify_oops() { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); VerifyOopClosure voc; - NMethodIterator iter(true /* only_alive */, true /* only_not_unloading */); + NMethodIterator iter(NMethodIterator::only_alive_and_not_unloading); while(iter.next()) { nmethod* nm = iter.method(); nm->oops_do(&voc); @@ -1120,7 +1120,7 @@ int CodeCache::number_of_nmethods_with_dependencies() { void CodeCache::clear_inline_caches() { assert_locked_or_safepoint(CodeCache_lock); - CompiledMethodIterator iter(true /* only_alive */, true /* only_not_unloading */); + CompiledMethodIterator iter(CompiledMethodIterator::only_alive_and_not_unloading); while(iter.next()) { iter.method()->clear_inline_caches(); } @@ -1128,7 +1128,7 @@ void CodeCache::clear_inline_caches() { void CodeCache::cleanup_inline_caches() { assert_locked_or_safepoint(CodeCache_lock); - NMethodIterator iter(true /* only_alive */, true /* only_not_unloading */); + NMethodIterator iter(NMethodIterator::only_alive_and_not_unloading); while(iter.next()) { iter.method()->cleanup_inline_caches(/*clean_all=*/true); } @@ -1199,7 +1199,7 @@ int CodeCache::mark_for_evol_deoptimization(InstanceKlass* dependee) { } } - CompiledMethodIterator iter(true /* only_alive */, true /* only_not_unloading */); + CompiledMethodIterator iter(CompiledMethodIterator::only_alive_and_not_unloading); while(iter.next()) { CompiledMethod* nm = iter.method(); if (nm->is_marked_for_deoptimization()) { @@ -1222,7 +1222,7 @@ int CodeCache::mark_for_evol_deoptimization(InstanceKlass* dependee) { // Deoptimize all methods void CodeCache::mark_all_nmethods_for_deoptimization() { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - CompiledMethodIterator iter(true /* only_alive */, true /* only_not_unloading */); + CompiledMethodIterator iter(CompiledMethodIterator::only_alive_and_not_unloading); while(iter.next()) { CompiledMethod* nm = iter.method(); if (!nm->method()->is_method_handle_intrinsic()) { @@ -1235,7 +1235,7 @@ int CodeCache::mark_for_deoptimization(Method* dependee) { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); int number_of_marked_CodeBlobs = 0; - CompiledMethodIterator iter(true /* only_alive */, true /* only_not_unloading */); + CompiledMethodIterator iter(CompiledMethodIterator::only_alive_and_not_unloading); while(iter.next()) { CompiledMethod* nm = iter.method(); if (nm->is_dependent_on_method(dependee)) { @@ -1250,7 +1250,7 @@ int CodeCache::mark_for_deoptimization(Method* dependee) { void CodeCache::make_marked_nmethods_not_entrant() { assert_locked_or_safepoint(CodeCache_lock); - CompiledMethodIterator iter(true /* only_alive */, true /* only_not_unloading */); + CompiledMethodIterator iter(CompiledMethodIterator::only_alive_and_not_unloading); while(iter.next()) { CompiledMethod* nm = iter.method(); if (nm->is_marked_for_deoptimization() && !nm->is_not_entrant()) { @@ -1519,7 +1519,7 @@ void CodeCache::print_internals() { int *buckets = NEW_C_HEAP_ARRAY(int, bucketLimit, mtCode); memset(buckets, 0, sizeof(int) * bucketLimit); - NMethodIterator iter(false /* only_alive */, false /* only_not_unloading */); + NMethodIterator iter(NMethodIterator::all_blobs); while(iter.next()) { nmethod* nm = iter.method(); if(nm->method() != NULL && nm->is_java_method()) { @@ -1659,7 +1659,7 @@ void CodeCache::print_summary(outputStream* st, bool detailed) { void CodeCache::print_codelist(outputStream* st) { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - CompiledMethodIterator iter(true /* only_alive */, true /* only_not_unloading */); + CompiledMethodIterator iter(CompiledMethodIterator::only_alive_and_not_unloading); while (iter.next()) { CompiledMethod* cm = iter.method(); ResourceMark rm;