Eric Caspole wrote:
> Hi Tom,
> In the course of working on the sweeper, I happened to notice that what looks like a merge mistake with the code cache unloading thing. In CompileBroker::compile_method(), the call to find_and_remove_saved_code() is not guarded by the UseCodeCacheFlushing flag, so it ends up taking the code cache lock to do that check even when unloading is off. I don't think it should be like this, although it is only a minor point. What do you think?
> Thanks,
> Eric
>
> 989 if (method->is_not_compilable(comp_level)) return NULL;
> 990
> 991 nmethod* saved = CodeCache::find_and_remove_saved_code(method());
> 992 if (saved != NULL) {
> 993 method->set_code(method, saved);
>
>
> 400 nmethod* CodeCache::find_and_remove_saved_code(methodOop m) {
> 401 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
> 402 nmethod* saved = _saved_nmethods;
> 403 nmethod* prev = NULL;
> 404 while (saved != NULL) {
>