Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8248133: SerialGC: Unify handling of all OopStorage instances in root…
… processing

Reviewed-by: eosterlund, kbarrett, pliden
  • Loading branch information
stefank committed Jun 24, 2020
1 parent 156f617 commit 3797364ce92a118f22e0c4c0b59b55f8c443bce9
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
@@ -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)) {
@@ -106,11 +106,10 @@ class GenCollectedHeap : public CollectedHeap {
// 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,
@@ -95,6 +95,9 @@ class OopStorageSet : public AllStatic {
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 {
@@ -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

0 comments on commit 3797364

Please sign in to comment.