Commit Graph

9 Commits

Author SHA1 Message Date
Erik Eckstein
384d936850 Use assumeNonNegative for the array body count.
This should help to optimize the range check in isValidSubscript to a single unsigned integer comparison.
But this is not done yet, because it also needs an optimization in llvm, which I'm currently working on.

Together with the llvm change there will be an performance improvement for array benchmarks, where the
range check cannot be hoisted out of a loop. E.g. ~ +30% on QuickSort.



Swift SVN r23583
2014-11-26 09:58:37 +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
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
Jordan Rose
da29f099f0 Update stdlib for accessibility modifiers becoming context-sensitive keywords.
Swift SVN r19672
2014-07-08 02:17:46 +00:00
Jordan Rose
cca27d02a0 Tag everything in the standard library with accessibility attributes.
Keep calm: remember that the standard library has many more public exports
than the average target, and that this contains ALL of them at once.
I also deliberately tried to tag nearly every top-level decl, even if that
was just to explicitly mark things @internal, to make sure I didn't miss
something.

This does export more than we might want to, mostly for protocol conformance
reasons, along with our simple-but-limiting typealias rule. I tried to also
mark things private where possible, but it's really going to be up to the
standard library owners to get this right. This is also only validated
against top-level access control; I haven't fully tested against member-level
access control yet, and none of our semantic restrictions are in place.

Along the way I also noticed bits of stdlib cruft; to keep this patch
understandable, I didn't change any of them.

Swift SVN r19145
2014-06-24 21:32:18 +00:00
Arnold Schwaighofer
da6d9152b6 Differentiate between user assertion and preconditions and the like
assert() and fatalError()
These functions are meant to be used in user code. They are enabled in debug
mode and disabled in release or fast mode.

_precondition() and _preconditionFailure()
These functions are meant to be used in library code to check preconditions at
the api boundry. They are enabled in debug mode (with a verbose message) and
release mode (trap). In fast mode they are disabled.

_debugPrecondition() and _debugPreconditionFailure()
These functions are meant to be used in library code to check preconditions that
are not neccesarily comprehensive for safety (UnsafePointer can be null or an
invalid pointer but we can't check both). They are enabled only in debug mode.

_sanityCheck() and _fatalError()
These are meant to be used for internal consistency checks. They are only
enabled when the library is build with -DSWIFT_STDLIB_INTERNAL_CHECKS=ON.

I modified the code in the standard library to the best of my judgement.

rdar://16477198

Swift SVN r18212
2014-05-16 20:49:54 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Dave Abrahams
2adf0679a3 [stdlib] CountAndCapacity => ArrayBody
CountAndCapacity is about to become even more Array-specific, so rename
it and give it its own source file.

Swift SVN r16091
2014-04-09 01:25:03 +00:00