1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef PANDA_LIBPANDAFILE_MODIFIERS_H_ 17 #define PANDA_LIBPANDAFILE_MODIFIERS_H_ 18 19 #include "utils/bit_utils.h" 20 21 #include <cstdint> 22 23 namespace panda { 24 25 static constexpr uint32_t ACC_PUBLIC = 0x0001; // field, method, class 26 static constexpr uint32_t ACC_PRIVATE = 0x0002; // field, method 27 static constexpr uint32_t ACC_PROTECTED = 0x0004; // field, method 28 static constexpr uint32_t ACC_STATIC = 0x0008; // field, method 29 static constexpr uint32_t ACC_FINAL = 0x0010; // field, method, class 30 static constexpr uint32_t ACC_SUPER = 0x0020; // class 31 static constexpr uint32_t ACC_SYNCHRONIZED = 0x0020; // method 32 static constexpr uint32_t ACC_BRIDGE = 0x0040; // method 33 static constexpr uint32_t ACC_VOLATILE = 0x0040; // field 34 static constexpr uint32_t ACC_TRANSIENT = 0x0080; // field, 35 static constexpr uint32_t ACC_VARARGS = 0x0080; // method 36 static constexpr uint32_t ACC_NATIVE = 0x0100; // method 37 static constexpr uint32_t ACC_INTERFACE = 0x0200; // class 38 static constexpr uint32_t ACC_ABSTRACT = 0x0400; // method, class 39 static constexpr uint32_t ACC_STRICT = 0x0800; // method 40 static constexpr uint32_t ACC_SYNTHETIC = 0x1000; // field, method, class 41 static constexpr uint32_t ACC_ANNOTATION = 0x2000; // class 42 static constexpr uint32_t ACC_ENUM = 0x4000; // field, class 43 44 static constexpr uint32_t ACC_FILE_MASK = 0xFFFF; 45 46 // Runtime internal modifiers 47 static constexpr uint32_t ACC_HAS_DEFAULT_METHODS = 0x00010000; // class (runtime) 48 static constexpr uint32_t ACC_CONSTRUCTOR = 0x00010000; // method (runtime) 49 static constexpr uint32_t ACC_DEFAULT_INTERFACE_METHOD = 0x00020000; // method (runtime) 50 static constexpr uint32_t ACC_SINGLE_IMPL = 0x00040000; // method (runtime) 51 static constexpr uint32_t ACC_INTRINSIC = 0x00200000; // method (runtime) 52 53 static constexpr uint32_t INTRINSIC_SHIFT = MinimumBitsToStore(ACC_INTRINSIC); 54 static constexpr uint32_t INTRINSIC_MASK = static_cast<uint32_t>(0xff) << INTRINSIC_SHIFT; 55 56 // Runtime internal language specific modifiers 57 static constexpr uint32_t ACC_PROXY = 0x00020000; // class (java runtime) 58 static constexpr uint32_t ACC_FAST_NATIVE = 0x00080000; // method (java runtime) 59 static constexpr uint32_t ACC_CRITICAL_NATIVE = 0x00100000; // method (java runtime) 60 61 static constexpr uint32_t ACC_VERIFICATION_STATUS = 0x00400000; // method (runtime) 62 static constexpr uint32_t VERIFICATION_STATUS_SHIFT = MinimumBitsToStore(ACC_VERIFICATION_STATUS); 63 static constexpr uint32_t VERIFICATION_STATUS_MASK = static_cast<uint32_t>(0x7) << VERIFICATION_STATUS_SHIFT; 64 65 static constexpr uint32_t ACC_COMPILATION_STATUS = 0x02000000; // method (runtime) 66 static constexpr uint32_t COMPILATION_STATUS_SHIFT = MinimumBitsToStore(ACC_COMPILATION_STATUS); 67 static constexpr uint32_t COMPILATION_STATUS_MASK = static_cast<uint32_t>(0x7) << COMPILATION_STATUS_SHIFT; 68 } // namespace panda 69 70 #endif // PANDA_LIBPANDAFILE_MODIFIERS_H_ 71