Commits

Andrew Trick committed b1b07ef0fa7
stdlib: Replace unsafeBitCast calls with unsafeCastReference. unsafeBitCast should only be used when we actually need to lie to the type system (as opposed to just having an unchecked downcast). Theses are the places where unsafeReferenceCast makes sense: (In general it makes sense whenever the source & dest are class or class existential types) - ArrayBuffer.getElement. The deferred downcast case cannot be benchmarked. It is never on the critical path. The ObjC array case cannot conceivably matter either, however, it is touched by DollarChain, JSONHelperDeserialize, and StrSplitter. These benchmarks do not regress at -O. - arrayForceCast No regressions at -O based on microbenchmarks. None of these remaining cases affect PerfTestSuite at -O: - General ObjC bridging - Set/Dictionary bridging - String bridging - AutoreleasingUnsafeMutablePointer These are confirmed speedups but I did not investigate the cause: |.Chars...................|.32.1%.| |.Sim2DArray..............|.15.4%.| |.Calculator..............|.13.0%.| |.RecursiveOwnedParameter.|..7.9%.| Swift SVN r32796