0N/A/*
3679N/A * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#include "precompiled.hpp"
1879N/A#include "classfile/javaClasses.hpp"
1879N/A#include "oops/oop.inline.hpp"
1879N/A#include "runtime/handles.inline.hpp"
1879N/A#include "utilities/copy.hpp"
1879N/A#ifdef TARGET_OS_FAMILY_linux
1879N/A# include "thread_linux.inline.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_OS_FAMILY_solaris
1879N/A# include "thread_solaris.inline.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_OS_FAMILY_windows
1879N/A# include "thread_windows.inline.hpp"
1879N/A#endif
2796N/A#ifdef TARGET_OS_FAMILY_bsd
2796N/A# include "thread_bsd.inline.hpp"
2796N/A#endif
0N/A
0N/Abool always_do_update_barrier = false;
0N/A
0N/ABarrierSet* oopDesc::_bs = NULL;
0N/A
0N/Avoid oopDesc::print_on(outputStream* st) const {
0N/A if (this == NULL) {
0N/A st->print_cr("NULL");
0N/A } else {
0N/A blueprint()->oop_print_on(oop(this), st);
0N/A }
0N/A}
0N/A
0N/Avoid oopDesc::print_address_on(outputStream* st) const {
0N/A if (PrintOopAddress) {
665N/A st->print("{"INTPTR_FORMAT"}", this);
0N/A }
0N/A}
0N/A
0N/Avoid oopDesc::print() { print_on(tty); }
0N/A
0N/Avoid oopDesc::print_address() { print_address_on(tty); }
0N/A
0N/Achar* oopDesc::print_string() {
1155N/A stringStream st;
1155N/A print_on(&st);
1155N/A return st.as_string();
1155N/A}
1155N/A
1155N/Avoid oopDesc::print_value() {
1155N/A print_value_on(tty);
0N/A}
0N/A
0N/Achar* oopDesc::print_value_string() {
1155N/A char buf[100];
1155N/A stringStream st(buf, sizeof(buf));
1155N/A print_value_on(&st);
1155N/A return st.as_string();
0N/A}
0N/A
1155N/Avoid oopDesc::print_value_on(outputStream* st) const {
1155N/A oop obj = oop(this);
1155N/A if (this == NULL) {
1155N/A st->print("NULL");
1155N/A } else if (java_lang_String::is_instance(obj)) {
1155N/A java_lang_String::print(obj, st);
1155N/A if (PrintOopAddress) print_address_on(st);
1155N/A#ifdef ASSERT
1155N/A } else if (!Universe::heap()->is_in(obj) || !Universe::heap()->is_in(klass())) {
1155N/A st->print("### BAD OOP %p ###", (address)obj);
1155N/A#endif //ASSERT
1155N/A } else {
1155N/A blueprint()->oop_print_value_on(obj, st);
1155N/A }
1155N/A}
1155N/A
0N/A
0N/Avoid oopDesc::verify_on(outputStream* st) {
0N/A if (this != NULL) {
0N/A blueprint()->oop_verify_on(this, st);
0N/A }
0N/A}
0N/A
0N/A
0N/Avoid oopDesc::verify() {
0N/A verify_on(tty);
0N/A}
0N/A
0N/Abool oopDesc::partially_loaded() {
0N/A return blueprint()->oop_partially_loaded(this);
0N/A}
0N/A
0N/A
0N/Avoid oopDesc::set_partially_loaded() {
0N/A blueprint()->oop_set_partially_loaded(this);
0N/A}
0N/A
0N/A
0N/Aintptr_t oopDesc::slow_identity_hash() {
0N/A // slow case; we have to acquire the micro lock in order to locate the header
0N/A ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY
0N/A HandleMark hm;
0N/A Handle object((oop)this);
0N/A assert(!is_shared_readonly(), "using identity hash on readonly object?");
0N/A return ObjectSynchronizer::identity_hash_value_for(object);
0N/A}
0N/A
0N/AVerifyOopClosure VerifyOopClosure::verify_oop;
113N/A
113N/Avoid VerifyOopClosure::do_oop(oop* p) { VerifyOopClosure::do_oop_work(p); }
113N/Avoid VerifyOopClosure::do_oop(narrowOop* p) { VerifyOopClosure::do_oop_work(p); }