-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Implement heuristic to prioritize reflection info in field descriptor search #59802
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
Implement heuristic to prioritize reflection info in field descriptor search #59802
Conversation
@swift-ci test |
88e8c3d
to
b3df5a4
Compare
The mangled type name already includes the module name. Is this for correctness or performance? |
@slavapestov performance. In lldb's case (not sure about the runtime) it can be quite expensive to normalize thousands of mangled names before finding the one we're looking for |
@swift-ci smoke test |
What does 'normalize' mean? Perhaps when loading the image we should build a hashtable or something instead? It seems unnecessary to add redundant information to the field descriptor. |
Essentially converting a mangled name with symbolic references, substitutions, etc, into a "normal" mangled name (look at
Building the hashtable of
We're only adding one fairly short StringRef per image ( |
b3df5a4
to
781feaa
Compare
@swift-ci smoke test |
Found = FieldTypeInfoCache.find(*MangledName); | ||
if (Found != FieldTypeInfoCache.end()) { | ||
return Found->second; | ||
} |
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.
both calls to PopulateFieldTypeInfoCacheWithReflectionInfo
are followed by this lookup. Should there be some function, say FindFieldDescriptor(Info, *MangledName)
, which searches and also handles the population/caching as an implementation detail?
Would it make sense for the Name to be a |
@jckarter yes I think that makes a lot of sense. |
5c43c2e
to
129fab7
Compare
4e0e6c8
to
632d187
Compare
@swift-ci smoke test |
@swift-ci test |
Currently when looking for field descriptors we parse the reflection metadata in whatever order it was registered. This patch implements a heuristic where we try to match a new optional Name field with the module name of the type's field descriptor we're looking for. rdar://87889973
632d187
to
65a9e7d
Compare
@swift-ci smoke test |
Currently when looking for field descriptors we parse the reflection
metadata in whatever order it was registered. This patch implements a
heuristic where we try to match a new optional Name field with the
module name of the type's field descriptor we're looking for.
rdar://87889973