public static DynamicMethod unwrapMethod(DynamicMethod method, String[] realName) throws IndirectBindingException { // get the "real" method in a few ways while (method instanceof AliasMethod) { realName[0] = ((AliasMethod)method).getOldName(); // need to use original name, not aliased name method = method.getRealMethod(); } while (method instanceof WrapperMethod) method = method.getRealMethod(); // ProfilingDynamicMethod wraps any number of other types of methods but // we do not handle it in indy binding right now. Disable direct binding // and bind through DynamicMethod. if (method instanceof ProfilingDynamicMethod) { throw new IndirectBindingException("profiling active"); } if (method instanceof DefaultMethod) { DefaultMethod defaultMethod = (DefaultMethod) method; if (defaultMethod.getMethodForCaching() instanceof JittedMethod) { method = defaultMethod.getMethodForCaching(); } } return method; }
public static DynamicMethod unwrapMethod(DynamicMethod method, String[] realName) throws IndirectBindingException { // get the "real" method in a few ways while (method instanceof AliasMethod) { realName[0] = ((AliasMethod)method).getOldName(); // need to use original name, not aliased name method = method.getRealMethod(); } while (method instanceof WrapperMethod) method = method.getRealMethod(); // ProfilingDynamicMethod wraps any number of other types of methods but // we do not handle it in indy binding right now. Disable direct binding // and bind through DynamicMethod. if (method instanceof ProfilingDynamicMethod) { throw new IndirectBindingException("profiling active"); } if (method instanceof DefaultMethod) { DefaultMethod defaultMethod = (DefaultMethod) method; if (defaultMethod.getMethodForCaching() instanceof JittedMethod) { method = defaultMethod.getMethodForCaching(); } } return method; }