Commit Graph

13 Commits

Author SHA1 Message Date
Nadav Rotem
15532a0fb5 Avoid calling bzero in Optional.init() by specializing the common tagbyte sizes.
Swift SVN r24234
2015-01-07 00:58:27 +00:00
Michael Gottesman
24b98cf55c Convert llvm_unreachable => crash.
Swift SVN r24133
2014-12-23 23:47:06 +00:00
Nadav Rotem
4069a4091d Specialize the memcpy in swift_getEnumCaseSinglePayload for the case of small constant values.
The libc memcpy implementation is not optimized for the case of constant count
values (because of the function's interface) and is not inlineable. Using the local
implementation allows us to eliminate the trampoline in the call and optimize for
small constants.

This gives a 4% boost on Prims.

Swift SVN r24131
2014-12-23 23:05:59 +00:00
Nadav Rotem
a8395e2895 A small cleanup. NFC.
Swift SVN r24130
2014-12-23 23:05:58 +00:00
Nadav Rotem
de706b1ae6 Whitespace
Swift SVN r23821
2014-12-09 23:51:26 +00:00
Dmitri Hrybenko
e588ec4906 Fixup for r23613 to allow the runtime to build on non-ObjC platforms
Swift SVN r23637
2014-12-03 03:39:04 +00:00
Joe Groff
27f49cd19d Runtime: Optional-like enums with single-refcounted payloads can share the refcounted value witnesses.
swift_retain and objc_retain both handle nil already, so we can bypass the generic Optional value witnesses when instantiating Optional on a class type, which happens kind of a lot.

Swift SVN r23613
2014-12-02 17:34:36 +00:00
Joe Groff
d752636387 Runtime: Drop in POD value witnesses when generic structs or enums are instantiated.
If, after layout, we recognize that a generic struct or enum instance is POD, we can replace the generic value witnesses in the image with POD ones.

Swift SVN r23609
2014-12-02 03:33:40 +00:00
John McCall
80dd63b38d Don't allocate values out-of-line just because they're
not bitwise takable.

Finishes rdar://16755731

Swift SVN r20742
2014-07-30 08:24:18 +00:00
Joe Groff
71678b4bdf IRGen/Runtime: Expose the 'isBitwiseTakable' bit in the value witness flags.
Set a bit for types that are non-bitwise-takable, and calculate it as part of runtime struct and enum layout. Include 'bitwise takable' as part of the runtime 'is inline' calculation to be consistent with the compile-time policy change in r17008.

Swift SVN r17036
2014-04-29 15:23:14 +00:00
Joe Groff
3e0c1cebcf Runtime: Update the 'inline storage' flag properly for single-payload enums.
It cannot be simply inherited from the payload value witness table; it needs to be recalculated for the new type's size.

Swift SVN r14060
2014-02-18 23:37:24 +00:00
Dave Abrahams
b3955c6d7a [stdlib] NewString.swift: work in progress
Swift SVN r10680
2013-11-28 16:45:21 +00:00
Joe Groff
e109124186 Replace 'union' keyword with 'enum'.
This only touches the compiler and tests. Doc updates to follow.

Swift SVN r8478
2013-09-20 01:33:14 +00:00