Commit Graph

3590 Commits

Author SHA1 Message Date
Dave Abrahams
3a7a30a822 Merge pull request #10059 from apple/utf16-small-character
[stdlib] Encode small Characters as UTF-16
2017-06-02 11:49:40 -07:00
swift-ci
5ecbde9a42 Merge pull request #10051 from apple/debug-only-single-grapheme-check 2017-06-02 11:37:33 -07:00
Arnold Schwaighofer
3f7fcfadeb Address review comments
Rename _parseASCIIOutlined to _parseASCIISlowPath.
Change doc comment to regular comment.
2017-06-02 11:27:42 -07:00
Dave Abrahams
51bf3a615f [stdlib] Make single-grapheme check debug-only
Because of the way grapheme breaking changes across updates to ICU and the Unicode standard, it may not even be legit to check this at all.  It's certainly not unsafe to skip the check, so let's see if we can do that in release builds, as grapheme breaking is expensive.
2017-06-02 09:53:22 -07:00
Arnold Schwaighofer
d289236f79 stdlib: Move _parseASCIIOutlined into the FixedWidthInteger extension 2017-06-02 07:24:20 -07:00
Dave Abrahams
2778dc85ea Add and use _ExpressibleByBuiltinUTF16ExtendedGraphemeClusterLiteral 2017-06-02 07:01:03 -07:00
Roman Levenstein
d6bddd20b9 Merge pull request #10040 from swiftix/inliner-improvements2
[sil-generic-specializer] Add @_semantics("optimize.sil.specialize.generic.partial.never") to disable partial specialization on specific functions
2017-06-01 21:56:10 -07:00
Dave Abrahams
562fd79aa6 [stdlib] Encode small Characters as UTF-16
This takes care of the standard library portion, but we need a new
BuiltinUTF16ExtendedGraphemeClusterLiteralConvertible protocol in order to
fully recover the performance of character literals.

Note that part of the character_literals.swift test is currently disabled.  That
will need to be fixed before we can merge this work.
2017-06-01 20:57:25 -07:00
Roman Levenstein
00d663d172 [sil-generic-specializer] Add @_semantics("optimize.sil.specialize.generic.partial.never") to disable partial specialization on functions
This new @_semantics is used to annotate some very big functions in the standard library. It reduced the code size of the stdlib by 2%.
2017-06-01 16:33:18 -07:00
Arnold Schwaighofer
d457adb776 stdlib: Outline integer parsing code in FixedWidthInteger.init(_: radix:) on the slow paths
This reduces code size by 20k on an app that uses this function.

