Commit Graph

1309 Commits

Author SHA1 Message Date
Dave Abrahams
f8f82a9061 [stdlib] ContiguousArrayBuffer: tiny logic cleanup
Swift SVN r22951
2014-10-26 21:37:40 +00:00
Dave Abrahams
ac79309e01 [stdlib] _ArrayBufferType: drop baseAddress
Exposing the raw baseAddress without lifetime control is error-prone.
Began to strip actual uses of baseAddress from specific models of
_ArrayBufferType, too.

Swift SVN r22950
2014-10-26 21:37:39 +00:00
Dave Abrahams
a71e88bb1d [stdlib] Use ''' instead of """ to deconfuse Emacs
The indenter does great until it sees the Python triple-quoted string
containing a swift string with a string intepolation inside; that brings
it out to quotation level zero and then the backslash escapes the open
paren causing the nesting level to go negative when it sees the close
paren.  Sheesh.

Swift SVN r22948
2014-10-26 18:29:43 +00:00
Dave Abrahams
1a9f96e1c7 [stdlib] Drop unneeded protocol requirement
Conversion to cocoa is not a common requirement for all models of
_ArrayBufferType

Swift SVN r22947
2014-10-26 18:29:42 +00:00
Dave Abrahams
df016d35f3 [stdlib] _ContiguousArrayStorageBase : NSArray
Every _ContiguousArrayStorageBase that stores objects now is-a NSArray.
No specific testing yet.

Swift SVN r22937
2014-10-25 01:08:20 +00:00
Dave Abrahams
7b774239d0 [stdlib] Kill redundant protocol requirement
Swift SVN r22934
2014-10-24 23:53:03 +00:00
Dave Abrahams
6786969209 [stdlib] Introduce _SwiftDeferredNSArray
This is mostly just a renaming of _SwiftNativeNSArray, except that we
want to add another NSArray subclass for verbatim-bridged elements, so
we want a common base class.  _SwiftNativeNSArray is the name of that
new base class, to parallel the other _SwiftNativeNSXXX classes.

Swift SVN r22913
2014-10-24 15:48:48 +00:00
Dave Abrahams
ce99c04938 [stdlib] mv files NSSwiftXXX => SwiftNativeNSXXX
Swift SVN r22912
2014-10-24 15:48:47 +00:00
Dave Abrahams
418aa75eb2 [stdlib] Rename _NSSwiftXXX => _SwiftNativeNSXXX
...to better reflect the purpose of these classes

Swift SVN r22911
2014-10-24 15:48:46 +00:00
Dave Abrahams
43c9d38abc [stdlib] Drop needless "Swift" from some names
Swift SVN r22910
2014-10-24 15:48:45 +00:00
Dave Abrahams
393c520fbe [stdlib] Separate source file for shadow protocols
They didn't belong lumped together in the implementation of Dictionary,
where they were.

Swift SVN r22909
2014-10-24 15:48:45 +00:00
Dave Abrahams
44c0ab4385 [stdlib] Internal protocol renaming
for consistency with earlier moves on NSArray shadow protocols

Swift SVN r22908
2014-10-24 15:48:44 +00:00
Dave Abrahams
981a156823 [stdlib] Add _UnitTestArray[Buffer] temporarily
We're going to replace StdlibUnittest's use of ContiguousArray with
_UnitTestArray so that we can work on (and potentially break)
_ContiguousArray and still get useful test results.  When refactoring is
complete, we can optionally replace StdlibUnittest's use of
_UnitTestArray with ContiguousArray, or move the decoupled component
into the StdlibUnittest module.

Swift SVN r22874
2014-10-22 05:28:22 +00:00
Dmitri Hrybenko
ca4df0cbf2 stdlib: use 'count' for parameter name consistently
rdar://18665454

Swift SVN r22871
2014-10-22 00:58:31 +00:00
Arnold Schwaighofer
f88190ab8b Reapply "stdlib: libm's sqrt and llvm.sqrt are not semantically equivalent""
This reapplies commit r22864 - it is not changing the public api as we initially
thought. sqrt() was never available without importing Darwin.

This change only changes where sqrt() gets "forwarded" to. Before 'sqrt' called
the builtin '_sqrt' defined in BuiltinMath now it just calls the math library's
'sqrt' function.

I also added a stdlib test.

rdar://18371371

Swift SVN r22870
2014-10-21 23:52:37 +00:00
Arnold Schwaighofer
d95b9c9ab8 Revert "stdlib: libm's sqrt and llvm.sqrt are not semantically equivalent"
This reverts commit 22864. The change is under discussion.

Swift SVN r22865
2014-10-21 17:46:24 +00:00
Arnold Schwaighofer
b0e5358624 stdlib: libm's sqrt and llvm.sqrt are not semantically equivalent
llvm.sqrt(-1.0) is undefined, while sqrt(-1.0) is defined as nan.

rdar://18371371

Swift SVN r22864
2014-10-21 17:26:59 +00:00
Dave Abrahams
383ebdc7dd Revert "[stdlib] ArrayBuffer: replace unsafeBitCasts"
This reverts r22824, again.  I need to try to reproduce the failure
Jordan is seeing on my own machine.

Swift SVN r22841
2014-10-20 16:39:01 +00:00
Dave Abrahams
fc862c1954 [stdlib] bisect replacement of bitcasts 0..<2 of 6
Swift SVN r22840
2014-10-20 16:02:45 +00:00
Dave Abrahams
5ef5df8b89 [stdlib] bisect replacement of bitcasts 0..<3 of 6
Applying half of an earlier change, trying to zero in on a bot-only
failure.

Swift SVN r22836
2014-10-20 11:14:23 +00:00
Dave Abrahams
4a1d2e67ec [stdlib] ContiguousArrayBuffer: truthful types
The buffer stored in a _ContiguousArrayBuffer<T> is not always
_ContiguousArrayStorage<T>.  It might in fact be the special empty
buffer class.

Swift SVN r22835
2014-10-20 05:13:21 +00:00
Dave Abrahams
b9bdbb87b6 Revert "[stdlib] ContiguousArrayBuffer: truthful types"
This reverts commit r22824, which I suspect of causing the
closure_multivalue failure at

Swift SVN r22834
2014-10-20 03:20:46 +00:00
Dave Abrahams
4d2dff1501 [stdlib] HeapBuffer: no lying to the type system
Swift SVN r22833
2014-10-20 03:20:45 +00:00
Dave Abrahams
00e1b67279 Revert "[stdlib] HeapBuffer: no lying to the type system"
This reverts commit r22825, which I suspect of causing the
closure_multivalue failure at

Swift SVN r22832
2014-10-20 01:05:12 +00:00
Dave Abrahams
8b9772d64e Revert "De-intrinsify and remove the _does*OptionalHaveValue functions."
This reverts commit r22829, because reverting r22828 depends on it.
Reverting r22828 because it
was apparently causing an assertion on the bot:

Swift SVN r22830
2014-10-19 19:54:34 +00:00
Joe Groff
7a24c85ed8 De-intrinsify and remove the _does*OptionalHaveValue functions.
Swift SVN r22829
2014-10-19 00:08:30 +00:00
Dave Abrahams
b9d5a7a71b Revert "[stdlib] ArrayBuffer: replace unsafeBitCasts"
This reverts r22824 as it appeared to be causing

Swift SVN r22826
2014-10-18 13:21:05 +00:00
Dave Abrahams
8119458acf [stdlib] HeapBuffer: no lying to the type system
Swift SVN r22825
2014-10-18 04:49:02 +00:00
Dave Abrahams
14043e8ed8 [stdlib] ArrayBuffer: replace unsafeBitCasts
Swift SVN r22824
2014-10-18 04:49:01 +00:00
Dave Abrahams
f765ffdc45 [stdlib] ContiguousArrayBuffer: truthful types
The buffer stored in a _ContiguousArrayBuffer<T> is not always
_ContiguousArrayStorage<T>.  It might in fact be the special empty
buffer class.

Swift SVN r22823
2014-10-18 04:49:00 +00:00
Dmitri Hrybenko
7fa402868d stdlib comments: remove a false statement that fatalError is a no-op
outside of debug mode

rdar://18614211

Swift SVN r22821
2014-10-17 23:37:35 +00:00
Dmitri Hrybenko
86a37dfd96 stdlib: fix grammar in comments
Swift SVN r22820
2014-10-17 23:35:05 +00:00
Dmitri Hrybenko
71887852e5 stdlib: clarify that toString and toDebugString are better alternatives
to Printable and DebugPrintable

rdar://18673000

Swift SVN r22819
2014-10-17 23:32:10 +00:00
Dave Abrahams
afe73f308f [stdlib] Disable a check on i386, where it breaks
Fix tracked by rdar://problem/18682097

Swift SVN r22811
2014-10-17 05:56:56 +00:00
Dave Abrahams
15f7847690 [stdlib] Disable a check on armv7, where it breaks
Fix tracked by rdar://problem/18682097

Swift SVN r22801
2014-10-16 21:04:51 +00:00
Erik Eckstein
2ae07c2326 Make _HashingDetail.fixedSeedOverride public because it is accessed in validation-test/stdlib/Hashing.swift.
Swift SVN r22794
2014-10-16 08:15:07 +00:00
Dave Abrahams
69194280a7 [stdlib] Nix an unused protocol and rename another
Swift SVN r22791
2014-10-16 03:46:34 +00:00
Dave Abrahams
8a27fb8178 [stdlib] Integrate BridgeStorage into the stdlib
We're going to use it for Array internals.  When we do, it should be
expected to cause a performance hit on arrays of value types until
rdar://18125016 is handled.

Swift SVN r22784
2014-10-15 23:32:44 +00:00
Dave Abrahams
56c4cb2d42 [stdlib] Kill off _isUniquelyReferenced
It was doing an unsafeBitCast and possibly not managing lifetimes;
replace it with more-typesafe and memory-safe calls where possible.

Swift SVN r22779
2014-10-15 22:25:12 +00:00
Dave Abrahams
4e31ae0a44 [stdlib] ArrayCast discipline
use withUnsafeMutableBufferPointer rather than accessing _elementStorage
directly, where possible

Swift SVN r22778
2014-10-15 22:25:11 +00:00
Dave Abrahams
506a1b07a6 [stdlib] Modernize ArrayBuffer uniqueness check
Swift SVN r22773
2014-10-15 21:17:31 +00:00
Dave Abrahams
4bdb9462c7 [stdlib] ArrayBufferType: identity is base address
Buffer identity is only used by tests.  The switch to an identity
representation that accounts for the buffer length was actually
incorrect for the way many tests used it.

Swift SVN r22771
2014-10-15 20:27:57 +00:00
Dmitri Hrybenko
3da435d96e stdlib: Fix doc comment on Dictionary.init()
rdar://problem/18665301

Swift SVN r22762
2014-10-15 17:23:24 +00:00
Dave Abrahams
903459d87e [stdlib] ManagedBuffer updates
Edit comments, add a holdsUniqueReference test, and make the buffer
class validity check work for the empty array buffer class.

Swift SVN r22747
2014-10-15 03:57:56 +00:00
Dave Abrahams
ab69e26656 [stdlib] Actually run the ArrayCore test
Fixes rdar://problem/18646425

Running the test uncovered avoidable inefficiencies in Array copying, so
dispatch of _copyToNativeArrayBuffer was revamped.  It's reasonable to
expect some speedups from this.

Also, the internal Array API requestNativeBuffer was highly error prone
when the source was a Slice, because it could return an array buffer
that represented more than the entire slice.  That capability was
probably used for optimization once, but is no longer, and the error
prone API probably caused bugs, so it was reformed.

Swift SVN r22746
2014-10-15 03:24:47 +00:00
Erik Eckstein
bec6758105 Enable tests which use ~= for Ranges.
These tests were disabled because of <rdar://problem/17668465> Failure to find overload
It seems that this is fixed now.



Swift SVN r22726
2014-10-14 09:06:55 +00:00
Erik Eckstein
b51b3ed123 Mark public compiler intrinsics with // COMPILER_INTRINSIC
I followed Joe's example in Process.swift and used COMPILER_INTRINSIC (and not just INTRINSIC)



Swift SVN r22723
2014-10-14 07:32:03 +00:00
Dave Abrahams
f2a046a64c [stdlib] Remove obsolete workaround
Swift SVN r22709
2014-10-13 21:23:48 +00:00
Dmitri Hrybenko
fea5de2fc8 stdlib and runtime: coding style fixes
Swift SVN r22685
2014-10-11 01:40:57 +00:00
Dmitri Hrybenko
8d68624c87 stdlib: fix doc comment syntax and coding style
Swift SVN r22684
2014-10-11 01:33:05 +00:00