diff options
| author | 2015-02-24 08:11:23 +0000 | |
|---|---|---|
| committer | 2015-02-24 08:11:24 +0000 | |
| commit | f548c54c69443ba94fcee89daca6f5f499d71e9a (patch) | |
| tree | aff0f707cb27e303d3b9de53f961bf48e38ad5be /compiler/driver/compiler_driver-inl.h | |
| parent | 9e87baff2eee8e8ae0700c7391ca4447dbe142b0 (diff) | |
| parent | a5ca888d715cd0c6c421313211caa1928be3e399 (diff) | |
Merge "Revert "Add JIT""
Diffstat (limited to 'compiler/driver/compiler_driver-inl.h')
| -rw-r--r-- | compiler/driver/compiler_driver-inl.h | 43 | 
1 files changed, 15 insertions, 28 deletions
| diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h index 4a35e9fbe7..9948c82663 100644 --- a/compiler/driver/compiler_driver-inl.h +++ b/compiler/driver/compiler_driver-inl.h @@ -56,13 +56,14 @@ inline mirror::Class* CompilerDriver::ResolveCompilingMethodsClass(    return referrer_class;  } -inline mirror::ArtField* CompilerDriver::ResolveFieldWithDexFile( +inline mirror::ArtField* CompilerDriver::ResolveField(      const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache, -    Handle<mirror::ClassLoader> class_loader, const DexFile* dex_file, +    Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit,      uint32_t field_idx, bool is_static) { -  DCHECK_EQ(dex_cache->GetDexFile(), dex_file); -  mirror::ArtField* resolved_field = Runtime::Current()->GetClassLinker()->ResolveField( -      *dex_file, field_idx, dex_cache, class_loader, is_static); +  DCHECK_EQ(dex_cache->GetDexFile(), mUnit->GetDexFile()); +  DCHECK_EQ(class_loader.Get(), soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader())); +  mirror::ArtField* resolved_field = mUnit->GetClassLinker()->ResolveField( +      *mUnit->GetDexFile(), field_idx, dex_cache, class_loader, is_static);    DCHECK_EQ(resolved_field == nullptr, soa.Self()->IsExceptionPending());    if (UNLIKELY(resolved_field == nullptr)) {      // Clean up any exception left by type resolution. @@ -77,19 +78,6 @@ inline mirror::ArtField* CompilerDriver::ResolveFieldWithDexFile(    return resolved_field;  } -inline mirror::DexCache* CompilerDriver::FindDexCache(const DexFile* dex_file) { -  return Runtime::Current()->GetClassLinker()->FindDexCache(*dex_file); -} - -inline mirror::ArtField* CompilerDriver::ResolveField( -    const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache, -    Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit, -    uint32_t field_idx, bool is_static) { -  DCHECK_EQ(class_loader.Get(), soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader())); -  return ResolveFieldWithDexFile(soa, dex_cache, class_loader, mUnit->GetDexFile(), field_idx, -                                 is_static); -} -  inline void CompilerDriver::GetResolvedFieldDexFileLocation(      mirror::ArtField* resolved_field, const DexFile** declaring_dex_file,      uint16_t* declaring_class_idx, uint16_t* declaring_field_idx) { @@ -184,7 +172,7 @@ inline bool CompilerDriver::IsStaticFieldsClassInitialized(mirror::Class* referr  inline mirror::ArtMethod* CompilerDriver::ResolveMethod(      ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache,      Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit, -    uint32_t method_idx, InvokeType invoke_type, bool check_incompatible_class_change) { +    uint32_t method_idx, InvokeType invoke_type) {    DCHECK_EQ(dex_cache->GetDexFile(), mUnit->GetDexFile());    DCHECK_EQ(class_loader.Get(), soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader()));    mirror::ArtMethod* resolved_method = mUnit->GetClassLinker()->ResolveMethod( @@ -196,8 +184,7 @@ inline mirror::ArtMethod* CompilerDriver::ResolveMethod(      soa.Self()->ClearException();      return nullptr;    } -  if (check_incompatible_class_change && -      UNLIKELY(resolved_method->CheckIncompatibleClassChange(invoke_type))) { +  if (UNLIKELY(resolved_method->CheckIncompatibleClassChange(invoke_type))) {      // Silently return nullptr on incompatible class change.      return nullptr;    } @@ -240,14 +227,14 @@ inline int CompilerDriver::IsFastInvoke(                                                          target_method->dex_method_index))) {      return 0;    } +    // Sharpen a virtual call into a direct call when the target is known not to have been    // overridden (ie is final). -  const bool same_dex_file = target_method->dex_file == mUnit->GetDexFile(); -  bool can_sharpen_virtual_based_on_type = same_dex_file && +  bool can_sharpen_virtual_based_on_type =        (*invoke_type == kVirtual) && (resolved_method->IsFinal() || methods_class->IsFinal());    // For invoke-super, ensure the vtable index will be correct to dispatch in the vtable of    // the super class. -  bool can_sharpen_super_based_on_type = same_dex_file && (*invoke_type == kSuper) && +  bool can_sharpen_super_based_on_type = (*invoke_type == kSuper) &&        (referrer_class != methods_class) && referrer_class->IsSubClass(methods_class) &&        resolved_method->GetMethodIndex() < methods_class->GetVTableLength() &&        (methods_class->GetVTableEntry(resolved_method->GetMethodIndex()) == resolved_method) && @@ -256,10 +243,10 @@ inline int CompilerDriver::IsFastInvoke(    if (can_sharpen_virtual_based_on_type || can_sharpen_super_based_on_type) {      // Sharpen a virtual call into a direct call. The method_idx is into referrer's      // dex cache, check that this resolved method is where we expect it. -    CHECK_EQ(target_method->dex_file, mUnit->GetDexFile()); -    DCHECK_EQ(dex_cache.Get(), mUnit->GetClassLinker()->FindDexCache(*mUnit->GetDexFile())); -    CHECK_EQ(referrer_class->GetDexCache()->GetResolvedMethod(target_method->dex_method_index), -             resolved_method) << PrettyMethod(resolved_method); +    CHECK(target_method->dex_file == mUnit->GetDexFile()); +    DCHECK(dex_cache.Get() == mUnit->GetClassLinker()->FindDexCache(*mUnit->GetDexFile())); +    CHECK(referrer_class->GetDexCache()->GetResolvedMethod(target_method->dex_method_index) == +        resolved_method) << PrettyMethod(resolved_method);      int stats_flags = kFlagMethodResolved;      GetCodeAndMethodForDirectCall(/*out*/invoke_type,                                    kDirect,  // Sharp type |