Commit Graph

1782 Commits

Author SHA1 Message Date
swift-ci
76bd350b43 Merge remote-tracking branch 'origin/master' into master-next 2018-05-24 08:09:06 -07:00
Arnold Schwaighofer
c0af215fd8 Merge pull request #16802 from aschwaighofer/swift5_sections
Rename swift sections from swift4 to swift5
2018-05-24 07:52:15 -07:00
swift-ci
469fb047c1 Merge remote-tracking branch 'origin/master' into master-next 2018-05-23 13:29:12 -07:00
swift-ci
435375d258 Merge pull request #16798 from aschwaighofer/opaque_existentials_bitwise_takable 2018-05-23 13:13:02 -07:00
Arnold Schwaighofer
cc7f207cec Rename swift sections from swift4 to swift5
rdar://38465220
2018-05-23 12:18:08 -07:00
swift-ci
0c5bd1d458 Merge remote-tracking branch 'origin/master' into master-next 2018-05-23 11:49:21 -07:00
Mike Ash
66628f6ed6 Merge pull request #16753 from mikeash/fix-metadatalookup-deadlocks
[Runtime] Change MetadataLookup section vectors to use ConcurrentReadableArray.
2018-05-23 14:38:46 -04:00
Mike Ash
93470fb9b9 Merge pull request #16794 from mikeash/fix-ConcurrentReadableArray-double-free
[Runtime] Fix double-frees in ConcurrentReadableArray.
2018-05-23 14:38:33 -04:00
Arnold Schwaighofer
98506e03cf IRGen: Opaque existentials are now bitwise takable
Now that the existential inline buffer is bitwise takable so are opaque
existentials.
2018-05-23 11:17:54 -07:00
swift-ci
9a6af07470 Merge remote-tracking branch 'origin/master' into master-next 2018-05-23 10:49:11 -07:00
Mike Ash
22f199b10d Merge pull request #16772 from mikeash/dynamicCast-unwrap-multilevel-optionals
[Runtime] Have swift_dynamicCast unwrap multiple levels of optionals in the source.
2018-05-23 13:35:38 -04:00
swift-ci
94f870732f Merge remote-tracking branch 'origin/master' into master-next 2018-05-23 08:49:20 -07:00
Mike Ash
00ef29c322 Merge branch 'fix-ConcurrentReadableArray-double-free' into fix-metadatalookup-deadlocks 2018-05-23 11:33:10 -04:00
Mike Ash
c7eeeb5a68 [Runtime] Change ConcurrentReadableArray's API to provide iterable snapshots rather than using a callback-based read call.
rdar://problem/40230581
2018-05-23 11:19:42 -04:00
Arnold Schwaighofer
6267860a7e IRGen: Remove initializeBufferWithTakeOfBuffer in favor of memcpy
And update the existential container's initializeWithTake implementation
in the runtime. After only allowing bitwise takable values in the
inline buffer we can use memcpy to move existential container values.

rdar://31414907
SR-343
2018-05-22 13:05:00 -07:00
swift-ci
7cdafa138d Merge remote-tracking branch 'origin/master' into master-next 2018-05-22 12:49:30 -07:00
Arnold Schwaighofer
d05f611b6d Merge pull request #16759 from aschwaighofer/abi_inline_implies_bitwise_takable
ABI: Only store bitwise take-able values inline
2018-05-22 12:42:03 -07:00
Mike Ash
0dae9b3dc0 [Runtime] Have swift_dynamicCast unwrap multiple levels of optionals in the source.
The real work is done in checkDynamicCastFromOptional. This code tried to unwrap the source and returned the payload on success. It only did this once, so a type like Optional<Optional<Int>> would come out as Optional<Int> and then a cast to Int would fail.

This change makes checkDynamicCastFromOptional recursive, which makes it unwrap as many levels of Optional as it encounters.

