mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -25,7 +25,7 @@ class CallGraph;
|
||||
enum class ArrayCallKind {
|
||||
kNone = 0,
|
||||
kArrayPropsIsNative,
|
||||
kArrayPropsNeedsTypeCheck,
|
||||
kArrayPropsIsNativeNoDTC,
|
||||
kCheckSubscript,
|
||||
kCheckIndex,
|
||||
kGetCount,
|
||||
|
||||
Reference in New Issue
Block a user