attemptToGenerateSimpleInvocation

open override fun attemptToGenerateSimpleInvocation(simpleTranslator: L2SimpleTranslator, functionIfKnown: A_Function?, rawFunction: A_RawFunction, argRestrictions: List<TypeRestriction>, expectedType: A_Type): TypeRestriction?

Attempt to generate a simplified, faster invocation of the given constant function, with the given argument restrictions. The arguments will be on the stack, the last-pushed one at stackp. If this code generation attempt is successful, code will be generated to invoke the given function, and if it completes without reification, to check the return result if it's not already guaranteed correct. Note that the call and the return type check can't be in separate instructions, since there's nowhere to store the unchecked return value to compare it against the expected type. We can't just clobber the expected type (that was pushed at the start of the call), since that would

If reification happens, the continuation that will be produced at runtime should be of the simple L1 form, using the unoptimizedChunk. It should have the expected type pushed on the stack in preparation for checking against the return type, once the continuation is "returned into".