The first parameter (the reciever) is always typed by val* in order to accept an object value The C-signature is always compatible with the intro
# The C function associated to a mmethoddef, that can be stored into a VFT of a class
# The first parameter (the reciever) is always typed by val* in order to accept an object value
# The C-signature is always compatible with the intro
fun virtual_runtime_function: SeparateRuntimeFunction
do
var res = self.virtual_runtime_function_cache
if res == null then
# Because the function is virtual, the signature must match the one of the original class
var intromclassdef = mproperty.intro.mclassdef
var recv = intromclassdef.bound_mtype
res = separate_runtime_function
if res.called_recv == recv then
self.virtual_runtime_function_cache = res
return res
end
var msignature = mproperty.intro.msignature.resolve_for(recv, recv, intromclassdef.mmodule, true)
if recv.ctype == res.called_recv.ctype and msignature.c_equiv(res.called_signature) then
self.virtual_runtime_function_cache = res
return res
end
res = new SeparateThunkFunction(self, recv, msignature, "VIRTUAL_{c_name}", mclassdef.bound_mtype)
end
return res
end
src/compiler/separate_compiler.nit:2416,2--2442,4