-
Notifications
You must be signed in to change notification settings - Fork 5.4k
JIT: Support loading Swift self register from SwiftSelf struct #99132
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4401,7 +4401,7 @@ enum class CFGCallKind | |
|
|
||
| class CallArgs; | ||
|
|
||
| enum class WellKnownArg | ||
| enum class WellKnownArg : unsigned | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change? (Seems fine, just curious)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| { | ||
| None, | ||
| ThisPointer, | ||
|
|
@@ -4419,6 +4419,7 @@ enum class WellKnownArg | |
| R2RIndirectionCell, | ||
| ValidateIndirectCallTarget, | ||
| DispatchIndirectCallTarget, | ||
| SwiftSelf, | ||
| }; | ||
|
|
||
| #ifdef DEBUG | ||
|
|
@@ -4728,6 +4729,7 @@ class CallArg | |
| CORINFO_CLASS_HANDLE GetSignatureClassHandle() { return m_signatureClsHnd; } | ||
| var_types GetSignatureType() { return m_signatureType; } | ||
| WellKnownArg GetWellKnownArg() { return m_wellKnownArg; } | ||
| void SetWellKnownArg(const WellKnownArg argType) { m_wellKnownArg = argType; } | ||
| bool IsTemp() { return m_isTmp; } | ||
| // clang-format on | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -765,6 +765,8 @@ const char* getWellKnownArgName(WellKnownArg arg) | |
| return "ValidateIndirectCallTarget"; | ||
| case WellKnownArg::DispatchIndirectCallTarget: | ||
| return "DispatchIndirectCallTarget"; | ||
| case WellKnownArg::SwiftSelf: | ||
| return "SwiftSelf"; | ||
| } | ||
|
|
||
| return "N/A"; | ||
|
|
@@ -3179,7 +3181,9 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) | |
| } | ||
|
|
||
| // TODO-ARGS: Review this, is it really necessary to treat them specially here? | ||
| if (call->gtArgs.IsNonStandard(this, call, &arg) && arg.AbiInfo.IsPassedInRegisters()) | ||
| // Exception: Lower SwiftSelf struct arg to GT_LCL_FLD | ||
| if (call->gtArgs.IsNonStandard(this, call, &arg) && arg.AbiInfo.IsPassedInRegisters() && | ||
| (arg.GetWellKnownArg() != WellKnownArg::SwiftSelf)) | ||
| { | ||
|
Comment on lines
+3184
to
3187
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary? That doesn't seem right.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likely we should instead insert a new arg in the importer that represents "self" as a primitive instead of keeping this as a struct argument. It being a struct argument is just an artifact of the design and it wouldn't work to keep it as a struct on all ABIs.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's just keep it as is for now. I'm refactoring stuff for the struct work which should make this change simple to make.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah, the fact that the argument was being kept as
Sure thing. |
||
| flagsSummary |= argx->gtFlags; | ||
| continue; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.