< prev index next >

src/hotspot/share/classfile/metadataOnStackMark.cpp

Concurrent class unloading

*** 45,60 **** // Walk metadata on the stack and mark it so that redefinition doesn't delete // it. Class unloading only deletes in-error class files, methods created by // the relocator and dummy constant pools. None of these appear anywhere except // in metadata Handles. MetadataOnStackMark::MetadataOnStackMark(bool redefinition_walk) { - assert(SafepointSynchronize::is_at_safepoint(), "sanity check"); assert(_used_buffers == NULL, "sanity check"); assert(!_is_active, "MetadataOnStackMarks do not nest"); NOT_PRODUCT(_is_active = true;) ! Threads::metadata_handles_do(Metadata::mark_on_stack); if (redefinition_walk) { Threads::metadata_do(Metadata::mark_on_stack); CodeCache::metadata_do(Metadata::mark_on_stack); CompileBroker::mark_on_stack(); --- 45,62 ---- // Walk metadata on the stack and mark it so that redefinition doesn't delete // it. Class unloading only deletes in-error class files, methods created by // the relocator and dummy constant pools. None of these appear anywhere except // in metadata Handles. MetadataOnStackMark::MetadataOnStackMark(bool redefinition_walk) { assert(_used_buffers == NULL, "sanity check"); assert(!_is_active, "MetadataOnStackMarks do not nest"); NOT_PRODUCT(_is_active = true;) ! if (!UseZGC) { ! assert(SafepointSynchronize::is_at_safepoint(), "sanity check"); ! Threads::metadata_handles_do(Metadata::mark_on_stack); ! } if (redefinition_walk) { Threads::metadata_do(Metadata::mark_on_stack); CodeCache::metadata_do(Metadata::mark_on_stack); CompileBroker::mark_on_stack(); ***************
*** 65,75 **** #endif } } MetadataOnStackMark::~MetadataOnStackMark() { ! assert(SafepointSynchronize::is_at_safepoint(), "sanity check"); // Unmark everything that was marked. Can't do the same walk because // redefine classes messes up the code cache so the set of methods // might not be the same. retire_current_buffer(); --- 67,77 ---- #endif } } MetadataOnStackMark::~MetadataOnStackMark() { ! assert(SafepointSynchronize::is_at_safepoint() || UseZGC, "sanity check"); // Unmark everything that was marked. Can't do the same walk because // redefine classes messes up the code cache so the set of methods // might not be the same. retire_current_buffer();
< prev index next >