Commit Graph

3744 Commits

Author SHA1 Message Date
Michael Ilseman
bd5189c25a [String] Grapheme fast paths for punctuation: 5-8x speedup.
Many strings use non-sub-300 punctuation characters (e.g. unicode
hyphen, CJK quotes, etc). This can cause switching between fast and
slow paths for grapheme breaking. Add in fast-paths for general
punctuation characters and CJK punctuation and symbol characters.

This results in about a 5-8x speedup for heavily (unicode) punctuated
Latiny and CJKy workloads.
2017-06-27 19:18:51 -07:00
Joe Groff
d07441651f Merge pull request #10556 from jckarter/key-path-optionals
KeyPaths: Add support for optional chaining/forcing components.
2017-06-26 18:57:42 -04:00
Nate Cook
1bae49950e Merge pull request #10491 from lorentey/sequence-doc-fix
[stdlib] Fix docs on Sequence.Iterator, .Element
2017-06-26 15:32:29 -05:00
Joe Groff
3c82e981f9 KeyPaths: Add support for optional chaining/forcing components.
rdar://problem/31768715
2017-06-26 09:40:31 -07:00
Antoine Cœur
3cc015bfe2 spelling 2017-06-25 10:42:21 +08:00
swift-ci
638cded005 Merge pull request #10481 from xwu/patch-1 2017-06-22 09:57:57 -07:00
Károly Lőrentey
5256d774ea [stdlib] Fix docs on Sequence.Iterator, .Element 2017-06-22 11:40:55 +02:00
Xiaodi Wu
f8688d2f97 Update DoubleWidth.swift.gyb 2017-06-21 20:03:48 -05:00
Xiaodi Wu
3916380e7c Prefix countRepresentedWords with underscore [NFC]
Per comments, `countRepresentedWords` is slated for eventual removal along with `_words(at:)`; it's not a part of SE-0104, so let's show users that it's not intended for public consumption.
2017-06-21 20:01:14 -05:00
Itai Ferber
41f93ca9d3 Improve runtime errors for conditional types 2017-06-21 15:52:31 -07:00
Max Moiseev
42e8491080 [stdlib] Default implementation for BinaryInteger._word(at:)
Temporarily addresses https://bugs.swift.org/browse/SR-5275
2017-06-21 13:46:16 -07:00
Joe Groff
860e3a4ca4 Merge pull request #10419 from jckarter/key-path-alignment
KeyPaths: Pointer-align pointer fields within key path patterns.
2017-06-20 19:44:10 -04:00
Joe Groff
752beac4f1 KeyPaths: Pointer-align pointer fields within key path patterns.
To get the full benefit of dyld3 on Darwin platforms, pointer relocations need to be pointer-aligned, which unfortunately requires growing some key path data structures a little bit. This does tidy up some code that had to hack around our lack of unaligned load/store operations on UnsafeRawPointer, at least. While we're here, we can also simplify the identification strategy for reabstracted stored properties; we only need the property index to identify, not the absolute offset. rdar://problem/32318829
2017-06-20 14:42:05 -07:00
Dave Abrahams
1da820da74 Merge pull request #10275 from natecook1000/nc-dict-grouping
[stdlib] Move Dictionary(grouping:by) down a level
2017-06-19 16:56:04 -07:00
Slava Pestov
0b35e49cd7 stdlib: Add another missing @_versioned annotation
We cannot diagnose uses of a non-public conformance yet, so this
was resulting in a linker failure.

Fixes <rdar://problem/32536790>.
2017-06-19 14:07:45 -07:00
Joe Groff
fe88bd5f3f KeyPaths: Correctly instantiate offsets for final stored properties in NSObject subclasses.
We need to use the ivar offset variables in this case, since the Swift field offset vector doesn't pick up the adjusted offsets from the ObjC runtime. Fixes SR-5036 | rdar://problem/32488871.
2017-06-16 14:42:32 -07:00
Nate Cook
695a7f975e [stdlib] Move Dictionary(grouping:by) down a level 2017-06-16 00:51:38 -05:00
Maxim Moiseev
a31e2bde14 Merge pull request #10097 from apple/stringprotocol-reform
[stdlib] Eliminate over-constraint on StringProtocol
2017-06-14 15:13:56 -07:00
Maxim Moiseev
651aaa8b54 Merge pull request #10206 from moiseev/unambiguous-bitpattern
[stdlib] Resolve the ambiguity for Int32.init(bitPattern:)
2017-06-14 11:34:32 -07:00
Graydon Hoare
fc3c5196bf Merge pull request #10237 from graydon/rdar-32547102-float-varargs-overflow-to-gp-args-area
Rdar 32547102 float varargs overflow to gp args area
2017-06-13 22:40:13 -07:00
Graydon Hoare
08503998ab [varargs] Don't put excess float varargs in GPR area, fix rdar://32547102 2017-06-13 20:25:45 -07:00
Graydon Hoare
8e6a775181 [varargs] Add comment to help future devs avoid losing a few hours. 2017-06-13 20:25:45 -07:00
Max Moiseev
90a20ea015 [stdlib] Resolve the ambiguity for Int32.init(bitPattern:)
When this initializer is invoked with an integer literal, the expression
is ambiguous, since both UIn32 and Float are
RepresentableByIntegerLiteral.

