(C context, ObjExpr objx, GeneratorAdapter gen)
| 2061 | } |
| 2062 | |
| 2063 | public void emit(C context, ObjExpr objx, GeneratorAdapter gen){ |
| 2064 | if(method != null) |
| 2065 | { |
| 2066 | Type type = Type.getType(method.getDeclaringClass()); |
| 2067 | target.emit(C.EXPRESSION, objx, gen); |
| 2068 | //if(!method.getDeclaringClass().isInterface()) |
| 2069 | gen.checkCast(type); |
| 2070 | MethodExpr.emitTypedArgs(objx, gen, method.getParameterTypes(), args); |
| 2071 | gen.visitLineNumber(line, gen.mark()); |
| 2072 | if(context == C.RETURN) |
| 2073 | { |
| 2074 | ObjMethod method = (ObjMethod) METHOD.deref(); |
| 2075 | method.emitClearLocals(gen); |
| 2076 | } |
| 2077 | Method m = new Method(methodName, Type.getReturnType(method), Type.getArgumentTypes(method)); |
| 2078 | if(method.getDeclaringClass().isInterface()) |
| 2079 | gen.invokeInterface(type, m); |
| 2080 | else |
| 2081 | gen.invokeVirtual(type, m); |
| 2082 | Class retClass = method.getReturnType(); |
| 2083 | if(context == C.STATEMENT) |
| 2084 | { |
| 2085 | if(retClass == long.class || retClass == double.class) |
| 2086 | gen.pop2(); |
| 2087 | else if(retClass != void.class) |
| 2088 | gen.pop(); |
| 2089 | } |
| 2090 | else |
| 2091 | HostExpr.emitBoxReturn(objx, gen, retClass); |
| 2092 | } |
| 2093 | else |
| 2094 | { |
| 2095 | target.emit(C.EXPRESSION, objx, gen); |
| 2096 | if(qualifyingClass != null) |
| 2097 | gen.push(qualifyingClass.getName()); |
| 2098 | gen.push(methodName); |
| 2099 | emitArgsAsArray(args, objx, gen); |
| 2100 | gen.visitLineNumber(line, gen.mark()); |
| 2101 | if(context == C.RETURN) |
| 2102 | { |
| 2103 | ObjMethod method = (ObjMethod) METHOD.deref(); |
| 2104 | method.emitClearLocals(gen); |
| 2105 | } |
| 2106 | if(qualifyingClass != null) |
| 2107 | gen.invokeStatic(REFLECTOR_TYPE, invokeInstanceMethodOfClassMethod); |
| 2108 | else |
| 2109 | gen.invokeStatic(REFLECTOR_TYPE, invokeInstanceMethodMethod); |
| 2110 | if(context == C.STATEMENT) |
| 2111 | gen.pop(); |
| 2112 | } |
| 2113 | } |
| 2114 | |
| 2115 | public boolean hasJavaClass(){ |
| 2116 | return method != null || tag != null; |
nothing calls this directly
no test coverage detected