From 043625222a2ba79411b76aa1a9d3d724ecdec0fd Mon Sep 17 00:00:00 2001 From: twisti Date: Tue, 6 Apr 2010 13:39:52 +0200 Subject: [PATCH] 6940520: CodeCache::scavenge_root_nmethods_do must fix oop relocations Summary: ScavengeRootsInCode can lead to unfixed code-embedded oops. Reviewed-by: kvn, never --- src/share/vm/code/codeCache.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/share/vm/code/codeCache.cpp b/src/share/vm/code/codeCache.cpp index 65ee62241..b7b1e285b 100644 --- a/src/share/vm/code/codeCache.cpp +++ b/src/share/vm/code/codeCache.cpp @@ -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 @@ void CodeCache::scavenge_root_nmethods_do(CodeBlobClosure* f) { 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. -- GitLab