ReplBridge
Game-loader side of the REPL. Builds the MaskingClassLoader, crosses into the masking world with a single reflective bootstrap of ...repl.impl.MaskingBridgeImpl — reached type-safely thereafter through the shared MaskingBridge interface — and caches the result so every compile / execute after the first is a warm call. The same bridge also fronts the remap-cache builder (assembleMappings, buildSymbols), so ALL masking-only calls share this one hop.
Why reflection: MaskingBridgeImpl and its backends (ReplHost, RemapCacheBuilder) link the Kotlin scripting / remapper APIs, which live only on the masking loader's urls (see MaskingClassLoader for why they cannot sit on the game's module path). The game loader therefore cannot link them by name, and this one bootstrap hop is the whole cost of that isolation.
Only types the masking loader delegates to the parent may cross the boundary: java.*, Any, and the mod's own classes outside repl.impl — which is also why MaskingBridge itself must stay in ...repl; see MaskingClassLoader. Never a kotlin.* type, function types included: under SPLIT the two sides run different kotlins.
Properties
The one thread the compiler runs on. Its FIR caches are single-threaded and nothing locks them: every caller is a task here, run in submission order — warmup first (startBackgroundWarmup), then each eval's compile. One thread for the life of the process, too: every thread that looks a class up through the compiler leaves an entry, for good, in a cache nothing ever disposes (KotlinBinaryClassCache).
①: CommonClass.init trigger — the baseline the other three timestamps are relative to.
Gates buildClasspath on a host that has plugins — not on their jars, which are all loaded before any is enabled, but on the urls a plugin attaches to its own loader inside onEnable, which PluginJarCollector reads live. Opened by MixinDedicatedServer at initServer's RETURN, by paper's ServerLoadEvent listener, or here at warmup start where no plugins are expected (pluginsExpected). Untimed: no constant tells a slow startup from a signal that will never come, so mcp.plugins.gate=false is the way past one that never does.
③: compiler working set preloaded (~= initStartNanos on a training launch).
②: remap symbols ready (~= initStartNanos on a mojmap runtime, where no remap is needed).
④: compiler built + one dummy snippet compiled and run — the first eval is now warm.
Counted down by the remap thread and the preload thread; the gate awaits both before building. Neither may run on COMPILER: the gate awaiting them heads its queue.
Functions
Cross into the masking loader (mapping-io + tiny-remapper live only there) to assemble the remap mappings: the half of the bundle that depends on the MC version alone. Called by RemapCache on a non-mojmap runtime with no mcp.remap.* flags, when no mappings are cached for this version yet.
The compile classpath, assembled once. Remap-DEPENDENT: see ReplJars.compileClasspath.
Reverse-remap the runtime jar through cached mappings into a mojmap symbol jar: the half of the bundle the loader's binpatches are baked into, and the only half a loader change rebuilds — locally, without the network.
Whether the runtime carries a Bukkit layer at all. A false negative only costs the plugin wait; a false positive waits for a level load, which every server does.
Build the masking loader + instantiate the MaskingBridge. Remap-independent, so the preload thread can run it while the remap download is still going. Idempotent.
The masking loader, built once and kept across a failed ensureMasking, its one caller, which holds LOCK.
Whether plugin jars can reach the compile classpath: a Bukkit layer, on a dedicated server. A client loads its plugins long after the classpath snapshot.
Called by the remap init (CommonClass) the moment mojmap symbols are ready — or immediately on a mojmap runtime where no remap is needed. Releases the warmup gate's remap half.
Start the warmup described above: the preload thread, and the gate that awaits both halves as COMPILER's first task. Called once from CommonClass.init. Both run below-normal priority to yield to the game's own startup work; the gate hands the compiler thread back at normal priority, which is what evals compile at.