MCPcopy Create free account
hub / github.com/NativeScript/android / ResolveMethodSignature

Method ResolveMethodSignature

test-app/runtime/src/main/cpp/MethodCache.cpp:32–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32MethodCache::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
66MethodCache::CacheMethodInfo MethodCache::ResolveConstructorSignature(const ArgsWrapper& argWrapper, const string& fullClassName, jclass javaClass, bool isInterface) {
67 CacheMethodInfo constructor_info;

Callers

nothing calls this directly

Calls 7

GetStaticMethodIDMethod · 0.80
GetMethodIDMethod · 0.80
emplaceMethod · 0.80
findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
FindClassMethod · 0.45

Tested by

no test coverage detected