未验证 提交 740081f2 编写于 作者: G github-actions[bot] 提交者: GitHub

[release/8.0] Update FixupPrecode and StubPrecode types for ARM (#92075)

* Update FixupPrecode and StubPrecode types for ARM
Co-authored-by: NJan Vorlicek <janvorli@microsoft.com>

* Update ThisPtrRetBufPrecode and NDirectImportPrecode types for arm
Co-authored-by: NJan Vorlicek <janvorli@microsoft.com>

* Addressing PR feedback - remove unnecessary #ifdef's

* FIx riscv64 build break due to NDirectImportPrecode::Type conflict with ThisPtrRetBufPrecode::Type

---------
Co-authored-by: NTom McDonald <tommcdon@microsoft.com>
Co-authored-by: NJan Vorlicek <janvorli@microsoft.com>
上级 f6cee7c5
......@@ -996,7 +996,7 @@ inline BOOL ClrFlushInstructionCache(LPCVOID pCodeAddr, size_t sizeOfCode, bool
// Precode to shuffle this and retbuf for closed delegates over static methods with return buffer
struct ThisPtrRetBufPrecode {
static const int Type = 0x46;
static const int Type = 0x01;
// mov r12, r0
// mov r0, r1
......
......@@ -36,8 +36,8 @@ EXTERN_C VOID STDCALL PrecodeRemotingThunk();
#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)
......@@ -100,7 +100,7 @@ struct StubPrecode
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;
......@@ -189,7 +189,7 @@ typedef DPTR(StubPrecode) PTR_StubPrecode;
// (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);
......@@ -237,7 +237,7 @@ struct FixupPrecode
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)
......@@ -614,4 +614,8 @@ static_assert_no_msg(FixupPrecode::Type != NDirectImportPrecode::Type);
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__
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册