generateGeneralFunctionInvocation

fun generateGeneralFunctionInvocation(    functionToCallReg: L2ReadBoxedOperand,     arguments: List<L2ReadBoxedOperand>,     tryToGenerateSpecialPrimitiveInvocation: Boolean,     callSiteHelper: L1Translator.CallSiteHelper)

Generate code to invoke a function in a register with arguments in registers. Also branch to the appropriate reification and return clauses depending on whether the returned value is guaranteed to satisfy the expectedType or not.

The code generation position is never L2Generator.currentlyReachable after this (Kotlin) method completes.

The final output from the entire polymorphic call will always be fully strengthened to the intersection of the VM-guaranteed type and the expectedType of the callSiteHelper, although an explicit type check may have to be generated along some paths.

Parameters

functionToCallReg

The L2ReadBoxedOperand containing the function to invoke.

arguments

The List of L2ReadBoxedOperands that supply arguments to the function.

tryToGenerateSpecialPrimitiveInvocation

true if an attempt should be made to generate a customized L2Instruction sequence for a Primitive invocation, false otherwise. This should generally be false only to prevent recursion from Primitive customization.

callSiteHelper

Information about the call being generated.