RFR: 8048248: G1 Class Unloading after completing a concurrent mark cycle

Stefan Karlsson stefan.karlsson at oracle.com
Fri Jul 4 08:22:36 UTC 2014


On 2014-07-04 10:06, Roland Westrelin wrote:
> Hi Stefan,
>
>> http://cr.openjdk.java.net/~stefank/8048248/webrev.02/
> So why can you change:
>
> 475       nm->fix_oop_relocations();
>
> to
>
> 526       DEBUG_ONLY(nm->verify_oop_relocations());
>
> in CodeCache::gc_epilogue()
>
> and
>
> 1914     cur->fix_oop_relocations();
>
> to
>
> 2188     cur->verify_oop_relocations();
>
> in nmethod::oops_do_marking_epilogue()

The call to fix_oop_relocations() are called when iterate over the oops 
in an nmethod, instead of doing it as a separate pass at the end.

See:

+void CodeBlobToOopClosure::do_nmethod(nmethod* nm) {
+  nm->oops_do(_cl);
+  if (_fix_relocations) {
+    nm->fix_oop_relocations();
+  }
+}

Every time we setup aCodeBlobToOopClosure or aMarkingCodeBlobClosure we specify if we should call fix_oop_reloctations() or not. For example:

--- old/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp	2014-07-03 21:13:02.077583821 +0200
+++ new/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp	2014-07-03 21:13:01.965583825 +0200
@@ -100,7 +100,7 @@
  
      case code_cache:
        {
-        CodeBlobToOopClosure each_scavengable_code_blob(&roots_to_old_closure, /*do_marking=*/ true);
+        MarkingCodeBlobClosure each_scavengable_code_blob(&roots_to_old_closure, CodeBlobToOopClosure::FixRelocations);
          CodeCache::scavenge_root_nmethods_do(&each_scavengable_code_blob);
        }
        break;

>
> ?
>
> This comment:
> 1196   // Find all calls in an nmethod, and clear the ones that points to zombie methods
> in nmethod.cpp doesn’t seem good.

I'll remove it.

Thanks!
StefanK

>
> Roland.



More information about the hotspot-dev mailing list