Commit Graph

7767 Commits

Author SHA1 Message Date
Rintaro Ishizaki
f11b74176b [stdlib] Workaround type checker ambiguity in Comparable SwiftNewtypeWrapper 2017-01-31 21:29:10 +09:00
Max Moiseev
c342166f10 Renaming leadingZeros to leadingZeroBits. Same for trailingZeros 2017-01-30 17:16:16 -08:00
Max Moiseev
125efc1fcc Moving / down to the BinaryInteger protocol 2017-01-30 17:16:16 -08:00
Joe Groff
b8b7b5f53b Merge pull request #6097 from spevans/pr_solib_constructor
[runtime] Binary section data loading for extra ELF images
2017-01-30 17:13:02 -08:00
Max Moiseev
0e7863129c Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-30 16:51:16 -08:00
Joe Groff
fd91396b30 Merge pull request #7136 from jckarter/missing-slice-default-implementations
Fix source compatibility problems with conforming to multiple Collection axes at once.
2017-01-30 14:34:47 -08:00
swift-ci
b1a0273fd3 Merge pull request #7145 from DougGregor/de-gyb-interpolation 2017-01-30 11:32:37 -08:00
swift-ci
138f75c80e Merge pull request #7036 from ktopley-apple/dispatch-data-copy 2017-01-30 11:06:25 -08:00
Simon Evans
86596a469e Add dependancy for Linux link argument files 2017-01-30 18:17:28 +00:00
Doug Gregor
658f244188 [Standard library] de-GYB string interpolation. NFC 2017-01-30 10:16:24 -08:00
Joe Groff
34ec424898 stdlib: Adding missing default implementations of subscript(Range<Index>) for combinations of [Mutable][RangeReplaceable][Bidirectional|RandomAccess]Collection.
These were overlooked, and somehow code that attempted to make a minimal collection conform to RangeReplaceableCollection and RandomAccessCollection managed to compile successfully in Swift 3.0, but in Swift 3.1…*something* changed to reject a type that conforms to both due to the lack of a suitable default slicing subscript implementation in the stdlib that provided all the requirements. Fill in these missing implementations, fixing rdar://problem/30228957.
2017-01-30 09:54:58 -08:00
John McCall
2b25701a93 Revert "Switch MetadataCache to use a global slab allocator."
This reverts commit ccbe5fcf73.
2017-01-29 00:17:30 -05:00
John McCall
7df2fa1b79 Merge pull request #7109 from rjmccall/global-slab-metadata-allocator
Switch MetadataCache to use a global slab allocator.
2017-01-28 17:16:51 -05:00
John McCall
ccbe5fcf73 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-01-28 02:37:22 -05:00
Doug Gregor
f6cac54606 Replace concrete init(stringInterpolationSegment:)'s with generic ones
Remove 16 concrete init(stringInterpolationSegment:) overloads and
replace them with 3 generic overloads, significantly reducing the
exponential blow-up from larger string interpolations.

