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
And make sure that all those public identifiers are preceeded with underscores.
I marked these public-modifiers with "// @testable" to document why they are public.
If some day we have a @testable attribute it should be used instead of those public-modifiers.
Again, this is needed for enabling dead internal function elimination in the stdlib.
Swift SVN r22657
They were never really useful to users, because their APIs were
insufficiently public. They have been replaced with a single class,
ManagedBuffer<Value,Element>, which is really designed for user
consumption.
Swift SVN r22636
It used to be a public enum, which unnecessarily exposed structure that
was intended to be private implementation detail. This change also has
the benefit that converting a String to a Character will avoid
allocating memory in many more cases.
Swift SVN r22629
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
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
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
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
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
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
...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
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
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
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
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
It was unintentionally possible to add an Int to any
UnsignedIntegerType. Use an intentional ambiguity to prevent that at
compile-time.
Swift SVN r22402