Call Site Helper
A helper that aggregates parameters for polymorphic dispatch inlining.
Parameters
The A_Bundle being invoked.
The type whose union with the arguments tuple type is used for lookup. This is ⊥ for ordinary calls, and other types for super calls.
The expected result type that has been strengthened by A_SemanticRestrictions at this call site. The VM does not always guarantee this type will be returned, but it inserts runtime checks in the case that it can't prove it.
Properties
Where to jump after a completed call if a return type check isn't needed.
Where to jump after a completed call to perform a return type check.
Where it ends up after the entire call, regardless of whether the returned value had to be checked or not.
A counter for generating unique branch names for this dispatch.
The type expected to be returned by invoking the function. This may be stronger than the type guaranteed by the VM, which requires a runtime check.
A map from each reachable looked-up A_Function to a Pair containing an L2BasicBlock in which code generation for invocation of this function should/did take place, and a lambda which will cause that code generation to happen.
Where to jump to perform the slow lookup.
Where to jump to perform reification without the need for an eventual return type check.
Where to jump to perform reification during a call that cannot ever return.
Where to jump to perform reification, eventually leading to a return type check after completion.
Bottom in the normal case, but for a super-call this is a tuple type with the same size as the number of arguments. For the purpose of looking up the appropriate A_Definition, the type union of each argument's dynamic type and the corresponding entry type from this field is computed, and that's used for the lookup.
Functions
For every L2BasicBlock in my invocationSitesToCreate that is reachable, generate an invocation of the corresponding A_Function. A_Bundle.message
Answer the L2Generator that this CallSiteHelper is within.
Answer the L1Translator that this CallSiteHelper is within.
Record the fact that this call has produced a value in a particular register which is to represent the new top-of-stack value.