src/share/vm/code/nmethod.cpp

Print this page

        

*** 1298,1307 **** --- 1298,1314 ---- // Common functionality for both make_not_entrant and make_zombie bool nmethod::make_not_entrant_or_zombie(unsigned int state) { assert(state == zombie || state == not_entrant, "must be zombie or not_entrant"); assert(!is_zombie(), "should not already be a zombie"); + // The state of nmethods that are currently locked by the VM must not change. + // Some operations such as setting ICs (e.g., SharedRuntime::resolve_sub_helper()) + // rely on this fact. + if (is_locked_by_vm()) { + return false; + } + // Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below. nmethodLocker nml(this); methodHandle the_method(method()); No_Safepoint_Verifier nsv;
*** 1415,1425 **** tty->print_cr("nmethod <" INTPTR_FORMAT "> code made %s", this, (state == not_entrant) ? "not entrant" : "zombie"); } // Make sweeper aware that there is a zombie method that needs to be removed NMethodSweeper::notify(this); - return true; } void nmethod::flush() { // Note that there are no valid oops in the nmethod anymore. --- 1422,1431 ----