Commit Graph

6 Commits

Author SHA1 Message Date
Dario Rexin
a8d4d57f11 [IRGen] Generate compressed representation of value witnesses (#63813)
rdar://105837040

* WIP: Store layout string in type metadata

* WIP: More cases working

* WIP: Layout strings almost working

* Add layout string pointer to struct metadata

* Fetch bytecode layout strings from metadata in runtime

* More efficient bytecode layout

* Add support for interpreted generics in layout strings

* Layout string instantiation, take and more

* Remove duplicate information from layout strings

* Include size of previous object in next objects offset to reduce number of increments at runtime

* Add support for existentials

* Build type layout strings with StructBuilder to support target sizes and metadata pointers

* Add support for resilient types

* Properly cache layout strings in compiler

* Generic resilient types working

* Non-generic resilient types working

* Instantiate resilient type in layout when possible

* Fix a few issues around alignment and signing

* Disable generics, fix static alignment

* Fix MultiPayloadEnum size when no extra tag is necessary

* Fixes after rebase

* Cleanup

* Fix most tests

* Fix objcImplementattion and non-Darwin builds

* Fix BytecodeLayouts on non-Darwin

* Fix Linux build

* Fix sizes in linux tests

* Sign layout string pointers

* Use nullptr instead of debug value
2023-02-24 15:40:28 -08:00
zoecarver
bdc37c9b46 [nfc][cxx-interop] Create and use custom metadata builder, visitor for foreign reference types. 2022-06-16 15:14:47 -07:00
John McCall
db8f23df74 Update the ABI for uniquing foreign type metadata.
- `swift_getForeignTypeMetadata` is now a request/response function.

- The initialization function is now a completion function, and the
  pointer to it has moved into the type descriptor.

- The cache variable is no longer part of the ABI; it's an
  implementation detail of the access function.

- The two points above mean that there is no special header on foreign
  type metadata and therefore that they can be marked constant when
  there isn't something about them that needs to be initialized.

The only foreign-metadata initialization we actually do right now is
of the superclass field of a foreign class, and since that relationship
is a proper DAG, it's not actually possible to have recursive
initialization problems.  But this is the right long-term thing to do,
and it removes one of the last two clients of once-based initialization.
2018-07-29 03:16:35 -04:00
Slava Pestov
e3ff63a289 IRGen: Rename addSuperClass() => addSuperclass() for consistency 2018-07-09 23:56:25 -07:00
Sho Ikeda
08644c1d8f [gardening][IRGen] Replace typedef with using 2018-03-27 09:06:33 +09:00
Doug Gregor
12a774abec [Runtime] Fill in the superclass of foreign class metadata.
When emitting foreign class metadata (e.g., for an imported CF type), fill
in the superclass when we have one. The superclass will itself be a foreign
metadata candidate, so also register an initialization function that uniques
the superclass metadata once we've picked the canonical foreign class
metadata.
2018-01-04 10:15:32 -08:00