mikera / magic

Experimental typed JVM Lisp inspired by Clojure
Eclipse Public License 1.0
32 stars 2 forks source link

Eliminate reflection where possible #11

Open mikera opened 7 years ago

mikera commented 7 years ago

Currently both regular Java instance method invocation and static method invocation go via reflection.

We can do much better since Magic can infer the types of arguments.

Task is to optimise reflective method invocation to direct method calls wherever we can, i.e.:

  1. There are methods in the class/instance that match the statically determined types of the arguments

Question about what to do if multiple methods match: probably need to follow Java calling convention.