10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 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 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_INLINE_HPP
25 #define SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_INLINE_HPP
26
27 #include "gc/shenandoah/shenandoahAsserts.hpp"
28 #include "gc/shenandoah/shenandoahForwarding.hpp"
29 #include "oops/markWord.inline.hpp"
30 #include "runtime/atomic.hpp"
31
32 inline HeapWord* ShenandoahForwarding::get_forwardee_raw(oop obj) {
33 shenandoah_assert_in_heap(NULL, obj);
34 return get_forwardee_raw_unchecked(obj);
35 }
36
37 inline HeapWord* ShenandoahForwarding::get_forwardee_raw_unchecked(oop obj) {
38 markWord mark = obj->mark_raw();
39 if (mark.is_marked()) {
40 return (HeapWord*) mark.clear_lock_bits().to_pointer();
41 } else {
42 return (HeapWord*) obj;
43 }
44 }
45
46 inline oop ShenandoahForwarding::get_forwardee(oop obj) {
47 shenandoah_assert_correct(NULL, obj);
48 return oop(get_forwardee_raw_unchecked(obj));
49 }
50
|
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 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 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_INLINE_HPP
25 #define SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_INLINE_HPP
26
27 #include "gc/shenandoah/shenandoahAsserts.hpp"
28 #include "gc/shenandoah/shenandoahForwarding.hpp"
29 #include "oops/markWord.inline.hpp"
30
31 inline HeapWord* ShenandoahForwarding::get_forwardee_raw(oop obj) {
32 shenandoah_assert_in_heap(NULL, obj);
33 return get_forwardee_raw_unchecked(obj);
34 }
35
36 inline HeapWord* ShenandoahForwarding::get_forwardee_raw_unchecked(oop obj) {
37 markWord mark = obj->mark_raw();
38 if (mark.is_marked()) {
39 return (HeapWord*) mark.clear_lock_bits().to_pointer();
40 } else {
41 return (HeapWord*) obj;
42 }
43 }
44
45 inline oop ShenandoahForwarding::get_forwardee(oop obj) {
46 shenandoah_assert_correct(NULL, obj);
47 return oop(get_forwardee_raw_unchecked(obj));
48 }
49
|