Commit Graph

1397 Commits

Author SHA1 Message Date
Dave Abrahams
e4d8ea49e4 [stdlib] Add a FIXME
Swift SVN r22579
2014-10-07 22:15:09 +00:00
Dave Abrahams
cc9bc0c274 [stdlib] Kill _swift_isUniquelyReferenced @asmname
Swift SVN r22576
2014-10-07 21:40:48 +00:00
Dave Abrahams
83eec23968 [stdlib] Revert "Gyb ManagedBuffer..."
This reverts r22541.  It turns out that because of the type-punning we
need in order to handle the canonical empty array buffer in Array<Int>
and Array<SomeClass>, calls through methods that could be
dynamically-dispatched (i.e. methods of classes) can't be used to access
an array buffer.  So, for arrays, we need to keep the HeapBuffer
strategy wherein a struct manager object does all the address
calculations.

ManagedBuffer is still a useful tool for users though, and it fills the
role that HeapBuffer was intended to serve for them better than
HeapBuffer itself does, because it is simpler and more type-safe.

Swift SVN r22573
2014-10-07 21:40:43 +00:00
Graham Batty
a7a032d4a6 Temporarily undo no-whole-archive change.
This change breaks things and will probably continue breaking them
until the standard library and code generation is more functional
on linux.

Leaving in a TODO to turn it back on later.

Swift SVN r22572
2014-10-07 21:26:25 +00:00
Dave Abrahams
add753905b [stdlib] Use a lifetime-managed "with" construct
...instead of an internal API that releases an UnsafeBufferPointer into the wild.

Swift SVN r22561
2014-10-07 01:08:35 +00:00
Dave Abrahams
41fe3896d8 [stdlib] Synchronization-free empty array buffer
Now that <rdar://problem/18540783> is fixed, we can stop allocating the
empty array buffer dynamically and go back to using the one that is
statically laid out in GlobalObjects.cpp, thereby avoiding the
atomic instructions required to make it threadsafe.

Swift SVN r22545
2014-10-06 18:40:06 +00:00
Dave Abrahams
ab045d95af [stdlib] Tiny formatting fix
Swift SVN r22544
2014-10-06 18:40:06 +00:00
Dave Abrahams
d669b8fd56 [stdlib] Always inline _isClassOrObjCExistential
Swift SVN r22543
2014-10-06 18:40:05 +00:00
Dave Abrahams
08ed3e556c [stdlib] Use addressor for ManagedBuffer
Swift SVN r22542
2014-10-06 18:40:05 +00:00
Dave Abrahams
01f6f811b5 [stdlib] Gyb ManagedBuffer for Array storage
Swift SVN r22541
2014-10-06 18:40:04 +00:00
Dmitri Hrybenko
08f74103d8 stdlib: fix coding style
Swift SVN r22535
2014-10-06 08:17:34 +00:00
Graham Batty
22c7a7569f Don't do foundations or objc linking on linux.
Swift SVN r22527
2014-10-05 20:10:57 +00:00
Dave Abrahams
eac8ca27f9 [stdlib] Use a universal empty array buffer
NFC, and no significant performance change expected.  This is part one
of a move to eliminate nil checks from the array implementation.

Swift SVN r22526
2014-10-05 17:55:11 +00:00
Joe Groff
cac5807ae2 SILGen: Emit "main" as a SIL function.
Eliminate the intermediate top_level_code function. Now that SIL is expressive enough to express a "main" function, there's no reason for it, and this eliminates a bunch of mystery code in IRGen to thunk from main to top_level_code by reaching for hardcoded symbol names. Demystify the special code for setting up C_ARGC and C_ARGV by having SILGen look for a transparent "_didEnterMain" hook in the stdlib and emit a call to it.

Swift SVN r22525
2014-10-05 04:13:24 +00:00
Dave Abrahams
c0f4b11b95 [stdlib] Don't expose uninitialized memory
...at least, not without the word "unsafe."  ManagedBuffer's create()
function takes a closure that creates an initial value for its "value"
property (which is technically computed but effectively stored).  Before
this change, the closure had access to that property before it was
initialized.  Now you can still get there, but you have to go through
"withUnsafeMutablePointer*" methods.

