Kotlin compilation moves from the Front-end, where the FIR tree resolves types and symbols, to the Middle-end (IR), where high-level features are "desugared" into simpler building blocks. The final Back-end stage generates the JVM bytecode.
The webinar demoed a custom profiling plugin that hooks into the IR stage. Using the visitor pattern, the plugin identifies @Profilable classes and @ProfiledCall methods and programmatically injects LatencyRecorder logic into the bytecode. This replaces manual boilerplate with automated, compiler-level instrumentation, though the presenter cautioned that these internal APIs remain unstable until the K2 compiler transition is fully complete.
Join the conversation! Your thoughts help the community grow.