raven-compiler/src/main/java/org/raven/compiler/Method.java
/**
     * Invoke a static function
     *
     * @param funOwner The class that owns this the function
     * @param funName  The name of the function
     * @param desc     The method descriptor
     * @param params   The method parameters
     */
Invoke a static function
@param funOwner The class that owns this the function
@param funName  The name of the function
@param desc     The method descriptor
@param params   The method parameters
Invoke a static function @param funOwner The class that owns this the function @param funName The name of the function @param desc The method descriptor @param params The method parameters
private void invokeStaticFun(final String funOwner, final String funName, final String desc, final Expression[] params) {
        Fun f = SymbolMap.resolveFun(ctx.getOwner(), funOwner, funName, params.length);
        int count = methodCount(funOwner, funName, params.length);
        if (f != null && !f.isJavaMethod()) {
            invokeStaticExact(funOwner, funName, desc, params);
        } else if (f == null || count != 1) {
            dynamicInvokeStatic(funOwner, funName, params);
        } else {
            Type methodType = Type.getMethodType(f.getDesc());
            Type[] types = Type.getArgumentTypes(f.getDesc());
            for (int i = 0; i < params.length; i++) {
                params[i].accept(this);
                coerce(types[i]);
            }
            visitMethodInsn(INVOKESTATIC, funOwner, funName, f.getDesc(), false);
            Primitive p = Primitive.getPrimitiveType(methodType.getReturnType().getDescriptor());
            if (!methodType.getReturnType().equals(Type.VOID_TYPE)) {
                if (p != null) {
                    p.wrap(this);
                }
                visitMethodInsn(INVOKESTATIC, getName(Intrinsics.class), "wrap",
                        getDesc(Intrinsics.class, "wrap", Object.class), false);
            } else {
                putNull();
            }
        }
    }
private void invokeStaticFun ( final String funOwner , final String funName , final String desc , final Expression [ ] params ) { Fun f = SymbolMap . resolveFun ( ctx . getOwner ( ) , funOwner , funName , params . length ) ; int count = methodCount ( funOwner , funName , params . length ) ; if ( f != null && ! f . isJavaMethod ( ) ) { invokeStaticExact ( funOwner , funName , desc , params ) ; } else if ( f == null || count != 1 ) { dynamicInvokeStatic ( funOwner , funName , params ) ; } else { Type methodType = Type . getMethodType ( f . getDesc ( ) ) ; Type [ ] types = Type . getArgumentTypes ( f . getDesc ( ) ) ; for ( int i = 0 ; i < params . length ; i ++ ) { params [ i ] . accept ( this ) ; coerce ( types [ i ] ) ; } visitMethodInsn ( INVOKESTATIC , funOwner , funName , f . getDesc ( ) , false ) ; Primitive p = Primitive . getPrimitiveType ( methodType . getReturnType ( ) . getDescriptor ( ) ) ; if ( ! methodType . getReturnType ( ) . equals ( Type . VOID_TYPE ) ) { if ( p != null ) { p . wrap ( this ) ; } visitMethodInsn ( INVOKESTATIC , getName ( Intrinsics . class ) , "wrap" , getDesc ( Intrinsics . class , "wrap" , Object . class ) , false ) ; } else { putNull ( ) ; } } }
Invoke a static function
 @param funOwner The class that owns this the function
 @param funName  The name of the function
 @param desc     The method descriptor
 @param params   The method parameters
Invoke a static function @param funOwner The class that owns this the function @param funName The name of the function @param desc The method descriptor @param params The method parameters
// if the function can be resolved, it is a tl function // method returns void so push null onto stack