Class DispatchTablePass
Extracted from the create-operations loops in AggregateDfnGenerator,
ServiceDfnGenerator and Scenario3SourceIRGenerator — each builds OperationInstrs
and wires dispatcher implementations, but only the first two ever generated a table. The Scenario 3
copy silently omitted it, so a dispatcher inside a monomorphized generic class dispatched every call
to its fallback body at runtime (finding Scenario3SourceIRGenerator:415). Call this after the
operation bodies are populated.
Fails loud (rather than silently skipping, finding AggregateDfnGenerator:353) when a dispatcher
is present but no compilable-program access is available: a dispatch table cannot be built without
it (ConcreteSubtypeFinder needs the program), and a silent skip is a runtime
miscompilation. The wrapper-generation IRContext must therefore carry program access — see
IRGenerator.generateParameterizedTypeWrappers.
-
Method Summary
Modifier and TypeMethodDescription(package private) static voidgenerate(Map<MethodSymbol, OperationInstr> operationsMap, AggregateSymbol aggregateSymbol, SharedThreadContext<CompilableProgram> compilableProgramAccess)
-
Method Details