0N/A/*
4185N/A * Copyright (c) 1997, 2013, 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 "oops/oop.inline.hpp"
1879N/A#include "utilities/accessFlags.hpp"
1879N/A#ifdef TARGET_OS_FAMILY_linux
1879N/A# include "os_linux.inline.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_OS_FAMILY_solaris
1879N/A# include "os_solaris.inline.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_OS_FAMILY_windows
1879N/A# include "os_windows.inline.hpp"
1879N/A#endif
2796N/A#ifdef TARGET_OS_FAMILY_bsd
2796N/A# include "os_bsd.inline.hpp"
2796N/A#endif
0N/A
0N/A
0N/Avoid AccessFlags::atomic_set_bits(jint bits) {
0N/A // Atomically update the flags with the bits given
0N/A jint old_flags, new_flags, f;
0N/A do {
0N/A old_flags = _flags;
0N/A new_flags = old_flags | bits;
0N/A f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
0N/A } while(f != old_flags);
0N/A}
0N/A
0N/Avoid AccessFlags::atomic_clear_bits(jint bits) {
0N/A // Atomically update the flags with the bits given
0N/A jint old_flags, new_flags, f;
0N/A do {
0N/A old_flags = _flags;
0N/A new_flags = old_flags & ~bits;
0N/A f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
0N/A } while(f != old_flags);
0N/A}
0N/A
0N/Avoid AccessFlags::print_on(outputStream* st) const {
0N/A if (is_public ()) st->print("public " );
0N/A if (is_private ()) st->print("private " );
0N/A if (is_protected ()) st->print("protected " );
0N/A if (is_static ()) st->print("static " );
0N/A if (is_final ()) st->print("final " );
0N/A if (is_synchronized()) st->print("synchronized ");
0N/A if (is_volatile ()) st->print("volatile " );
0N/A if (is_transient ()) st->print("transient " );
0N/A if (is_native ()) st->print("native " );
0N/A if (is_interface ()) st->print("interface " );
0N/A if (is_abstract ()) st->print("abstract " );
0N/A if (is_strict ()) st->print("strict " );
0N/A if (is_synthetic ()) st->print("synthetic " );
0N/A if (is_old ()) st->print("{old} " );
0N/A if (is_obsolete ()) st->print("{obsolete} " );
0N/A}
0N/A
0N/Avoid accessFlags_init() {
0N/A assert(sizeof(AccessFlags) == sizeof(jint), "just checking size of flags");
0N/A}