Path: blob/master/src/hotspot/share/gc/shenandoah/shenandoahForwarding.hpp
40961 views
/*1* Copyright (c) 2013, 2019, Red Hat, Inc. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_HPP25#define SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_HPP2627#include "oops/oop.hpp"28#include "utilities/globalDefinitions.hpp"2930class ShenandoahForwarding {31public:32/* Gets forwardee from the given object.33*/34static inline oop get_forwardee(oop obj);3536/* Gets forwardee from the given object. Only from mutator thread.37*/38static inline oop get_forwardee_mutator(oop obj);3940/* Returns the raw value from forwardee slot.41*/42static inline oop get_forwardee_raw(oop obj);4344/* Returns the raw value from forwardee slot without any checks.45* Used for quick verification.46*/47static inline oop get_forwardee_raw_unchecked(oop obj);4849/**50* Returns true if the object is forwarded, false otherwise.51*/52static inline bool is_forwarded(oop obj);5354/* Tries to atomically update forwardee in $holder object to $update.55* Assumes $holder points at itself.56* Asserts $holder is in from-space.57* Asserts $update is in to-space.58*59* Returns the new object 'update' upon success, or60* the new forwardee that a competing thread installed.61*/62static inline oop try_update_forwardee(oop obj, oop update);6364};6566#endif // SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_HPP676869