Fixes rdar://problem/40171034 and SR-7664.
2018-05-22 15:05:09 -04:00
swift-ci
71070cf332 Merge remote-tracking branch 'origin/master' into master-next 2018-05-22 07:29:25 -07:00
Mike Ash
5b991f30b8 [Runtime] Redo the ErrorObject/dlsym interface to use a struct containing all the bridging points. This allows for better static typing and reduces the amount of dynamic symbol lookups.
rdar://problem/39810532
2018-05-21 17:10:46 -04:00
Arnold Schwaighofer
298067496d ABI: Only store bitwise take-able values inline
SR-343
rdar://31414907
2018-05-21 14:02:12 -07:00
Mike Ash
b3d1030b65 [Runtime] Change MetadataLookup's various section vectors to use ConcurrentReadableArray rather than std::vector. This avoids the need to hold a lock while iterating, removing potential deadlocks.
rdar://problem/40230581
2018-05-21 12:35:15 -04:00
Mike Ash
73002af3bc [Runtime] Change ConcurrentReadableArray's API to provide iterable snapshots rather than using a callback-based read call.
rdar://problem/40230581
2018-05-21 12:30:46 -04:00
swift-ci
6afe722359 Merge remote-tracking branch 'origin/master' into master-next 2018-05-19 12:29:32 -07:00
Ben Langmuir
2e6c7ee76d Revert "[Runtime] Look up Error bridging symbols indirectly through special symbols that won't be stripped in static builds." 2018-05-19 10:05:00 -07:00
swift-ci
ffd52ad1eb Merge remote-tracking branch 'origin/master' into master-next 2018-05-18 15:29:13 -07:00
Joe Groff
0a95ef77fd Merge pull request #16729 from jckarter/leaks-metadata-kind-switch
Update Leaks.mm not to exhaustively switch metadata kinds too.
2018-05-18 15:11:51 -07:00
Joe Groff
f23bbaac63 Update Leaks.mm not to exhaustively switch metadata kinds too. 2018-05-18 14:20:30 -07:00
swift-ci
64ef74d07a Merge remote-tracking branch 'origin/master' into master-next 2018-05-18 14:09:42 -07:00
Joe Groff
987116eed1 Merge pull request #16720 from jckarter/mirror-demangle-failure-fallback
Mirror: Treat fields with type names we fail to demangle as empty.
2018-05-18 13:54:55 -07:00
Joe Groff
d91fe6bcca Mirror: Treat fields with type names we fail to demangle as empty.
And log a warning message that we're doing so.
2018-05-18 13:12:22 -07:00
swift-ci
9736e559d4 Merge remote-tracking branch 'origin/master' into master-next 2018-05-18 10:09:40 -07:00
Joe Groff
3ec7fc169d Merge pull request #16698 from jckarter/metadata-forward-compatibility
Runtime: Tolerate unknown metadata kinds.
2018-05-18 09:50:13 -07:00
swift-ci
e64331ea3a Merge remote-tracking branch 'origin/master' into master-next 2018-05-18 06:29:34 -07:00
Joe Groff
681a96b45c Runtime: Tolerate unknown metadata kinds.
We want to be able to potentially introduce new metadata kinds in future Swift compilers, so a runtime ought to be able to degrade gracefully in the face of metadata kinds it doesn't know about. Remove attempts to exhaustively switch over metadata kinds and instead treat unknown metadata kinds as opaque.
2018-05-17 15:35:06 -07:00
swift-ci
336e42ee2c Merge remote-tracking branch 'origin/master' into master-next 2018-05-17 15:09:01 -07:00
Ben Langmuir
628b6a1fc7 Revert "Turn on ‘as’ bridging on Linux." 2018-05-17 14:54:35 -07:00
swift-ci
e0c8c31b0b Merge remote-tracking branch 'origin/master' into master-next 2018-05-17 14:29:05 -07:00
Mike Ash
177f34cd0e Merge branch 'master' into fix-static-stripped-error-bridging 2018-05-17 14:13:00 -04:00
Lily Vulcano
b9455930ee Turn on ‘as’ bridging on Darwin. 2018-05-17 09:59:39 -07:00
Mike Ash
3cc86eb836 [Runtime] Look up Error bridging symbols indirectly through special symbols that won't be stripped in static builds.
This fixes a problem where error bridging didn't work in stripped executables using the static versions of the Swift libraries. ErrorObject.mm looks up some symbols with dlsym, but stripping makes it so it can't find those. This change makes a separate set of symbols explicitly made for ErrorObject.mm to look up, and marks them as dynamically referenced so stripping won't remove them. Longer term, we'd like a better solution for looking up these symbols, but this will do for now.

rdar://problem/39810532
2018-05-17 11:43:15 -04:00
swift-ci
228d6d7674 Merge remote-tracking branch 'origin/master' into master-next 2018-05-17 07:49:03 -07:00
Arnold Schwaighofer
0be00c820e Merge pull request #16608 from aschwaighofer/unique_foreign_type_witnesses
Unique synthesized foreign type witnesses and make witness tables part of the metadata cache key
2018-05-17 07:35:10 -07:00
swift-ci
260bf93f5a Merge remote-tracking branch 'origin/master' into master-next 2018-05-16 11:09:52 -07:00
Mike Ash
0e952b45bc Merge pull request #16254 from mikeash/runtime-conformance-scanning-lockless-array
[Runtime] Change protocol conformance scanning to use a concurrent array rather than a locked vector.
2018-05-16 14:03:10 -04:00
swift-ci
3c1802a186 Merge remote-tracking branch 'origin/master' into master-next 2018-05-15 13:29:11 -07:00
Andrew Trick
495d5aecf6 [exclusivity] Add an access marker folding pass.
Use AccessedStorageAnalysis to find access markers with no nested conflicts.

This optimization analyzes the scope of each access to determine
whether it contains a potentially conflicting access. If not, then it
can be demoted to an instantaneous check, which still catches
conflicts on any enclosing outer scope.

This removes up to half of the runtime calls associated with
exclusivity checking.
2018-05-15 12:29:19 -07:00
Mike Ash
da4fa67d7e [Runtime] Move ConcurrentReadableArray's allocate/deallocate functions into Storage. Mark ConcurrentReadableArray as un-copyable, un-assignable, and un-movable. Use SWIFT_MEMORY_ORDER_CONSUME instead of std::memory_order_consume. Make read() pass a const pointer.
rdar://problem/37173156
2018-05-15 15:27:33 -04:00
Arnold Schwaighofer
1ba367ada8 Fix _swift_makeAnyHashableUpcastingToHashableBaseType to use the witness table of the just unboxed typed of a SwiftValue
This got exposed due to the change to use witness tables as part of the
metadata cache key.

The  Swift._ConcreteHashableBox<MinimalHashableValue> metadata created as
part of:

 AnyHashable(MinimalHashableValue(1))

and

 AnyHashable(_bridgeAnythingToObjectiveC(MinimalHashableValue(1)) as!  NSObject)

Would not be uniqued to the same metadata because the witness table of
NSObject that we queried before that change was not equal to the witness
table of MinimalHashableValue.

This is tested by the AnyHashable.swift.gyb test case.

rdar://24958043
2018-05-14 13:54:15 -07:00
Arnold Schwaighofer
b83941795a Unique synthesized foreign type conformances
- Add swift_getForeignWitnessTable to unique non-unique foreign type
   witness tables

 - IRGen: Call the foreign witness uniquing runtime function

rdar://24958043
2018-05-14 13:52:41 -07:00