Commit Graph

1960 Commits

Author SHA1 Message Date
Michael Gottesman
7bceb07083 [+0-normal-args] Upstream fixes for _bridgeAnythingNonVerbatimToObjectiveC and _bridgeNonVerbatimFromObjectiveCConditional at +0.
NFC with +1 arguments. I am testing this upstream against SILGen changes.

rdar://34222540
2018-02-14 14:34:20 -08:00
swift-ci
5be3c78ef9 Merge remote-tracking branch 'origin/master' into master-next 2018-02-14 09:29:30 -08:00
Mike Ash
4c9dc2677c Merge pull request #14375 from mikeash/fix-slowalloc-alignment
[Runtime] Fix swift_slowAlloc to respect its alignMask parameter.
2018-02-14 12:29:14 -05:00
swift-ci
eddd61be68 Merge remote-tracking branch 'origin/master' into master-next 2018-02-14 08:09:28 -08:00
Arnold Schwaighofer
fff94ad18c Fix comment of escape and noescape witness tables 2018-02-14 05:32:33 -08:00
swift-ci
beae25974d Merge remote-tracking branch 'origin/master' into master-next 2018-02-14 05:29:28 -08:00
Arnold Schwaighofer
74e1cfaeb3 runtime: Implemenation of value witness for @noescape types
We should not need those -- except (at least) for functions passed as
arguments to materializeForSet ...
2018-02-13 04:19:59 -08:00
swift-ci
831a238176 Merge remote-tracking branch 'origin/master' into master-next 2018-02-12 12:29:36 -08:00
Joe Groff
b53d90e8e2 Merge pull request #14512 from jckarter/mangling-symbolic-references
IRGen/Runtime: Allow mangled type refs to embed "symbolic references" to type context descriptors.
2018-02-12 12:21:19 -08:00
Joe Groff
953dddd5d3 IRGen/Runtime: Allow mangled type refs to embed "symbolic references" to type context descriptors.
This makes resolving mangled names to nominal types in the same module more efficient, and for eventual secrecy improvements, also allows types in the same module to be referenced from mangled typerefs without encoding any source-level name information about them.
2018-02-10 10:43:47 -08:00
swift-ci
230dc11d1a Merge remote-tracking branch 'origin/master' into master-next 2018-02-09 00:10:00 -08:00
Kuba (Brecka) Mracek
6278146ed8 Fix "variable unused" warning in Metadata.cpp in non-assert build 2018-02-08 11:23:13 -08:00
swift-ci
f770ff6004 Merge remote-tracking branch 'origin/master' into master-next 2018-02-07 12:49:48 -08:00
Michael Gottesman
68e2e708d0 [runtime] Add a dumping method to HeapObject when asserts are enabled.
Given any heap object, this method dumps:

* The pointer address of the heap object.
* The pointer address of the heap metadata of the object.
* The strong reference count.
* The unowned reference count.
* The weak reference count.
* Whether or not the value is in the deinit state.
* Whether or not the heap object uses swift_retain or objc_retain.
* The address of the object's side table if one exists.

This makes it really easy when debugging quickly to get all of the information
that you could possibly need from a HeapObject.
2018-02-07 11:54:48 -08:00
Mike Ash
7b091bf91d [Runtime] Have swift_slowAlloc malloc directly if the alignMask is sufficiently small.
rdar://problem/22975669
2018-02-07 13:32:47 -05:00
swift-ci
7e31e1c66b Merge remote-tracking branch 'origin/master' into master-next 2018-02-06 10:09:18 -08:00
Arnold Schwaighofer
d981bb1d96 Mangling: noescape functions will be trivial and no longer compatible with escape function types.
Mangle escapeness as part of the type.

Part of:
SR-5441
rdar://36116691
2018-02-06 08:51:43 -08:00
swift-ci
6890ae823d Merge remote-tracking branch 'origin/master' into master-next 2018-02-06 00:28:56 -08:00
Pavel Yaskevich
caf73113ea [Runtime/Metadata] Add ownership information to _getTypeByMangledName
`_typeByMangledName` could encounter types which have ownership attributes
associated with them which are not representable by the metadata object
but nevertheless are important, so such ownership information should be
returned along with metadata itself from the call.
2018-02-05 15:26:11 -08:00
swift-ci
2dbd3646b7 Merge remote-tracking branch 'origin/master' into master-next 2018-02-04 10:09:00 -08:00
Saleem Abdulrasool
83c4df8045 Merge pull request #14358 from compnerd/remove-SWIFT_USE_SWIFTCALL
stdlib: remove vestigial SWIFT_USE_SWIFTCALL
2018-02-04 09:53:27 -08:00
swift-ci
d25ea3627b Merge remote-tracking branch 'origin/master' into master-next 2018-02-02 17:49:23 -08:00
swift-ci
87f7b4e5fb Merge pull request #14368 from DougGregor/se-0143-runtime-conditional-conformances 2018-02-02 17:29:26 -08:00
swift-ci
cd5fa39ec3 Merge remote-tracking branch 'origin/master' into master-next 2018-02-02 17:29:05 -08:00
swift-ci
5663b4487d Merge pull request #14378 from compnerd/windows-runtime-initializer 2018-02-02 17:17:13 -08:00
Doug Gregor
81f15746b6 [Runtime] Always cache conformance results based on the type metadata. 2018-02-02 16:41:28 -08:00
Doug Gregor
93442cf11f [Runtime] SE-0143: Evaluate conditional conformances at runtime.
When evaluating whether a given type conforms to a protocol, evaluate the
conditional requirements and pass the results to the witness table
accessor function. This provides the ability to query conditional
conformances at runtime, and is the last major part of implementing
SE-0143.

