system/src/sc/lang/java/ModelUtil.java
public static Object invokeMethod(Object thisObject, Object method, Object[] argValues, ExecutionContext ctx) {
      // Compiled
      if (method instanceof Method) {
         Method jMethod = (Method) method;
         return PTypeUtil.invokeMethod(thisObject, jMethod, argValues);
      }
      // Interpreted
      else if (method instanceof AbstractMethodDefinition) {
         AbstractMethodDefinition rtmeth = (AbstractMethodDefinition) method;

         if (rtmeth.isDynMethod())
            return rtmeth.invoke(ctx, argValues == null ? Collections.EMPTY_LIST : Arrays.asList(argValues));
         else {
            Object invMeth = rtmeth.getRuntimeMethod();
            return ModelUtil.invokeMethod(thisObject, invMeth, argValues, ctx);
         }
      }
      else if (method instanceof CFMethod) {
         Method rtMeth = ((CFMethod) method).getRuntimeMethod();

         if (rtMeth == null)
            throw new IllegalArgumentException("Can't invoke method: " + method + " No runtime class found");

         return ModelUtil.invokeMethod(thisObject, rtMeth, argValues, ctx);
      }
      else if (method instanceof ParamTypedMethod) {
         return invokeMethod(thisObject, ((ParamTypedMethod) method).method, argValues, ctx);
      }
      else
         throw new UnsupportedOperationException();
   }
/** A simple direct invoke of either an interpreted or compiled method once values are bound to parameters */
A simple direct invoke of either an interpreted or compiled method once values are bound to parameters
A simple direct invoke of either an interpreted or compiled method once values are bound to parameters
public static Object invokeMethod(Object thisObject, Object method, Object[] argValues, ExecutionContext ctx) {
      if (method instanceof Method) {
         Method jMethod = (Method) method;
         return PTypeUtil.invokeMethod(thisObject, jMethod, argValues);
      }
      else if (method instanceof AbstractMethodDefinition) {
         AbstractMethodDefinition rtmeth = (AbstractMethodDefinition) method;
         if (rtmeth.isDynMethod())
            return rtmeth.invoke(ctx, argValues == null ? Collections.EMPTY_LIST : Arrays.asList(argValues));
         else {
            Object invMeth = rtmeth.getRuntimeMethod();
            return ModelUtil.invokeMethod(thisObject, invMeth, argValues, ctx);
         }
      }
      else if (method instanceof CFMethod) {
         Method rtMeth = ((CFMethod) method).getRuntimeMethod();
         if (rtMeth == null)
            throw new IllegalArgumentException("Can't invoke method: " + method + " No runtime class found");
         return ModelUtil.invokeMethod(thisObject, rtMeth, argValues, ctx);
      }
      else if (method instanceof ParamTypedMethod) {
         return invokeMethod(thisObject, ((ParamTypedMethod) method).method, argValues, ctx);
      }
      else
         throw new UnsupportedOperationException();
   }
public static Object invokeMethod ( Object thisObject , Object method , Object [ ] argValues , ExecutionContext ctx ) { if ( method instanceof Method ) { Method jMethod = ( Method ) method ; return PTypeUtil . invokeMethod ( thisObject , jMethod , argValues ) ; } else if ( method instanceof AbstractMethodDefinition ) { AbstractMethodDefinition rtmeth = ( AbstractMethodDefinition ) method ; if ( rtmeth . isDynMethod ( ) ) return rtmeth . invoke ( ctx , argValues == null ? Collections . EMPTY_LIST : Arrays . asList ( argValues ) ) ; else { Object invMeth = rtmeth . getRuntimeMethod ( ) ; return ModelUtil . invokeMethod ( thisObject , invMeth , argValues , ctx ) ; } } else if ( method instanceof CFMethod ) { Method rtMeth = ( ( CFMethod ) method ) . getRuntimeMethod ( ) ; if ( rtMeth == null ) throw new IllegalArgumentException ( "Can't invoke method: " + method + " No runtime class found" ) ; return ModelUtil . invokeMethod ( thisObject , rtMeth , argValues , ctx ) ; } else if ( method instanceof ParamTypedMethod ) { return invokeMethod ( thisObject , ( ( ParamTypedMethod ) method ) . method , argValues , ctx ) ; } else throw new UnsupportedOperationException ( ) ; }
A simple direct invoke of either an interpreted or compiled method once values are bound to parameters
A simple direct invoke of either an interpreted or compiled method once values are bound to parameters
// Compiled // Interpreted