Tag

SIL

0 views collected around this technical thread.

NetEase Cloud Music Tech Team
NetEase Cloud Music Tech Team
Jun 5, 2023 · Fundamentals

Understanding Swift SIL and Method Dispatch Mechanisms

Swift inserts the high‑level SIL intermediate representation between source code and LLVM, exposing type declarations, method blocks, and virtual tables, while supporting three dispatch strategies—direct for value types and final methods, VTable for regular class methods, and Objective‑C message dispatch for @objc dynamic methods—crucial for debugging mixed Swift/Objective‑C and protocol‑extension behavior.

CompilerLLVMMethod Dispatch
0 likes · 20 min read
Understanding Swift SIL and Method Dispatch Mechanisms
Sohu Tech Products
Sohu Tech Products
Jan 11, 2023 · Mobile Development

Deep Dive into Swift Array Implementation and Copy‑On‑Write Mechanics

This article provides a comprehensive, low‑level exploration of Swift's Array type, detailing its memory layout, the SIL generation process, buffer allocation, internal structures such as _ArrayBuffer and _ContiguousArrayStorage, and the copy‑on‑write behavior that governs mutation and reference counting.

Copy-on-WriteLow-Level DebuggingMemory Management
0 likes · 18 min read
Deep Dive into Swift Array Implementation and Copy‑On‑Write Mechanics
Sohu Tech Products
Sohu Tech Products
Aug 5, 2020 · Fundamentals

Exploring Swift Enum Implementation: SIL, Memory Layout, Raw Values, Associated Values, and Protocols

This article delves into the inner workings of Swift enums—covering their compilation to SIL, memory representation, use of MemoryLayout for size and alignment, techniques for retrieving variable addresses, the role of raw values and associated values, and how default protocols like Equatable and Hashable are automatically provided.

Associated ValueProgrammingRawValue
0 likes · 19 min read
Exploring Swift Enum Implementation: SIL, Memory Layout, Raw Values, Associated Values, and Protocols
Sohu Tech Products
Sohu Tech Products
Jan 15, 2020 · Mobile Development

Understanding Swift Thunk Functions and SIL: Why UITableViewDelegate Methods May Not Be Invoked

This article examines a real iOS project case where a UITableView delegate method does not fire, explores Swift Intermediate Language (SIL) and thunk functions, explains the role of @objc and dynamic dispatch, and demonstrates how generic base classes affect Objective‑C visibility of delegate methods.

Message DispatchObjective-CSIL
0 likes · 16 min read
Understanding Swift Thunk Functions and SIL: Why UITableViewDelegate Methods May Not Be Invoked
Sohu Tech Products
Sohu Tech Products
Jan 8, 2020 · Backend Development

Understanding Swift SIL: Exploring LLVM Backend and Protocol Extension Implementation

This article explains how Swift leverages LLVM's three‑stage compiler architecture and the Swift Intermediate Language (SIL) to implement protocol extensions, detailing the generation and analysis of SIL code, VTables, Witness Tables, and function calls to reveal the language's underlying compilation process.

CompilerLLVMProtocol Extension
0 likes · 12 min read
Understanding Swift SIL: Exploring LLVM Backend and Protocol Extension Implementation