summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc24
1 files changed, 10 insertions, 14 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index fe91272ef7..b199933ae4 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -99,7 +99,7 @@
#include "mirror/stack_trace_element.h"
#include "mirror/string-inl.h"
#include "native/dalvik_system_DexFile.h"
-#include "nativehelper/ScopedLocalRef.h"
+#include "nativehelper/scoped_local_ref.h"
#include "oat.h"
#include "oat_file-inl.h"
#include "oat_file.h"
@@ -1819,6 +1819,7 @@ bool ClassLinker::AddImageSpace(
if (kIsDebugBuild && app_image) {
// This verification needs to happen after the classes have been added to the class loader.
// Since it ensures classes are in the class table.
+ ScopedTrace trace("VerifyAppImage");
VerifyAppImage(header, class_loader, dex_caches, class_table, space);
}
@@ -7707,12 +7708,6 @@ mirror::Class* ClassLinker::ResolveType(const DexFile& dex_file,
Thread::PoisonObjectPointersIfDebug();
ObjPtr<mirror::Class> resolved = dex_cache->GetResolvedType(type_idx);
if (resolved == nullptr) {
- // TODO: Avoid this lookup as it duplicates work done in FindClass(). It is here
- // as a workaround for FastNative JNI to avoid AssertNoPendingException() when
- // trying to resolve annotations while an exception may be pending. Bug: 34659969
- resolved = LookupResolvedType(dex_file, type_idx, dex_cache.Get(), class_loader.Get());
- }
- if (resolved == nullptr) {
Thread* self = Thread::Current();
const char* descriptor = dex_file.StringByTypeIdx(type_idx);
resolved = FindClass(self, descriptor, class_loader);
@@ -7981,7 +7976,8 @@ ArtField* ClassLinker::ResolveFieldJLS(const DexFile& dex_file,
return resolved;
}
-mirror::MethodType* ClassLinker::ResolveMethodType(const DexFile& dex_file,
+mirror::MethodType* ClassLinker::ResolveMethodType(Thread* self,
+ const DexFile& dex_file,
uint32_t proto_idx,
Handle<mirror::DexCache> dex_cache,
Handle<mirror::ClassLoader> class_loader) {
@@ -7993,7 +7989,6 @@ mirror::MethodType* ClassLinker::ResolveMethodType(const DexFile& dex_file,
return resolved.Ptr();
}
- Thread* const self = Thread::Current();
StackHandleScope<4> hs(self);
// First resolve the return type.
@@ -8043,13 +8038,14 @@ mirror::MethodType* ClassLinker::ResolveMethodType(const DexFile& dex_file,
return type.Get();
}
-mirror::MethodType* ClassLinker::ResolveMethodType(uint32_t proto_idx, ArtMethod* referrer) {
- Thread* const self = Thread::Current();
+mirror::MethodType* ClassLinker::ResolveMethodType(Thread* self,
+ uint32_t proto_idx,
+ ArtMethod* referrer) {
StackHandleScope<2> hs(self);
const DexFile* dex_file = referrer->GetDexFile();
Handle<mirror::DexCache> dex_cache(hs.NewHandle(referrer->GetDexCache()));
Handle<mirror::ClassLoader> class_loader(hs.NewHandle(referrer->GetClassLoader()));
- return ResolveMethodType(*dex_file, proto_idx, dex_cache, class_loader);
+ return ResolveMethodType(self, *dex_file, proto_idx, dex_cache, class_loader);
}
mirror::MethodHandle* ClassLinker::ResolveMethodHandleForField(
@@ -8344,10 +8340,10 @@ mirror::MethodHandle* ClassLinker::ResolveMethodHandleForMethod(
return mirror::MethodHandleImpl::Create(self, target, kind, method_type);
}
-mirror::MethodHandle* ClassLinker::ResolveMethodHandle(uint32_t method_handle_idx,
+mirror::MethodHandle* ClassLinker::ResolveMethodHandle(Thread* self,
+ uint32_t method_handle_idx,
ArtMethod* referrer)
REQUIRES_SHARED(Locks::mutator_lock_) {
- Thread* const self = Thread::Current();
const DexFile* const dex_file = referrer->GetDexFile();
const DexFile::MethodHandleItem& method_handle = dex_file->GetMethodHandle(method_handle_idx);
switch (static_cast<DexFile::MethodHandleType>(method_handle.method_handle_type_)) {