ObjC pointer types as UncheckedOptional.
Some of these changes are totally necessary; others may
simply reflect language/implementation work that hasn't
been done yet.
If anything seems particularly objectionable, bugs welcome.
Swift SVN r15783
Language features like erasing concrete metatype
values are also left for the future. Still, baby steps.
The singleton ordinary metatype for existential types
is still potentially useful; we allow it to be written
as P.Protocol.
I've been somewhat cavalier in making code accept
AnyMetatypeType instead of a more specific type, and
it's likely that a number of these places can and
should be more restrictive.
When T is an existential type, parse T.Type as an
ExistentialMetatypeType instead of a MetatypeType.
An existential metatype is the formal type
\exists t:P . (t.Type)
whereas the ordinary metatype is the formal type
(\exists t:P . t).Type
which is singleton. Our inability to express that
difference was leading to an ever-increasing cascade
of hacks where information is shadily passed behind
the scenes in order to make various operations with
static members of protocols work correctly.
This patch takes the first step towards fixing that
by splitting out existential metatypes and giving
them a pointer representation. Eventually, we will
need them to be able to carry protocol witness tables
Swift SVN r15716
All of the malloc zone APIs are clumsy object-oriented design in C, but that
does not mean we should be too. This should clarify the design more too.
Swift SVN r15690
Good:
* We now no longer wrap the system malloc zone.
* Tiny allocation quantum is pointer sized, not 16 bytes.
* Far less metadata overhead than the system malloc zone.
Bad:
* Our heap density isn't quite as good as the default zone. This is a O(1)
versus O(N) tradeoff. The default malloc zone has been trending in this
direction too.
TODO:
* Introspection
* Tune secondary fast paths
* Huge allocations
Swift SVN r15269
Playgrounds want to be able to represent numbers different from strings, so provide different tags for types that represent numbers distinct from strings. Set up the Int and Double mirrors to return quick look objects of the appropriate cases, and hook up the magic ObjC mirror to do the same for NSNumbers. <rdar://problem/16360758>
Swift SVN r15219
Only the bits that actually need to grovel metadata really need to be written in C++, so define away hopefully most of the potential for memory safety or corruption bugs from screwing up calling convention matchups by moving most of the magic mirror implementations into pure Swift.
Swift SVN r15180
We'll need to apply the same tricks we're using for Array to Dictionary
and String, so prepare to generate base classes for those buffers as
well. Actually generate and use the one for Dictionary, but don't
actually bridge it yet.
Swift SVN r15167
We want the metadata of the ObjC class, not the opaque Builtin.ObjCPointer metadata. This allows the Any to actually be downcast to an expected type on the client side.
Swift SVN r15009
Add 'Sound', 'Color', and 'BezierPath', as requested by Enrico, as well as a '_Raw' case that can be used for internal experimentation.
Swift SVN r14978
malloc_size() also is used to determine which zone owns a given allocation.
<rdar://problem/16293435> malloc_size is getting called recursively
Swift SVN r14928
Implicit conversions to and from an unsigned long long enum class give us the calling convention we want for swift_allocBox without totally destroying the API for C callers.
Swift SVN r14919
Playgrounds want to present aggregate-like values with fixed children, such as structs and classes, differently from container-like values with variable amounts of children, like arrays and dictionaries, so add a property to Mirror that describes the disposition of the value being reflected.
Swift SVN r14827