Commit Graph

7762 Commits

Author SHA1 Message Date
swift_jenkins
6887dfcca4 Merge remote-tracking branch 'origin/main' into next 2022-02-17 10:01:03 -08:00
Arnold Schwaighofer
62ec31a462 Merge pull request #41338 from aschwaighofer/reuse_contiguous_array_storage_metadata
Reuse `_ContiguousArrayStorage<AnyObject>` metadata for any class or objc generic type
2022-02-17 12:47:23 -05:00
swift_jenkins
f649deeafd Merge remote-tracking branch 'origin/main' into next 2022-02-17 09:41:05 -08:00
Philippe Hausler
e675b310f8 [SE-0329] Clock/Instant/Duration (#40609)
* [WIP] Initial draft at v2 Clock/Instant/Duration

* Ensure the literal types for _DoubleWide are able to be at least 64 bits on 32 bit platforms

* static cast timespec members to long

* Remove runtime exports from clock functions

* Export clock functions in implementations as they are in headers

* Clean up internal properties by adding leading underscores, refine availability to a TBD marker macro, and break at 80 lines to match style

* Shift operators to concrete Instant types to avoid complexity in solver resolution

* Adjust diagnostic note and error expectation of ambiguities to reflect new potential solver (perhaps incorrect) solutions

* Update stdlib/public/Concurrency/TaskSleep.swift

Co-authored-by: Karoy Lorentey <klorentey@apple.com>

* [stdlib][NFC] Remove trailing whitespace

* [stdlib] Remove _DoubleWidth from stdlib's ABI

* [stdlib] Strip downd _DoubleWidth to _[U]Int128

* Additional adjustments to diagnostic notes and errors expectation of ambiguities to reflect new potential solver (perhaps incorrect) solutions

* Disable type checker performance validation for operator overload inferences (rdar://33958047)

* Decorate Duration, DurationProtocol, Instant and clocks with @available(SwiftStdlib 9999, *)

* Restore diagnostic ambiguity test assertion (due to availability)

* Add a rough attempt at implementing time accessors on win32

* Remove unused clock id, rename SPI for swift clock ids and correct a few more missing availabilities

* remove obsolete case of realtime clock for dispatch after callout

* Use the default implementation of ~ for Int128 and UInt128

* Ensure diagnostic ambiguitiy applies evenly to all platforms and their resolved types

* Restore the simd vector build modifications (merge damage)

* Update to latest naming results for Instant.Duration

* Updates to latest proposal initializers and accessors and adjust encoding/decoding to string based serialization

* Update availability for Clock/Instant/Duration methods and types to be 5.7

* Correct *Clock.now to report via the correct runtime API

* Ensure the hashing of Duration is based upon the attoseconds hashing

* Avoid string based encoding and resort back to high and low bit encoding/decoding but as unkeyed

* Adjust naming of component initializer to use suffixes on parameters

* Duration decoding should use a mutable container for decoding

* fix up components initializer and decode access

* Add platform base initializers for timespec and tiemval to and from Duration

* Add some first draft documentation for standard library types Duration, DurationProtocol and InstantProtocol

* Another round of documentation prose and some drive-by availability fixes

* InstantProtocol availability should be 5.7

* Correct linux timeval creation to be Int and not Int32

Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2022-02-17 09:32:46 -08:00
Arnold Schwaighofer
9f2b6a4ebb Reuse _ContiguousArrayStorage<AnyObject> metadata for any class or objc generic type
Reduces the number of _ContiguousArrayStorage metadata.

In order to support constant time bridging we do need to set the correct
metadata when we bridge to Objective-C. This is so that the type check
succeeds when bridging back from Objective-C to reuse the storage
instance rather than bridging the elements.

To support dynamically setting the `_ContiguousArrayStorage` element
type i needed to add support for optimizing `alloc_ref_dynamic`
throughout the optimizer.

Possible future improvements:
* Use different metadata such that we can disambiguate native Swift
  classes during destruction -- allowing native release rather then unknown
  release usage.
* Optimize the newly added semantic function
  getContiguousArrayStorageType

rdar://86171143
2022-02-16 07:55:34 -08:00
Alejandro Alonso
657c17fa39 Setup grapheme breaking tests 2022-02-15 17:16:36 -08:00
Alex Martini
fa04ef570d Add missing parameter in doc comment.
This text matches what's in the doc comment for
UnsafeMutableRawPointer.storeBytes(of:toByteOffset:as:)

Fixes rdar://88982081
2022-02-15 16:49:07 -08:00
Alejandro Alonso
c0e1ef01f9 Fix backwards count of Indic graphemes 2022-02-15 15:28:37 -08:00
swift_jenkins
b773d1408b Merge remote-tracking branch 'origin/main' into next 2022-02-14 14:41:02 -08:00
Guillaume Lessard
d870a9f164 Merge pull request #41288 from glessard/sr15433
[stdlib] Implement `withContiguousStorageIfAvailable` for raw buffer types
2022-02-14 15:37:27 -07:00
Alex Martini
9bc7b8ea99 Add missing comma & slightly clarify. 2022-02-11 11:48:07 -08:00
swift_jenkins
ea7813436f Merge remote-tracking branch 'origin/main' into next 2022-02-09 17:41:37 -08:00
Alex Martini
6dcd9b27b9 Merge pull request #40529 from amartini51/array_slice_end_76254761
Fix mentions of nonexistent 'end' parameter.
2022-02-09 17:32:03 -08:00
swift_jenkins
ed58ee8712 Merge remote-tracking branch 'origin/main' into next 2022-02-09 05:41:20 -08:00
Kuba (Brecka) Mracek
2fa79689fa Turn build-swift-stdlib-static-print on for freestanding preset (#41260) 2022-02-09 05:41:04 -08:00
Guillaume Lessard
441e3ce4e3 [stdlib] add withContiguousStorageIfAvailable for raw buffers 2022-02-08 18:05:02 -07:00
swift_jenkins
a18da6ac61 Merge remote-tracking branch 'origin/main' into next 2022-02-08 17:03:22 -08:00
Guillaume Lessard
8552044dc5 Merge pull request #40828 from glessard/sort-optimization
[nfc] document legacy ABI in the implementation of sort
2022-02-08 16:17:05 -07:00
swift_jenkins
265e609bbe Merge remote-tracking branch 'origin/main' into next 2022-02-08 10:21:25 -08:00
Alex Martini
aac6d97f3f Merge pull request #40943 from amartini51/significand_exponent_56184186
Make pseudocode look less like real code.
2022-02-08 10:03:33 -08:00
Guillaume Lessard
71627b1b74 [stdlib] make some underscored functions internal 2022-02-05 10:43:54 -07:00
swift_jenkins
b730a41ac5 Merge remote-tracking branch 'origin/main' into next 2022-02-05 08:20:20 -08:00
Guillaume Lessard
1161f92bd7 Merge pull request #39529 from glessard/se-withMemoryRebound 2022-02-05 09:01:05 -07:00
Guillaume Lessard
3f67313cce [gardening] formatting adjustments 2022-02-04 16:26:11 -07:00
Guillaume Lessard
ba416cd008 [abi] forward calls made to the old withMemoryRebound symbols 2022-02-04 16:07:52 -07:00
Guillaume Lessard
2a9fa0c8dd [abi] make the compatibility symbols internal 2022-02-04 15:48:19 -07:00
swift_jenkins
c5f999fd72 Merge remote-tracking branch 'origin/main' into next 2022-02-04 11:40:36 -08:00
Kuba (Brecka) Mracek
1781715d58 constant_vprintf: Add a mode where prints are silenced when -DPRINT_DISABLED is present on the client side (#41177) 2022-02-04 11:38:00 -08:00
swift_jenkins
4ae6acb569 Merge remote-tracking branch 'origin/main' into next 2022-02-04 10:40:46 -08:00
Karoy Lorentey
8533b4295b Merge pull request #37424 from Lukasa/cb-fewer-checks-in-ubp
Remove as much checked math as possible from buffer pointers.
2022-02-04 10:40:24 -08:00
Guillaume Lessard
245426493c [stdlib] documentation clarifications 2022-02-03 20:02:33 -07:00
Guillaume Lessard
c24832677d [stdlib] add U[M]RBP.assumingMemoryBound 2022-02-03 20:02:33 -07:00
Guillaume Lessard
5403129588 [stdlib] add U[M]RBP.withMemoryRebound 2022-02-03 20:02:33 -07:00
Guillaume Lessard
3de1eace23 [stdlib] add U[M]RP.withMemoryRebound 2022-02-03 20:02:33 -07:00
Guillaume Lessard
5f5c75d21a [abi] preserve original implementations of withMemoryRebound 2022-02-03 20:02:33 -07:00
Karoy Lorentey
0a82ef8e13 Re-add debug-mode overflow check in index(_:,_offsetBy:limit:) 2022-02-03 11:40:41 -08:00
Karoy Lorentey
a3fdcfa43f Reword note on wrapping arithmetic 2022-02-03 11:39:44 -08:00
swift_jenkins
4fffb9301d Merge remote-tracking branch 'origin/main' into next 2022-02-02 18:00:48 -08:00
Karoy Lorentey
823e5d4e3e Merge pull request #41132 from lorentey/ObjectIdentifier-single-shot-hashing
[stdlib] Speed up `ObjectIdentifier`-keyed dictionaries
2022-02-02 17:47:19 -08:00
Guillaume Lessard
c2dfb94f88 [stdlib] update existing withMemoryRebound
- updated documentation and adjust implementations
2022-02-02 15:33:28 -07:00
swift_jenkins
885ce9d4d3 Merge remote-tracking branch 'origin/main' into next 2022-02-02 12:20:32 -08:00
Kuba (Brecka) Mracek
e6a1e23a9f Add SWIFT_STDLIB_ENABLE_VECTOR_TYPES to take away support for SIMD (#41149) 2022-02-02 12:06:45 -08:00
Karoy Lorentey
a72544fb77 [stdlib] Speed up ObjectIdentifier-keyed dictionaries
ObjectIdentifier is used relatively frequently as the Key type for dictionaries, so it makes sense for it to implement single-shot hashing. This will lead to a measurable speedup in lookup/insertion performance.

rdar://88339458
2022-02-01 11:34:40 -08:00
swift_jenkins
3462ae5f11 Merge remote-tracking branch 'origin/main' into next 2022-01-31 18:40:47 -08:00
swift-ci
89bb2b5db2 Merge pull request #41089 from philipturner/patch-27 2022-01-31 18:29:30 -08:00
swift_jenkins
914ab8fe8e Merge remote-tracking branch 'origin/main' into next 2022-01-29 11:21:17 -08:00
Philip Turner
80c97da156 Change argument label 2022-01-29 12:41:45 -05:00
Karoy Lorentey
aa3b48f432 [stdlib] Define platform version numbers for SwiftStdlib 5.6 2022-01-27 14:41:07 -08:00
swift_jenkins
41b4d4b034 Merge remote-tracking branch 'origin/main' into next 2022-01-21 12:01:38 -08:00
Alex Martini
d4109704dd Make pseudocode look less like real code.
There isn't actually an ** operator in Swift, so making the formula that
includes ** for exponentiation look like Swift can lead to confusion.

Fixes rdar://56184186
2022-01-20 15:07:23 -08:00