Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bitcode in Swift

Bitcode in Swift

Cyril Lashkevich

November 30, 2016
Tweet

More Decks by Cyril Lashkevich

Other Decks in Programming

Transcript

  1. Bitcode • is an LLVM Intermediate Representation of your binary,

    which allows the store to reoptimize your apps for each kind of device before they get delivered to the user. • future-proofs your apps because it will allow the store to let your apps take advantage of new processor capabilities we might be adding in the future, and all that without you having to resubmit your app to the store
  2. Brief history of Apple CPUs armv6 armv7 armv7s arm64 iOS

    10 Code names; Whitetail iOS 9 Code names; Monarch, Boulder, Castlerock, Eagle iOS 8 Code names; Okemo, OkemoTaos, OkemoZurs, Stowe, Copper iOS 7 Code names; Innsbruck, Sochi iOS 6 Code names; Sundance, Brighton iOS 5 Code names; Telluride, Hoodoo iPhone SDK 4.0 Code names; Apex, Baker, Jasper, Phoenix, Durango iPhone SDK 3.0 Code names; Kirkwood, Northstar, Wildcat iPhone SDK 2.0 Code names; Big Bear, Sugarbowl, Timberline iPhone OS 1.0 Code names; Alpine, Heavenly Little Bear, Snobird, Oktoberfest ̖ 3.0 ̖ 5.0 ̖ 6.0 ̖ 6.0 ̖ 6.0 ̖ 6.0 ̖ 7.0 ̖ 7.0 ̖ 7.0 ̖ 7.0 ̖ 1.0 ̖ 1.1 3.1.3 ▼ 3.1.3 ▼ 4.2.1 ▼ 4.2.1 ▼ ̖ 2.0 ̖ 2.1.1 4.3.5 ̖ 3.1.1 ̖ 3.2 iPad SDK ̖ 4.0 (GSM) 4.2.6 (CDMA) ̖ 4.2.1 ̖ 4.3.5 ̖ 5.1 ̖ 8.1 ̖ 8.0 ̖ 8.0 ̖ 8.1 ̖ 8.4 ̖ 9.0 ̖ 9.0 ̖ 9.0 ̖ 9.1 ̖ 9.3 ̖ 9.3 6.1.6 ▼ 5.1.1 ▼ 5.1.1 ▼ 7.1.2 ▼ 6.1.6 ▼ 9.3.3 ▼ 9.3.3 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 10.0 ▼ 9.3.3 ▼ 9.3.3 ▼ 9.3.3 ▼ iPad Pro 9.7” March 2016 iPhone SE March 2016 iPad Pro 12.9” November 2015 iPhone 6s Plus September 2015 iPhone 6s September 2015 iPad mini 4 September 2015 iPod touch (6th generation) July 2015 iPad Air 2 October 2014 iPhone 6 Plus September 2014 iPhone 6 September 2014 iPad mini 3 October 2014 iPad mini 2 October 2013 iPad Air October 2013 iPhone 5s September 2013 iPhone 5c September 2013 iPad October 2012 iPhone 5 September 2012 iPad mini October 2012 iPod touch (5th generation) September 2012 [new] iPad March 2012 iPhone 4S October 2011 iPad 2 March 2011 iPod touch (4th generation) September 2010 iPhone 4 June 2010 iPad April 2010 iPod touch (3rd generation) September 2009 iPhone 3GS June 2009 iPod touch (2nd generation) September 2008 iPod touch September 2007 iPhone 3G July 2008 iPhone June 2007 32bit/Swift/ARMv7-A A6 64bit/Cyclone/ARMv8-A A7 64bit/Typhoon/ARMv8-A A8 64bit/Twister/ARMv8-A A9 32bit/Cortex A8/ARMv7-A A4 32bit/Cortex A9/ARMv7-A A5 128MB 256MB 256MB 256MB 512MB 512MB 512MB 1GB 1GB 1GB 1GB 2GB 2GB 4GB 2GB 2GB 1GB @isupportmatrix iOSSupportMatrix.com Summer 2016 — v4.0b6 B E T A 6 armv7k
  3. • armv6 - multimedia instructions, VFPv2 • armv7 - Advanced

    SIMD, VFPv3 • armv7s - integer div, Advanced SIMDv2, VFPv4, half precision, fused add • arm64 - brand new 64bit arch, vmax, vmin, AES • armv7k - is low power variant of armv7 Слайд про архитектуры
  4. Source code to LLVM IR llvm-link .c llvm-gcc / clang

    .bc opt .bc .bc llc .s as llvm-mc .o libc.a libstdc++.a ld libc.a / libc.so libstdc++.a / libstdc++.so executable input bitcode LLVM tools native native tools Legend
  5. Откуда взять LLVM IR clang -arch armv7 -S -emit-llvm swiftc

    -target armv7-apple-ios10.1 -S -Xfrontend -emit-bc
  6. $ xcrun size -x -l -m Test Test (for architecture

    armv7): Segment __PAGEZERO: 0x4000 (vmaddr 0x0 fileoff 0) Segment __TEXT: 0x54c000 (vmaddr 0x4000 fileoff 0) Segment __DATA: 0xc000 (vmaddr 0x550000 fileoff 5554176) Segment __LLVM: 0x1054000 (vmaddr 0x55c000 fileoff 5603328) Section __bundle: 0x1051bc4 (addr 0x55c000 offset 5603328) total 0x1051bc4 Segment __LINKEDIT: 0x58000 (vmaddr 0x15b0000 fileoff 22724608) Test (for architecture arm64): Segment __PAGEZERO: 0x100000000 (vmaddr 0x0 fileoff 0) Segment __TEXT: 0x5b0000 (vmaddr 0x100000000 fileoff 0) Segment __DATA: 0x18000 (vmaddr 0x1005b0000 fileoff 5963776) Segment __LLVM: 0x103c000 (vmaddr 0x1005c8000 fileoff 6045696) Section __bundle: 0x103b8e4 (addr 0x1005c8000 offset 6045696) total 0x103b8e4 Segment __LINKEDIT: 0x58000 (vmaddr 0x101604000 fileoff 23068672)
  7. $ xcrun otool -s __LLVM __bundle Test Test (architecture armv7):

    Contents of (__LLVM,__bundle) section 0055c000 21726178 01001c00 00000000 949b0000 0055c010 00000000 4abe0700 01000000 57ecda78 0055c020 38db6f4d 57f7bd10 3416be18 a5b65b25 0055c030 34915142 1668b74d bba49a09 231f8337 0055c040 aa24899b 59c6ed22 925f7fec 565b6396 0055c050 5ec9d4d0 3c087b16 19be1c7c 4c869e72 0055c060 cf3efefc 94a80b3a d751c590 0edd79ef 0055c070 51724c14 37ba8f4c ec2867d7 c4de4fbe 0055c080 de4aa4f7 a7356274 eaceb25c 1c905267 0055c090 bce7ba8e 713aa66b 243b8a26 94886d4b 0055c0a0 6af13a05 840e2090 44ae944f db1ae319 0055c0b0 ca37c79e ac99c7c4 82e7c118 e25aa456 ................... http://llvm.org/docs/BitCodeFormat.html LLVM Bitcode File Format
  8. bitcode_retriever • Извлекает arm.xar и arm64.xar из Mach-O executable •

    Внутри xar файлы с именами 0001, 0002, 0003, 0004… • llvm-dis что бы сконвертировать в ll https://github.com/AlexDenisov/bitcode_retriever
  9. ; ModuleID = 'arm.bc' source_filename = "libyuv/source/ row_neon.cc" target datalayout

    = "e-m:o-p:32:32- f64:32:64-v64:32:64-v128:32:128-a:0:32- n32-S32" target triple = "thumbv7-apple-ios8.0.0" %struct.YuvConstants = type { <16 x i8>, <16 x i8>, <8 x i16>, <4 x i32> } @kYuvI601Constants = external global %struct.YuvConstants, align 16 LLVM Language Reference Manual http://llvm.org/docs/LangRef.html
  10. Swift • Class is reference type • Struct is value

    type • И class и struct могут реализовывать протоколы • Что происходит когда передается параметр с типом протокола?
  11. define hidden void @_TFC14ViewController14ViewController8testFuncfT_T_(%C14ViewController14ViewController*) #0 { %2 = alloca %P13CoolFramework12CoolProtocol_,

    align 4 %3 = alloca %P13CoolFramework12CoolProtocol_, align 4 %4 = call %swift.type* @_TMaC13CoolFramework13CoolTestClass() #2 %5 = call %C13CoolFramework13CoolTestClass* @_TFC13CoolFramework13CoolTestClassCfT_S0_(%swift.type* %4) %6 = bitcast %C13CoolFramework13CoolTestClass* %5 to %swift.type** %7 = load %swift.type*, %swift.type** %6, align 4 %8 = bitcast %swift.type* %7 to i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)** %9 = getelementptr inbounds i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)*, i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)** %8, i32 14 %10 = load i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)*, i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)** %9, align 4, !invariant.load !34 %11 = bitcast i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)* %10 to i8* %12 = bitcast %P13CoolFramework12CoolProtocol_* %2 to i8* call void @llvm.lifetime.start(i64 20, i8* %12) %13 = call %swift.type* @_TMaC14ViewController10CProtoImpl() #2 %14 = getelementptr inbounds %P13CoolFramework12CoolProtocol_, %P13CoolFramework12CoolProtocol_* %2, i32 0, i32 1 store %swift.type* %13, %swift.type** %14, align 4 %15 = getelementptr inbounds %P13CoolFramework12CoolProtocol_, %P13CoolFramework12CoolProtocol_* %2, i32 0, i32 2 store i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @_TWPC14ViewController10CProtoImpl13CoolFramework12CoolProtocolS_, i32 0, i32 0), i8*** %15, align 4 %16 = getelementptr inbounds %P13CoolFramework12CoolProtocol_, %P13CoolFramework12CoolProtocol_* %2, i32 0, i32 0 %17 = bitcast [12 x i8]* %16 to %C14ViewController10CProtoImpl** %18 = bitcast %C14ViewController14ViewController* %0 to %swift.type** %19 = load %swift.type*, %swift.type** %18, align 4 %20 = bitcast %swift.type* %19 to %C14ViewController10CProtoImpl* (%C14ViewController14ViewController*)** %21 = getelementptr inbounds %C14ViewController10CProtoImpl* (%C14ViewController14ViewController*)*, %C14ViewController10CProtoImpl* (%C14ViewController14ViewController*)** %20, i32 13 %22 = load %C14ViewController10CProtoImpl* (%C14ViewController14ViewController*)*, %C14ViewController10CProtoImpl* (%C14ViewController14ViewController*)** %21, align 4, !invariant.load !34 %23 = bitcast %C14ViewController10CProtoImpl* (%C14ViewController14ViewController*)* %22 to i8* %24 = bitcast i8* %23 to %C14ViewController10CProtoImpl* (%C14ViewController14ViewController*)* %25 = call %C14ViewController10CProtoImpl* %24(%C14ViewController14ViewController* %0) store %C14ViewController10CProtoImpl* %25, %C14ViewController10CProtoImpl** %17, align 4 %26 = bitcast i8* %11 to i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)* %27 = call i64 %26(%P13CoolFramework12CoolProtocol_* noalias nocapture dereferenceable(20) %2, i32 1, %C13CoolFramework13CoolTestClass* %5) %28 = bitcast %P13CoolFramework12CoolProtocol_* %2 to i8* call void @llvm.lifetime.end(i64 20, i8* %28) %29 = bitcast %C13CoolFramework13CoolTestClass* %5 to %swift.type** %30 = load %swift.type*, %swift.type** %29, align 4 %31 = bitcast %swift.type* %30 to i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)** %32 = getelementptr inbounds i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)*, i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)** %31, i32 14 %33 = load i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)*, i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)** %32, align 4, !invariant.load !34 %34 = bitcast i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)* %33 to i8* %35 = bitcast %P13CoolFramework12CoolProtocol_* %3 to i8* call void @llvm.lifetime.start(i64 20, i8* %35) %36 = getelementptr inbounds %P13CoolFramework12CoolProtocol_, %P13CoolFramework12CoolProtocol_* %3, i32 0, i32 1 store %swift.type* bitcast (i32* getelementptr inbounds (<{ i8**, i32, i32, %swift.type* }>, <{ i8**, i32, i32, %swift.type* }>* @_TMfV14ViewController10SProtoImpl, i32 0, i32 1) to %swift.type*), %swift.type** %36, align 4 %37 = getelementptr inbounds %P13CoolFramework12CoolProtocol_, %P13CoolFramework12CoolProtocol_* %3, i32 0, i32 2 store i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @_TWPV14ViewController10SProtoImpl13CoolFramework12CoolProtocolS_, i32 0, i32 0), i8*** %37, align 4 %38 = getelementptr inbounds %P13CoolFramework12CoolProtocol_, %P13CoolFramework12CoolProtocol_* %3, i32 0, i32 0 %39 = bitcast [12 x i8]* %38 to %V14ViewController10SProtoImpl* %40 = bitcast %C14ViewController14ViewController* %0 to %swift.type** %41 = load %swift.type*, %swift.type** %40, align 4 %42 = bitcast %swift.type* %41 to void (%C14ViewController14ViewController*)** %43 = getelementptr inbounds void (%C14ViewController14ViewController*)*, void (%C14ViewController14ViewController*)** %42, i32 16 %44 = load void (%C14ViewController14ViewController*)*, void (%C14ViewController14ViewController*)** %43, align 4, !invariant.load !34 %45 = bitcast void (%C14ViewController14ViewController*)* %44 to i8* %46 = bitcast i8* %45 to void (%C14ViewController14ViewController*)* call void %46(%C14ViewController14ViewController* %0) %47 = bitcast i8* %34 to i64 (%P13CoolFramework12CoolProtocol_*, i32, %C13CoolFramework13CoolTestClass*)* %48 = call i64 %47(%P13CoolFramework12CoolProtocol_* noalias nocapture dereferenceable(20) %3, i32 2, %C13CoolFramework13CoolTestClass* %5) %49 = bitcast %P13CoolFramework12CoolProtocol_* %3 to i8* call void @llvm.lifetime.end(i64 20, i8* %49) %50 = call %swift.type* @_TMaP_() #2 %51 = call { %swift.bridge*, i8* } @_TFs27_allocateUninitializedArrayurFBwTGSax_Bp_(i32 2, %swift.type* %50) %52 = extractvalue { %swift.bridge*, i8* } %51, 0 %53 = extractvalue { %swift.bridge*, i8* } %51, 1 %54 = bitcast i8* %53 to %Any* %55 = getelementptr inbounds %Any, %Any* %54, i32 0, i32 1 store %swift.type* @_TMVs5Int64, %swift.type** %55, align 4 %56 = getelementptr inbounds %Any, %Any* %54, i32 0, i32 0 %57 = call noalias i8* @rt_swift_slowAlloc(i32 8, i32 7) #1 %58 = bitcast [12 x i8]* %56 to i8** store i8* %57, i8** %58, align 4 %59 = bitcast i8* %57 to %Vs5Int64* %60 = getelementptr inbounds %Vs5Int64, %Vs5Int64* %59, i32 0, i32 0 store i64 %27, i64* %60, align 8 %61 = getelementptr inbounds %Any, %Any* %54, i32 1 %62 = getelementptr inbounds %Any, %Any* %61, i32 0, i32 1 store %swift.type* @_TMVs5Int64, %swift.type** %62, align 4 %63 = getelementptr inbounds %Any, %Any* %61, i32 0, i32 0 %64 = call noalias i8* @rt_swift_slowAlloc(i32 8, i32 7) #1 %65 = bitcast [12 x i8]* %63 to i8** store i8* %64, i8** %65, align 4 %66 = bitcast i8* %64 to %Vs5Int64* %67 = getelementptr inbounds %Vs5Int64, %Vs5Int64* %66, i32 0, i32 0 store i64 %48, i64* %67, align 8 %68 = call { i32, i32, i32 } @_TIFs5printFTGSaP__9separatorSS10terminatorSS_T_A0_() %69 = extractvalue { i32, i32, i32 } %68, 0 %70 = extractvalue { i32, i32, i32 } %68, 1 %71 = extractvalue { i32, i32, i32 } %68, 2 %72 = call { i32, i32, i32 } @_TIFs5printFTGSaP__9separatorSS10terminatorSS_T_A1_() %73 = extractvalue { i32, i32, i32 } %72, 0 %74 = extractvalue { i32, i32, i32 } %72, 1 %75 = extractvalue { i32, i32, i32 } %72, 2 call void @_TFs5printFTGSaP__9separatorSS10terminatorSS_T_(%swift.bridge* %52, i32 %69, i32 %70, i32 %71, i32 %73, i32 %74, i32 %75) call void bitcast (void (%swift.refcounted*)* @rt_swift_release to void (%C13CoolFramework13CoolTestClass*)*)(%C13CoolFramework13CoolTestClass* %5) #1 ret void }
  12. movw r0, #0x45c8 ; :lower16:(0xcb3c - 0x45c8) movt r0, #0x0

    ; 0x45c8, :upper16:(0xcb3c - 0x45c8) add r0, pc, r0 ; __TMfC8CoolTest10CProtoImpl add r0, r0, #0x8 ; __TMC8CoolTest10CProtoImpl bl _rt_swift_getInitializedObjCClass movw r1, #0x46dc ; :lower16:(0xcc68 - 0x46dc) movt r1, #0x0 ; 0x46dc, :upper16:(0xcc68 - 0x46dc) dmb add r1, pc, r1 ; __TMLC8CoolTest10CProtoImpl str r0, [r1] ; __TMLC8CoolTest10CProtoImpl movw r0, #0x4600 mov sl, r5 movt r0, #0x0 ; 0x4600 ldr r0, [pc, r0] ; __TMLP_ cmp r0, #0x0 bne loc_865c add r1, sp, #0x10 mov r0, #0x0 bl _rt_swift_getExistentialTypeMetadata movw r1, #0x45dc ; :lower16:(0xcc38 - 0x45dc) movt r1, #0x0 ; 0x45dc, :upper16:(0xcc38 - 0x45dc) dmb add r1, pc, r1 ; __TMLP_ str r0, [r1] ; __TMLP_ loc_865c: bl imp___picsymbolstub4___TMaCs23_ContiguousArrayStorage ; type metadata accessor for Swift._ContiguousArrayStorage, CODE XREF=__TFC8CoolTest14ViewController8testFuncfT_T_+272 movw r1, #0x45bc ; :lower16:(0xcc34 - 0x45bc) mov r5, sl movt r1, #0x0 ; 0x45bc, :upper16:(0xcc34 - 0x45bc) mov sl, #0x2 add r1, pc, r1 ; __TMLGCs23_ContiguousArrayStorageP__ dmb str r0, [r1] ; __TMLGCs23_ContiguousArrayStorageP__ loc_867c: mov r1, #0x34 ; CODE XREF=__TFC8CoolTest14ViewController8testFuncfT_T_+248 mov r2, #0x3 str r4, [sp, #0x3c + var_30] bl imp___picsymbolstub4__swift_bufferAllocate movw r1, #0x396c mov r4, r5 movt r1, #0x0 mov r5, r0 ldr r1, [pc, r1] ; __TMVs5Int64_c010,__TMVs5Int64 mov r0, #0x4 str sl, [r5, #0xc] str r0, [r5, #0x10] mov r0, #0x8 str r1, [r5, #0x20] mov sl, r1 mov r1, #0x7 bl _rt_swift_slowAlloc str r0, [r5, #0x14] mov r1, #0x7 str fp, [r0, #0x4] str r4, [r0] mov r0, #0x8 str sl, [r5, #0x30] bl _rt_swift_slowAlloc str r0, [r5, #0x24] str r8, [r0, #0x4] str r6, [r0] bl imp___picsymbolstub4___TIFs5printFTGSaP__9separatorSS10terminatorSS_T_A0_ ; Swift.(print ([protocol<>], separator : Swift.String, terminator : Swift.String) -> ()).(default argument 1) mov r6, r0 mov r4, r1 mov sl, r2 bl imp___picsymbolstub4___TIFs5printFTGSaP__9separatorSS10terminatorSS_T_A1_ ; Swift.(print ([protocol<>], separator : Swift.String, terminator : Swift.String) -> ()).(default argument 2) stm sp, {r0, r1, r2} mov r0, r5 mov r1, r6 mov r2, r4 mov r3, sl bl imp___picsymbolstub4___TFs5printFTGSaP__9separatorSS10terminatorSS_T_ ; Swift.print ([protocol<>], separator : Swift.String, terminator : Swift.String) -> () ldr r0, [sp, #0x3c + var_30] bl _rt_swift_release sub sp, r7, #0x18 pop {r8, sl, fp} pop {r4, r5, r6, r7, pc} loc_858c: movw r1, #0x3b64 ; :lower16:(0xc104 - 0x3b64), CODE XREF=__TFC8CoolTest14ViewController8testFuncfT_T_+56 movt r1, #0x0 ; :upper16:(0xc104 - 0x3b64) str r0, [sp, #0x3c + var_20] add r1, pc, r1 ; __TWPC8CoolTest10CProtoImpl13CoolFramework12CoolProtocolS_ str r1, [sp, #0x3c + var_1C] movw r0, #0x45e4 movt r0, #0x0 ; 0x45e4 ldr r0, [pc, r0] ; __TWvdvC8CoolTest14ViewController1cCS_10CProtoImpl ldr r0, [r5, r0] str r0, [sp, #0x3c + var_2C] bl _rt_swift_retain add r0, sp, #0x10 mov r1, #0x1 mov r2, r4 blx r6 mov r5, r0 movw r0, #0x3b78 ; :lower16:(0xc15c - 0x3b78) movt r0, #0x0 ; :upper16:(0xc15c - 0x3b78) mov fp, r1 movw r1, #0x3b14 ; :lower16:(0xc108 - 0x3b14) add r0, pc, r0 ; __TMfV8CoolTest10SProtoImpl movt r1, #0x0 ; :upper16:(0xc108 - 0x3b14) add r0, r0, #0x4 ; __TMV8CoolTest10SProtoImpl str r0, [sp, #0x3c + var_20] add r1, pc, r1 ; __TWPV8CoolTest10SProtoImpl13CoolFramework12CoolProtocolS_ add r0, sp, #0x10 str r1, [sp, #0x3c + var_1C] mov r1, #0x2 mov r2, r4 mov sl, #0x2 blx r6 mov r6, r0 movw r0, #0x4614 movt r0, #0x0 ; 0x4614 mov r8, r1 ldr r0, [pc, r0] ; __TMLGCs23_ContiguousArrayStorageP__ cmp r0, #0x0 bne loc_867c ; ================ B E G I N N I N G O F P R O C E D U R E ================ ; Variables: ; var_1C: -28 ; var_20: -32 ; var_2C: -44 ; var_30: -48 __TFC8CoolTest14ViewController8testFuncfT_T_: // CoolTest.ViewController.testFunc () -> () push {r4, r5, r6, r7, lr} ; CODE XREF=__TToFC8CoolTest14ViewController8testFuncfT_T_+20, __TFC8CoolTest14ViewController11viewDidLoadfT_T_+108, __TToFC8CoolTest14ViewController11viewDidLoadfT_T_+112 add r7, sp, #0xc push {r8, sl, fp} sub sp, sp, #0x24 mov r5, r0 bl imp___picsymbolstub4___TMaC13CoolFramework13CoolTestClass ; type metadata accessor for CoolFramework.CoolTestClass bl imp___picsymbolstub4___TFC13CoolFramework13CoolTestClassCfT_S0_ ; CoolFramework.CoolTestClass.__allocating_init () -> CoolFramework.CoolTestClass mov r4, r0 ldr r0, [r4] ldr r6, [r0, #0x38] movw r0, #0x4708 movt r0, #0x0 ; 0x4708 ldr r0, [pc, r0] ; __TMLC8CoolTest10CProtoImpl cmp r0, #0x0 bne loc_858c
  13. Выводы • Bitcode ok • Для Debug его лучше не

    включать • Swift не самый быстрый язык • Protocol as parameter передается by reference