diff options
-rw-r--r-- | compiler/driver/compiler_driver.cc | 36 | ||||
-rw-r--r-- | runtime/class_linker.cc | 1 |
2 files changed, 19 insertions, 18 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 1c831cf3f6..6eabeed34b 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -1471,6 +1471,24 @@ static void ResolveClassFieldsAndMethods(const ParallelCompilationManager* manag // generated code. const DexFile::ClassDef& class_def = dex_file.GetClassDef(class_def_index); if (!SkipClass(class_linker, jclass_loader, dex_file, class_def)) { + ScopedObjectAccess soa(self); + mirror::ClassLoader* class_loader = soa.Decode<mirror::ClassLoader*>(jclass_loader); + mirror::DexCache* dex_cache = class_linker->FindDexCache(dex_file); + + // Resolve the class. + mirror::Class* klass = class_linker->ResolveType(dex_file, class_def.class_idx_, dex_cache, + class_loader); + + bool resolve_fields_and_methods; + if (klass == NULL) { + // Class couldn't be resolved, for example, super-class is in a different dex file. Don't + // attempt to resolve methods and fields when there is no declaring class. + CHECK(soa.Self()->IsExceptionPending()); + soa.Self()->ClearException(); + resolve_fields_and_methods = false; + } else { + resolve_fields_and_methods = manager->GetCompiler()->IsImage(); + } // Note the class_data pointer advances through the headers, // static fields, instance fields, direct methods, and virtual // methods. @@ -1479,24 +1497,6 @@ static void ResolveClassFieldsAndMethods(const ParallelCompilationManager* manag // Empty class such as a marker interface. requires_constructor_barrier = false; } else { - ScopedObjectAccess soa(self); - mirror::ClassLoader* class_loader = soa.Decode<mirror::ClassLoader*>(jclass_loader); - mirror::DexCache* dex_cache = class_linker->FindDexCache(dex_file); - - // Resolve the class. - mirror::Class* klass = class_linker->ResolveType(dex_file, class_def.class_idx_, dex_cache, - class_loader); - - bool resolve_fields_and_methods; - if (klass == NULL) { - // Class couldn't be resolved, for example, super-class is in a different dex file. Don't - // attempt to resolve methods and fields when there is no declaring class. - CHECK(soa.Self()->IsExceptionPending()); - soa.Self()->ClearException(); - resolve_fields_and_methods = false; - } else { - resolve_fields_and_methods = manager->GetCompiler()->IsImage(); - } ClassDataItemIterator it(dex_file, class_data); while (it.HasNextStaticField()) { if (resolve_fields_and_methods) { diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 4043f8be5a..4a3ae1b8c9 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -3979,6 +3979,7 @@ mirror::Class* ClassLinker::ResolveType(const DexFile& dex_file, } } } + DCHECK((resolved == NULL) || resolved->IsResolved()) << PrettyDescriptor(resolved); return resolved; } |