src/share/vm/ci/ciFlags.hpp

Thu, 24 May 2018 18:41:44 +0800

author
aoqi
date
Thu, 24 May 2018 18:41:44 +0800
changeset 8856
ac27a9c85bea
parent 8664
00cbb581da94
parent 6876
710a3c8b516e
permissions
-rw-r--r--

Merge

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@0 25 #ifndef SHARE_VM_CI_CIFLAGS_HPP
aoqi@0 26 #define SHARE_VM_CI_CIFLAGS_HPP
aoqi@0 27
aoqi@0 28 #include "ci/ciClassList.hpp"
aoqi@0 29 #include "memory/allocation.hpp"
aoqi@0 30 #include "prims/jvm.h"
aoqi@0 31 #include "utilities/accessFlags.hpp"
aoqi@0 32
aoqi@0 33 // ciFlags
aoqi@0 34 //
aoqi@0 35 // This class represents klass or method flags.
aoqi@0 36 class ciFlags VALUE_OBJ_CLASS_SPEC {
aoqi@0 37 private:
aoqi@0 38 friend class ciInstanceKlass;
aoqi@0 39 friend class ciField;
aoqi@0 40 friend class ciMethod;
aoqi@0 41
aoqi@0 42 jint _flags;
aoqi@0 43
aoqi@0 44 ciFlags() { _flags = 0; }
aoqi@0 45 ciFlags(AccessFlags flags) { _flags = flags.as_int(); }
aoqi@0 46
aoqi@0 47 public:
aoqi@0 48 // Java access flags
zmajo@8664 49 bool is_public () const { return (_flags & JVM_ACC_PUBLIC ) != 0; }
zmajo@8664 50 bool is_private () const { return (_flags & JVM_ACC_PRIVATE ) != 0; }
zmajo@8664 51 bool is_protected () const { return (_flags & JVM_ACC_PROTECTED ) != 0; }
zmajo@8664 52 bool is_static () const { return (_flags & JVM_ACC_STATIC ) != 0; }
zmajo@8664 53 bool is_final () const { return (_flags & JVM_ACC_FINAL ) != 0; }
zmajo@8664 54 bool is_synchronized () const { return (_flags & JVM_ACC_SYNCHRONIZED ) != 0; }
zmajo@8664 55 bool is_super () const { return (_flags & JVM_ACC_SUPER ) != 0; }
zmajo@8664 56 bool is_volatile () const { return (_flags & JVM_ACC_VOLATILE ) != 0; }
zmajo@8664 57 bool is_transient () const { return (_flags & JVM_ACC_TRANSIENT ) != 0; }
zmajo@8664 58 bool is_native () const { return (_flags & JVM_ACC_NATIVE ) != 0; }
zmajo@8664 59 bool is_interface () const { return (_flags & JVM_ACC_INTERFACE ) != 0; }
zmajo@8664 60 bool is_abstract () const { return (_flags & JVM_ACC_ABSTRACT ) != 0; }
zmajo@8664 61 bool is_strict () const { return (_flags & JVM_ACC_STRICT ) != 0; }
zmajo@8664 62 bool is_stable () const { return (_flags & JVM_ACC_FIELD_STABLE ) != 0; }
zmajo@8664 63 // In case the current object represents a field, return true if
zmajo@8664 64 // the field is modified outside of instance initializer methods
zmajo@8664 65 // (or class/initializer methods if the field is static) and false
zmajo@8664 66 // otherwise.
zmajo@8664 67 bool has_initialized_final_update() const { return (_flags & JVM_ACC_FIELD_INITIALIZED_FINAL_UPDATE) != 0; };
aoqi@0 68
aoqi@0 69 // Conversion
aoqi@0 70 jint as_int() { return _flags; }
aoqi@0 71
aoqi@0 72 void print_klass_flags(outputStream* st = tty);
aoqi@0 73 void print_member_flags(outputStream* st = tty);
aoqi@0 74 void print(outputStream* st = tty);
aoqi@0 75 };
aoqi@0 76
aoqi@0 77 #endif // SHARE_VM_CI_CIFLAGS_HPP

mercurial