rdar://32519912
2017-06-01 15:18:54 -07:00
Ben Cohen
28c470da45 Test if two ascii string pointers are equal before memcmp (#10018) 2017-06-01 15:01:42 -07:00
Nate Cook
42efcdb246 One more from @xwu + 80-column fixes 2017-06-01 12:53:05 -05:00
Michael Ilseman
022c973d77 Merge pull request #10002 from milseman/i_dream_of_grapheme
[stdlib] Grapheme break fast-paths for Cyrillic, Arabic, Hangul
2017-06-01 08:59:25 -07:00
Dave Abrahams
b2e4bd5d09 [stdlib] Replace _HeapBuffer with a thin wrapper
...over ManagedBufferPointer
2017-06-01 04:40:52 -07:00
Dave Abrahams
ce804529a1 [stdlib] Dump _StringStorage.grow()
This implementation detail was adding lots of needless complexity
2017-05-31 16:12:22 -07:00
Michael Ilseman
44cccba22d [stdlib] Change dynamic check to sanity check.
Double-checking for CR-LF is redundant in
_internalExtraCheckGraphemeBreakBetween. Add in a sanity check and
omit the overly conservative CR check.
2017-05-31 14:55:24 -07:00
Michael Ilseman
0a88de53d3 [stdlib] Grapheme break fast-paths for Cyrillic, Arabic, Hangul
Add in more grapheme break fast paths for scripts based on Cyrillic,
Arabic, or Hangul. Generates significant performance wins, similar to
those for the unihan fast paths.

While every extra check does slow down the runtime of
_internalExtraCheckGraphemeBreakBetween as currently implemented, I've
not found the performance cost to be relevant for workloads with
occasional mixed emoji contents, nor for workloads that his the
earlier checks. A pure Korean workload (currently the last check) does
pays a rather noticable price for the previous checks, but this is
only because the workload is now so greatly improved. Optimizing this
implementation is interesting future work, but not urgent.
2017-05-31 11:09:43 -07:00
swift-ci
9e76bc371d Merge pull request #9771 from Jnosh/patch-1 2017-05-30 13:09:15 -07:00
Maxim Moiseev
6c836dbd04 Merge pull request #9949 from moiseev/renames
[stdlib] Renames and tests for Swift 3 compatibility mode
2017-05-30 10:26:01 -07:00
Max Moiseev
53004a1015 [stdlib] Renames and tests for Swift 3 compatibility mode
Addresses <rdar://problem/32432481>
2017-05-26 16:28:11 -07:00
Max Moiseev
612a07fc73 [stdlib] Fixing build with -swift-stdlib-enable-resiliency
Fixes: <rdar://problem/32409661>
2017-05-26 13:18:00 -07:00
Janosch Hildebrand
ba067aa9c8 [Documentation] Add missing 'of' to UnicodeScalar documentation. 2017-05-26 21:23:04 +02:00
Joe Groff
8022266404 Merge pull request #9933 from jckarter/partial-key-path-application
Support application of AnyKeyPath/PartialKeyPath.
2017-05-26 08:45:55 -07:00
Nate Cook
2612e00eaf Additional notes from @xwu 2017-05-26 08:46:42 -05:00
Nate Cook
2f9bf3cb1c Add an abstract for DoubleWidth 2017-05-25 18:38:45 -05:00
Nate Cook
1149eeac16 Incorporate feedback from @moiseev
- Also clean up some 80-column issues
- And improve some tests from before literal expressibility
2017-05-25 18:32:15 -05:00
Dave Abrahams
4cb60a0873 Merge pull request #9915 from apple/swift-3-api-preserving-changes
Swift 3 api preserving changes
2017-05-25 16:31:36 -07:00
Joe Groff
cdc7a5c945 Support application of AnyKeyPath/PartialKeyPath.
rdar://problem/32237567
2017-05-25 15:51:22 -07:00
Nate Cook
237d8775dc Catch overflow into high bit in signed multiplication 2017-05-25 15:04:34 -05:00
Nate Cook
e5fb87128e Revert multipliedFullWidth for 64-bit ints on 32-bit platforms 2017-05-25 03:47:52 -05:00
practicalswift
0d2b0cc666 Merge pull request #9911 from practicalswift/gardening-20170524
[gardening] Add copyright header. Fix \t:s and spacing. Use isa instead of dyn_cast where appropriate.
2017-05-25 08:06:56 +02:00
Nate Cook
5ab34bf6f0 Add floating-point initializers and tests 2017-05-24 19:16:26 -05:00
Nate Cook
06490e6a44 Shortcut on binary division 2017-05-24 19:16:26 -05:00
Nate Cook
7353042a4f Fix overflow issue 2017-05-24 19:16:26 -05:00
Nate Cook
1e59f65a91 Implement tricky full-width multiply/divides 2017-05-24 19:16:26 -05:00
Nate Cook
2edbb085d0 Fix overflow issues 2017-05-24 19:16:26 -05:00
Nate Cook
788f4e81b6 Add recursive constraints for integer Magnitude 2017-05-24 19:16:26 -05:00
Nate Cook
b935be828c Remove endian operations from fixed-width ints 2017-05-24 19:16:26 -05:00
Nate Cook
b72449bc72 Provide implementations or masking bitshift operators 2017-05-24 19:16:26 -05:00
Nate Cook
a539919052 Add negation operator/method to DoubleWidth 2017-05-24 19:16:26 -05:00
Nate Cook
c866bcf3d4 Convert endian symbols to default implementations 2017-05-24 19:16:26 -05:00
Nate Cook
b2676f90ca Use literals instead of DoubleWidth inits 2017-05-24 19:16:26 -05:00
Nate Cook
8926df9bbc [stdlib] Partial implementation of DoubleWidth 2017-05-24 19:16:26 -05:00
Dave Abrahams
807410b99e [stdlib] Make String("...") non-failable in Swift 4 2017-05-24 16:11:34 -07:00
Dave Abrahams
6cea7c1b5d [stdlib] Correct constraints on disambiguating overload
/cc @moiseev
2017-05-24 16:11:16 -07:00
Dave Abrahams
801b9c5544 [stdlib] Move specialization from init to append
Since init just calls append anyway, it's 2 birds/1 stone
2017-05-24 16:10:34 -07:00
Pavol Vaskovic
f123404f95 Every dot counts. Period. 2017-05-25 00:08:19 +02:00
practicalswift
1283248ebd [gardening] Add missing copyright header 2017-05-24 21:27:28 +02:00
Dave Abrahams
52cf9e52c4 Merge pull request #9811 from palimondo/struct-the-class
[stdlib] Sequence internals with struct instead of class.
2017-05-24 12:05:34 -07:00
Dave Abrahams
794a287c27 Kill a stray TAB
How'd that get in there?

Thanks, @moiseev
2017-05-24 04:10:25 -07:00