Commit Graph

7726 Commits

Author SHA1 Message Date
David Zarzycki
3db28e5425 Merge pull request #18220 from davezarzycki/add_missing_wv_sym
[IRGen & Runtime] Remove prefab'ed VWT for reference storage types
2018-07-28 17:24:31 -04:00
swift-ci
0d5cb630cc Merge remote-tracking branch 'origin/master' into master-next 2018-07-28 10:09:14 -07:00
David Zarzycki
8231b3a750 [IRGen & Runtime] Remove prefab'ed VWT for reference storage types
The prefab'ed value witness tables for reference storage types are a
premature optimization. Not all scenarios are covered, and those that
are "look suspect" according to John McCall.
2018-07-28 09:43:12 -04:00
John McCall
d10239313f Reference runtime-only ObjC classes with bare strings.
As part of this, rename TypeMetadataRecordKind to TypeReferenceKind
and consistently give it three bits of storage.

The better modelling of these type references appears to have been
sufficient to make dynamic conformance checks succeed, which is good
but unexpected.
2018-07-27 22:55:22 -04:00
swift-ci
be42f56e2c Merge remote-tracking branch 'origin/master' into master-next 2018-07-27 17:19:18 -07:00
Doug Gregor
ee1713ce67 [Standard library] Break up another “large” expression.
Bitwise arithmetic is a killer for the type checker :(. Shave off another
half second of typecheck time in the standard library.
2018-07-27 15:37:59 -07:00
Doug Gregor
6ffcbc5eff [Standard library] Faster formulation for the _HasherTailBuffer sanity check 2018-07-27 15:37:59 -07:00
Doug Gregor
fa9a24538f [Standard library] Ascribe types to some literals to improve typecheck time.
One expression in the new hashing implementation is going exponential,
accounting for a huge amount of type-checking type. Add (admittedly ugly)
“as UInt64” annotations to greatly reduce the time to type-check this
expression.

*Ahem* type-checking time for the standard library goes from 24s->14s with
this change. Added a type-checker “slow” performance test and captured
the problem in rdar://problem/42672946.
2018-07-27 14:10:49 -07:00
Joe Groff
b89ed05148 KeyPaths: Followup fix for computed component size 2018-07-27 13:16:14 -07:00
Joe Groff
c4806b5889 KeyPaths: Centralize alignment manipulations in helpers. 2018-07-27 13:15:49 -07:00
Joe Groff
f01c731a6b KeyPaths: Fix alignment skew issue when key path pattern ends with a less-than-pointer-aligned element. 2018-07-27 13:15:49 -07:00
Dante Broggi
6e5b471aad "if is RandomAccessCollection" is unnecessary
* remove the performance qualifiers on API redeclared from `Collection`, because they are necessarily satisfied.
2018-07-27 14:28:21 -04:00
swift-ci
634329dba7 Merge remote-tracking branch 'origin/master' into master-next 2018-07-27 03:49:16 -07:00
Karoy Lorentey
b50294a8e7 Merge pull request #18257 from lorentey/NSObject-hashing2
[ObjectiveC] NSObject: Clarify hashing implementation
2018-07-27 11:44:32 +01:00
swift-ci
f2623b8659 Merge remote-tracking branch 'origin/master' into master-next 2018-07-26 10:29:20 -07:00
Max Moiseev
26790d0c72 Merge pull request #18165 from moiseev/bidirectional-decls
[stdlib] Explicitly declare Collection requirements on child protocols
2018-07-26 10:15:16 -07:00
Karoy Lorentey
d03786ee1c [ObjectiveC] NSObject: Clarify hashing implementation
NSObject defines its own interface for hashing and equality. Subclasses must implement custom hashing by overriding the hash property, or NSSet and NSDictionary will not work correctly.

Unfortunately, we currently define NSObject.hashValue and NSObject.hash(into:) as overridable, which leads people to accidentally override one of these instead of hash. hashValue is explicitly declared open, while hash(into:) is automatically synthesized as such.

Making hashValue non-open is a potentially source breaking change, but we can at least provide an explicit, non-overridable definition for hash(into:), and update the documentation to explain the contract.
2018-07-26 16:09:54 +01:00
swift-ci
87fc9d2cf8 Merge remote-tracking branch 'origin/master' into master-next 2018-07-26 00:49:24 -07:00
swift-ci
128d33cb85 Merge pull request #18169 from ravikandhadai/InconsistentUnreachWarning 2018-07-26 00:37:33 -07:00
swift-ci
a39a50d142 Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 21:09:25 -07:00
Joe Groff
665bcb99a5 Merge pull request #18100 from jckarter/keypath-external-irgen
IRGen and runtime support for key path resilience.
2018-07-25 21:04:40 -07:00
swift-ci
e5e4bab96e Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 18:09:16 -07:00
swift-ci
d4f15178dd Merge pull request #18232 from milseman/string_cleaning 2018-07-25 18:04:53 -07:00
Michael Ilseman
296ee295a1 [gardening] De-gyb Substring; NFC 2018-07-25 15:42:48 -07:00
Maxim Moiseev
7cbfed3f3a [stdlib] Explicitly declare Collection requirements on child protocols
Fixes: <rdar://problem/42408692> and SR-8022
2018-07-25 15:12:40 -07:00
Michael Ilseman
ba591b3f3c [stdlib] Drop some inlinability annotations.
ThreadLocalStorage is not accessible in an inlinable context, so drop
all such annotations. Also, drop a redundant one from Optional to
suppress a warning.

NFC
2018-07-25 15:04:48 -07:00
Joe Groff
4098aa02c7 KeyPaths: Support instantiating property descriptors with captured arguments. 2018-07-25 14:28:33 -07:00
Michael Ilseman
463e3747a8 [gardening] Factor out String bidi conformance
Add StringCharacterView.swift for String's bidi conformance. NFC.
2018-07-25 14:14:37 -07:00
Michael Ilseman
2195cda3ec [gardening] Rename StringUTFx.swift to StringUTFxView.swift 2018-07-25 14:09:45 -07:00
swift-ci
97d4d925fc Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 14:09:23 -07:00
Michael Ilseman
4a66c4719f [gardening] Move string creation internals to StringCreate.swift
NFC
2018-07-25 14:05:46 -07:00
Davide Italiano
44cccd011e Merge pull request #18205 from dcci/valuewittarget
[Runtime] Targetize the layout of ValueWitnessTable.
2018-07-25 14:00:26 -07:00
John McCall
a5524d2d29 Merge pull request #18214 from rjmccall/in-place-value-metadata-dependencies
Resolve cyclic dependencies in in-place metadata initialization of value types
2018-07-25 16:54:08 -04:00
Ravi Kandhadai
81fad3c367 [Stdlib] Make the comparison operators (<, >, <= and >=) on concrete Int types transparent.
This makes all operators symmetric, and makes constant folding
and unreachable code analysis more precise and consistent.

<rdar://39516135>
2018-07-25 12:02:02 -07:00
Davide Italiano
1c3c1904a4 [Runtime] Targetize the layout of ValueWitnessTable.
From what I see the only fields are DATA_VALUE_WITNESS which
all have type size_t. I converted them to use the target-dependent
`StoredSize`. While I was around I fixed also isValueInline()
to do the right thing (it was using ValueBuffer instead of
TargetValueBuffer) and all the getters for the data value witnesses.

<rdar://problem/41546568>
2018-07-25 11:37:57 -07:00
Joe Groff
fceea87bf4 KeyPaths: Support instantiating generic property descriptors from concrete contexts.
This is a bit easier than the fully general case where both the external descriptor and local pattern have captured arguments (because of generics or subscript indices) since we don't have to combine the two argument files in one component.
2018-07-25 11:09:04 -07:00
Joe Groff
02fa6311ae KeyPaths: Centralize some flag testing logic. 2018-07-25 11:09:04 -07:00
Joe Groff
36882aae7a Remove test/stdlib/KeyPathImplementation test.
This was useful for bringup before compiler support for building key path patterns was implemented, but now it just hardcodes a bunch of implementation details that expose some internal details as ABI and interfere with refactorings. Remove it now that the same functionality is tested at a higher level.
2018-07-25 11:09:04 -07:00
Joe Groff
add80edea9 KeyPaths: Rationalize fragility attributes. 2018-07-25 11:09:04 -07:00
Joe Groff
3b9501a283 KeyPaths: Handle computed property descriptor instantiation w/o indexes or generics. 2018-07-25 11:09:04 -07:00
Joe Groff
e96472807f KeyPaths: Instantiate external property descriptors for stored properties. 2018-07-25 11:09:04 -07:00
Joe Groff
f1cd3122fc KeyPaths: Stub out support for instantiating external components with trivial descriptors. 2018-07-25 11:09:04 -07:00
swift-ci
e2a1a689de Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 11:08:56 -07:00
Stephen Canon
35db40c9f9 Make BinaryInteger._binaryLogarithm() return Int instead of Self (#18219)
Returning `Self` was probably a hack from when shifts were required to be homogenous and we didn't have good generic inits between integer types. Returning Int is more natural, because:

1. Dimensional analysis says that we shouldn't expect the logarithm to have the same type.
2. Int is guaranteed to be able to represent any object size, and BinaryInteger does not admit sparse representations, so the logarithm of the value cannot exceed allocated storage size.
3. Every single use case in the stdlib and tests is either unchanged or simplified by this change.
2018-07-25 14:04:32 -04:00
Joe Groff
b607e549f1 Adjust the key path component tags so that the trivial property descriptor can be zero.
…and thus more likely to be folded with another zero constant in the module and/or put in a zero-initialized page.
2018-07-25 10:49:29 -07:00
John McCall
dadb51e708 Support in-place value metadata initialization in the runtime. 2018-07-25 03:00:36 -04:00
John McCall
e6fc5cb54e Refactor LockingConcurrentMap to allow it to not use a map; NFC. 2018-07-25 03:00:36 -04:00
swift-ci
066dd10dfb Merge remote-tracking branch 'origin/master' into master-next 2018-07-24 20:49:47 -07:00
Ben Cohen
df22c3647c [stdlib] Build the standard library as Swift 5 (#18121)
* Update std lib to Swift 5.0

* Disable Unicode.* warnings for now

* Slow path to resiliently handle the case where an unknown rounding rule is passed

* Remove resilience from Encoding/DecodingError (which should only happen on slow paths anyway)

* internal typealiases now need @usableFromInline

* Force inlining on Array._owner.get
2018-07-24 20:47:58 -07:00
swift-ci
d98fd93c77 Merge remote-tracking branch 'origin/master' into master-next 2018-07-24 18:29:48 -07:00