Commit Graph

26 Commits

Author SHA1 Message Date
Graham Batty
e537c75d0c Revert "Disable existential metatype casting on non-objc."
This reverts commit 3e918838b3708bf2287e7caab437ccf72fe9a3f6.

Swift SVN r23579
2014-11-24 17:42:19 +00:00
Graham Batty
277891d8b5 Disable existential metatype casting on non-objc.
Swift SVN r23575
2014-11-24 17:40:44 +00:00
Joe Groff
b60a30c84b stdlib: Make isUniquelyReferenced shims properly return bool.
rdar://problem/18573806 is fixed.

Swift SVN r23547
2014-11-22 05:36:38 +00:00
Graham Batty
04f8efbdf5 Correctly calculate non-objc instance size and rename to reflect.
Renames swift_class_getInstanceSize to
swift_class_getInstancePositiveExtentSize to reflect that it is
the size of the object after the instance address point.

Swift SVN r23333
2014-11-14 22:09:20 +00:00
Dave Abrahams
2cf30d2661 [stdlib] Nix stale comment
Swift SVN r23198
2014-11-09 07:44:29 +00:00
Dave Abrahams
3475aa6dd6 [stdlib] use sanity-checked downcasts
Avoid type punning except where absolutely necessary

Swift SVN r23195
2014-11-09 06:20:46 +00:00
Dave Abrahams
cb80bb3057 [stdlib] ManagedBuffer: closure-free internal APIs
We want to see if this will be easier for the the optimizer to handle.

Swift SVN r23182
2014-11-08 20:04:27 +00:00
Chris Willmore
22f2452909 Only allow labeled parameters with function type to claim trailing closures, as opposed to any unlabeled argument.
For real this time. Added some additional tests.

rdar://problem/18778670

Swift SVN r23094
2014-11-04 03:40:08 +00:00
Chris Willmore
da2e3c4c73 Revert "Only allow labeled parameters with function type to claim trailing closures, as opposed to any unlabeled argument."
The commit broke the PerfTestSuite build:

/Users/buildslave/jenkins/sharedspace/swift-release-asserts/swift/src/tools/swift/benchmark/PerfTestSuite/SingleSource/DollarChain.swift:30:14:
error: missing argument label 'function:' in call
       $.tap(beatle, {$0.name = "Beatle"}).color = "Blue"

This reverts commit r23090.

Swift SVN r23093
2014-11-04 02:19:10 +00:00
Chris Willmore
f64bdb3021 Only allow labeled parameters with function type to claim trailing closures, as opposed to any unlabeled argument.
rdar://problem/18778670

Swift SVN r23090
2014-11-03 22:22:48 +00:00
Dave Abrahams
788cb848e0 [stdlib] Fix idiotic bug in ManagedBufferPointer
Found by inspection.  I tried long and hard to think of a test that
would detect this bug, and even tried to write quite a few, but none
would be triggered.  Bright ideas most welcome.

Commits to come, however, in the presence of this bug, cause around 25
failures in the stdlib test suite, so at least this won't regress.

Swift SVN r22984
2014-10-28 03:41:49 +00:00
Graham Batty
eaf22e9661 Make malloc_size a platform stub called swift_malloc_size.
Swift SVN r22971
2014-10-27 17:16:24 +00:00
Dave Abrahams
35a2584024 [stdlib] Work around rdar://18619176
Force a use of the value addressor so the linker doesn't drop it.

Swift SVN r22952
2014-10-26 21:37:41 +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
Dave Abrahams
506a1b07a6 [stdlib] Modernize ArrayBuffer uniqueness check
Swift SVN r22773
2014-10-15 21:17:31 +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
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
Dave Abrahams
5c33278e63 [stdlib] Add ManagedBufferPointer
A revamped version of HeapBuffer that doesn't allow null buffer
references.  Something like this is needed for killing the null array
state.

Swift SVN r22683
2014-10-11 01:10:38 +00:00
Dave Abrahams
74e27aaab1 [stdlib] uniqueness checking for users
Make unique reference checking available to users, making ManagedBuffer
a complete facility for building COW value types.  Also rationalize the
way we name and organize the runtime primitives we ultimately call.

Swift SVN r22594
2014-10-08 04:48:52 +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
Dave Abrahams
01f6f811b5 [stdlib] Gyb ManagedBuffer for Array storage
Swift SVN r22541
2014-10-06 18:40:04 +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
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