Commit Graph

65 Commits

Author SHA1 Message Date
Doug Gregor
0f3d1062aa Implement -_cfTypeID on SwiftObject.
This allows us to use CFGetTypeID() on a Swift-native class. This is
the simplest part of <rdar://problem/18088474>.

Swift SVN r21367
2014-08-21 17:59:31 +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
Joe Groff
8e093f1bcb Runtime: Fix logic inversion in objc_rootWeakRetained (which is really UnownedRetain).
We want to initialize the side weak reference the first time we retain a new unowned reference, not reinitialize the weak reference every time we retain it. Unowned @objc references are still racy, but this fixes the obvious brokenness behind <rdar://problem/17623813>.

Swift SVN r21074
2014-08-06 21:19:17 +00:00
Greg Parker
fe8618a3d2 Scrap the custom allocator until we have time to fix it.
The allocator's crimes include:
* It uses OS SPI that must not be used by non-OS apps.
* It does not play well with memory debugging tools like Instruments.
* It does not return memory to the OS in response to memory pressure.
* It is less tested than we would like because many configurations 
  inadvertently turn it off (such as running from Xcode).
* Its per-thread magazine implementation does not actually work.
* Its "try alloc" flag is incompletely implemented and never used.
* Its "zero fill" flag is unimplemented and inconsistently used.



Swift SVN r20757
2014-07-30 14:11:40 +00:00
John McCall
934527a029 Eliminate all uses of the typeof value witness.
Swift SVN r20734
2014-07-30 04:40:58 +00:00
Greg Parker
dc407c6235 [runtime] Improve unrecognized-selector error message for pure-Swift classes.
Swift SVN r20577
2014-07-25 23:42:29 +00:00
Greg Parker
e473436383 [runtime] Remove workaround for Swift marker bit in ObjC class data.
arclite and libobjc now preserve this bit.


Swift SVN r20568
2014-07-25 22:49:12 +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
5c3f40c301 Use a data structure with stable pointers for the Objective-C
unowned reference side table.

rdar://16981772

Swift SVN r18476
2014-05-21 00:22:02 +00:00
Greg Clayton
2a74838159 Extensions to Objective-C objects fail in REPL if the class is not already initialized and LLDB now gets Objective C categories and extensions initialized properly.
Prior to this fix this would fail:
(swift) import Foundation
(swift) extension NSDate { func foo() { println("foo") }}   

As the Class for NSDate was not initialized.

<rdar://problem/16934080>



Swift SVN r18206
2014-05-16 19:49:41 +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
Dmitri Hrybenko
eb9c3a406d stdlib/runtime: implement bridgeFromObjectiveC()
Swift SVN r18070
2014-05-14 13:40:46 +00:00
Dave Zarzycki
cf4fbe33f5 Heap: Checkpoint leaks/heap/vm_map support
Huge allocation leaks are detected correctly.
Tiny allocation leaks are problematic, both false positive and false negative.

For example:

leaks Report Version:  2.0
Process 73345: 4980 nodes malloced for 1677 KB
Process 73345: 1 leak for 1048576 total leaked bytes.
Leak: 0x10aed0000  size=1048576  zone: SwiftZone_0x10adc35d8

Swift SVN r18007
2014-05-13 16:28:44 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Dmitri Hrybenko
ea43c46262 Splitting the standard library: move runtime -> stdlib/runtime
Swift SVN r5887
2013-06-28 22:41:38 +00:00