Skip to content
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

[SR-9652] foreign type metadata references VWT directly breaking Windows #52096

Closed
compnerd opened this issue Jan 13, 2019 · 6 comments
Closed
Assignees
Labels
compiler The Swift compiler in itself

Comments

@compnerd
Copy link
Collaborator

Previous ID SR-9652
Radar None
Original Reporter @compnerd
Type Sub-task
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Sub-task
Assignee @compnerd
Priority Medium

md5: 9c0f48560541397354de851f69a1b3c1

Parent-Task:

Issue Description:

We emit the VWT reference inline which breaks on Windows as it is cross-module. This was fixed for most cases using the singleton strategy, but for foreign types, this needs to be addressed still (breaks CF usage)

@compnerd
Copy link
Collaborator Author

CC: @slavapestov

@compnerd
Copy link
Collaborator Author

This has size wins for android and Darwin as well, since the metadata here can be synthesized at runtime. CC: @jckarter

@jckarter
Copy link
Member

Definitely, it'd be awesome to emit just a minimal symbolic representation of the CF type and build the metadata structure on demand. On Darwin, however, we will need to maintain support for the old mechanism for the now-stable ABI, though.

@compnerd
Copy link
Collaborator Author

compnerd commented Feb 1, 2019

Hmm, what would be the best way to do this now then?

@jckarter
Copy link
Member

jckarter commented Feb 4, 2019

On Darwin, the runtime would need to be able to continue to provide the existing `swift_getForeignTypeMetadata` entry point and accept the current format of pre-generated foreign metadata records. Either you could add a new entry point that uses minimal templates, or maybe you could have the one entry point recognize from the format of the arguments whether it's an old-format metadata record or a new-format minimal record. This might be possible because an existing metadata record should only ever have the value of MetadataKind::Struct, ::Enum, or ::ForeignClass as a pointer-sized int value at the address point, whereas if you instead passed in a nominal type descriptor with foreign instantiation information or something like that, it should never have one of those values at the address point because of additional flags.

@compnerd
Copy link
Collaborator Author

#22857

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants