Commit Graph

5263 Commits

Author SHA1 Message Date
Michael Ilseman
8b9cc18003 Merge pull request #20621 from milseman/unsafe_unchecked_buffer_pointer
[stdlib] Unchecked subscript on UnsafeBufferPointer
2018-11-26 10:31:04 -08:00
Karoy Lorentey
66db9b40b8 [stdlib] _HashTable.copyContents: Fix buffer overrun 2018-11-26 18:24:23 +00:00
Arjun Nayini
a15ecd0039 PR Feedback 2018-11-24 13:51:48 -08:00
Arjun Nayini
300124460f [SR-7076] Make ContiguousArray Codable
Implements Encodable and Decodable for ContiguousArray.
2018-11-24 09:09:55 -08:00
Karoy Lorentey
545fa5e640 [stdlib] Re-add previously synthesized hashing definitions 2018-11-22 17:15:36 +00:00
Karoy Lorentey
8bd56509b2 [stdlib] Add hashing methods to RawRepresentable to match == 2018-11-22 17:14:56 +00:00
Saleem Abdulrasool
ab37099967 Merge pull request #20686 from compnerd/alignment
stdlib: pass along alignment for dealloc
2018-11-21 09:34:14 -08:00
Saleem Abdulrasool
381cae6df0 stdlib: pass along alignment for dealloc
Ensure that UnsafeMutablePointer.deallocate has the alignment that was
used when invoking UnsafeMutablePointer.allocate.  This is required to
ensure that the appropriate `free` function is invoked.  We would
previously fail on Windows as the allocation would use `malloc` and due
to the value being `-1`, use `_aligned_free` instead when deallocating.
2018-11-20 14:05:13 -08:00
Karoy Lorentey
694b153992 Merge pull request #20643 from lorentey/string-32-simple
[stdlib] _StringObject: Use a full 8-bit discriminator on 32-bit platforms
2018-11-20 17:50:53 +00:00
Karoy Lorentey
ef76bcf7cf [stdlib] Don’t change the 64-bit ABI 2018-11-20 12:11:34 +00:00
Mark Lacey
9e7d7d0b8e Merge pull request #20659 from rudkx/add-designated-types-for-logical-and-ranges
Update Policy.swift with designated types for logical and range operators.
2018-11-17 22:59:54 -08:00
Mark Lacey
b7626d7ccf [stdlib] Update Policy.swift with designated types for logical and range operators. 2018-11-17 20:18:28 -08:00
swift-ci
89950feea9 Merge pull request #20651 from milseman/spurious_inlinable 2018-11-16 19:16:20 -08:00
Lance Parker
8306ef322a Merge pull request #20585 from lancep/spotFixForStringCompCrash
[stdlib] properly promote stack buffer to heap buffer when necessary
2018-11-16 19:05:35 -08:00
Michael Ilseman
18e415b4c0 [String] CJK Grapheme breaking fast-paths for fullwidth
Add in grapheme breaking fast-paths for fullwidth forms and
punctuation. Extend non-combining kana fast-paths to include vowel
extender.
2018-11-16 16:27:20 -08:00
Mark Lacey
2c15dc2d1c Merge pull request #20625 from rudkx/designated-types-array
[ConstraintSystem] Add Array as a designated type for `+` and `+=`.
2018-11-16 15:28:34 -08:00
Michael Ilseman
8b1464a984 [String] Drop spurious @inlinable 2018-11-16 15:08:20 -08:00
Michael Ilseman
3a0ac0270d [stdlib] Unchecked subscript on UnsafeBufferPointer
Add a use an unchecked subscript on UnsafeBufferPointer, which skips
debugPrecondition checks (in case we're not inlined) as well as a
force-unwrap check.
2018-11-16 11:12:29 -08:00
Lance Parker
fc3341eddc fixup rebase 2018-11-16 11:07:30 -08:00
Mark Lacey
d3b660d907 [stdlib] Remove FIXMEs from Array extension. 2018-11-16 11:03:55 -08:00
Karoy Lorentey
3b748933f1 [stdlib] _StringObject: Use a full 8-bit discriminator on 32-bit platforms
We now have plenty of extra inhabitants in the variant enum, so we can get rid of the 7-bit hack.

It’d also be possible now to increase small string capacity to a spacious 11 bytes; however this needs a full overhaul of the 32-bit representation, so it needs a little bit more time in the oven.
2018-11-16 18:36:03 +00:00
Lance Parker
f9aa78761f Moar feedback 2018-11-16 10:21:33 -08:00
Lance Parker
12bf2978e3 Michael's feedback 2018-11-16 10:20:46 -08:00
Lance Parker
0009b21533 properly promote stack buffer to heap buffer when necessary 2018-11-16 10:19:48 -08:00
Doug Gregor
cc2ee165a1 [ABI] Use generic environment to handle mangled generic keypath types.
Always use mangled type names to represent type metadata in keypath patterns.
For generic types, use the generic environment to pull substituted types
from the instantiation arguments.

Finishes the type metadata part of rdar://problem/38038799.
2018-11-16 10:13:07 -08:00
Doug Gregor
f759296cc8 [Keypaths] Encode generic environment in the key-path pattern.
Extend the key-path pattern with a representation of the generic environment
of the key-path, which includes the generic parameters and generic
requirements of the environment.
2018-11-16 10:13:06 -08:00
Mark Lacey
d7cf830842 [ConstraintSystem] Add Array as a designated type for + and +=.
Also add overloads for these operators to an extension of Array.

This allows us to typecheck array concatenation quickly with
designated type support enabled and the remaining type checker hacks
disabled.
2018-11-15 21:42:33 -08:00
Ben Cohen
f86fc100a5 Ditch the underscore 2018-11-15 20:55:10 -08:00
Ben Cohen
7df1587c27 Restore LazyCollection, but deprecated 2018-11-15 20:54:13 -08:00
Ben Cohen
1673c12d78 [stdlib] Replace "sanityCheck" with "internalInvariant" (#20616)
* Replace "sanityCheck" with "internalInvariant"
2018-11-15 20:50:22 -08:00
swift-ci
f093925036 Merge pull request #20452 from Catfish-Man/stringtrampolines 2018-11-15 17:55:34 -08:00
swift-ci
126f9d7773 Merge pull request #20610 from DougGregor/abi-symbolic-accessor-ref-2-byte 2018-11-15 17:30:19 -08:00
swift-ci
f76d920709 Merge pull request #20612 from DougGregor/runtime-demangle-to-metadata-overriode 2018-11-15 17:16:29 -08:00
David Smith
8bb6b78e36 Use super trampolines to let us override several more NSString methods (-UTF8String, -cStringUsingEncoding:, and -getCString:maxLength:encoding:) for performance 2018-11-15 17:10:51 -08:00
Doug Gregor
723b56e64f [Standard library] Simplify _getTypeByMangledName.
Simplify the signature of the internal _getTypeByMangledName() used by the
standard library to what we actually (currently) use. Drop it as a
compatibility override, because it’s not a useful place to introduce
customization.
2018-11-15 16:10:11 -08:00
Doug Gregor
3eb171d814 [ABI] Ensure that symbolic references to accessor functions are 2-byte aligned
When we emit "false" symbolic references to accesors for conformances or
type metadata, ensure that we end up with two-byte-aligned symbolic
references. This addresses a problem with ARM+Thumb compilation where the
low bit wasn't getting set for Thumb code.

Fixes rdar://problem/46067353.
2018-11-15 14:51:55 -08:00
Michael Ilseman
f9e6df312a Implement SE-0221: Character Properties (#20520)
Provide convenience properties on Character.
2018-11-15 14:03:49 -08:00
Michael Ilseman
0a5177d778 Merge pull request #20605 from milseman/abi_publishing
Finish String and Unicode ABI audit
2018-11-15 14:03:28 -08:00
Karoy Lorentey
7df40769a4 Merge pull request #20509 from lorentey/not-quite-shadowy-enough
[stdlib] Unexport shadow protocols
2018-11-15 20:09:26 +00:00
swift-ci
d6a9f30882 Merge pull request #20601 from milseman/stringinable 2018-11-15 12:09:03 -08:00
Doug Gregor
041ffe82d4 [Standard library] Eliminate some newly-introduced warnings. 2018-11-15 11:21:42 -08:00
Doug Gregor
a53b2e285c [Standard library] Drop _typeByMangledName().
This underscored function was only intended for testing; drop it from the
ABI. We’re keeping _typeByName because it’s used by Foundation.
2018-11-15 11:06:52 -08:00
Michael Ilseman
63fe485758 [String] Audit and publish the rest of the ABI 2018-11-15 11:06:33 -08:00
Michael Ilseman
cd35876fa5 [Unicode] Publish Unicode ABI
De-genericize one axis of storage buffers to speed up compilation time
of stdlib and user code. Publish the rest as ABI, since we're out of
time to reevaluate the design.
2018-11-15 11:06:33 -08:00
Michael Ilseman
c749123297 [String] DCE and drop inlinable
Remove some more inlinable annotations and drop dead code.
2018-11-15 11:06:30 -08:00
Lance Parker
739169dc77 Merge pull request #20369 from lancep/ArrayCastInlinableAudit
[stdlib]Remove unneeded @inlinable attributes from the array casts
2018-11-15 10:59:48 -07:00
Michael Ilseman
034f76d10b [String] Remove some unneeded inlinable annotations 2018-11-15 09:43:34 -08:00
Karoy Lorentey
d707b0beeb [stdlib] Re-add dummy versions of _NSSetCore and _NSDictionaryCore on non-ObjC platforms 2018-11-15 09:54:25 +00:00
Karoy Lorentey
93a3ebe509 [stdlib] Make the rest of the shadow protocols internal
These shadow protocols don’t add any real type safety, and exposing them in the ABI seems unnecessary.
2018-11-15 09:54:25 +00:00
Karoy Lorentey
c4c4c17871 [stdlib] _BridgeStorage: Remove second type parameter (ObjCClass)
It used to be a shadow protocol existential, but now it’s invariably AnyObject.
I see no reason to keep supporting this unused abstraction.
2018-11-15 09:54:25 +00:00