Commit Graph

16 Commits

Author SHA1 Message Date
Joe Groff
27f49cd19d Runtime: Optional-like enums with single-refcounted payloads can share the refcounted value witnesses.
swift_retain and objc_retain both handle nil already, so we can bypass the generic Optional value witnesses when instantiating Optional on a class type, which happens kind of a lot.

Swift SVN r23613
2014-12-02 17:34:36 +00:00
Graham Batty
7b71be3fc9 Fix non-objc implementation of getRootSuperclass and isObjCTaggedPointer.
Swift SVN r23329
2014-11-14 21:18:25 +00:00
Joe Groff
4c0e64f1da Handle class-constrained generic class-to-objc-existential casts.
Fixes rdar://problem/18638625.

Swift SVN r23324
2014-11-14 19:51:20 +00:00
Graham Batty
d15c24e25b Changes to runtime library to support non-objc targets
Swift SVN r23122
2014-11-05 23:17:07 +00:00
Joe Groff
01554448fc Runtime: Walk up superclass chains to find class conformances.
Swift SVN r23065
2014-11-02 15:41:00 +00:00
Joe Groff
26eae4743a Runtime: Conditionalize the ObjC-bridging parts of bridgeObjectRetain/Release.
If there's no ObjC runtime to interop with, then there's no need to handle tagged pointers or the native refcounting bit.

Swift SVN r23019
2014-10-30 21:18:53 +00:00
Greg Parker
c6a88262cf [stdlib] Scrap bit-rotted FastEntryPoints.s. Rewrite refcounts using __atomic.
Generated code on x86_64 for swift_retain and swift_release and 
swift_allocObject are unchanged. arm64 is improved by using weaker 
memory barriers, fixing rdar://17423624.


Swift SVN r22887
2014-10-23 08:22:48 +00:00
Dave Abrahams
cc9bc0c274 [stdlib] Kill _swift_isUniquelyReferenced @asmname
Swift SVN r22576
2014-10-07 21:40:48 +00:00
Graham Batty
9ce17cfdb1 Stub implementation of _swift_classConformsToObjCProtocol
Swift SVN r22529
2014-10-05 20:10:59 +00:00
John McCall
590c25479d Use isa-masking to read the class object pointer from
instances of Swift subclasses of ObjC classes.

We were already doing this in the runtime.  This patch
unhides the runtime's mask word (swift_isaMask) and makes
IR-gen take advantage of it when it can.

Swift SVN r21592
2014-08-29 21:36:53 +00:00
Dave Abrahams
0085b94509 [stdlib] AnyObject wrapper for bridging purposes
As part of the evolution toward a one-word array layout, create a type
that can be used to efficiently store Cocoa or Native class instances
and discriminate between them.

Swift SVN r21469
2014-08-27 00:04:25 +00:00
John McCall
77ea35ab46 Introduce a flag to mark classes with Swift-native
refcounting and take advantage of it.

Also, set the Swift1 flag in classes we generate.

Also, initialize a global cache of the non-pointer-isa
mask and use that instead of object_getClass, at least
within the runtime.

Also, centralize the runtime on a _swift_getSuperclass
function and make that use a direct access while we
await word from Greg on the desired ABI requirements.

Swift SVN r21077
2014-08-06 21:51:45 +00:00
John McCall
9890d8bca0 Add swift_dynamicCast.
This is the most general dynamic cast operation, permitting
arbitary source and destination types and handling arbitrary
changes in representation.  A value of the destination type
is constructed in an address provided by the caller; flags
control the behavior w.r.t. the source value.

Not yet used; probably buggy in various particulars.

Swift SVN r18815
2014-06-12 00:13:13 +00:00
John McCall
329abe543d Pass an alignment mask during heap array allocation,
not an alignment value.

Assert that various entrypoints get an alignment mask.

Get everything uniformly passing an assertion about
dealloating an object with the correct allocation
size; don't actually enable the assertion yet, though.

rdar://16989632

Swift SVN r18550
2014-05-22 01:58:05 +00:00
John McCall
059ed4cd10 Propagate alignment arguments around through the
slow allocation/deallocation APIs.

Swift SVN r18160
2014-05-16 01:40:36 +00:00
John McCall
b77c430848 Add SIL-gen and some missing runtime support for [unowned].
Swift SVN r6881
2013-08-03 08:46:54 +00:00