Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahForwarding.hpp
38920 views
/*1* Copyright (c) 2013, 2018, Red Hat, Inc. All rights reserved.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation.6*7* This code is distributed in the hope that it will be useful, but WITHOUT8* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License10* version 2 for more details (a copy is included in the LICENSE file that11* accompanied this code).12*13* You should have received a copy of the GNU General Public License version14* 2 along with this work; if not, write to the Free Software Foundation,15* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.16*17* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA18* or visit www.oracle.com if you need additional information or have any19* questions.20*21*/2223#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_HPP24#define SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_HPP2526#include "oops/oop.hpp"27#include "utilities/globalDefinitions.hpp"2829class ShenandoahForwarding {30public:31/* Gets forwardee from the given object.32*/33static inline oop get_forwardee(oop obj);3435/* Gets forwardee from the given object. Only from mutator thread.36*/37static inline oop get_forwardee_mutator(oop obj);3839/* Returns the raw value from forwardee slot.40*/41static inline HeapWord* get_forwardee_raw(oop obj);4243/* Returns the raw value from forwardee slot without any checks.44* Used for quick verification.45*/46static inline HeapWord* get_forwardee_raw_unchecked(oop obj);4748/**49* Returns true if the object is forwarded, false otherwise.50*/51static inline bool is_forwarded(oop obj);5253/* Tries to atomically update forwardee in $holder object to $update.54* Assumes $holder points at itself.55* Asserts $holder is in from-space.56* Asserts $update is in to-space.57*58* Returns the new object 'update' upon success, or59* the new forwardee that a competing thread installed.60*/61static inline oop try_update_forwardee(oop obj, oop update);6263};6465#endif // SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_HPP666768