1 /* 2 * Copyright (C) 2015 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef ART_RUNTIME_MIRROR_CLASS_FLAGS_H_ 18 #define ART_RUNTIME_MIRROR_CLASS_FLAGS_H_ 19 20 #include <stdint.h> 21 22 #include "base/macros.h" 23 24 namespace art HIDDEN { 25 namespace mirror { 26 27 // Normal instance with at least one ref field other than the class. 28 static constexpr uint32_t kClassFlagNormal = 0x00000000; 29 30 // Only normal objects which have no reference fields, e.g. string or primitive array or normal 31 // class instance with no fields other than klass. 32 static constexpr uint32_t kClassFlagNoReferenceFields = 0x00000001; 33 34 // Class is java.lang.String.class. 35 static constexpr uint32_t kClassFlagString = 0x00000004; 36 37 // Class is an object array class. 38 static constexpr uint32_t kClassFlagObjectArray = 0x00000008; 39 40 // Class is java.lang.Class.class. 41 static constexpr uint32_t kClassFlagClass = 0x00000010; 42 43 // Class is ClassLoader or one of its subclasses. 44 static constexpr uint32_t kClassFlagClassLoader = 0x00000020; 45 46 // Class is DexCache. 47 static constexpr uint32_t kClassFlagDexCache = 0x00000040; 48 49 // Class is a soft/weak/phantom class. 50 static constexpr uint32_t kClassFlagSoftReference = 0x00000080; 51 52 // Class is a weak reference class. 53 static constexpr uint32_t kClassFlagWeakReference = 0x00000100; 54 55 // Class is a finalizer reference class. 56 static constexpr uint32_t kClassFlagFinalizerReference = 0x00000200; 57 58 // Class is the phantom reference class. 59 static constexpr uint32_t kClassFlagPhantomReference = 0x00000400; 60 61 // Class is a record class. See doc at java.lang.Class#isRecord(). 62 static constexpr uint32_t kClassFlagRecord = 0x00000800; 63 64 // Combination of flags to figure out if the class is either the weak/soft/phantom/finalizer 65 // reference class. 66 static constexpr uint32_t kClassFlagReference = 67 kClassFlagSoftReference | 68 kClassFlagWeakReference | 69 kClassFlagFinalizerReference | 70 kClassFlagPhantomReference; 71 72 } // namespace mirror 73 } // namespace art 74 75 #endif // ART_RUNTIME_MIRROR_CLASS_FLAGS_H_ 76 77