Commit Graph

7767 Commits

Author SHA1 Message Date
Roman Levenstein
20b92e6ed0 Merge pull request #7751 from swiftix/code-size-improvements
Code size improvements
2017-02-26 11:52:20 -08:00
Saleem Abdulrasool
125e882c8c build: permit overriding the linker
When cross-compiling for android ARM, it is possible that the system
linker does not support the target.  However, in order to cross-compile
the target runtime, we need to adjust the linker to the target linker.
If one is not specified, fall back to the current behaviour of using the
system linker.
2017-02-26 11:25:07 -08:00
Erik Eckstein
7d7dc5aaac Demangler: Use a bump-pointer allocator for node allocation.
This makes the demangler about 10 times faster.
It also changes the lifetimes of nodes. Previously nodes were reference-counted.
Now the returned demangle  node-tree is owned by the Demangler class and it’s lifetime ends with the lifetime of the Demangler.

Therefore the old (and already deprecated) global functions demangleSymbolAsNode and demangleTypeAsNode are no longer available.

Another change is that the demangling for reflection now only supports the new mangling (which should be no problem because
we are generating only new mangled names for reflection).
2017-02-24 19:04:13 -08:00
Joe Groff
24367fa5d9 Runtime: Have native refcounting entry points ignore negative pointer values on x86-64 and arm64.
The high half of the address space is used by the kernel in these architectures, and it would be useful for us to be able to pack small values into places the ABI otherwise requires a refcountable pointer, such as closures and maybe refcounted existentials.
2017-02-24 16:02:11 -08:00
Roman Levenstein
34815ff9ef [sil-generic-specializer] Do not create specializations for functions marked with @_semantics("optimize.sil.specialize.generic.never")
Those functions are not critical for performance, but their specializations result in a stdlib code bloat.
2017-02-24 14:59:44 -08:00
Greg Parker
ae1c984920 New refcount representation (#5282)
New refcount representation and weak variable implementation. See SwiftShims/RefCount.h for details.
2017-02-24 14:19:11 -08:00
practicalswift
f062a84185 [gardening] Add end-of-namespace comment 2017-02-24 09:38:00 +01:00
Jordan Rose
51d0715434 [CMake] Update dependencies for CloudKit for Apple-internal configs. (#7693)
rdar://problem/30432611
2017-02-23 13:40:01 -08:00
Slava Pestov
66bcf5b756 stdlib: Address a couple of ABI FIXMEs by deleting code
We have an implicit conversion to AnyHashable, so there's no
need to have the special subscript on Dictionary at all.
2017-02-21 20:28:49 -08:00
swift-ci
6c981c8f64 Merge pull request #7432 from ktopley-apple/dispatch-after-mach 2017-02-21 13:21:38 -08:00
Jordan Rose
20bdedf17e Merge pull request #6689 from parkera/pr27556178_wrong_image_thumbnail_key
Use the right key for the image thumbnail dictionaries in the URL resources struct
2017-02-21 09:27:30 -08:00
Hugh Bellamy
6564a8b3b5 Use std::thread::hardware_concurrency instead of our own solution 2017-02-21 11:46:32 +07:00
Hugh Bellamy
098df729fe Merge pull request #7490 from hughbe/attribute-cleanup
Various cleanups to definitions in the runtime
2017-02-21 08:03:51 +07:00
Doug Gregor
63b122c1f6 Merge pull request #7282 from kballard/urlerror_missing_cases
[SDK] Convert URLError.Code to a struct and add missing cases
2017-02-20 09:14:42 -08:00
Hugh Bellamy
52a362270c Attempt to fix Linux build - a clang/ubuntu bug means we can't find stddef.h 2017-02-20 19:52:39 +07:00
Hugh Bellamy
387ecad7b5 Cleanup redundant #ifdefs working around libc's stdint.h implementation pulling in Darwin 2017-02-20 17:58:57 +07:00
Kevin Ballard
bbd71b987d [SDK] Convert URLError.Code to a struct and add missing cases
URLError.Code was an enum, which is a bad idea because it can lead to
crashes if the enum doesn't cover a legitimate error code. Convert it to
a struct to match how CocoaError.Code is implemented.

Also add the missing cases `. dataLengthExceedsMaximum` and
`. appTransportSecurityRequiresSecureConnection`, and fix the broken
cases `.backgroundSessionRequiresSharedContainer`,
`.backgroundSessionInUseByAnotherProcess`, and
`.backgroundSessionWasDisconnected`.
2017-02-19 23:33:25 -08:00
Hugh Bellamy
3a96ded085 Don't use certain attributes in shims or stubs if the attribute doesn't exist 2017-02-20 10:16:30 +07:00
Jans Pavlovs
aa9efae562 Update map example code
Changes deprecated lowercaseString calls to lowercased()
This commit only affects example code provided in comments
2017-02-19 14:19:08 +02:00
Roman Levenstein
dd19a13221 Merge pull request #7553 from swiftix/wip-generics-inlining-flag-6
Preparation for enabling the  inlining of generics
2017-02-17 18:41:34 -08:00
Hugh Bellamy
a570f6b87b Merge pull request #7405 from hughbe/visual-studio-bug
Work around Visual Studio bug inferring type of auto
2017-02-18 09:26:40 +07:00
swift-ci
9f132d4dd0 Merge pull request #7566 from moiseev/ck-watch 2017-02-17 12:15:41 -08:00
Max Moiseev
95e2bb4746 [overlay] watchOS availability for CKError 2017-02-17 10:37:42 -08:00
Nate Cook
3ab1060e0a [stdlib] Doc comment revisions for (un)signed integers (#7541) 2017-02-16 15:34:19 -08:00
Nate Cook
15525c0d68 [stdlib] Correct documentation for ReversedIndex.base 2017-02-16 15:46:31 -06:00
Roman Levenstein
658a9cc93f Do not use the inlining of generics for creation of pre-specializations
We want to produce as many of the required specializations as possible, instead of generically inlining their implementations.
2017-02-16 13:05:04 -08:00
Ben Cohen
863dfca3a2 Merge pull request #7510 from airspeedswift/zip-aliases
[stdlib] Deprecate aliases on Zip2Sequence
2017-02-16 08:14:03 -08:00
Arnold Schwaighofer
d0810fcce8 Add missing terminating quotation character in include line 2017-02-16 06:48:06 -08:00
Michael Gottesman
8437819b5a [CMake] Revert recent changes.
These changes caused a number of issues:

1. No debug info is emitted when a release-debug info compiler is built.
2. OS X deployment target specification is broken.
3. Swift options were broken without any attempt any recreating that
functionality. The specific option in question is --force-optimized-typechecker.

Such refactorings should be done in a fashion that does not break existing
users and use cases.

This reverts commit e6ce2ff388.
This reverts commit e8645f3750.
This reverts commit 89b038ea7e.
This reverts commit 497cac64d9.
This reverts commit 953ad094da.
This reverts commit e096d1c033.

rdar://30549345
2017-02-15 22:26:06 -08:00
Ben Cohen
800248406e [stdlib] Deprecate aliases on Zip2Sequence 2017-02-15 16:09:18 -08:00
swift-ci
843327a300 Merge pull request #7496 from eeckstein/new-manging-in-reflection 2017-02-15 11:55:20 -08:00
swift-ci
5c19726b81 Merge pull request #7498 from aschwaighofer/add_missing_include_for_swift_cc 2017-02-15 11:22:03 -08:00
Philippe Hausler
525ffcc605 Merge pull request #7155 from phausler/Data_as_own_SubSequence
[Foundation] Convert Data’s SubSequence type to be Data
2017-02-15 11:02:27 -08:00
Arnold Schwaighofer
1af4fb401c Add missing include
The leaks bot complains about not knowning what SWIFT_CC is.
2017-02-15 10:55:50 -08:00
Maxim Moiseev
36ec947c06 Fix for the Intents overlay on watchOS (#7493) 2017-02-15 10:37:28 -08:00
Erik Eckstein
2d127e4192 Reinstate ”Use the new mangling for reflection."
It also uses the new mangling for type names in meta-data (except for top-level non-generic classes).
lldb has now support for new mangled metadata type names.

This reinstates commit 21ba292943.
2017-02-15 09:47:22 -08:00
Doug Coleman
40e092b308 Merge pull request #7468 from spevans/pr_lowercase
Remove misspelt CMakefile variable
2017-02-14 20:47:36 -08:00
Greg Parker
0d8818583b [stdlib] Retry after EINTR in posixWaitpid(). 2017-02-14 20:44:16 -08:00
Slava Pestov
13d6b183c0 Merge pull request #7370 from llvm-beanz/simplify-add_swift_library
[CMake] Simplify add_swift_library
2017-02-14 19:16:59 -08:00
Chris Bieneman
e096d1c033 [CMake] Simplify add_swift_library
This patch splits add_swift_library into two functions one which handles
the simple case of adding a library that is part of the compiler being
built and the second handling the more complicated case of "target"
libraries, which may need to build for one or more targets.

The new add_swift_library is built using llvm_add_library, which re-uses
LLVM's CMake modules. In adapting to use LLVM's modules some of
add_swift_library's named parameters have been removed and
LINK_LIBRARIES has changed to LINK_LIBS, and LLVM_LINK_COMPONENTS
changed to LINK_COMPONENTS.

This patch also cleans up libswiftBasic's handling of UUID library and
headers, and how it interfaces with gyb sources.

add_swift_library also no longer has the FILE_DEPENDS parameter, which
doesn't matter because llvm_add_library's DEPENDS parameter has the same
behavior.
2017-02-14 14:28:10 -08:00
Arnold Schwaighofer
39fa2f0228 Use the swift calling convention for swift functions
Use the generic type lowering algorithm described in
"docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion
type to the type expected by the ABI.

Change IRGen to use the swift calling convention (swiftcc) for native swift
functions.

Use the 'swiftself' attribute on self parameters and for closures contexts.

Use the 'swifterror' parameter for swift error parameters.

Change functions in the runtime that are called as native swift functions to use
the swift calling convention.

rdar://19978563
2017-02-14 12:17:57 -08:00
Bob Wilson
03ff046afc Replace a cmake option with a preprocessor macro.
When moving to the swift-4.0-branch of LLVM, we started using the
LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING cmake option to turn off those
checks. This was necessary for the stdlib build, where it uses some LLVM
headers without linking libSupport.a, but the cmake option forced us to
disable the checks across the board. It also caused a lot of churn for
people who needed to remove their cmake caches when switching to the new
version of LLVM. This change switches to use a preprocessor macro to
disable the checks only in the context of the stdlib build. It requires
LLVM r295090. rdar://problem/30098953
2017-02-14 11:27:20 -08:00
practicalswift
65b0219f7b [gardening] Fix typos 2017-02-14 20:04:08 +01:00
Simon Evans
11a71912e8 Remove misspelt CMakefile variable
- ${lowercase} was used instead of ${lowercase_sdk} so evaluated to ''
  but wasnt required anyway.
2017-02-14 17:34:13 +00:00
John McCall
038303b1b1 Switch MetadataCache to use a global slab allocator.
This seems to more than fix a performance regression that we
detected on a metadata-allocation microbenchmark.

A few months ago, I improved the metadata cache representation
and changed the metadata allocation scheme to primarily use malloc.
Previously, we'd been using malloc in the concurrent tree data
structure but a per-cache slab allocator for the metadata itself.
At the time, I was concerned about the overhead of per-cache
allocators, since many metadata patterns see only a small number
of instantiations.  That's still an important factor, so in the
new scheme we're using a global allocator; but instead of using
malloc for individual allocations, we're using a slab allocator,
which should have better peak, single-thread performance, at the
cost of not easily supporting deallocation.  Deallocation is
only used for metadata when there's contention on the cache, and
specifically only when there's contention for the same key, so
leaking a little isn't the worst thing in the world.

The initial slab is a 64K globally-allocated buffer.
Successive slabs are 16K and allocated with malloc.

rdar://28189496
2017-02-14 11:10:44 -05:00
Hugh Bellamy
0ca86fb760 Merge pull request #7411 from hughbe/getKeyIntValueForDump-intrptrt
Change getKeyIntValueForDump to use intptr_t rather than long
2017-02-14 09:08:37 +07:00
Kim Topley
fe8d8bb88a Fix the DispatchTime.init(uptimeNanoseconds:) initializer to convert its argument to Mach absolute time instead of treating it as Mach absolute time.
(Radar 29660448)
2017-02-13 12:24:38 -08:00
Kim Topley
5229d1a777 Revert "Fix the DispatchTime.init(uptimeNanoseconds:) initializer to convert its argument to Mach absolute time instead of treating it as Mach absolute time."
This reverts commit 1377cae2b9.
2017-02-13 12:22:06 -08:00
Kim Topley
1377cae2b9 Fix the DispatchTime.init(uptimeNanoseconds:) initializer to convert its argument to Mach absolute time instead of treating it as Mach absolute time.
(Radar 29660448)
2017-02-13 11:19:40 -08:00
Jordan Rose
1c60910198 Revert "Merge pull request #6092 from swiftix/wip-generics-inlining-flag-4"
This reverts commit 1b3d29a163, reversing
changes made to b32424953e.

We're seeing a handful of issues from turning on inlining of generics,
so I'm reverting to unblock the bots.
2017-02-13 10:52:17 -08:00