| 30 | } |
| 31 | |
| 32 | MethodCache::CacheMethodInfo MethodCache::ResolveMethodSignature(const string& className, const string& methodName, const FunctionCallbackInfo<Value>& args, bool isStatic) { |
| 33 | CacheMethodInfo method_info; |
| 34 | |
| 35 | auto encoded_method_signature = EncodeSignature(className, methodName, args, isStatic); |
| 36 | auto it = s_mthod_ctor_signature_cache.find(encoded_method_signature); |
| 37 | |
| 38 | if (it == s_mthod_ctor_signature_cache.end()) { |
| 39 | auto signature = ResolveJavaMethod(args, className, methodName); |
| 40 | |
| 41 | DEBUG_WRITE("ResolveMethodSignature %s='%s'", encoded_method_signature.c_str(), signature.c_str()); |
| 42 | |
| 43 | if (!signature.empty()) { |
| 44 | JEnv env; |
| 45 | auto clazz = env.FindClass(className); |
| 46 | assert(clazz != nullptr); |
| 47 | method_info.clazz = clazz; |
| 48 | method_info.signature = signature; |
| 49 | method_info.returnType = MetadataReader::ParseReturnType(method_info.signature); |
| 50 | method_info.retType = MetadataReader::GetReturnType(method_info.returnType); |
| 51 | method_info.isStatic = isStatic; |
| 52 | method_info.mid = isStatic |
| 53 | ? env.GetStaticMethodID(clazz, methodName, signature) |
| 54 | : |
| 55 | env.GetMethodID(clazz, methodName, signature); |
| 56 | |
| 57 | s_mthod_ctor_signature_cache.emplace(encoded_method_signature, method_info); |
| 58 | } |
| 59 | } else { |
| 60 | method_info = (*it).second; |
| 61 | } |
| 62 | |
| 63 | return method_info; |
| 64 | } |
| 65 | |
| 66 | MethodCache::CacheMethodInfo MethodCache::ResolveConstructorSignature(const ArgsWrapper& argWrapper, const string& fullClassName, jclass javaClass, bool isInterface) { |
| 67 | CacheMethodInfo constructor_info; |
nothing calls this directly
no test coverage detected