#elif defined(TARGET_ARM)
-#define SIZEOF_PRECODE_BASE CODE_SIZE_ALIGN
-#define OFFSETOF_PRECODE_TYPE 3
+#define SIZEOF_PRECODE_BASE CODE_SIZE_ALIGN * 2
+#define OFFSETOF_PRECODE_TYPE 7
#elif defined(TARGET_LOONGARCH64)
static const int Type = 0x4A;
static const SIZE_T CodeSize = 24;
#elif defined(TARGET_ARM)
- static const int Type = 0xCF;
+ static const int Type = 0xFF;
static const SIZE_T CodeSize = 12;
#elif defined(TARGET_LOONGARCH64)
static const int Type = 0x4;
// (This is fake precode. VTable slot does not point to it.)
struct NDirectImportPrecode : StubPrecode
{
- static const int Type = 0x01;
+ static const int Type = 0x05;
void Init(NDirectImportPrecode* pPrecodeRX, MethodDesc* pMD, LoaderAllocator *pLoaderAllocator);
static const SIZE_T CodeSize = 24;
static const int FixupCodeOffset = 8;
#elif defined(TARGET_ARM)
- static const int Type = 0xFF;
+ static const int Type = 0xCF;
static const SIZE_T CodeSize = 12;
static const int FixupCodeOffset = 4 + THUMB_CODE;
#elif defined(TARGET_LOONGARCH64)
static_assert_no_msg(FixupPrecode::Type != ThisPtrRetBufPrecode::Type);
static_assert_no_msg(NDirectImportPrecode::Type != ThisPtrRetBufPrecode::Type);
+// Verify that the base type for each precode fits into each specific precode type
+static_assert_no_msg(sizeof(Precode) <= sizeof(NDirectImportPrecode));
+static_assert_no_msg(sizeof(Precode) <= sizeof(FixupPrecode));
+static_assert_no_msg(sizeof(Precode) <= sizeof(ThisPtrRetBufPrecode));
#endif // __PRECODE_H__