< prev index next >

src/hotspot/share/code/compiledMethod.cpp

Print this page

471         }
472       } else {
473         ShouldNotReachHere();
474       }
475     }
476   }
477 
478   return ic->set_to_clean();
479 }
480 
481 // Clean references to unloaded nmethods at addr from this one, which is not unloaded.
482 template <class CompiledICorStaticCall>
483 static bool clean_if_nmethod_is_unloaded(CompiledICorStaticCall *ic, address addr, CompiledMethod* from,
484                                          bool clean_all) {
485   // Ok, to lookup references to zombies here
486   CodeBlob *cb = CodeCache::find_blob_unsafe(addr);
487   CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
488   if (nm != NULL) {
489     // Clean inline caches pointing to both zombie and not_entrant methods
490     if (clean_all || !nm->is_in_use() || nm->is_unloading() || (nm->method()->code() != nm)) {
491       if (!ic->set_to_clean(from->is_alive())) {
492         return false;
493       }
494       assert(ic->is_clean(), "nmethod " PTR_FORMAT "not clean %s", p2i(from), from->method()->name_and_sig_as_C_string());
495     }
496   }
497   return true;
498 }
499 
500 static bool clean_if_nmethod_is_unloaded(CompiledIC *ic, CompiledMethod* from,
501                                          bool clean_all) {
502   return clean_if_nmethod_is_unloaded(ic, ic->ic_destination(), from, clean_all);
503 }
504 
505 static bool clean_if_nmethod_is_unloaded(CompiledStaticCall *csc, CompiledMethod* from,
506                                          bool clean_all) {
507   return clean_if_nmethod_is_unloaded(csc, csc->destination(), from, clean_all);
508 }
509 
510 // Cleans caches in nmethods that point to either classes that are unloaded
511 // or nmethods that are unloaded.

471         }
472       } else {
473         ShouldNotReachHere();
474       }
475     }
476   }
477 
478   return ic->set_to_clean();
479 }
480 
481 // Clean references to unloaded nmethods at addr from this one, which is not unloaded.
482 template <class CompiledICorStaticCall>
483 static bool clean_if_nmethod_is_unloaded(CompiledICorStaticCall *ic, address addr, CompiledMethod* from,
484                                          bool clean_all) {
485   // Ok, to lookup references to zombies here
486   CodeBlob *cb = CodeCache::find_blob_unsafe(addr);
487   CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
488   if (nm != NULL) {
489     // Clean inline caches pointing to both zombie and not_entrant methods
490     if (clean_all || !nm->is_in_use() || nm->is_unloading() || (nm->method()->code() != nm)) {
491       if (!ic->set_to_clean(!from->is_unloading())) {
492         return false;
493       }
494       assert(ic->is_clean(), "nmethod " PTR_FORMAT "not clean %s", p2i(from), from->method()->name_and_sig_as_C_string());
495     }
496   }
497   return true;
498 }
499 
500 static bool clean_if_nmethod_is_unloaded(CompiledIC *ic, CompiledMethod* from,
501                                          bool clean_all) {
502   return clean_if_nmethod_is_unloaded(ic, ic->ic_destination(), from, clean_all);
503 }
504 
505 static bool clean_if_nmethod_is_unloaded(CompiledStaticCall *csc, CompiledMethod* from,
506                                          bool clean_all) {
507   return clean_if_nmethod_is_unloaded(csc, csc->destination(), from, clean_all);
508 }
509 
510 // Cleans caches in nmethods that point to either classes that are unloaded
511 // or nmethods that are unloaded.
< prev index next >