Fixes: https://bugs.swift.org/browse/SR-5176
2017-06-13 17:28:19 -07:00
Nate Cook
0ebf95b8ac Merge pull request #10209 from natecook1000/nc-fixes-75-3
Documentation edits
2017-06-13 16:21:42 -05:00
Nate Cook
825e9d077d [stdlib] More documentation revisions / consistency fixes. 2017-06-13 14:08:00 -05:00
Nate Cook
b7af9bfe83 [stdlib] Remove SeeAlso tags 2017-06-13 11:23:51 -05:00
John McCall
3578e20a1f Merge pull request #10213 from rjmccall/cf-create-is-plus-one
Annotate a couple of +1-returning functions appropriately
2017-06-12 23:15:50 -04:00
John McCall
eb6cebdfa2 Annotate a couple of +1-returning functions appropriately instead of
trying to compensate in the caller.

One of the callers was apparently not _cocoaStringSlice trying to compensate,
so this probably also fixes a leak.
2017-06-12 20:42:57 -04:00
Slava Pestov
88f33767c3 stdlib: Make _HeapBufferHeader @_versioned to fix resilient build 2017-06-12 14:41:45 -07:00
Nate Cook
0a7780c213 [stdlib] Various minor documentation revisions 2017-06-12 16:20:11 -05:00
Arjun Nayini
a3e94cc1d1 Merge branch 'master' into bugfix/SR-4172 2017-06-07 09:37:45 -07:00
Dave Abrahams
4bfa2bff24 Merge pull request #10131 from natecook1000/nc-dw-sep
[stdlib] Move DoubleWidth into its own file
2017-06-06 16:09:55 -07:00
Nate Cook
41ea7e296c Merge pull request #10113 from natecook1000/nc-dict-tuples
[stdlib] Add dictionary overloads for merging methods
2017-06-06 14:58:15 -07:00
Nate Cook
6133adc413 [stdlib] Move DoubleWidth into its own file 2017-06-06 08:54:15 -07:00
Roman Levenstein
ff1e770e6f Merge pull request #10126 from swiftix/inliner-improvements2
Re-factor Codable.decode functions to reduce the standard library code size
2017-06-05 21:36:42 -07:00
Roman Levenstein
890c2d5015 Re-factor Codable.decode functions to reduce the standard library code size
Move the error reporting slow-path into a separate function, which is not inlined or specialized.
This reduced the stdlib code size by almost 1%.
2017-06-05 16:28:37 -07:00
Nate Cook
b2e9d74d5a [stdlib] Add dictionary overloads for merge/merging methods
This resolves the issue where a dictionary can’t be passed to
the Dictionary.merge and .merging methods. rdar://problem/32352586
2017-06-05 15:54:11 -07:00
Maxim Moiseev
0c108340d1 Merge pull request #9367 from natecook1000/nc-doublewidth
[stdlib] DoubleWidth Implementation
2017-06-05 10:03:42 -07:00
Itai Ferber
71819ef4e0 Merge pull request #10105 from linqingmo/dictionary-decodable-fix
Dictionary decodable fix
2017-06-05 09:33:53 -07:00
sushangjin
279f4d9f8e ditionary-decodable-fix 2017-06-05 11:40:12 +08:00
Roman Levenstein
0f788727bf Merge pull request #10096 from swiftix/inliner-improvements2
Reduce code size of the stdlib
2017-06-04 20:29:13 -07:00
Dave Abrahams
eb04df45f4 [stdlib] Eliminate over-constraint on StringProtocol 2017-06-03 17:18:20 -07:00
Roman Levenstein
ecff16cba3 Reduce code size of the stdlib
This should reduce the code size of the stdlib by 1.5%.
2017-06-03 14:22:12 -07:00
Dave Abrahams
9050d74647 [stdlib] Inline fast paths of String append 2017-06-03 13:33:58 -07:00
Dave Abrahams
508e9a627d [stdlib] ASCII fastpath for UTF16.transcodedLength 2017-06-03 13:08:11 -07:00
Dave Abrahams
ceff7a5573 [stdlib] Rewrite UTF16.transcodedLength 2017-06-03 13:08:11 -07:00
Dave Abrahams
7db9ba8dd2 [stdlib] Replace UTF8.EncodedScalar
This is a way of testing infrastructure for an updated UTF8View iterator
2017-06-03 13:08:11 -07:00
Ben Cohen
d0c0043f93 [stdlib] Use ephemeral string for substring comparison (#10009)
* Use _ephemeralString for substring comparison

Add back != for String/Substring comparison

* OK fine, Linux, if you're going to be difficult

* Different forms of comparison, tests
2017-06-03 11:20:01 -07:00
Roman Levenstein
f98f1269be Merge pull request #10080 from swiftix/inliner-improvements2
[sil-generic-specializer] Do not specialize Mirror._superclassIterator to reduce the stdlib code size
2017-06-03 10:16:59 -07:00
swift-ci
dbad2eb785 Merge pull request #10082 from dabrahams/inline-character-comparison-fast-paths 2017-06-02 18:44:24 -07:00