Fixes rdar://problem/29389887.
2017-01-27 21:54:59 -08:00
Greg Parker
ea94be6f90 [runtime] Clean up documentation of the swift_once() implementation. 2017-01-27 19:37:47 -08:00
Jordan Rose
db45e57379 [SDK] Resolve unsafeBitCast warnings in the 'os' overlay. (#7120) 2017-01-27 19:36:20 -08:00
Jordan Rose
2c48542f2f [SDK] Resolve unsafeBitCast warnings in the CoreData overlay (#7118)
No intended functionality change.
2017-01-27 19:35:50 -08:00
Max Moiseev
06a45cb8fd Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-27 16:36:41 -08:00
Max Moiseev
5601f5fd51 Adding back a transparrent attribute in an initializer 2017-01-27 16:35:49 -08:00
Simon Evans
7d2a9aa761 [runtime] Abort if dlopen() fails when loading ELF section data 2017-01-27 23:50:26 +00:00
Simon Evans
5c993b45db [runtime] Remove swift_addNewDSOImage() call from static ELF binaries
- Create separate swift_begin.o/swift_end.o for lib/swift and
  lib/swift_static. The static swift_begin.o does not call
  swift_addNewDSOImage() at startup.

- Update ToolChains.cpp to use the correct swift_begin.o/swift_end.o
  files for the `-static-stdlib` and `-static-executable` options.
2017-01-27 14:04:58 +00:00
Simon Evans
30436f4077 [runtime] ELF DSO binary section fixes
- Rename swift::addNewDSOImage() to swift_addNewDSOImage() and
  export using SWIFT_RUNTIME_EXPORT.

- Move ELF specific parts of ImageInspection.h into
  ImageInspectionELF.h.
2017-01-27 14:04:54 +00:00
Simon Evans
e07c0d21c2 [runtime] Binary section data loading for extra ELF images
- For ELF targets, keep track of shared objects as they are
  dynamically loaded so that section data can be added to
  the protocol conformance and type metadata caches after
  initialisation (rdar://problem/19045112).
2017-01-27 10:28:46 +00:00
Hugh Bellamy
a2daee58c6 Merge pull request #7055 from hughbe/unreachable
Cleanup swift_unreachable
2017-01-27 08:55:04 +00:00
Erik Eckstein
ef3a611ddb stdlib: make sure that Array._copyBuffer is not inlined.
Although it’s called via _slowPath the compiler sometimes inlines it, because it considers it to be a trivial function.
This change gives small code size improvements for benchmarks which deal with arrays.

rdar://problem/30210047
2017-01-26 15:59:55 -08:00
Max Moiseev
90ef26824f Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-26 15:28:42 -08:00
Kim Topley
7d9ed86d8c Fixes handling of range indices in DispatchData.copyBytes() and adds tests for the copyBytes() method (Radar 29005050) 2017-01-26 09:13:25 -08:00
Hugh Bellamy
818099ecbe Rename swift_unreachable to swift_runtime_unreachable 2017-01-26 15:31:34 +00:00
Hugh Bellamy
5a59971b95 Move Unreachable.h from include/Basic to include/Runtime 2017-01-26 15:31:33 +00:00
Ben Cohen
d3728ac5a8 Merge pull request #6850 from allevato/character-performance
[stdlib] Speed up Character.init significantly for small characters.
2017-01-25 16:51:41 -08:00
Mishal Shah
92ef777085 Update master to build with Xcode 8.3 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2017-01-25 16:13:36 -08:00
Saleem Abdulrasool
ac57b66c99 Merge pull request #6820 from hughbe/extern-c
Introduce SWIFT_EXTERN_RUNTIME_EXPORT for Windows
2017-01-24 19:34:44 -08:00
Max Moiseev
083a2054cb [stdlib] Commenting out a few transparent annotations
To make standard library compile with resiliency on.
2017-01-24 15:59:50 -08:00
swift-ci
de771d3819 Merge pull request #7002 from moiseev/fix-integers-for-resiliency 2017-01-24 12:24:35 -08:00
Nate Cook
d6033995f6 Merge pull request #6995 from keitaito/docs-fix-patch
[stdlib] Fix an error in max() method documentation
2017-01-24 13:26:00 -06:00
Max Moiseev
c81c3ebcdd This fixes the build with resiliency
The compiler changes introduced in
0c294314d0 now prohibit the transparent
initializer assigning to self. One such initializer was in the new
integer protocols, that made it to the master before Swift 3. Luckily it
is not used and can be safely removed for now.
2017-01-24 11:17:02 -08:00
Brian Croom
dc4e856875 Merge pull request #6991 from briancroom/fix-XCTAssert-perf-regression
[SR-3701] [XCTest] Reduce bridging overhead from the exception-catching trampoline
2017-01-24 10:53:22 -08:00
Keita Ito
4318d9d688 [stdlib] Fix an error in max() method documentation
In max() method’s documentation comment, The explanation says “This
example finds the smallest value in an array of height measurements.”
But, it should be “the largest value”. This commit fixes this
documentation error.
2017-01-23 22:25:51 -08:00
Max Moiseev
6d380d9638 Correcting the logic in the reasoning for the heterogeneous comparison implementation 2017-01-23 16:45:09 -08:00
Max Moiseev
d382ac97ea Using >= instead of > to catch overshifts correctly 2017-01-23 16:01:32 -08:00
Max Moiseev
441d2c03e2 Adding CustomDebugStringConvertible conformance to CGVector 2017-01-23 15:42:49 -08:00
Brian Croom
42b6577aa9 [XCTest] Reduce bridging overhead from the exception-catching trampoline
By returning `nil` instead of an empty dictionary in the common case where
no exception is encountered, we skip any dictionary-bridging work which
can become expensive if making assertions in a tight loop.
2017-01-23 15:02:38 -08:00
Max Moiseev
b5ab7263c1 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-23 11:00:33 -08:00
Max Moiseev
1265f0792a Implementing arithmetic operators on NSDecimal, CGFloat, and concrete FP types 2017-01-23 10:59:24 -08:00
practicalswift
a9d6d8938c [gardening] Fix recently introduced typos 2017-01-22 20:40:45 +01:00
Hugh Bellamy
a5a4880075 Remove extern "C" uses of SWIFT_RT_ENTRY_VISIBILITY 2017-01-22 18:32:17 +00:00
Hugh Bellamy
05a50fd978 Remove extern "C" from uses of SWIFT_RUNTIME_STDLIB_INTERFACE 2017-01-22 18:32:17 +00:00
Hugh Bellamy
63cf2d561e Remove extern "C" from uses of SWIFT_RUNTIME_EXPORT 2017-01-22 18:32:17 +00:00
Hugh Bellamy
b6ee5b21f2 Change definition of SWIFT_RUNTIME_EXPORT 2017-01-22 18:32:16 +00:00