diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-25 10:08:51 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-25 17:13:54 +0000 |
commit | 9437b78780f9e6ffa5797ebe82de8e8d7f3a5ed6 (patch) | |
tree | d99027ae9295f162865c01f9a8795ac8cda09b84 /compiler/driver | |
parent | 11e99b19f48576f1bb6d0993635b34b6e09c9832 (diff) | |
download | art-9437b78780f9e6ffa5797ebe82de8e8d7f3a5ed6.zip art-9437b78780f9e6ffa5797ebe82de8e8d7f3a5ed6.tar.gz art-9437b78780f9e6ffa5797ebe82de8e8d7f3a5ed6.tar.bz2 |
Revert "Revert "Inline across dex files.""
This reverts commit 6a816cf624ba56bf2872916d7b65b18fd9a411ef.
Change-Id: I36cb524108786dd7996f2aea0443675be1f1b859
Diffstat (limited to 'compiler/driver')
-rw-r--r-- | compiler/driver/compiler_driver-inl.h | 25 | ||||
-rw-r--r-- | compiler/driver/compiler_driver.h | 6 |
2 files changed, 23 insertions, 8 deletions
diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h index 4a35e9f..8babc28 100644 --- a/compiler/driver/compiler_driver-inl.h +++ b/compiler/driver/compiler_driver-inl.h @@ -39,6 +39,22 @@ inline mirror::ClassLoader* CompilerDriver::GetClassLoader(ScopedObjectAccess& s return soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader()); } +inline mirror::Class* CompilerDriver::ResolveClass( + const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache, + Handle<mirror::ClassLoader> class_loader, uint16_t cls_index, + const DexCompilationUnit* mUnit) { + DCHECK_EQ(dex_cache->GetDexFile(), mUnit->GetDexFile()); + DCHECK_EQ(class_loader.Get(), soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader())); + mirror::Class* cls = mUnit->GetClassLinker()->ResolveType( + *mUnit->GetDexFile(), cls_index, dex_cache, class_loader); + DCHECK_EQ(cls == nullptr, soa.Self()->IsExceptionPending()); + if (UNLIKELY(cls == nullptr)) { + // Clean up any exception left by type resolution. + soa.Self()->ClearException(); + } + return cls; +} + inline mirror::Class* CompilerDriver::ResolveCompilingMethodsClass( const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache, Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit) { @@ -46,14 +62,7 @@ inline mirror::Class* CompilerDriver::ResolveCompilingMethodsClass( DCHECK_EQ(class_loader.Get(), soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader())); const DexFile::MethodId& referrer_method_id = mUnit->GetDexFile()->GetMethodId(mUnit->GetDexMethodIndex()); - mirror::Class* referrer_class = mUnit->GetClassLinker()->ResolveType( - *mUnit->GetDexFile(), referrer_method_id.class_idx_, dex_cache, class_loader); - DCHECK_EQ(referrer_class == nullptr, soa.Self()->IsExceptionPending()); - if (UNLIKELY(referrer_class == nullptr)) { - // Clean up any exception left by type resolution. - soa.Self()->ClearException(); - } - return referrer_class; + return ResolveClass(soa, dex_cache, class_loader, referrer_method_id.class_idx_, mUnit); } inline mirror::ArtField* CompilerDriver::ResolveFieldWithDexFile( diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 9463c2c..b825293 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -228,6 +228,12 @@ class CompilerDriver { Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + mirror::Class* ResolveClass( + const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache, + Handle<mirror::ClassLoader> class_loader, uint16_t type_index, + const DexCompilationUnit* mUnit) + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + // Resolve a field. Returns nullptr on failure, including incompatible class change. // NOTE: Unlike ClassLinker's ResolveField(), this method enforces is_static. mirror::ArtField* ResolveField( |