fix and de-dup cached calls to methods_by_ftype
in compiler
#36404
+35
−33
methods_by_ftype
in compiler
#36404