Swift SVN r22501
2014-10-03 21:30:00 +00:00
Dave Abrahams
65ec2cdb00 [stdlib] Minor ManagedBuffer cleanups
In preparation for gyb'ing; we'll need to inject different base classes
so we can use this for Array et. al.

Swift SVN r22500
2014-10-03 21:29:59 +00:00
Dave Abrahams
b740ad0df9 Revert "[stdlib] Use a universal empty array buffer"
This reverts commit r22495, because it wroke havoc with SIL and the perf
test suite somehow.

Swift SVN r22499
2014-10-03 18:52:11 +00:00
Dave Abrahams
f2f068c3dc [stdlib] Use a universal empty array buffer
NFC, and no significant performance change expected.  This is part one
of a move to eliminate nil checks from the array implementation.

Swift SVN r22495
2014-10-03 16:01:50 +00:00
Dmitri Hrybenko
b8186229d0 stdlib: remove an invalid cast in Character implementation
rdar://18151953

Swift SVN r22492
2014-10-03 15:14:42 +00:00
Erik Eckstein
60dcb9a435 Make compiler intrinsics public (part 2).
With the changed SILLinkage and dead function removal of internal functions this is necessary.



Swift SVN r22490
2014-10-03 13:58:50 +00:00
Arnold Schwaighofer
c1eefb1dad Reapply "stdlib: Remove dead semantic Array._setElement function
Also remove helper functions."

With fixes.

Swift SVN r22479
2014-10-02 20:26:32 +00:00
Arnold Schwaighofer
2bd116c20b Revert "stdlib: Remove dead semantic Array._setElement function"
This reverts r22468. Because it breaks the build.

Swift SVN r22469
2014-10-02 18:46:24 +00:00
Arnold Schwaighofer
cfd4a0902d stdlib: Remove dead semantic Array._setElement function
Also remove helper functions.

Swift SVN r22468
2014-10-02 18:44:31 +00:00
Erik Eckstein
48e4c951e0 Remove dead arrays which are constrcuted with _allocateUninitialized
This fixes the performance regressions in Richards and some other benchmarks.



Swift SVN r22465
2014-10-02 14:08:49 +00:00
Erik Eckstein
10133eb6d7 Fix wrong effects attribute for Dictionary.init()
This bug caused a crash in the Dictionary benchmark when compiled with -Ounchecked.
The problem was the CSE moved the Dictionary.init() over a store to the argument's
array buffer.



Swift SVN r22464
2014-10-02 11:45:47 +00:00
Dave Abrahams
1ba2cbcfe6 [stdlib] explanatory comment
Swift SVN r22441
2014-10-01 21:12:45 +00:00
Dave Abrahams
43deddf8ac [stdlib] Move ManagedBuffer prototype into stdlib
...in preparation to use it in _[Contiguous]ArrayBuffer

Swift SVN r22440
2014-10-01 21:12:43 +00:00
Arnold Schwaighofer
b6f28bede1 ArraySemantics: Teach array semantics about getting the address of an array element
rdar://18517410

Swift SVN r22439
2014-10-01 21:08:22 +00:00
Erik Eckstein
cd4b943897 Don't call reserveCapacity if constructing an empty uninitalized array.
This speeds up empty array literals and fixes the performance regression in the Havlak benchmark.
See <rdar://problem/18480488> PerfReg: Havlak - Megaclang - r353047-r353195 - 3x



Swift SVN r22427
2014-10-01 14:52:25 +00:00
John McCall
8541ffd006 Convert UnsafePointer's memory property and
subscript operator to be addressed.

Swift SVN r22424
2014-10-01 07:09:18 +00:00
Dmitri Hrybenko
50c99099ec Remove redundant semicolon
Swift SVN r22422
2014-10-01 06:31:25 +00:00
John McCall
1fa4f422ba Use mutable addressors for Array, now that doing so
doesn't prevent us from using a getter for immutable
accesses.

rdar://17270560

Swift SVN r22421
2014-10-01 05:20:43 +00:00
Dave Abrahams
c93f32a4b3 [stdlib] Eliminate needless intermediate class
Swift SVN r22415
2014-09-30 23:43:25 +00:00
Dave Abrahams
156020de19 [stdlib] Rename 'countElements' => 'count'
The name was not only long and unwieldy, but inconsistent with our
conscious decision to avoid the use of "elements" in APIs as mostly
redundant.

