Skip to content

Commit

Permalink
remove unnecessary now PTFF_RAX_IS_GCREF and similar.
Browse files Browse the repository at this point in the history
  • Loading branch information
VSadov committed Dec 18, 2024
1 parent 58dd802 commit d695d52
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 41 deletions.
6 changes: 2 additions & 4 deletions src/coreclr/nativeaot/Runtime/amd64/AsmMacros.inc
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,8 @@ PTFF_SAVE_ALL_PRESERVED equ 000000F7h ;; NOTE: RBP is not included in this set
PTFF_SAVE_RSP equ 00008000h
PTFF_SAVE_RAX equ 00000100h ;; RAX is saved in hijack handler - in case it contains a GC ref
PTFF_SAVE_ALL_SCRATCH equ 00007F00h
PTFF_RAX_IS_GCREF equ 00010000h ;; iff PTFF_SAVE_RAX: set -> eax is Object, clear -> eax is scalar
PTFF_RAX_IS_BYREF equ 00020000h ;; iff PTFF_SAVE_RAX: set -> eax is ByRef, clear -> eax is Object or scalar
PTFF_THREAD_ABORT equ 00100000h ;; indicates that ThreadAbortException should be thrown when returning from the transition
PTFF_THREAD_HIJACK equ 00200000h ;; indicates that this is a frame for a hijacked call
PTFF_THREAD_ABORT equ 00010000h ;; indicates that ThreadAbortException should be thrown when returning from the transition
PTFF_THREAD_HIJACK equ 00020000h ;; indicates that this is a frame for a hijacked call

;; These must match the TrapThreadsFlags enum
TrapThreadsFlags_None equ 0
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/nativeaot/Runtime/arm64/AsmMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ PTFF_SAVE_ALL_SCRATCH equ 0x3FFFF800 ;; NOTE: X0-X18
PTFF_SAVE_FP equ 0x40000000
PTFF_SAVE_LR equ 0x80000000

PTFF_THREAD_HIJACK_HI equ 0x00000020 // upper 32 bits of the PTFF_THREAD_HIJACK
PTFF_THREAD_HIJACK_HI equ 0x00000002 // upper 32 bits of the PTFF_THREAD_HIJACK

;; Bit position for the flags above, to be used with tbz / tbnz instructions
PTFF_THREAD_ABORT_BIT equ 36
PTFF_THREAD_ABORT_BIT equ 32

;; These must match the TrapThreadsFlags enum
TrapThreadsFlags_None equ 0
Expand Down
36 changes: 8 additions & 28 deletions src/coreclr/nativeaot/Runtime/inc/rhbinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,9 @@ enum PInvokeTransitionFrameFlags
// a return address pointing into the hijacked method and that method's
// lr register, which may hold a gc pointer

PTFF_R0_IS_GCREF = 0x00004000, // used by hijack handler to report return value of hijacked method
PTFF_R0_IS_BYREF = 0x00008000, // used by hijack handler to report return value of hijacked method
PTFF_THREAD_ABORT = 0x00004000, // indicates that ThreadAbortException should be thrown when returning from the transition

PTFF_THREAD_ABORT = 0x00010000, // indicates that ThreadAbortException should be thrown when returning from the transition

PTFF_THREAD_HIJACK = 0x00020000, // indicates that this is a frame for a hijacked call
PTFF_THREAD_HIJACK = 0x00008000, // indicates that this is a frame for a hijacked call
};
#elif defined(TARGET_ARM64)
enum PInvokeTransitionFrameFlags : uint64_t
Expand Down Expand Up @@ -331,15 +328,9 @@ enum PInvokeTransitionFrameFlags : uint64_t
// a return address pointing into the hijacked method and that method's
// lr register, which may hold a gc pointer

// used by hijack handler to report return value of hijacked method
PTFF_X0_IS_GCREF = 0x0000000100000000,
PTFF_X0_IS_BYREF = 0x0000000200000000,
PTFF_X1_IS_GCREF = 0x0000000400000000,
PTFF_X1_IS_BYREF = 0x0000000800000000,

PTFF_THREAD_ABORT = 0x0000001000000000, // indicates that ThreadAbortException should be thrown when returning from the transition
PTFF_THREAD_ABORT = 0x0000000100000000, // indicates that ThreadAbortException should be thrown when returning from the transition

PTFF_THREAD_HIJACK = 0x0000002000000000, // indicates that this is a frame for a hijacked call
PTFF_THREAD_HIJACK = 0x0000000200000000, // indicates that this is a frame for a hijacked call
};

#elif defined(TARGET_LOONGARCH64)
Expand Down Expand Up @@ -394,15 +385,9 @@ enum PInvokeTransitionFrameFlags : uint64_t
// a return address pointing into the hijacked method and that method's
// ra register, which may hold a gc pointer

