Map<Integer, MethodType> signatures = ((IRMethod)method.getIRMethod()).getNativeSignatures();
String jittedName = ((IRMethod)method.getIRMethod()).getJittedName();
if (signatures.size() == 1) {
// only variable-arity
method.switchToJitted(
new CompiledIRMethod(
MethodHandles.publicLookup().findStatic(sourceClass, jittedName, signatures.get(-1)),
method.getIRMethod(),
method.getVisibility(),
method.getImplementationClass()));
} else {
// also specific-arity
for (Map.Entry<Integer, MethodType> entry : signatures.entrySet()) {
if (entry.getKey() == -1) continue; // variable arity handle pushed above
method.switchToJitted(
new CompiledIRMethod(
MethodHandles.publicLookup().findStatic(sourceClass, jittedName, signatures.get(-1)),
MethodHandles.publicLookup().findStatic(sourceClass, jittedName, entry.getValue()),
entry.getKey(),
method.getIRMethod(),
method.getVisibility(),