1 /* 2 * Copyright (c) 2023 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 MPL2MPL_INCLUDE_REFLECTION_ANALYSIS_H 17 #define MPL2MPL_INCLUDE_REFLECTION_ANALYSIS_H 18 19 namespace maple { 20 // maple field index definition 21 enum class ClassRO : uint32 { 22 kClassName, 23 kIfields, 24 kMethods, 25 kSuperclass, 26 kNumOfFields, 27 kNumofMethods, 28 #ifndef USE_32BIT_REF 29 kFlag, 30 kNumOfSup, 31 kPadding, 32 #endif //! USE_32BIT_REF 33 kMod, 34 kAnnotation, 35 kClinitAddr 36 }; 37 38 enum StaticFieldName { 39 kClassName = 0, 40 kFieldName = 1, 41 kTypeName = 2, 42 }; 43 44 enum class ClassProperty : uint32 { 45 kShadow, 46 kMonitor, 47 kClassloader, 48 kObjsize, 49 #ifdef USE_32BIT_REF 50 FLAG, 51 NUMOFSUP, 52 #endif // USE_32BIT_REF 53 kItab, 54 kVtab, 55 kGctib, 56 kInfoRo, 57 #ifdef USE_32BIT_REF 58 kInstanceOfCacheFalse, 59 #endif 60 kClint 61 }; 62 63 enum class MethodProperty : uint32 { 64 kVtabIndex, 65 kDeclarclass, 66 kPaddrData, 67 kMod, 68 kMethodName, 69 kSigName, 70 kAnnotation, 71 kFlag, 72 kArgsize, 73 #ifndef USE_32BIT_REF 74 padding 75 #endif 76 }; 77 78 enum class MethodInfoCompact : uint32 { kVtabIndex, kPaddrData }; 79 80 enum class FieldProperty : uint32 { 81 kPOffset, 82 kMod, 83 kFlag, 84 kIndex, 85 kTypeName, 86 kName, 87 kAnnotation, 88 kDeclarclass, 89 kPClassType 90 }; 91 92 enum class FieldPropertyCompact : uint32 { kPOffset, kMod, kTypeName, kIndex, kName, kAnnotation }; 93 94 enum class MethodSignatureProperty : uint32 { kSignatureOffset, kParameterTypes }; 95 96 } // namespace maple 97 #endif // MPL2MPL_INCLUDE_REFLECTION_ANALYSIS_H 98