-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Method descriptors #19067
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
Method descriptors #19067
Conversation
7338d9f
to
92067a4
Compare
92067a4
to
ad67380
Compare
@swift-ci Please smoke test |
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.
One minor style comment, but otherwise good.
lib/IRGen/GenMeta.cpp
Outdated
@@ -1207,12 +1218,14 @@ namespace { | |||
|
|||
SILVTable *VTable = nullptr; | |||
unsigned VTableSize = 0; | |||
bool isResilient; |
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.
Capitalized, please.
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.
Fixed
ad67380
to
ee4ba9f
Compare
When we define type metadata, the 'full' symbol points at the entire struct, whereas the 'address point' symbol points at an offset inside. The logic for setting this up is a bit tricky because the 'address point' symbol may have been forward declared, and has to be replaced.
ee4ba9f
to
ee5deee
Compare
@swift-ci Please smoke test |
Nominal type descriptors for protocols and classes contain an array of method descriptors. This PR defines symbols pointing at these descriptors, allowing them to be referenced from outside the module.
Method descriptors will be used in two places:
Resilient witness tables. Previously resilient witness tables used protocol dispatch thunks as keys, but this is problematic because we don't want to rely on function pointer identity.
Resilient method overrides. Here again we don't want to use dispatch thunks as keys; classes have the additional issue that resilient overrides are sometimes needed for methods that don't have dispatch thunks.