Method inlining
Previously in this chapter, I spent quite some time describing the mechanics of enabling and disabling method inlining, but I never said what that actually means. To put it simply, method inlining allows one method to be compiled as if its code would be a part of another.
When you call a method that is not marked as inlineable (doesn't have the inline suffix), the compiler prepares method parameters in an appropriate way (in registers and on the stack, but I'm not going there) and then executes a CALL assembler instruction.
If the called method is marked as inlineable, then the compiler basically just inserts the body of the inlineable method inside the code of the caller. This speeds up the code but also makes it larger as ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access