6940520: CodeCache::scavenge_root_nmethods_do must fix oop relocations
authortwisti
Tue, 06 Apr 2010 13:39:52 +0200
changeset 5247 c2b4e525b3e5
parent 5235 9261638fa59c
child 5248 5eddf88cc3c9
6940520: CodeCache::scavenge_root_nmethods_do must fix oop relocations Summary: ScavengeRootsInCode can lead to unfixed code-embedded oops. Reviewed-by: kvn, never
hotspot/src/share/vm/code/codeCache.cpp
--- a/hotspot/src/share/vm/code/codeCache.cpp	Fri Apr 02 15:55:04 2010 -0700
+++ b/hotspot/src/share/vm/code/codeCache.cpp	Tue Apr 06 13:39:52 2010 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2010 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -284,9 +284,11 @@
       cur->print_on(tty, is_live ? "scavenge root" : "dead scavenge root"); tty->cr();
     }
 #endif //PRODUCT
-    if (is_live)
+    if (is_live) {
       // Perform cur->oops_do(f), maybe just once per nmethod.
       f->do_code_blob(cur);
+      cur->fix_oop_relocations();
+    }
   }
 
   // Check for stray marks.