Giter VIP home page Giter VIP logo

Comments (1)

LeoMobileDeveloper avatar LeoMobileDeveloper commented on July 18, 2024 3

objc代码生成objc_msgSend是在哪一步?

是在CodeGen这一步,这一步会对Objective C的runtime进行桥接,objective c的方法会被转换为objc_msgSend函数调用。 详见:深入浅出iOS编译

runtime 是不是就是动态库?

runtime是一套Objective C运行时机制,把runtime叫做动态库是不严谨的,runtime会依赖于一些动态库,核心的是libobjc.A.dylib,在操作系统的这个目录下 /usr/lib/libobjc.A.dylib

objc_msgSend 就是runtime动态库里的方法, 最后会链接,装载成 执行文件吗?

不会,Objective C的ABI非常稳定,所以动态库libobjc.A.dylib是iOS操作系统层面提供的,不需要打包进App。链接时,可执行文件里会写入objc_msgSend来自libobjc.A.dylib,然后App启动的时候,由dyld修复objc_msgSend函数在内存中的地址。详见:深入理解iOS App的启动过程

from blogs.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.