diff options
author | 2018-05-11 08:21:45 +0000 | |
---|---|---|
committer | 2018-05-11 08:21:45 +0000 | |
commit | 51dda39549033b3c50a7fce5522ffc81325db54b (patch) | |
tree | f3f34dcfbf1fb7e499e3f250541926c2e6494ad1 /runtime/entrypoints/entrypoint_utils.cc | |
parent | bae5e4e8e1cc93edd938ee0ee2303b7f5ad6b4dc (diff) | |
parent | 18259d7fb7164a5e029df4f883b3a79ccc2403e8 (diff) |
Merge "ART: Compiler support for const-method-type"
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.cc')
-rw-r--r-- | runtime/entrypoints/entrypoint_utils.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc index 246c703e93..df184bc733 100644 --- a/runtime/entrypoints/entrypoint_utils.cc +++ b/runtime/entrypoints/entrypoint_utils.cc @@ -260,4 +260,19 @@ ArtMethod* GetCalleeSaveOuterMethod(Thread* self, CalleeSaveType type) { return DoGetCalleeSaveMethodOuterCallerAndPc(sp, type).first; } +ObjPtr<mirror::MethodType> ResolveMethodTypeFromCode(ArtMethod* referrer, + uint32_t proto_idx) { + Thread::PoisonObjectPointersIfDebug(); + ObjPtr<mirror::MethodType> method_type = + referrer->GetDexCache()->GetResolvedMethodType(proto_idx); + if (UNLIKELY(method_type == nullptr)) { + StackHandleScope<2> hs(Thread::Current()); + Handle<mirror::DexCache> dex_cache(hs.NewHandle(referrer->GetDexCache())); + Handle<mirror::ClassLoader> class_loader(hs.NewHandle(referrer->GetClassLoader())); + ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); + method_type = class_linker->ResolveMethodType(hs.Self(), proto_idx, dex_cache, class_loader); + } + return method_type; +} + } // namespace art |