< prev index next >

test/hotspot/gtest/gc/shared/test_preservedMarks.cpp

Print this page
rev 49289 : 8199735: Mark word updates need to use Access API

*** 1,7 **** /* ! * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 21,30 **** --- 21,31 ---- * questions. */ #include "precompiled.hpp" #include "gc/shared/preservedMarks.inline.hpp" + #include "oops/oop.inline.hpp" #include "unittest.hpp" class ScopedDisabledBiasedLocking { bool _orig; public:
*** 36,53 **** // return true for calls to must_be_preserved(). class FakeOop { oopDesc _oop; public: ! FakeOop() : _oop() { _oop.set_mark(originalMark()); } oop get_oop() { return &_oop; } ! markOop mark() { return _oop.mark(); } ! void set_mark(markOop m) { _oop.set_mark(m); } void forward_to(oop obj) { markOop m = markOopDesc::encode_pointer_as_mark(obj); ! _oop.set_mark(m); } static markOop originalMark() { return markOop(markOopDesc::lock_mask_in_place); } static markOop changedMark() { return markOop(0x4711); } }; --- 37,54 ---- // return true for calls to must_be_preserved(). class FakeOop { oopDesc _oop; public: ! FakeOop() : _oop() { _oop.set_mark_raw(originalMark()); } oop get_oop() { return &_oop; } ! markOop mark() { return _oop.mark_raw(); } ! void set_mark(markOop m) { _oop.set_mark_raw(m); } void forward_to(oop obj) { markOop m = markOopDesc::encode_pointer_as_mark(obj); ! _oop.set_mark_raw(m); } static markOop originalMark() { return markOop(markOopDesc::lock_mask_in_place); } static markOop changedMark() { return markOop(0x4711); } };
< prev index next >