-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ABI] Use faux mangled names for associated conformances in witness tables #20472
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
[ABI] Use faux mangled names for associated conformances in witness tables #20472
Conversation
@swift-ci please benchmark |
There's one known issue in the test suite I have yet to address, but this should be good enough now for basic benchmarking. |
Build comment file:Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
Performance: -Onone
Code size: -swiftlibs
How 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
|
The code size regressions are expected (we've strictly added code, via the indirection through the faux mangled name). We expect that real manglings of conformances will provide code size improvements. |
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
@swift-ci please smoke test macOS |
1 similar comment
@swift-ci please smoke test macOS |
@swift-ci please smoke test Linux |
@swift-ci please clean test Linux |
Build failed |
@swift-ci please smoke test Linux |
1 similar comment
@swift-ci please smoke test Linux |
…ables The current representation of an associated conformance in a witness tables (e.g., Iterator: IteratorProtocol within a witness table for Sequence) is a function that the client calls. Replace this with something more like what we do for associated types: an associated conformance is either a pointer to the witness table (once it is known) or a pointer to a mangled name that describes that conformance. On first access, demangle the mangled name and replace the entry with the resulting witness table. This will give us a more compact representation of associated conformances, as well as always caching them. For now, the mangled name is a sham: it’s a mangled relative reference to the existing witness table accessors, not a true mangled name. In time, we’ll extend the support here to handle proper mangled names. Part of rdar://problem/38038799.
If the type checker doesn't prepopulate signature conformances, fill them in when we first need them. This is a stopgap solution until we can move these queries over to the request-evaluator. Fixes rdar://problem/34584596, as well as a regression introduced by the use of mangled names for associated conformances in witness tables.
…stant. The runtime can choose to re-use the pattern of a witness table if in fact there is nothing dependent about it. Only mark the pattern as constant when we know it has no inline caching behavior.
a7b459b
to
dbe50c6
Compare
@swift-ci please smoke test and merge |
1 similar comment
@swift-ci please smoke test and merge |
The current representation of an associated conformance in a witness
tables (e.g., Iterator: IteratorProtocol within a witness table for
Sequence) is a function that the client calls.
Replace this with something more like what we do for associated types:
an associated conformance is either a pointer to the witness table (once
it is known) or a pointer to a mangled name that describes that
conformance. On first access, demangle the mangled name and replace the
entry with the resulting witness table. This will give us a more compact
representation of associated conformances, as well as always caching
them.
For now, the mangled name is a sham: it’s a mangled relative reference to
the existing witness table accessors, not a true mangled name. In time,
we’ll extend the support here to handle proper mangled names.
Part of rdar://problem/38038799.