Commit Graph

1782 Commits

Author SHA1 Message Date
Pavel Yaskevich
3323ae36bf [Metadata] Use ownership info from _typeByMangledName 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
7bcd7306c0 [Runtime/Metadata] Move swift_getFieldAt to new generic context framework 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
50785df558 [Runtime] NFC: Update names of the field section to swift5_fieldmd 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
7a7825ff50 [Runtime/Reflection] Switch enum mirrors to use runtime get field method 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
877c70bae9 [Runtime/Metadata] Add support for dynamic field descriptor registration 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
c44ad571c8 [Runtime/ABI] Add ownership info to the name-to-type metadata builder 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
0da5e48a0e [Runtime/Reflection] Add swift_getFieldAt runtime accessor
Use information from reflection section of the binary to lookup
type field info such as name and it's type and return it using
new `swift_getFieldAt` method based on nominal type and field index.
2018-02-20 18:20:09 -08:00
Pavel Yaskevich
bc1c170a45 [Runtime] Register type field metadata section 2018-02-20 18:18:48 -08:00
John McCall
23fa44e56c Render TypeContextDescriptor into a proper hierarchy; NFC.
The purpose here is to make it easier to add type-specific fields to the
descriptor.
2018-02-20 15:20:32 -05:00
Mike Ash
0cff498db4 [Reflection] Use getClassObject() when testing for ObjCness rather than blindly casting to ClassMetada, which turns out to be completely incorrect. 2018-02-20 15:15:14 -05:00
swift-ci
aa5c530a36 Merge remote-tracking branch 'origin/master' into master-next 2018-02-19 17:09:06 -08:00
Pavel Yaskevich
855e2286cd [Metadata/TypeByName] Don't try to check for dot syntax in presence of symbolic references
If symbolic references are present in the mangled name don't try
to check for convenience dot syntax as well since they can't appear
together.
2018-02-19 14:54:34 -08:00
Mike Ash
fa2ea034d1 Merge branch 'master' into remove-reflectionlegacy 2018-02-19 09:56:57 -05:00
Mike Ash
44d9b2f5cd [Runtime] Move swift_demangle to Demangle.cpp. It seems more at home there. 2018-02-16 16:55:11 -05:00
Mike Ash
33990583df [Runtime] Have ReflectionMirror.mm get SwiftObject declarations from SwiftObject.h. 2018-02-16 16:20:12 -05:00
Mike Ash
4045edf886 [Runtime] Remove old-style mirrors in ReflectionLegacy.swift.
The old-style mirrors were the basis for non-custom, reflection based Mirrors. As part of removing old-style mirrors, reflection based Mirrors are reimplemented without them. Reflection.mm is deleted and replaced with ReflectionMirror.mm, which borrows a chunk of the old code but presents a simpler API to the Swift side. ReflectionMirror.swift then uses that API to implement a reflection-based Mirror init.

rdar://problem/20356017
2018-02-16 16:05:40 -05:00
swift-ci
91376db8cb Merge remote-tracking branch 'origin/master' into master-next 2018-02-16 11:29:49 -08:00
Doug Gregor
800e3818b7 [Type metadata] @objc protocol conformance requirements don't have arguments.
@objc protocols don't have witness tables. However, both type metadata
(in the nominal type descriptors) and the runtime code to demangle
type names into metadata weren't acknowledging this. Fix type metadata
emission to not count an "extra argument" for @objc protocol
conformance requirements, and teach the runtime code to properly look
for conformances to @objc protocols (through the Objective-C runtime)
and not record witness tables for them.
2018-02-15 14:07:46 -08:00
swift-ci
934240baba Merge remote-tracking branch 'origin/master' into master-next 2018-02-14 22:29:26 -08:00
Pavel Yaskevich
33996de39c Merge pull request #14649 from xedin/objc-existential-type-by-name
[Runtime] Existential types marked as @objc should satisfy class requirement
2018-02-14 22:28:37 -08:00
Pavel Yaskevich
73f09ecbf5 [Runtime] Existential types marked as @objc should satisfy class requirement
Make sure that `checkGenericRequirements` properly enforces
"class requirement" constraint on the generic parameters.
2018-02-14 21:16:44 -08:00
swift-ci
6dd6a9213b Merge remote-tracking branch 'origin/master' into master-next 2018-02-14 15:49:04 -08:00
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