Commit Graph

1960 Commits

Author SHA1 Message Date
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
swift-ci
03c738e9ec Merge remote-tracking branch 'origin/master' into master-next 2018-05-11 00:29:02 -07:00
Joe Groff
0d438c91c4 [Demangle to metadata] Support simple extension contexts.
Support demangling for types nested within some simple extension contexts.
Still does not support nested types within constrained extensions that
involve same-type constraints among generic parameters, nor
deeply-nested types in extensions. However, it fixes
rdar://problem/40071688.
2018-05-10 23:36:01 -07:00
swift-ci
8daaa4ea35 Merge remote-tracking branch 'origin/master' into master-next 2018-05-10 14:49:25 -07:00
Mike Ash
75450e5b3c Merge pull request #16472 from mikeash/silence-offsetof-warning
[Runtime] Silence warnings for offsetof usage on TupleCacheEntry.
2018-05-10 17:29:31 -04:00
swift-ci
8733e2bdaf Merge remote-tracking branch 'origin/master' into master-next 2018-05-10 09:49:16 -07:00
Saleem Abdulrasool
f4c24d6e2e Merge pull request #16403 from lanza/inspect-arch-sdk
Configure the swiftImageInspectionShared to generate arch & sdk speci…
2018-05-10 09:42:35 -07:00
Mike Ash
89bf915e99 Merge branch 'master' into runtime-conformance-scanning-lockless-array 2018-05-09 15:23:36 -04:00
Mike Ash
b821a2ef6d [Runtime] Silence warnings for offsetof usage on TupleCacheEntry.
rdar://problem/39739801
2018-05-09 13:51:59 -04:00
Nathan Lanza
9815368788 Configure the swiftImageInspectionShared to generate arch & sdk specific libraries
Previously, swiftImageInspectionShared generated one specific library at
`lib/libswiftImageInspectionShared.a` for only the main arch and sdk.
Generic cross compilation and various changes to the build system to get
cross compilation to work will require swiftImageInspectionShared to
generate libraries at the proper subdirectory. Change the outputs to
agree with paths such as `lib/swift/linux/x86_64`
2018-05-03 12:33:45 -07:00
swift-ci
49b2c7fe2a Merge remote-tracking branch 'origin/master' into master-next 2018-05-01 12:08:52 -07:00
Arnold Schwaighofer
1f65ee25f6 Distinguish between withoutActuallyEscaping and passing @noescape
Objective C closures when reporting that a closure has escaped

rdar://39682865
2018-05-01 07:24:19 -07:00
swift-ci
13ab622cba Merge remote-tracking branch 'origin/master' into master-next 2018-04-30 17:09:26 -07:00
Michael Gottesman
54137ed302 Merge pull request #16242 from davezarzycki/nfc_misc_warning_fixes
[Misc] NFC: Fix random build warnings
2018-04-30 17:04:29 -07:00
swift-ci
b80f58cbcf Merge remote-tracking branch 'origin/master' into master-next 2018-04-30 13:29:16 -07:00
Mike Ash
8459167b3e Merge pull request #16253 from mikeash/disable-mangled-name-verification
[Runtime] Disable mangled name verification unless specifically enabled with an environment variable.
2018-04-30 13:18:52 -07:00
Michael Gottesman
0d1f98a4ef Merge pull request #16259 from gottesmm/pr-aab473d24268b0934ac216bf2683f0a2c8e3be0f
[+0-all-args] Make _bridgeAnythingNonVerbatimToObjectiveC() take its …
2018-04-30 13:14:46 -07:00
swift-ci
9d81e603c3 Merge remote-tracking branch 'origin/master' into master-next 2018-04-30 12:29:27 -07:00
Michael Gottesman
c31033c525 [+0-all-args] Make _bridgeAnythingNonVerbatimToObjectiveC() take its parameter at +1.
This hoists out the retain into Swift code from the casting runtime and along a
few paths in the runtime allows us to eliminate a dynamic retain release.

rdar://38196046
rdar://38771331
2018-04-30 11:05:00 -07:00
Michael Gottesman
87681375e2 [+0-all-args] Change _swift_stdlib_bridgeErrorToNSError to take its parameter at +1.
This is truly a consuming operation. This can be seen since we always would need
to retain the argument here. This makes guaranteed -> owned less transformation
effective. Instead represent it taking a +1 argument so that the retain happens
outside the builtin instead of inside the builtin.

This also allows me to remove an extra copy from dynamicCastValueToNSError

rdar://38771331
2018-04-30 10:16:41 -07:00
David Zarzycki
95473a10d7 [Misc] NFC: Fix random build warnings
Unused variables/methods, language extensions, extra semicolons, intentional
self assignment, platform specific quirks, etc.
2018-04-30 12:52:43 -04:00
Mike Ash
8b59295a92 [Runtime] Change protocol conformance scanning to use a concurrent array rather than a locked vector.
rdar://problem/37173156
2018-04-30 12:24:47 -04:00
Mike Ash
09e1e355a4 [Runtime] Disable mangled name verification unless specifically enabled with an environment variable.
rdar://problem/39821779 rdar://problem/39821761 rdar://problem/39821758
2018-04-30 10:56:09 -04:00