Commit Graph

1960 Commits

Author SHA1 Message Date
Andrew Trick
4ed120e46c Merge branch 'master' into add-access-tracking-flag 2018-03-30 19:25:46 -07:00
swift-ci
3466e93d25 Merge remote-tracking branch 'origin/master' into master-next 2018-03-29 19:09:12 -07:00
Andrew Trick
ed8a604c27 Merge branch 'master' into add-access-tracking-flag 2018-03-29 18:26:22 -07:00
Slava Pestov
f197c137a3 Runtime: Remove old 'default requirements at the end' mechanism 2018-03-29 15:23:20 -07:00
Mike Ash
f8837c8d9a [Runtime] Add missing swift:: qualifiers on lookupSection implementations.
rdar://problem/36997475
2018-03-29 17:04:18 -04:00
Slava Pestov
72b56ec66b Runtime: New mechanism for resilient witness table instantiation 2018-03-29 14:03:58 -07:00
Slava Pestov
d1c6e1d24a SIL: Generalize default witness tables now that defaulted witnesses don't have to go at the end
NFC until the new witness table instantiation mechanism is enabled.
2018-03-29 14:03:58 -07:00
Mike Ash
de2d944215 [Runtime] Put some compatibility overrides behind SWIFT_OBJC_INTEROP.
rdar://problem/36997475
2018-03-29 16:56:49 -04:00
swift-ci
b626da4ec6 Merge remote-tracking branch 'origin/master' into master-next 2018-03-29 13:29:09 -07:00
John McCall
aceb2fd5ce Ensure the transitive completion of type arguments and the superclass
before declaring nominal type metadata complete.

Also, future-proof MetadataState.
2018-03-29 13:52:36 -04:00
Mike Ash
f8241caa59 [Runtime] Rename __swift_lite section to __swift_hooks.
rdar://problem/36997475
2018-03-29 12:16:01 -04:00
swift-ci
1cbd392413 Merge remote-tracking branch 'origin/master' into master-next 2018-03-28 22:28:50 -07:00
Slava Pestov
4671f89925 Runtime: Use witness table accessors instead of direct witness table references for Error bridging
This breaks with resilient conformances once the pattern symbol
is no longer public.
2018-03-28 19:47:18 -07:00
Mike Ash
34be7f6f15 Merge branch 'master' into casting-hooks 2018-03-28 14:45:48 -04:00
Mike Ash
f4224b092e [Runtime] Redo compatibility overrides boilerplate using a .def file.
rdar://problem/36997475
2018-03-28 13:39:55 -04:00
tanner0101
56713f7630 add context pointer to swift_getFieldAt function 2018-03-28 01:09:36 -04:00
swift-ci
306cbdf0fc Merge remote-tracking branch 'origin/master' into master-next 2018-03-27 15:46:59 -07:00
Andrew Trick
89d96bff4e Runtime support for nontracking begin_access.
There are multiple reasons to do this. Primarily this is
useful as an optimization. Whenever analysis can determine that no
potentially conflicting access occurs within the scope, the access can
be demoted to "nontracking". It is also useful as an escape hatch for
future code deploying to older runtimes. For example, if a future access
scope may cross threads, and the older runtime doesn't know how to
migrate threads.

See <rdar://problem/37507434> add a flag to swift_beginAccess to inform
the runtime that an access might migrate between threads
2018-03-27 12:04:32 -07:00
Mike Ash
a3a44a1529 [Runtime] Return nullptr instead of NULL in lookupSection stubs.
rdar://problem/36997475
2018-03-27 11:54:28 -04:00
tanner0101
1af7c118ab make swift_getFieldAt runtime method c-callable 2018-03-27 02:21:05 -04:00
Greg Parker
072e9827aa Use SwiftObject's old name when building for the pre-stable ABI.
rdar://35554345
2018-03-26 14:04:30 -07:00
swift-ci
65d71c8fc1 Merge remote-tracking branch 'origin/master' into master-next 2018-03-26 11:50:42 -07:00
John McCall
583bec3b2c Add a runtime function to query the current runtime state of a metadata.
This functions returns the metadata purely for liveness purposes.
2018-03-26 02:48:52 -04:00
John McCall
6d99a7755a Restructure how we finalize VWTs in the runtime to potentially allow asynchronous queries.
I keep finding reasons to want such queries and then deciding that they're
unnecessary.  Let's at least do this much, though.
2018-03-26 01:13:45 -04:00
John McCall
ba17f320c6 Extract MetadataRequest::BasicKind as MetadataState. NFC.
I de-templated MetadataState and MetadataRequest because we weren't
relying on the template and because using the template was causing
conversion problems due to the inability to directly template an enum
in C++.
2018-03-26 01:13:45 -04:00
swift-ci
47e75bf7c0 Merge remote-tracking branch 'origin/master' into master-next 2018-03-23 20:23:04 -07:00
Slava Pestov
b1f4430410 Runtime: Rename swift_initClassMetadata_UniversalStrategy()
Rename it to swift_initClassMetadata() just like we recently did
swift_initStructMetadata(), and add a StructLayoutFlags parameter
so we can version calls to this function in the future.

