Commit Graph

3606 Commits

Author SHA1 Message Date
swift-ci
6f511d66fb Merge pull request #9301 from eeckstein/fix-resilience-build 2017-05-04 18:11:24 -07:00
Erik Eckstein
a5ddde2d45 stdlib: make a few structs @_fixed_layout to fix the resilience build.
This is a follow-up fix for making struct constructors inline(__always) in
155db0a4bd: Let Character literals, which fit into 64 bits, be folded into a single integer constant.
and
d8f1caf4a6: Inline all the new low-level bits

If we decide that this structs should not have fixed layout we must re-evaluate the performance difference of not being able to inline
the struct constructors.
2017-05-04 16:08:08 -07:00
swift-ci
144dc55dca Merge pull request #9297 from apple/integrate-utf16 2017-05-04 15:49:37 -07:00
Dave Abrahams
bea71aa80e [stdlib] Legacy UTF16 decoding in terms of new components 2017-05-04 11:03:46 -07:00
Michael Ilseman
47d0247476 [stdlib] Speed up Character construction from CharacterView.subscript (#9252)
This adds a fast path for single-code-unit Character
construction. Rather than use the general purpose String based
initializer (which then repeats grapheme breaking to ensure a trap,
amongst other inefficiencies), just make the Character from the single
unicode scalar value directly.

This also speeds up simple iteration of BMP strings when the optimizer
is unable to eliminate the subscript. Around 2x for ASCII, and around
20% for BMP UTF16.
2017-05-04 06:59:30 -07:00
Doug Gregor
f5c9ee346f Merge pull request #9158 from natecook1000/nc-devert-dictionary
[stdlib] Dictionary/Set enhancements (redux)
2017-05-03 14:07:27 -07:00
swift-ci
edd13eca60 Merge pull request #9188 from apple/new-unicode-decoders 2017-05-03 11:38:25 -07:00
Itai Ferber
9e12b95862 Merge pull request #9231 from itaiferber/collection-codable-conformance
Add Dictionary and Set Codable conformance
2017-05-03 11:22:30 -07:00
Dave Abrahams
d8f1caf4a6 Inline all the new low-level bits 2017-05-03 09:53:30 -07:00
Erik Eckstein
155db0a4bd Let Character literals, which fit into 64 bits, be folded into a single integer constant.
This is done by ensuring that the corresponding Character constructor is inlined. llvm will do the constant folding.
Also add a test which checks this.

It makes character literals much faster (3x improvement for the CharacterLiteralsSmall benchmark)
And it removes _a lot_ of redundant code (~80% for the CharacterLiteralsSmall benchmark)
2017-05-03 09:10:21 -07:00
Ben Cohen
d8be7ae29e Use CF for Hashing (#9203) 2017-05-03 05:42:40 -07:00
Slava Pestov
e8f4930cb5 Merge pull request #9192 from slavapestov/anyobject-removal-vol-4
AnyObject removal volume 4
2017-05-02 22:03:44 -07:00
Joe Groff
7913e9821b Merge pull request #9214 from jckarter/keypaths-32-bit
Support key paths on 32-bit platforms.
2017-05-02 20:36:07 -07:00
Slava Pestov
b5721e8d8e AST: Remove AnyObject protocol 2017-05-02 19:45:00 -07:00
Dave Abrahams
c3391023a4 [stdlib] Inline integer parsing 2017-05-02 18:44:23 -07:00
Dave Abrahams
fe38ab1579 [stdlib] Inline var first default implementation 2017-05-02 18:36:04 -07:00
Joe Groff
525001f7a7 Support key paths on 32-bit platforms.
I had optimistically written the code here optimistically hoping #7837 would land in time for me to merge, but that didn't happen, so adjust some things to match the current 12-byte object header size on 32-bit, and introduce some ABI constants for the expected 32- and 64-bit object header sizes we can assert against so that we have some robustness when it eventually changes again. Implements rdar://problem/31768303.
2017-05-02 18:19:07 -07:00
Dave Abrahams
4e878a28b6 [stdlib] Inline _encodeSomeUTF8 2017-05-02 18:10:57 -07:00
Tony Parker
ff65a2b2a1 Revert "[stdlib] Reformatting and gybbification for Codable &co" 2017-05-02 17:06:51 -07:00
Itai Ferber
1eb73b3b62 Add Dictionary and Set {En,De}codable conformance 2017-05-02 17:03:48 -07:00
Dave Abrahams
b1ebc5cd48 [stdlib] Inline legacy UTF8.decode 2017-05-02 16:54:28 -07:00
Dave Abrahams
a9c8d415df [stdlib] Inline parseScalar 2017-05-02 16:54:28 -07:00
Dave Abrahams
e8cb3cabd8 [stdlib] Inline transcode() 2017-05-02 16:54:28 -07:00
Dave Abrahams
2226cbacc0 [stdlib] Inline all of IndexingIterator 2017-05-02 16:54:27 -07:00
Dave Abrahams
40b66e5935 [stdlib] Implement legacy UTF8 APIs in terms of new components 2017-05-02 16:54:27 -07:00
Dave Abrahams
f155d499c0 [stdlib] Drop redundant constraint 2017-05-02 16:54:27 -07:00
Jordan Rose
de969c66c6 [ClangImporter] Don't infer 'Comparable' for swift_wrapper. (#9120)
The underlying type's ordering may not be appropriate for the wrapped
type (think an ordered list whose underlying type is NSString).
Frameworks can always add a Comparable conformance explicitly.

We squeak out of this being a source-breaking change by virtue of
never having released a working version of it. Rintaro fixed the
ambiguity problems back in f11b74176b, but that was after the last
rebranch for Swift 3.1.

rdar://problem/30166538
2017-05-02 11:41:03 -07:00
Nate Cook
f7abeb0a66 [stdlib] GYB Codable and remove duplicated code 2017-05-02 02:31:13 -05:00
Nate Cook
443dbd727a [stdlib] Rename Codable.swift to .gyb 2017-05-01 23:05:10 -05:00
Nate Cook
cde3b920c1 [gardening] Indentation and comment formatting 2017-05-01 23:05:10 -05:00
Dave Abrahams
feea061d32 [stdlib] Move new Unicode decoders into the stdlib
No expected change in benchmarks, as legacy components aren't using this yet.
2017-05-01 17:08:08 -07:00
Max Moiseev
bfb1824f44 [stdlib] Adding the StringProtocol 2017-05-01 16:41:26 -07:00
Nate Cook
3f68f2876a Fix dictionary merge bug under optimization 2017-05-01 16:06:19 -05:00
Nate Cook
2e2e4d9bda Revert "Revert "[stdlib] Dictionary/Set enhancements""
This reverts commit 328ebe8567.
2017-05-01 16:06:14 -05:00
Max Moiseev
288eee0b1b [stdlib] New overload for joined()
Now that `String` conforms to the `BidirectionalCollection` protocol, in
the expression `let x = [""].joined()` the best matching overload for
`joined` is no longer the one returning `String`.

Fixes: <rdar://problem/31899440>
2017-05-01 12:41:57 -07:00
swift-ci
2dce594005 Merge pull request #9143 from apple/revert-9139-revert_8710 2017-04-30 18:49:17 -07:00
Ben Cohen
43211b602a [stdlib] De-gyb sorting (#9135)
* [stdlib] De-gyb sort algorithms

* [stdlib] Rename Sort.swift.gyb

* Update tests for de-gybbed sort
2017-04-30 18:11:27 -07:00
Ben Cohen
38903764df Revert "Revert "[stdlib] One-sided ranges and RangeExpression (#8710)"" 2017-04-30 16:47:23 -07:00
Arnold Schwaighofer
7d5d63eaf8 Revert "[stdlib] One-sided ranges and RangeExpression (#8710)"
This reverts commit 946b776e37.
2017-04-30 15:51:16 -07:00
Nate Cook
ad8d5a97ec [stdlib] Stop precounting lazily filtered collections (#8038)
This eliminates the counting step for a lazy filtered collection
when converting it into an array by treating the collection
as a sequence when copying elements. FlattenCollections already
have this behavior. (SR-4164)
2017-04-30 13:37:28 -07:00
swift-ci
8fea2f7ac2 Merge pull request #9134 from airspeedswift/delete-dead-code 2017-04-30 08:26:38 -07:00
ben-cohen
a7def4bba9 Delete old unused String._splitFirst 2017-04-30 06:04:15 -07:00
swift-ci
c24e1b2772 Merge pull request #9128 from rudkx/subscript-ambiguity 2017-04-29 17:50:13 -07:00
Mark Lacey
bcdf09d166 [stdlib] Disambiguate a subscript operation.
This is only flagged by some type checker changes that I have, but it
appears to be a legitimate ambiguity.
2017-04-29 17:15:02 -07:00
Ted Kremenek
09775ffa13 Merge pull request #9005 from itaiferber/foundation-encoders
Foundation Encoders
2017-04-29 15:51:48 -07:00
Dave Abrahams
0c61db5129 Merge pull request #9074 from apple/reverse-collection-iterator
Custom Reverse[RandomAccess]Collection.Iterator
2017-04-29 12:45:49 -07:00
Itai Ferber
7778fc2fb3 Fix encoding container linker errors
The box types were previously fileprivate because they lived in
the Foundation overlay. As part of the Swift stdlib, though, they need
to be internal so they can be linked against.
2017-04-29 12:18:49 -07:00
Ben Cohen
1163ea7c7a [stdlib] swapAt method (#9119)
* Add swapAt method

* Migrate sorting to swapAt

* Migrate further stdlib usage
2017-04-29 11:55:00 -07:00
Arnold Schwaighofer
328ebe8567 Revert "[stdlib] Dictionary/Set enhancements" 2017-04-29 07:02:57 -07:00
Itai Ferber
f7cd0a6343 Add Codable conformance to Array 2017-04-28 23:38:25 -07:00