-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add swift_getTypeByMangledNameInContextInMetadataState such that we can #28337
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
Add swift_getTypeByMangledNameInContextInMetadataState such that we can #28337
Conversation
use getTypeByMangledName when abstract metadata state is requested This can significantly reduce the code size of apps constructing deeply nested types with conditional conformances. Requires a new runtime. rdar://57157619
@swift-ci Please test |
Build failed |
@swift-ci Please test |
Build failed |
Build failed |
auto instantiationFnName = | ||
request.isStaticallyAbstract() | ||
? "__swift_instantiateConcreteTypeFromMangledNameAbstract" | ||
: "__swift_instantiateConcreteTypeFromMangledName"; |
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.
Thanks for implementing this, Arnold! I wonder whether, if we're targeting Swift >= 5.2, we could only emit __swift_instantiateConcreteTypeFromMangledNameAbstract
and use it for all metadata requests. That would probably mean a couple more instructions at call sites to materialize the metadata request kind argument, though.
RETURNS(TypeMetadataPtrTy), | ||
ARGS(SizeTy, Int8PtrTy, SizeTy, TypeContextDescriptorPtrTy, | ||
Int8PtrPtrTy), | ||
ATTRS(NoUnwind, ArgMemOnly)) |
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'd also be good to add the swift_getTypeByMangledNameInEnvironmentInMetadataState
variant, so we have it available for future use to instantiate metadata in generic environments that don't have an associated type context.
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please test |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci Please test linux |
@swift-ci please benchmark |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibsHow to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
use getTypeByMangledName when abstract metadata state is requested
This can significantly reduce the code size of apps constructing deeply
nested types with conditional conformances.
Requires a new runtime.
rdar://57157619