Path: blob/master/runtime/gc_glue_java/CompactSchemeCheckMarkRoots.hpp
5990 views
1/*******************************************************************************2* Copyright (c) 1991, 2016 IBM Corp. and others3*4* This program and the accompanying materials are made available under5* the terms of the Eclipse Public License 2.0 which accompanies this6* distribution and is available at https://www.eclipse.org/legal/epl-2.0/7* or the Apache License, Version 2.0 which accompanies this distribution and8* is available at https://www.apache.org/licenses/LICENSE-2.0.9*10* This Source Code may also be made available under the following11* Secondary Licenses when the conditions for such availability set12* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU13* General Public License, version 2 with the GNU Classpath14* Exception [1] and GNU General Public License, version 2 with the15* OpenJDK Assembly Exception [2].16*17* [1] https://www.gnu.org/software/classpath/license.html18* [2] http://openjdk.java.net/legal/assembly-exception.html19*20* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception21*******************************************************************************/2223#ifndef CHECKMARKROOTS_HPP_24#define CHECKMARKROOTS_HPP_2526#include "RootScanner.hpp"2728class MM_CompactSchemeCheckMarkRoots : public MM_RootScanner {29private:30public:31MM_CompactSchemeCheckMarkRoots(MM_EnvironmentStandard *env)32: MM_RootScanner(env, true)33{}3435virtual void doSlot(omrobjectptr_t* slot)36{}3738virtual void doClass(J9Class *clazz)39{40GC_ClassIterator classIterator(_env, clazz);41while (volatile omrobjectptr_t *slot = classIterator.nextSlot()) {42/* discard volatile since we must be in stop-the-world mode */43doSlot((omrobjectptr_t*)slot);44}45}4647virtual void doClassLoader(J9ClassLoader *classLoader)48{49if (J9_GC_CLASS_LOADER_DEAD != (classLoader->gcFlags & J9_GC_CLASS_LOADER_DEAD)) {50doSlot(&classLoader->classLoaderObject);51scanModularityObjects(classLoader);52}53}54#if defined(J9VM_GC_FINALIZATION)55virtual void doFinalizableObject(omrobjectptr_t object) {56omrobjectptr_t objectPtr = object;57doSlot(&objectPtr);58}59#endif /* J9VM_GC_FINALIZATION */60};6162#endif /* CHECKMARKROOTS_HPP_ */636465