Maybe at some point this will become a separate ClassLayoutFlags
type, but at this point it doesn't matter because IRGen always
passes a value of 0.
2018-03-23 18:59:07 -06:00
swift-ci
a76be68e93 Merge remote-tracking branch 'origin/master' into master-next 2018-03-22 09:29:33 -07:00
Mike Ash
cf3ee980a8 Merge pull request #14283 from mikeash/fix-urc-overflow-to-side-table-in-deinit
[Runtime] Fix unowned refcount overflow to side table during deinit.
2018-03-22 09:15:20 -07:00
Mike Ash
d024fd7487 [Runtime] Fill out a bunch more compatibility hooks.
rdar://problem/36997475
2018-03-22 09:14:55 -07:00
Mike Ash
f2b89d1b94 Merge branch 'master' into fix-urc-overflow-to-side-table-in-deinit 2018-03-21 15:32:01 -07:00
Mike Ash
6ed2628883 [Runtime] Clean up the compatibility hooking mechanism a bit. Add a hook to swift_conformsToProtocol.
rdar://problem/36997475
2018-03-21 14:16:41 -07:00
swift-ci
893d163241 Merge remote-tracking branch 'origin/master' into master-next 2018-03-21 10:29:45 -07:00
Mike Ash
9e8d4da76f [Runtime] Add a hooking mechanism to allow future apps to extend dynamic casting and type lookup. Make swift_dynamicCast and swift_getTypeByMangledName use these hooks.
rdar://problem/36997475
2018-03-20 16:33:37 -07:00
Arnold Schwaighofer
9d8c381ab4 Remove resilient tag indices 2018-03-20 13:19:56 -07:00
swift-ci
a948e52936 Merge remote-tracking branch 'origin/master' into master-next 2018-03-19 10:43:42 -07:00
John McCall
31f2eec044 Change type metadata accessors to support incomplete metadata.
This includes global generic and non-generic global access
functions, protocol associated type access functions,
swift_getGenericMetadata, and generic type completion functions.

The main part of this change is that the functions now need to take
a MetadataRequest and return a MetadataResponse, which is capable
of expressing that the request can fail.  The state of the returned
metadata is reported as an second, independent return value; this
allows the caller to easily check the possibility of failure without
having to mask it out from the returned metadata pointer, as well
as allowing it to be easily ignored.

Also, change metadata access functions to use swiftcc to ensure that
this return value is indeed returned in two separate registers.

Also, change protocol associated conformance access functions to use
swiftcc.  This isn't really related, but for some reason it snuck in.
Since it's clearly the right thing to do, and since I really didn't
want to retroactively tease that back out from all the rest of the
test changes, I've left it in.

Also, change generic metadata access functions to either pass all
the generic arguments directly or pass them all indirectly.  I don't
know how we ended up with the hybrid approach.  I needed to change all
the code-generation and calls here anyway in order to pass the request
parameter, and I figured I might as well change the ABI to something
sensible.
2018-03-18 21:38:08 -04:00
swift-ci
188ecdd102 Merge remote-tracking branch 'origin/master' into master-next 2018-03-17 10:49:11 -07:00
John McCall
1d4fc1933b Let the runtime copy generic arguments into place. 2018-03-17 11:40:31 -04:00
John McCall
aa0658decf Allow value witness tables to advertise themselves as incomplete
and use that when evaluating how complete an incomplete metadata is.
2018-03-17 11:40:30 -04:00
John McCall
3d5d643b9e Substantially simplify the synchronization scheme for metadata caches.
I was trying to make the entry-delegation thing do *way* too much.
Just give the entry access to the lock/queue and introduce subclasses
which simplify most of the work.

Also, fix some bad reasoning around the attempts to avoid acquiring
locks in the absence of waiters.  It really is always necessary to
acquire the lock when notifying; waiters cannot atomically set the
has-waiters flag and wait, so we have to protect against the
possibility that we notify before they can wait.
2018-03-17 11:40:30 -04:00
John McCall
3cf9a6f91a Add the caching machinery for arbitrary metadata dependencies.
We aren't taking advantage of this yet.
2018-03-17 11:40:30 -04:00
swift-ci
f168a79875 Merge remote-tracking branch 'origin/master' into master-next 2018-03-14 15:36:54 -07:00
Arnold Schwaighofer
0c11e1a0a3 Mark swift sections as swift4 for Swift 4.2
rdar://36363251
2018-03-14 10:27:28 -07:00
swift-ci
7eb158fadd Merge remote-tracking branch 'origin/master' into master-next 2018-03-12 09:49:23 -07:00
swift-ci
f764e685c2 Merge pull request #15177 from darquro/excise-iostream-from-metadata 2018-03-12 09:39:11 -07:00
swift-ci
43dfbf05b3 Merge remote-tracking branch 'origin/master' into master-next 2018-03-12 07:09:15 -07:00
Joe Groff
3fd2d2165e Merge pull request #15145 from jckarter/trimming-metadata
Trimming metadata
2018-03-12 06:55:59 -07:00
darquro
71e27406dd [stdlib] Excise #include <iostream> from Metadata.cpp. (SR-7164) 2018-03-12 20:29:27 +09:00
swift-ci
9fc03c25c4 Merge remote-tracking branch 'origin/master' into master-next 2018-03-10 10:28:59 -08:00