The newly-added unlock/lock dance in the conformance lookup code is a
temporary stub. We have some ideas to do this better.

Fixes rdar://problem/34944655.
2018-02-02 16:41:27 -08:00
swift-ci
caef060db7 Merge remote-tracking branch 'origin/master' into master-next 2018-02-02 16:29:05 -08:00
Saleem Abdulrasool
76d7bfd8ed runtime: ensure that the module constructor element is RO
The default attribute on the section is read/write.  This would cause
the section to have different attributes when compiled.  The linker
would then preserve the section rather than merge it into the right
location.  This was noticed when linking with `link.exe`.
2018-02-02 15:01:44 -08:00
Saleem Abdulrasool
bb55044f38 runtime: add missing sw5prt to the section list
The Windows constructor was not populated properly, with the protocol
list being dropped.  Ensure that all the fields are initialised
properly.  Thanks to clang's `-Wmissing-field-initializers` warning to
help catch this.
2018-02-02 15:00:34 -08:00
Saleem Abdulrasool
bc950fd41a runtime: mark the section markers with the correct attributes
On windows, we create synthetic markers with grouping identifiers to
ensure that the markers are sorted properly and merged.  We would
previously mark the section as read/write rather than read-only causing
warnings when linking.  Correct the attributes.  This ensures the proper
linking of the modules.
2018-02-02 14:56:23 -08:00
Mike Ash
7239dd61b9 [Runtime] Fix swift_slowAlloc to respect its alignMask parameter.
Instead of calling malloc, call AlignedAlloc. That calls posix_memalign on platforms where it's available. The man page cautions to use it judiciously, but Apple OSes and Linux implement it to call through to malloc when the alignment is suitable. Presumably/hopefully other OSes do the same.

rdar://problem/22975669
2018-02-02 17:16:36 -05:00
troughton
e156826984 Remove _swift_allocBox_ function pointers. 2018-02-03 10:20:57 +13:00
troughton
cf28ff448c Remove TwoWordPair and use SwiftCC instead. 2018-02-03 09:43:00 +13:00
Saleem Abdulrasool
0fa8ac062c stdlib: remove vestigial SWIFT_USE_SWIFTCALL
Remove the last vestiges of `SWIFT_USE_SWIFTCALL`.  Building without
SwiftCC is no longer supported.
2018-02-01 22:52:17 -08:00
swift-ci
a741a4e376 Merge remote-tracking branch 'origin/master' into master-next 2018-02-01 19:09:25 -08:00
swift-ci
5dd3572dbf Merge pull request #14351 from DougGregor/demangle-to-metadata-class-constraints 2018-02-01 18:59:56 -08:00
Doug Gregor
ef1dfdfc42 [Runtime] Stub out the same-conformance requirement check.
The compiler doesn't generate these yet, and we don't really have a
good way to use or test them. For now, ignore them.
2018-02-01 17:40:17 -08:00
Doug Gregor
90afecfda8 [Runtime] Dynamically evaluate superclass constraints. 2018-02-01 17:35:47 -08:00
Doug Gregor
9445839208 [Runtime] Evaluate layout constraints at runtime. 2018-02-01 17:20:44 -08:00
Doug Gregor
5c59e81480 [Runtime] Evaluate same-type requirements at runtime.
Extend the runtime's ability for evaluating generic requirements to
handle same-type requirements, demangling/substituting the name from
the generic requirement metadata.
2018-02-01 17:00:51 -08:00
swift-ci
78578e2a7c Merge remote-tracking branch 'origin/master' into master-next 2018-02-01 16:09:08 -08:00
Doug Gregor
6dc429af43 Merge pull request #14327 from DougGregor/demangle-to-metadata-generic-reqs
Check generic requirements in `_typeByMangledName`.
2018-02-01 16:07:29 -08:00
swift-ci
cac783ef9e Merge remote-tracking branch 'origin/master' into master-next 2018-02-01 15:49:08 -08:00
swift-ci
13d6d9b67b Merge pull request #14344 from gottesmm/pr-3795434d15ca181c9da1f232ce9a3f23e936f94c 2018-02-01 15:37:39 -08:00
swift-ci
10acb447da Merge remote-tracking branch 'origin/master' into master-next 2018-02-01 15:09:22 -08:00
swift-ci
1b7f76f0f2 Merge pull request #14343 from gottesmm/pr-4ae52c548d2f9133a74b620859eb1ed0640f60cf 2018-02-01 14:53:12 -08:00
Doug Gregor
f8c769c4ae [Demangle-to-type] Handle type arguments and requirements for nested generics.
Extend the support for mangled-name-to-type-metadata's handling of generic
types to handle nested types, including gathering type arguments from
parent contents and checking generic requirements.
2018-02-01 14:45:13 -08:00
Doug Gregor
8c4d86c74a [Mangled name -> metadata] Check generic protocol conformance requirements.
Extend support for mapping a mangled name -> type metadata to include
support for checking protocol conformance requirements, using the
encoding of generic requirements that is now available within context
descriptors. For example, this allows
_typeByMangledName(mangled-name-of-Set<Int>) to construct proper type
metadata, filling in the Int: Hashable requirement as appropriate.
2018-02-01 14:43:24 -08:00
Doug Gregor
82259e11f1 [Runtime] Make type context descriptor accessor for TargetTypeMetadataRecord robust.
Don't assert if we have an unexpected kind; return null so the caller
can handle it.
2018-02-01 14:41:53 -08:00