diff options
Diffstat (limited to 'compiler/dex/mir_method_info.cc')
| -rw-r--r-- | compiler/dex/mir_method_info.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/compiler/dex/mir_method_info.cc b/compiler/dex/mir_method_info.cc index 2c33ef18f5..cc2bd953d8 100644 --- a/compiler/dex/mir_method_info.cc +++ b/compiler/dex/mir_method_info.cc @@ -19,10 +19,10 @@ #include "driver/compiler_driver.h" #include "driver/dex_compilation_unit.h" #include "driver/compiler_driver-inl.h" -#include "mirror/class_loader.h" // Only to allow casts in SirtRef<ClassLoader>. -#include "mirror/dex_cache.h" // Only to allow casts in SirtRef<DexCache>. +#include "mirror/class_loader.h" // Only to allow casts in Handle<ClassLoader>. +#include "mirror/dex_cache.h" // Only to allow casts in Handle<DexCache>. #include "scoped_thread_state_change.h" -#include "sirt_ref.h" +#include "handle_scope-inl.h" namespace art { @@ -45,11 +45,12 @@ void MirMethodLoweringInfo::Resolve(CompilerDriver* compiler_driver, // We're going to resolve methods and check access in a tight loop. It's better to hold // the lock and needed references once than re-acquiring them again and again. ScopedObjectAccess soa(Thread::Current()); - SirtRef<mirror::DexCache> dex_cache(soa.Self(), compiler_driver->GetDexCache(mUnit)); - SirtRef<mirror::ClassLoader> class_loader(soa.Self(), - compiler_driver->GetClassLoader(soa, mUnit)); - SirtRef<mirror::Class> referrer_class(soa.Self(), - compiler_driver->ResolveCompilingMethodsClass(soa, dex_cache, class_loader, mUnit)); + StackHandleScope<3> hs(soa.Self()); + Handle<mirror::DexCache> dex_cache(hs.NewHandle(compiler_driver->GetDexCache(mUnit))); + Handle<mirror::ClassLoader> class_loader( + hs.NewHandle(compiler_driver->GetClassLoader(soa, mUnit))); + Handle<mirror::Class> referrer_class(hs.NewHandle( + compiler_driver->ResolveCompilingMethodsClass(soa, dex_cache, class_loader, mUnit))); // Even if the referrer class is unresolved (i.e. we're compiling a method without class // definition) we still want to resolve methods and record all available info. @@ -73,10 +74,10 @@ void MirMethodLoweringInfo::Resolve(CompilerDriver* compiler_driver, MethodReference target_method(mUnit->GetDexFile(), it->MethodIndex()); int fast_path_flags = compiler_driver->IsFastInvoke( - soa, dex_cache, class_loader, mUnit, referrer_class.get(), resolved_method, &invoke_type, + soa, dex_cache, class_loader, mUnit, referrer_class.Get(), resolved_method, &invoke_type, &target_method, devirt_target, &it->direct_code_, &it->direct_method_); bool needs_clinit = - compiler_driver->NeedsClassInitialization(referrer_class.get(), resolved_method); + compiler_driver->NeedsClassInitialization(referrer_class.Get(), resolved_method); uint16_t other_flags = it->flags_ & ~(kFlagFastPath | kFlagNeedsClassInitialization | (kInvokeTypeMask << kBitSharpTypeBegin)); it->flags_ = other_flags | |