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_MUID_REPLACEMENT_H 17 #define MPL2MPL_INCLUDE_MUID_REPLACEMENT_H 18 #include "phase_impl.h" 19 #include "muid.h" 20 #include "version.h" 21 #include "maple_phase_manager.h" 22 23 namespace maple { 24 // For func def table. 25 constexpr uint32 kFuncDefAddrIndex = 0; 26 // For data def table. 27 constexpr uint32 kDataDefAddrIndex = 0; 28 // For func def info. table. 29 constexpr uint32 kFuncDefSizeIndex = 0; 30 constexpr uint32 kFuncDefNameIndex = 1; 31 constexpr uint32 kRangeBeginIndex = 0; 32 constexpr int32_t kDecoupleAndLazy = 3; 33 constexpr uint32_t kShiftBit16 = 16; 34 constexpr uint32_t kShiftBit15 = 15; 35 36 enum RangeIdx { 37 // 0,1 entry is reserved for a stamp 38 kVtabAndItab = 2, 39 kItabConflict = 3, 40 kVtabOffset = 4, 41 kFieldOffset = 5, 42 kValueOffset = 6, 43 kLocalClassInfo = 7, 44 kConststr = 8, 45 kSuperclass = 9, 46 kGlobalRootlist = 10, 47 kClassmetaData = 11, 48 kClassBucket = 12, 49 kOldMaxNum = 16, // Old num 50 kDataSection = 17, 51 kDecoupleStaticKey = 18, 52 kDecoupleStaticValue = 19, 53 kBssStart = 20, 54 kLinkerSoHash = 21, 55 kArrayClassCache = 22, 56 kArrayClassCacheName = 23, 57 kNewMaxNum = 24 // New num 58 }; 59 60 struct SourceFileMethod { 61 uint32 sourceFileIndex; 62 uint32 sourceClassIndex; 63 uint32 sourceMethodIndex; 64 bool isVirtual; 65 }; 66 67 struct SourceFileField { 68 uint32 sourceFileIndex; 69 uint32 sourceClassIndex; 70 uint32 sourceFieldIndex; 71 }; 72 73 } // namespace maple 74 #endif // MPL2MPL_INCLUDE_MUID_REPLACEMENT_H 75