-
Bug
-
Resolution: Fixed
-
P4
-
None
-
None
-
b21
j.l.invoke.MethodType has a pair of public convenience methods genericMethodType(int) and genericMethodType(int, boolean) that will return a possibly cached method type. These operations are generally much faster than the equivalent methodType(..) calls.
Rather than painstakingly use genericMethodType(int, ..) everywhere it might matter, an alternative solution is to refactor methodType(..) to check if the parameters match the genericMethodType and then automatically call genericMethodType method. Since generic type signatures are common, this appears to be a net win on both startup and helps enable constant folding.
Rather than painstakingly use genericMethodType(int, ..) everywhere it might matter, an alternative solution is to refactor methodType(..) to check if the parameters match the genericMethodType and then automatically call genericMethodType method. Since generic type signatures are common, this appears to be a net win on both startup and helps enable constant folding.