Swift SVN r22408
2014-09-30 22:00:26 +00:00
Dave Abrahams
b05f1ad720 [stdlib] Comments for _getBridgedUnsafeBuffer
Also dropped an unused typealias.

Swift SVN r22407
2014-09-30 21:33:48 +00:00
Dave Abrahams
c8ecf6649d [stdlib] cross-reference radar in FIXME comment
Swift SVN r22405
2014-09-30 21:30:28 +00:00
Dave Abrahams
7f0439b90a [stdlib] Disable one more mixed-sign case
Also update release notes

Swift SVN r22403
2014-09-30 21:25:03 +00:00
Dave Abrahams
41359fb128 [stdlib] Disallow mixed-sign arithmetic
It was unintentionally possible to add an Int to any
UnsignedIntegerType.  Use an intentional ambiguity to prevent that at
compile-time.

Swift SVN r22402
2014-09-30 20:21:01 +00:00
Dmitri Hrybenko
d7e724efa0 StaticString: use a less error-prone bit masking construct
Swift SVN r22357
2014-09-29 18:40:56 +00:00
Dmitri Hrybenko
4f38403eda stdlib: fix bugs in StaticString.isASCII and add tests
rdar://18301485 rdar://18139547

Swift SVN r22356
2014-09-29 16:07:18 +00:00
Dmitri Hrybenko
f8455d3a6e stdlib/Unicode: fix invalid casts in Character._SmallUTF16
Part of rdar://18151953

Swift SVN r22306
2014-09-26 22:59:59 +00:00
Dmitri Hrybenko
a2c4a7a3ea stdlib: remove redundant parens
Swift SVN r22305
2014-09-26 22:59:55 +00:00
Dmitri Hrybenko
03d3d3b3f1 stdlib: rename IntEncoder to a more descriptive _SmallUTF8Sink
Swift SVN r22304
2014-09-26 22:01:44 +00:00
Devin Coughlin
9c7d27c4eb Add an OS version check for API availability to standard library and runtime.
This patch adds a compiler entry point to the standard library that checks
whether the running OS version is greater than or equal to a given version
triple. The idea is that #os(...) will get SILGen'd into a call to this
function.

The standard library function calls a runtime function to actually get the OS
version. This runtime function uses -[NSProcessInfo operatingSystemVersion] when
possible, otherwise it loads the SystemVersion plist. When running under the
simulator, we use an environmental variable set by the simulator to look up the
version for the simulated OS and not the host OS.

At the moment, there is no caching for version info. I will add this in a later
patch.


Swift SVN r22303
2014-09-26 18:26:29 +00:00
Dmitri Hrybenko
a04ee3a463 stdlib/Unicode: allow transcode() to operate on mutable value-typed
sinks

Swift SVN r22302
2014-09-26 17:28:00 +00:00
Joe Groff
c04992bf78 stdlib: Remove Array.convertFromHeapArray.
Swift SVN r22297
2014-09-26 04:27:19 +00:00
Joe Groff
9eb4f5b512 SILGen: Use Array._allocateUninitialized to form array literals.
This avoids a pointless copy every time an array literal is written, and will let us retire the horrible "alloc_array" instruction and globs of broken IRGen code. Implements rdar://problem/16386862, and probably fixes a bunch of bugs related to alloc_array brokenness.

Swift SVN r22289
2014-09-25 22:26:20 +00:00
Erik Eckstein
a4c7d89671 fix coding style in stdlib: move non-attribute keywords in same line as function declaration
Swift SVN r22275
2014-09-25 08:43:55 +00:00
Dmitri Hrybenko
42b9bf3e28 stdlib: use addressors in {ContiguousArray,Slice}.subscript(_: Int)
Swift SVN r22265
2014-09-24 14:38:23 +00:00
Dave Abrahams
a7f3e4222e [stdlib] finish public non-protocol docs
The 58 undocumented public non-operator APIs still present in core are
all on non-exposed (underscored) APIs.

Swift SVN r22263
2014-09-24 12:31:45 +00:00