re-apply r26871: stdlib: Do the Array fast-path check with a single array property call.

Changes compared to the original version:
I fixed the 2 bugs and added a test for the so far undetected missing range check bug.
To keep the SIL simple (4 basic blocks for arr[x]) I extracted the slow path for getElement into a
non-inlinable function.
On the other hand I inlined _typeCheck into the slow-path function.
This speeds up NSArray accesses because now only a single objectAtIndex is required for both
type checking and element retrieving.

Update on performance: DeltaBlue is now only 12% better (and not 25%). I suspect this is because
now Arnold's tail duplication cannot detect the ObjC call in the slow path.



Swift SVN r26935
This commit is contained in:
Erik Eckstein
2015-04-03 06:48:25 +00:00
parent 283b08c511
commit 2f971c22cb
11 changed files with 156 additions and 127 deletions

View File

@@ -25,7 +25,7 @@ class CallGraph;
enum class ArrayCallKind {
kNone = 0,
kArrayPropsIsNative,
kArrayPropsNeedsTypeCheck,
kArrayPropsIsNativeNoDTC,
kCheckSubscript,
kCheckIndex,
kGetCount,