Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/vm/arm/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions src/coreclr/vm/precode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 = 0x02;

void Init(NDirectImportPrecode* pPrecodeRX, MethodDesc* pMD, LoaderAllocator *pLoaderAllocator);

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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__
Loading