+
+ # Replace monomorphic call to a trampoline by a direct call to the virtual implementation
+ if modelbuilder.toolcontext.opt_substitute_monomorph.value then do
+ var m = pd.mproperty
+ if rta == null then
+ # Without RTA, monomorphic means alone (uniq name)
+ if m.mpropdefs.length != 1 then break label
+ else
+ # With RTA, monomorphic means only live methoddef
+ if not rta.live_methoddefs.has(pd) then break label
+ for md in m.mpropdefs do
+ if md != pd and rta.live_methoddefs.has(md) then break label
+ end
+ end
+ # Here the trick, GNU ld can substitute symbols with specific values.
+ var n2 = "CALL_" + m.const_color
+ linker_script.add("{n2} = {r2.c_name};")
+ end label