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 kJavatext = 13, 50 kJavajni = 14, 51 kJavajniFunc = 15, 52 kOldMaxNum = 16, // Old num 53 kDataSection = 17, 54 kDecoupleStaticKey = 18, 55 kDecoupleStaticValue = 19, 56 kBssStart = 20, 57 kLinkerSoHash = 21, 58 kArrayClassCache = 22, 59 kArrayClassCacheName = 23, 60 kNewMaxNum = 24 // New num 61 }; 62 63 struct SourceFileMethod { 64 uint32 sourceFileIndex; 65 uint32 sourceClassIndex; 66 uint32 sourceMethodIndex; 67 bool isVirtual; 68 }; 69 70 struct SourceFileField { 71 uint32 sourceFileIndex; 72 uint32 sourceClassIndex; 73 uint32 sourceFieldIndex; 74 }; 75 76 } // namespace maple 77 #endif // MPL2MPL_INCLUDE_MUID_REPLACEMENT_H 78