526 } 527 release_nmethod(nm); 528 _flushed_count++; 529 } else { 530 if (PrintMethodFlushing && Verbose) { 531 tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (zombie) being marked for reclamation", nm->compile_id(), nm); 532 } 533 nm->mark_for_reclamation(); 534 // Keep track of code cache state change 535 _bytes_changed += nm->total_size(); 536 _marked_for_reclamation_count++; 537 SWEEP(nm); 538 } 539 } else if (nm->is_not_entrant()) { 540 // If there are no current activations of this method on the 541 // stack we can safely convert it to a zombie method 542 if (nm->can_not_entrant_be_converted()) { 543 if (PrintMethodFlushing && Verbose) { 544 tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), nm); 545 } 546 // Code cache state change is tracked in make_zombie() 547 nm->make_zombie(); 548 _zombified_count++; 549 SWEEP(nm); 550 } else { 551 // Still alive, clean up its inline caches 552 MutexLocker cl(CompiledIC_lock); 553 nm->cleanup_inline_caches(); 554 SWEEP(nm); 555 } 556 } else if (nm->is_unloaded()) { 557 // Unloaded code, just make it a zombie 558 if (PrintMethodFlushing && Verbose) { 559 tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (unloaded) being made zombie", nm->compile_id(), nm); 560 } 561 if (nm->is_osr_method()) { 562 SWEEP(nm); 563 // No inline caches will ever point to osr methods, so we can just remove it 564 freed_memory = nm->total_size(); 565 if (nm->is_compiled_by_c2()) { | 526 } 527 release_nmethod(nm); 528 _flushed_count++; 529 } else { 530 if (PrintMethodFlushing && Verbose) { 531 tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (zombie) being marked for reclamation", nm->compile_id(), nm); 532 } 533 nm->mark_for_reclamation(); 534 // Keep track of code cache state change 535 _bytes_changed += nm->total_size(); 536 _marked_for_reclamation_count++; 537 SWEEP(nm); 538 } 539 } else if (nm->is_not_entrant()) { 540 // If there are no current activations of this method on the 541 // stack we can safely convert it to a zombie method 542 if (nm->can_not_entrant_be_converted()) { 543 if (PrintMethodFlushing && Verbose) { 544 tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), nm); 545 } 546 // Clear ICStubs to prevent back patching stubs of zombie or unloaded 547 // nmethods during the next safepoint (see ICStub::finalize). 548 MutexLocker cl(CompiledIC_lock); 549 nm->clear_ic_stubs(); 550 // Code cache state change is tracked in make_zombie() 551 nm->make_zombie(); 552 _zombified_count++; 553 SWEEP(nm); 554 } else { 555 // Still alive, clean up its inline caches 556 MutexLocker cl(CompiledIC_lock); 557 nm->cleanup_inline_caches(); 558 SWEEP(nm); 559 } 560 } else if (nm->is_unloaded()) { 561 // Unloaded code, just make it a zombie 562 if (PrintMethodFlushing && Verbose) { 563 tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (unloaded) being made zombie", nm->compile_id(), nm); 564 } 565 if (nm->is_osr_method()) { 566 SWEEP(nm); 567 // No inline caches will ever point to osr methods, so we can just remove it 568 freed_memory = nm->total_size(); 569 if (nm->is_compiled_by_c2()) { |