Path: blob/master/runtime/gc_glue_java/CompactSchemeFixupObject.hpp
5985 views
/*******************************************************************************1* Copyright (c) 1991, 2021 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* 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-exception20*******************************************************************************/2122#ifndef COMPACTSCHEMEOBJECTFIXUP_HPP_23#define COMPACTSCHEMEOBJECTFIXUP_HPP_2425#include "j9cfg.h"26#include "objectdescription.h"2728#include "CompactScheme.hpp"29#include "GCExtensions.hpp"3031class MM_CompactSchemeFixupObject {32public:33protected:34private:35OMR_VM *_omrVM;36MM_GCExtensions *_extensions;37MM_CompactScheme *_compactScheme;38public:3940/**41* Perform fixup for a single object42* @param env[in] the current thread43* @param objectPtr pointer to object for fixup44*/45void fixupObject(MM_EnvironmentStandard *env, omrobjectptr_t objectPtr);4647static void verifyForwardingPtr(omrobjectptr_t objectPtr, omrobjectptr_t forwardingPtr);4849MM_CompactSchemeFixupObject(MM_EnvironmentBase* env, MM_CompactScheme *compactScheme) :50_omrVM(env->getOmrVM()),51_extensions(MM_GCExtensions::getExtensions(env)),52_compactScheme(compactScheme)53{}5455protected:56private:57/**58* Perform fixup for a mixed object59* @param objectPtr pointer to object for fixup60*/61void fixupMixedObject(omrobjectptr_t objectPtr);6263/**64* Perform fixup for an array object65* @param objectPtr pointer to object for fixup66*/67void fixupArrayObject(omrobjectptr_t objectPtr);6869/**70* Perform fixup for a flattened array object71* @param objectPtr pointer to object for fixup72*/73void fixupFlattenedArrayObject(omrobjectptr_t objectPtr);7475/**76* Called whenever a ownable synchronizer object is fixed up during compact. Places the object on the thread-specific buffer of gc work thread.77* @param env -- current thread environment78* @param object -- The object of type or subclass of java.util.concurrent.locks.AbstractOwnableSynchronizer.79*/80MMINLINE void addOwnableSynchronizerObjectInList(MM_EnvironmentBase *env, omrobjectptr_t objectPtr);81};8283#endif /* COMPACTSCHEMEOBJECTFIXUP_HPP_ */848586