Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/oops/markOop.cpp
32285 views
/*1* Copyright (c) 1997, 2015, Oracle and/or its affiliates. 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#include "precompiled.hpp"25#include "oops/markOop.hpp"26#include "runtime/thread.inline.hpp"27#include "runtime/objectMonitor.inline.hpp"2829PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC3031void markOopDesc::print_on(outputStream* st) const {32if (is_marked()) {33st->print(" marked(" INTPTR_FORMAT ")", value());34} else if (is_locked()) {35st->print(" locked(" INTPTR_FORMAT ")->", value());36if (is_neutral()) {37st->print("is_neutral");38if (has_no_hash()) st->print(" no_hash");39else st->print(" hash=" INTPTR_FORMAT, hash());40st->print(" age=%d", age());41} else if (has_bias_pattern()) {42st->print("is_biased");43JavaThread* jt = biased_locker();44st->print(" biased_locker=" INTPTR_FORMAT, p2i(jt));45} else if (has_monitor()) {46ObjectMonitor* mon = monitor();47if (mon == NULL)48st->print("monitor=NULL");49else {50BasicLock * bl = (BasicLock *) mon->owner();51st->print("monitor={count=" INTPTR_FORMAT ",waiters=" INTPTR_FORMAT ",recursions=" INTPTR_FORMAT ",owner=" INTPTR_FORMAT "}",52mon->count(), mon->waiters(), mon->recursions(), p2i(bl));53}54} else {55st->print("??");56}57} else {58assert(is_unlocked() || has_bias_pattern(), "just checking");59st->print("mark(");60if (has_bias_pattern()) st->print("biased,");61st->print("hash %#lx,", hash());62st->print("age %d)", age());63}64}656667