-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Cleanup unused JIT stubs in vm #111237
base: main
Are you sure you want to change the base?
Cleanup unused JIT stubs in vm #111237
Conversation
# <NOTE> | ||
# | ||
# </NOTE> | ||
LEAF_ENTRY JIT_ProfilerEnterLeaveTailcallStub, _TEXT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UNIX_AMD64 was the only platform not implementing this in ASM.
What's the requirement for this method? Can it be implemented in C for all platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method has custom calling convention - it has to preserve more register than the default calling convention is guaranteed to preserve. It cannot be implemented in C in general.
I think we just got lucky on UNIX_AMD64 or this profiling scenario is not tested on Unix Amd64.
@@ -89,9 +89,9 @@ EXTERN_C LPVOID STDCALL COMPlusEndCatch(LPVOID ebp, DWORD ebx, DWORD edi, DWORD | |||
// RedirectedHandledJITCaseForXXX_Stub's. | |||
// | |||
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(CONTEXT * pContext); | |||
#ifdef FEATURE_EH_FUNCLETS | |||
#if defined(FEATURE_EH_FUNCLETS) && !defined(TARGET_UNIX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to port Windows x86 to new EH in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is something we have in our backlog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to delete this since there is no implementation.
This method has to more to do with low-level implementation of EH and thread suspension than funclets. If I am reading the code correctly, this method is only called from FixRedirectContextHandler that is only used on Windows x64. It can be probably deleted everywhere else as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be probably deleted everywhere else as well.
I do plan to delete it on UNIX. Including in this PR should be fine.
For Windows x86, leaving a stub may be useful for future implementation. Deleting it should also be fine because there should be more missing definitions for new EH on Windows x86.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think it will be needed for new EH on Windows x86
|
||
void STDMETHODCALLTYPE JIT_ProfilerEnterLeaveTailcallStub(UINT_PTR ProfilerHandle); | ||
#if !defined(TARGET_ARM64) && !defined(TARGET_LOONGARCH64) && !defined(TARGET_RISCV64) | ||
void STDCALL JIT_StackProbe(); | ||
#endif // TARGET_ARM64 | ||
#endif // !defined(TARGET_ARM64) && !defined(TARGET_LOONGARCH64) && !defined(TARGET_RISCV64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the condition here be inverted? Is the function meaningful for RISC platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the function meaningful for RISC platforms?
I think that it is. You can link it to #13519
The JIT_TailCall helpers are only used on Windows x86. Removing all stub definitions on other platforms.
GetCONTEXTFromRedirectedStubStackFrame(DISPATCH_CONTEXT) is only used on Windows.