comparison src/share/vm/code/codeCache.cpp @ 2375:d673ef06fe96

7028374: race in fix_oop_relocations for scavengeable nmethods Reviewed-by: kvn
author never
date Fri, 18 Mar 2011 15:52:42 -0700
parents 1c0cf339481b
children c7f3d0b4570f
comparison
equal deleted inserted replaced
2370:048f98400b8e 2375:d673ef06fe96
335 } 335 }
336 #endif //PRODUCT 336 #endif //PRODUCT
337 if (is_live) { 337 if (is_live) {
338 // Perform cur->oops_do(f), maybe just once per nmethod. 338 // Perform cur->oops_do(f), maybe just once per nmethod.
339 f->do_code_blob(cur); 339 f->do_code_blob(cur);
340 cur->fix_oop_relocations();
341 } 340 }
342 } 341 }
343 342
344 // Check for stray marks. 343 // Check for stray marks.
345 debug_only(verify_perm_nmethods(NULL)); 344 debug_only(verify_perm_nmethods(NULL));
547 } 546 }
548 } 547 }
549 set_needs_cache_clean(false); 548 set_needs_cache_clean(false);
550 prune_scavenge_root_nmethods(); 549 prune_scavenge_root_nmethods();
551 assert(!nmethod::oops_do_marking_is_active(), "oops_do_marking_prologue must be called"); 550 assert(!nmethod::oops_do_marking_is_active(), "oops_do_marking_prologue must be called");
551 }
552
553
554 void CodeCache::verify_oops() {
555 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
556 VerifyOopClosure voc;
557 FOR_ALL_ALIVE_BLOBS(cb) {
558 if (cb->is_nmethod()) {
559 nmethod *nm = (nmethod*)cb;
560 nm->oops_do(&voc);
561 nm->verify_oop_relocations();
562 }
563 }
552 } 564 }
553 565
554 566
555 address CodeCache::first_address() { 567 address CodeCache::first_address() {
556 assert_locked_or_safepoint(CodeCache_lock); 568 assert_locked_or_safepoint(CodeCache_lock);