Commit Graph

19 Commits

Author SHA1 Message Date
Dave Abrahams
6506068262 [stdlib] Update a comment
We have Builtin.BridgeObject now, so eliminate the "someday..." phrasing

Swift SVN r24806
2015-01-28 21:55:04 +00:00
John McCall
3be27ad22b Adopt safe addressors in Swift's Array family of types.
rdar://190323998

Swift SVN r24599
2015-01-21 09:12:49 +00:00
Joe Groff
b60a30c84b stdlib: Make isUniquelyReferenced shims properly return bool.
rdar://problem/18573806 is fixed.

Swift SVN r23547
2014-11-22 05:36:38 +00:00
Dave Abrahams
15e195943e [stdlib] BridgeStorage: uniqueness check fast path
When we know we've got a native object and no spare bits set, we can use
a faster check for uniqueness.

Swift SVN r23506
2014-11-21 01:39:55 +00:00
Dave Abrahams
bf233c5b46 [stdlib] BridgeStorage: rename a property
This name is more consistent with the convention used throughout the
runtime: use underscores to separate the preconditions of partial
functions from the rest of their names.

Swift SVN r23505
2014-11-21 01:39:55 +00:00
Dave Abrahams
de8967e2cd [stdlib] Copious force-inling
Just trying to remove possible overheads in the new Array
implementation.  It doesn't seem to affect performance, though.

Swift SVN r23504
2014-11-21 01:39:54 +00:00
Dave Abrahams
1ed31fa31a [stdlib] Fix BridgeStorage!
Fix the test so it actually runs, then fix all the bugs it finds, then
extend the test to cover the no-bits-fast-path functionality.

Swift SVN r23466
2014-11-20 03:41:10 +00:00
Dave Abrahams
44a18861b6 [stdlib] BridgeStorage: no-bits fast path
When there's static knowledge that no spare bits are to be set, it's
faster to use that knowledge.  We need a proper builtin to let us drop
the reinterpretCasts.

Swift SVN r23465
2014-11-20 03:41:09 +00:00
Dave Abrahams
4785e7b2e9 [stdlib] Explicit keywords for BridgeStorage.init
This improves clarity of usage, especially when we add a fast
constructor for the "native with no spare bits set" case.

Swift SVN r23460
2014-11-20 01:05:39 +00:00
Dave Abrahams
68fbea2988 BridgeObject: native object with no spare bits set
Naturally, the fast path for things like Array<Int> has to be that no
masking is required to get at the buffer.  Therefore, the state with no
spare bits set needs to be reserved for native objects.  After the
change, an ObjC non-tagged pointer is stored with all spare bits set, and
native objects are stored with 0..<N bits set, where N is the number of
spare bits.  ObjC tagged pointers are still stored verbatim.

Swift SVN r23430
2014-11-19 06:07:19 +00:00
Dave Abrahams
726aba123a [stdlib] BridgeStorage optimizations
Stop trafficking in optionals and using checked arithmetic; the
optimizer doesn't like that.  Also drop a needless cast, fix up some
names, and accept a native 2nd argument.  Only classes imported from
ObjC actually have non-native refcounting, and we don't really care
about enforcing that for the 2nd argument.  It's just expected to be a
possibly-non-native class.

Swift SVN r23396
2014-11-18 02:46:09 +00:00
Dave Abrahams
9d6cccbf11 Revert "[stdlib] Workarounds for <rdar://18992875>"
This reverts commit r23361 now that Joe fixed the problem

Swift SVN r23388
2014-11-17 22:54:39 +00:00
Dave Abrahams
d7689759f9 [stdlib] BridgeStorage: rename uniqueness check
The name should reflect the fact that the check only ever returns true
in the native case.

Swift SVN r23362
2014-11-17 02:15:27 +00:00
Dave Abrahams
f7ae19f7b9 [stdlib] Workarounds for <rdar://18992875>
Some brutal casting and type punning can get us past this bug, for now.

Swift SVN r23361
2014-11-17 02:15:26 +00:00
Dave Abrahams
4111b94d1f [stdlib] _BridgeStorage: use Builtin.BridgeObject
Swift SVN r23348
2014-11-15 01:54:53 +00:00
Graham Batty
dc6a776d10 stdlib: Use config directives to work without objective-c.
Swift SVN r23211
2014-11-10 20:06:25 +00:00
Graham Batty
373414864d Revert "Use config directives to carve out a 'portable' kernel stdlib."
This reverts commit r23202 pending further discussion.

Swift SVN r23205
2014-11-10 18:46:42 +00:00
Graham Batty
dfa260fab1 Use config directives to carve out a 'portable' kernel stdlib.
Swift SVN r23202
2014-11-10 18:03:09 +00:00
Dave Abrahams
8a27fb8178 [stdlib] Integrate BridgeStorage into the stdlib
We're going to use it for Array internals.  When we do, it should be
expected to cause a performance hit on arrays of value types until
rdar://18125016 is handled.

Swift SVN r22784
2014-10-15 23:32:44 +00:00