accessFlags.cpp revision 1472
418N/A/*
418N/A * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
605N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
418N/A *
1063N/A * This code is free software; you can redistribute it and/or modify it
418N/A * under the terms of the GNU General Public License version 2 only, as
418N/A * published by the Free Software Foundation.
919N/A *
919N/A * This code is distributed in the hope that it will be useful, but WITHOUT
919N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
919N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
919N/A * version 2 for more details (a copy is included in the LICENSE file that
919N/A * accompanied this code).
919N/A *
919N/A * You should have received a copy of the GNU General Public License version
919N/A * 2 along with this work; if not, write to the Free Software Foundation,
919N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
919N/A *
919N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
919N/A * or visit www.oracle.com if you need additional information or have any
919N/A * questions.
919N/A *
919N/A */
919N/A
418N/A# include "incls/_precompiled.incl"
418N/A# include "incls/_accessFlags.cpp.incl"
418N/A
418N/A
493N/Avoid AccessFlags::atomic_set_bits(jint bits) {
418N/A // Atomically update the flags with the bits given
970N/A jint old_flags, new_flags, f;
970N/A do {
970N/A old_flags = _flags;
970N/A new_flags = old_flags | bits;
970N/A f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
970N/A } while(f != old_flags);
970N/A}
970N/A
970N/Avoid AccessFlags::atomic_clear_bits(jint bits) {
970N/A // Atomically update the flags with the bits given
970N/A jint old_flags, new_flags, f;
970N/A do {
970N/A old_flags = _flags;
418N/A new_flags = old_flags & ~bits;
1063N/A f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
418N/A } while(f != old_flags);
911N/A}
1063N/A
1063N/A#ifndef PRODUCT
911N/A
418N/Avoid AccessFlags::print_on(outputStream* st) const {
553N/A if (is_public ()) st->print("public " );
418N/A if (is_private ()) st->print("private " );
553N/A if (is_protected ()) st->print("protected " );
553N/A if (is_static ()) st->print("static " );
553N/A if (is_final ()) st->print("final " );
553N/A if (is_synchronized()) st->print("synchronized ");
418N/A if (is_volatile ()) st->print("volatile " );
418N/A if (is_transient ()) st->print("transient " );
418N/A if (is_native ()) st->print("native " );
857N/A if (is_interface ()) st->print("interface " );
418N/A if (is_abstract ()) st->print("abstract " );
418N/A if (is_strict ()) st->print("strict " );
418N/A if (is_synthetic ()) st->print("synthetic " );
493N/A if (is_old ()) st->print("{old} " );
418N/A if (is_obsolete ()) st->print("{obsolete} " );
418N/A}
418N/A
851N/A#endif
418N/A
851N/Avoid accessFlags_init() {
418N/A assert(sizeof(AccessFlags) == sizeof(jint), "just checking size of flags");
418N/A}
493N/A