Shared Counters
Monotonically increasing counters used by both MiniKotlinCompiler and ExpressionCompiler to generate names that are unique within a single compilation unit.
A single SharedCounters instance is created by MiniKotlinCompiler at construction time and passed to ExpressionCompiler. This ensures that continuation labels (cont_N), result names (res_N), and variable names (x_N) never collide, even when expression and statement compilation interleave deeply nested CPS lambdas.
Both counters are reset to zero at the start of each MiniKotlinCompiler.compile call so that the generated Java is deterministic for a given input program.
Functions
Resets both counters to zero. Called at the start of each top-level MiniKotlinCompiler.compile invocation to guarantee deterministic output.