< prev index next >

src/hotspot/share/oops/markWord.cpp

Print this page

 6  * under the terms of the GNU General Public License version 2 only, as
 7  * published by the Free Software Foundation.
 8  *
 9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  *
23  */
24 
25 #include "precompiled.hpp"

26 #include "oops/markWord.hpp"
27 #include "runtime/thread.inline.hpp"
28 #include "runtime/objectMonitor.inline.hpp"
29 #include "utilities/ostream.hpp"
30 
31 markWord markWord::displaced_mark_helper() const {
32   assert(has_displaced_mark_helper(), "check");
33   if (has_monitor()) {
34     // Has an inflated monitor. Must be checked before has_locker().
35     ObjectMonitor* monitor = this->monitor();
36     return monitor->header();
37   }
38   if (has_locker()) {  // has a stack lock
39     BasicLock* locker = this->locker();
40     return locker->displaced_header();
41   }
42   // This should never happen:
43   fatal("bad header=" INTPTR_FORMAT, value());
44   return markWord(value());
45 }

 6  * under the terms of the GNU General Public License version 2 only, as
 7  * published by the Free Software Foundation.
 8  *
 9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  *
23  */
24 
25 #include "precompiled.hpp"
26 #include "oops/compressedOops.inline.hpp"
27 #include "oops/markWord.hpp"
28 #include "runtime/thread.inline.hpp"
29 #include "runtime/objectMonitor.inline.hpp"
30 #include "utilities/ostream.hpp"
31 
32 markWord markWord::displaced_mark_helper() const {
33   assert(has_displaced_mark_helper(), "check");
34   if (has_monitor()) {
35     // Has an inflated monitor. Must be checked before has_locker().
36     ObjectMonitor* monitor = this->monitor();
37     return monitor->header();
38   }
39   if (has_locker()) {  // has a stack lock
40     BasicLock* locker = this->locker();
41     return locker->displaced_header();
42   }
43   // This should never happen:
44   fatal("bad header=" INTPTR_FORMAT, value());
45   return markWord(value());
46 }
< prev index next >