8248133: SerialGC: Unify handling of all OopStorage instances in root processing

Reviewed-by: eosterlund, kbarrett, pliden
This commit is contained in:
Stefan Karlsson 2020-06-24 13:15:54 +02:00
parent 156f6174ed
commit 3797364ce9
4 changed files with 45 additions and 9 deletions

View File

@ -49,7 +49,7 @@
#include "gc/shared/gcInitLogger.hpp"
#include "gc/shared/locationPrinter.inline.hpp"
#include "gc/shared/oopStorage.inline.hpp"
#include "gc/shared/oopStorageSet.hpp"
#include "gc/shared/oopStorageSet.inline.hpp"
#include "gc/shared/oopStorageParState.inline.hpp"
#include "gc/shared/scavengableNMethods.hpp"
#include "gc/shared/space.hpp"
@ -825,10 +825,6 @@ void GenCollectedHeap::process_roots(StrongRootsScope* scope,
if (_process_strong_tasks->try_claim_task(GCH_PS_Universe_oops_do)) {
Universe::oops_do(strong_roots);
}
// Global (strong) JNI handles
if (_process_strong_tasks->try_claim_task(GCH_PS_JNIHandles_oops_do)) {
JNIHandles::oops_do(strong_roots);
}
if (_process_strong_tasks->try_claim_task(GCH_PS_ObjectSynchronizer_oops_do)) {
ObjectSynchronizer::oops_do(strong_roots);
@ -844,8 +840,8 @@ void GenCollectedHeap::process_roots(StrongRootsScope* scope,
AOTLoader::oops_do(strong_roots);
}
#endif
if (_process_strong_tasks->try_claim_task(GCH_PS_VMGlobal_oops_do)) {
OopStorageSet::vm_global()->oops_do(strong_roots);
if (_process_strong_tasks->try_claim_task(GCH_PS_OopStorageSet_oops_do)) {
OopStorageSet::strong_oops_do(strong_roots);
}
if (_process_strong_tasks->try_claim_task(GCH_PS_CodeCache_oops_do)) {

View File

@ -106,11 +106,10 @@ protected:
// The set of potentially parallel tasks in root scanning.
enum GCH_strong_roots_tasks {
GCH_PS_Universe_oops_do,
GCH_PS_JNIHandles_oops_do,
GCH_PS_ObjectSynchronizer_oops_do,
GCH_PS_FlatProfiler_oops_do,
GCH_PS_Management_oops_do,
GCH_PS_VMGlobal_oops_do,
GCH_PS_OopStorageSet_oops_do,
GCH_PS_ClassLoaderDataGraph_oops_do,
GCH_PS_jvmti_oops_do,
GCH_PS_CodeCache_oops_do,

View File

@ -95,6 +95,9 @@ public:
static OopStorage* resolved_method_table_weak() {
return storage(resolved_method_table_weak_index);
}
template <typename Closure>
static void strong_oops_do(Closure* cl);
};
class OopStorageSet::Iterator {

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_GC_SHARED_OOPSTORAGESET_INLINE_HPP
#define SHARE_GC_SHARED_OOPSTORAGESET_INLINE_HPP
#include "gc/shared/oopStorage.inline.hpp"
#include "gc/shared/oopStorageSet.hpp"
template <typename Closure>
void OopStorageSet::strong_oops_do(Closure* cl) {
for (OopStorageSet::Iterator it = OopStorageSet::strong_iterator(); !it.is_end(); ++it) {
(*it)->oops_do(cl);
}
}
#endif // SHARE_GC_SHARED_OOPSTORAGESET_INLINE_HPP