// used by hijack handler to report return value of hijacked method
PTFF_R4_IS_GCREF = 0x0000000080000000,
PTFF_R4_IS_BYREF = 0x0000000100000000,
PTFF_R5_IS_GCREF = 0x0000000200000000,
PTFF_R5_IS_BYREF = 0x0000000400000000,
PTFF_THREAD_ABORT = 0x0000000080000000, // indicates that ThreadAbortException should be thrown when returning from the transition

PTFF_THREAD_ABORT = 0x0000000800000000, // indicates that ThreadAbortException should be thrown when returning from the transition

PTFF_THREAD_HIJACK = 0x0000001000000000, // indicates that this is a frame for a hijacked call
PTFF_THREAD_HIJACK = 0x0000000100000000, // indicates that this is a frame for a hijacked call
};

#else // TARGET_ARM
Expand Down Expand Up @@ -440,14 +425,9 @@ enum PInvokeTransitionFrameFlags
PTFF_SAVE_R10 = 0x00002000,
PTFF_SAVE_R11 = 0x00004000,

PTFF_RAX_IS_GCREF = 0x00010000, // used by hijack handler to report return value of hijacked method
PTFF_RAX_IS_BYREF = 0x00020000,
PTFF_RDX_IS_GCREF = 0x00040000,
PTFF_RDX_IS_BYREF = 0x00080000,

PTFF_THREAD_ABORT = 0x00100000, // indicates that ThreadAbortException should be thrown when returning from the transition
PTFF_THREAD_ABORT = 0x00010000, // indicates that ThreadAbortException should be thrown when returning from the transition

PTFF_THREAD_HIJACK = 0x00200000, // indicates that this is a frame for a hijacked call
PTFF_THREAD_HIJACK = 0x00020000, // indicates that this is a frame for a hijacked call
};
#endif // TARGET_ARM

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/nativeaot/Runtime/unix/unixasmmacrosamd64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ C_FUNC(\Name):
#define PTFF_SAVE_RAX 0x00000100 // RAX is saved in hijack handler - in case it contains a GC ref
#define PTFF_SAVE_RDX 0x00000400 // RDX is saved in hijack handler - in case it contains a GC ref
#define PTFF_SAVE_ALL_SCRATCH 0x00007F00
#define PTFF_THREAD_ABORT 0x00100000 // indicates that ThreadAbortException should be thrown when returning from the transition
#define PTFF_THREAD_HIJACK 0x00200000 // indicates that this is a frame for a hijacked call
#define PTFF_THREAD_ABORT 0x00010000 // indicates that ThreadAbortException should be thrown when returning from the transition
#define PTFF_THREAD_HIJACK 0x00020000 // indicates that this is a frame for a hijacked call

// These must match the TrapThreadsFlags enum
#define TrapThreadsFlags_None 0
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/nativeaot/Runtime/unix/unixasmmacrosarm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#define PTFF_SAVE_R9 0x00000020
#define PTFF_SAVE_SP 0x00000100
#define PTFF_SAVE_R0 0x00000200
#define PTFF_THREAD_ABORT 0x00100000
#define PTFF_THREAD_HIJACK 0x00200000 // indicates that this is a frame for a hijacked call
#define PTFF_THREAD_ABORT 0x00004000
#define PTFF_THREAD_HIJACK 0x00008000 // indicates that this is a frame for a hijacked call

#define DEFAULT_FRAME_SAVE_FLAGS (PTFF_SAVE_ALL_PRESERVED + PTFF_SAVE_SP)

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/nativeaot/Runtime/unix/unixasmmacrosarm64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ C_FUNC(\Name):
#define PTFF_SAVE_X0 0x00000800
#define PTFF_SAVE_X1 0x00001000
#define PTFF_SAVE_ALL_PRESERVED 0x000003FF // NOTE: x19-x28
#define PTFF_THREAD_HIJACK_HI 0x00000020 // upper 32 bits of the PTFF_THREAD_HIJACK
#define PTFF_THREAD_HIJACK_HI 0x00000002 // upper 32 bits of the PTFF_THREAD_HIJACK

#define DEFAULT_FRAME_SAVE_FLAGS (PTFF_SAVE_ALL_PRESERVED + PTFF_SAVE_SP)

Expand Down Expand Up @@ -346,7 +346,7 @@ C_FUNC(\Name):
.endm

// Bit position for the flags above, to be used with tbz / tbnz instructions
#define PTFF_THREAD_ABORT_BIT 36
#define PTFF_THREAD_ABORT_BIT 32

//
// CONSTANTS -- INTEGER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ C_FUNC(\Name):
.endm

// Bit position for the flags above, to be used with bstrpick.d+beq/bne instructions
#define PTFF_THREAD_ABORT_BIT 35
#define PTFF_THREAD_ABORT_BIT 31

//
// CONSTANTS -- INTEGER
Expand Down

0 comments on commit d695d52

Please sign in to comment.