diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 20 | ||||
| -rw-r--r-- | compiler/image_writer.cc | 2 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator.cc | 2 | ||||
| -rw-r--r-- | compiler/optimizing/inliner.cc | 2 | ||||
| -rw-r--r-- | compiler/optimizing/instruction_builder.cc | 20 | ||||
| -rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 2 | ||||
| -rw-r--r-- | compiler/optimizing/sharpening.cc | 6 | ||||
| -rw-r--r-- | compiler/verifier_deps_test.cc | 2 |
8 files changed, 28 insertions, 28 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 7af850a263..f7bea32d4c 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -960,7 +960,7 @@ static void EnsureVerifiedOrVerifyAtRuntime(jobject jclass_loader, const DexFile::ClassDef& class_def = dex_file->GetClassDef(i); const char* descriptor = dex_file->GetClassDescriptor(class_def); cls.Assign(class_linker->FindClass(soa.Self(), descriptor, class_loader)); - if (cls.Get() == nullptr) { + if (cls == nullptr) { soa.Self()->ClearException(); } else if (&cls->GetDexFile() == dex_file) { DCHECK(cls->IsErroneous() || cls->IsVerified() || cls->IsCompileTimeVerified()) @@ -1155,7 +1155,7 @@ void CompilerDriver::LoadImageClasses(TimingLogger* timings) { StackHandleScope<1> hs(self); Handle<mirror::Class> klass( hs.NewHandle(class_linker->FindSystemClass(self, descriptor.c_str()))); - if (klass.Get() == nullptr) { + if (klass == nullptr) { VLOG(compiler) << "Failed to find class " << descriptor; image_classes_->erase(it++); self->ClearException(); @@ -1182,13 +1182,13 @@ void CompilerDriver::LoadImageClasses(TimingLogger* timings) { Handle<mirror::DexCache> dex_cache(hs2.NewHandle(class_linker->RegisterDexFile(*dex_file, nullptr))); Handle<mirror::Class> klass(hs2.NewHandle( - (dex_cache.Get() != nullptr) + (dex_cache != nullptr) ? class_linker->ResolveType(*dex_file, exception_type_idx, dex_cache, ScopedNullHandle<mirror::ClassLoader>()) : nullptr)); - if (klass.Get() == nullptr) { + if (klass == nullptr) { const DexFile::TypeId& type_id = dex_file->GetTypeId(exception_type_idx); const char* descriptor = dex_file->GetTypeDescriptor(type_id); LOG(FATAL) << "Failed to resolve class " << descriptor; @@ -1877,7 +1877,7 @@ class ResolveTypeVisitor : public CompilationVisitor { Handle<mirror::DexCache> dex_cache(hs.NewHandle(class_linker->RegisterDexFile( dex_file, class_loader.Get()))); - ObjPtr<mirror::Class> klass = (dex_cache.Get() != nullptr) + ObjPtr<mirror::Class> klass = (dex_cache != nullptr) ? class_linker->ResolveType(dex_file, dex::TypeIndex(type_idx), dex_cache, class_loader) : nullptr; @@ -1978,7 +1978,7 @@ static void LoadAndUpdateStatus(const DexFile& dex_file, ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); Handle<mirror::Class> cls(hs.NewHandle<mirror::Class>( class_linker->FindClass(self, descriptor, class_loader))); - if (cls.Get() != nullptr) { + if (cls != nullptr) { // Check that the class is resolved with the current dex file. We might get // a boot image class, or a class in a different dex file for multidex, and // we should not update the status in that case. @@ -2126,7 +2126,7 @@ class VerifyClassVisitor : public CompilationVisitor { Handle<mirror::Class> klass( hs.NewHandle(class_linker->FindClass(soa.Self(), descriptor, class_loader))); verifier::MethodVerifier::FailureKind failure_kind; - if (klass.Get() == nullptr) { + if (klass == nullptr) { CHECK(soa.Self()->IsExceptionPending()); soa.Self()->ClearException(); @@ -2228,7 +2228,7 @@ class SetVerifiedClassVisitor : public CompilationVisitor { Handle<mirror::Class> klass( hs.NewHandle(class_linker->FindClass(soa.Self(), descriptor, class_loader))); // Class might have failed resolution. Then don't set it to verified. - if (klass.Get() != nullptr) { + if (klass != nullptr) { // Only do this if the class is resolved. If even resolution fails, quickening will go very, // very wrong. if (klass->IsResolved() && !klass->IsErroneousResolved()) { @@ -2290,7 +2290,7 @@ class InitializeClassVisitor : public CompilationVisitor { Handle<mirror::Class> klass( hs.NewHandle(manager_->GetClassLinker()->FindClass(soa.Self(), descriptor, class_loader))); - if (klass.Get() != nullptr && !SkipClass(jclass_loader, dex_file, klass.Get())) { + if (klass != nullptr && !SkipClass(jclass_loader, dex_file, klass.Get())) { // Only try to initialize classes that were successfully verified. if (klass->IsVerified()) { // Attempt to initialize the class but bail if we either need to initialize the super-class @@ -2540,7 +2540,7 @@ class CompileClassVisitor : public CompilationVisitor { Handle<mirror::Class> klass( hs.NewHandle(class_linker->FindClass(soa.Self(), descriptor, class_loader))); Handle<mirror::DexCache> dex_cache; - if (klass.Get() == nullptr) { + if (klass == nullptr) { soa.Self()->AssertPendingException(); soa.Self()->ClearException(); dex_cache = hs.NewHandle(class_linker->FindDexCache(soa.Self(), dex_file)); diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc index 70ff327e72..d2dd30d8e6 100644 --- a/compiler/image_writer.cc +++ b/compiler/image_writer.cc @@ -1078,7 +1078,7 @@ ObjectArray<Object>* ImageWriter::CreateImageRoots(size_t oat_index) const { } Handle<ObjectArray<Object>> dex_caches( hs.NewHandle(ObjectArray<Object>::Alloc(self, object_array_class.Get(), dex_cache_count))); - CHECK(dex_caches.Get() != nullptr) << "Failed to allocate a dex cache array."; + CHECK(dex_caches != nullptr) << "Failed to allocate a dex cache array."; { ReaderMutexLock mu(self, *Locks::dex_lock_); size_t non_image_dex_caches = 0; diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index d68aa51b1b..bac16cd5df 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -1419,7 +1419,7 @@ void CodeGenerator::EmitJitRoots(uint8_t* code, QuickEntrypointEnum CodeGenerator::GetArrayAllocationEntrypoint(Handle<mirror::Class> array_klass) { ScopedObjectAccess soa(Thread::Current()); - if (array_klass.Get() == nullptr) { + if (array_klass == nullptr) { // This can only happen for non-primitive arrays, as primitive arrays can always // be resolved. return kQuickAllocArrayResolved32; diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index f0afccb782..f1e8239f76 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -380,7 +380,7 @@ bool HInliner::TryInline(HInvoke* invoke_instruction) { soa.Self(), class_linker->GetClassRoot(ClassLinker::kClassArrayClass), InlineCache::kIndividualCacheSize)); - if (inline_cache.Get() == nullptr) { + if (inline_cache == nullptr) { // We got an OOME. Just clear the exception, and don't inline. DCHECK(soa.Self()->IsExceptionPending()); soa.Self()->ClearException(); diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index a1c391f455..3374e42955 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -680,7 +680,7 @@ ArtMethod* HInstructionBuilder::ResolveMethod(uint16_t method_idx, InvokeType in Handle<mirror::Class> methods_class(hs.NewHandle(class_linker->ResolveReferencedClassOfMethod( method_idx, dex_compilation_unit_->GetDexCache(), class_loader))); - if (UNLIKELY(methods_class.Get() == nullptr)) { + if (UNLIKELY(methods_class == nullptr)) { // Clean up any exception left by type resolution. soa.Self()->ClearException(); return nullptr; @@ -702,7 +702,7 @@ ArtMethod* HInstructionBuilder::ResolveMethod(uint16_t method_idx, InvokeType in // Check access. The class linker has a fast path for looking into the dex cache // and does not check the access if it hits it. - if (compiling_class.Get() == nullptr) { + if (compiling_class == nullptr) { if (!resolved_method->IsPublic()) { return nullptr; } @@ -718,7 +718,7 @@ ArtMethod* HInstructionBuilder::ResolveMethod(uint16_t method_idx, InvokeType in // make this an invoke-unresolved to handle cross-dex invokes or abstract super methods, both of // which require runtime handling. if (invoke_type == kSuper) { - if (compiling_class.Get() == nullptr) { + if (compiling_class == nullptr) { // We could not determine the method's class we need to wait until runtime. DCHECK(Runtime::Current()->IsAotCompiler()); return nullptr; @@ -954,7 +954,7 @@ bool HInstructionBuilder::BuildNewInstance(dex::TypeIndex type_index, uint32_t d } // Consider classes we haven't resolved as potentially finalizable. - bool finalizable = (klass.Get() == nullptr) || klass->IsFinalizable(); + bool finalizable = (klass == nullptr) || klass->IsFinalizable(); AppendInstruction(new (arena_) HNewInstance( cls, @@ -972,7 +972,7 @@ static bool IsSubClass(mirror::Class* to_test, mirror::Class* super_class) } bool HInstructionBuilder::IsInitialized(Handle<mirror::Class> cls) const { - if (cls.Get() == nullptr) { + if (cls == nullptr) { return false; } @@ -1292,7 +1292,7 @@ bool HInstructionBuilder::IsOutermostCompilingClass(dex::TypeIndex type_index) c // When this happens we cannot establish a direct relation between the current // class and the outer class, so we return false. // (Note that this is only used for optimizing invokes and field accesses) - return (cls.Get() != nullptr) && (outer_class.Get() == cls.Get()); + return (cls != nullptr) && (outer_class.Get() == cls.Get()); } void HInstructionBuilder::BuildUnresolvedStaticFieldAccess(const Instruction& instruction, @@ -1340,7 +1340,7 @@ ArtField* HInstructionBuilder::ResolveField(uint16_t field_idx, bool is_static, } // Check access. - if (compiling_class.Get() == nullptr) { + if (compiling_class == nullptr) { if (!resolved_field->IsPublic()) { return nullptr; } @@ -1612,7 +1612,7 @@ void HInstructionBuilder::BuildFillWideArrayData(HInstruction* object, static TypeCheckKind ComputeTypeCheckKind(Handle<mirror::Class> cls) REQUIRES_SHARED(Locks::mutator_lock_) { - if (cls.Get() == nullptr) { + if (cls == nullptr) { return TypeCheckKind::kUnresolvedCheck; } else if (cls->IsInterface()) { return TypeCheckKind::kInterfaceCheck; @@ -1643,7 +1643,7 @@ HLoadClass* HInstructionBuilder::BuildLoadClass(dex::TypeIndex type_index, uint3 soa, dex_compilation_unit_->GetDexCache(), class_loader, type_index, dex_compilation_unit_)); bool needs_access_check = true; - if (klass.Get() != nullptr) { + if (klass != nullptr) { if (klass->IsPublic()) { needs_access_check = false; } else { @@ -1679,7 +1679,7 @@ HLoadClass* HInstructionBuilder::BuildLoadClass(dex::TypeIndex type_index, type_index, *actual_dex_file, klass, - klass.Get() != nullptr && (klass.Get() == GetOutermostCompilingClass()), + klass != nullptr && (klass.Get() == GetOutermostCompilingClass()), dex_pc, needs_access_check); diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 727ca7d893..8638e346fb 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1214,7 +1214,7 @@ bool OptimizingCompiler::JitCompile(Thread* self, Handle<mirror::ObjectArray<mirror::Object>> roots( hs.NewHandle(mirror::ObjectArray<mirror::Object>::Alloc( self, class_linker->GetClassRoot(ClassLinker::kObjectArrayClass), number_of_roots))); - if (roots.Get() == nullptr) { + if (roots == nullptr) { // Out of memory, just clear the exception to avoid any Java exception uncaught problems. DCHECK(self->IsExceptionPending()); self->ClearException(); diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc index f07f02a719..be400925d5 100644 --- a/compiler/optimizing/sharpening.cc +++ b/compiler/optimizing/sharpening.cc @@ -163,7 +163,7 @@ HLoadClass::LoadKind HSharpening::SharpenClass(HLoadClass* load_class, if (!compiler_driver->GetSupportBootImageFixup()) { // compiler_driver_test. Do not sharpen. desired_load_kind = HLoadClass::LoadKind::kDexCacheViaMethod; - } else if ((klass.Get() != nullptr) && compiler_driver->IsImageClass( + } else if ((klass != nullptr) && compiler_driver->IsImageClass( dex_file.StringDataByIdx(dex_file.GetTypeId(type_index).descriptor_idx_))) { is_in_boot_image = true; desired_load_kind = codegen->GetCompilerOptions().GetCompilePic() @@ -175,7 +175,7 @@ HLoadClass::LoadKind HSharpening::SharpenClass(HLoadClass* load_class, desired_load_kind = HLoadClass::LoadKind::kBssEntry; } } else { - is_in_boot_image = (klass.Get() != nullptr) && + is_in_boot_image = (klass != nullptr) && runtime->GetHeap()->ObjectIsInBootImageSpace(klass.Get()); if (runtime->UseJitCompilation()) { // TODO: Make sure we don't set the "compile PIC" flag for JIT as that's bogus. @@ -183,7 +183,7 @@ HLoadClass::LoadKind HSharpening::SharpenClass(HLoadClass* load_class, if (is_in_boot_image) { // TODO: Use direct pointers for all non-moving spaces, not just boot image. Bug: 29530787 desired_load_kind = HLoadClass::LoadKind::kBootImageAddress; - } else if (klass.Get() != nullptr) { + } else if (klass != nullptr) { desired_load_kind = HLoadClass::LoadKind::kJitTableAddress; } else { // Class not loaded yet. This happens when the dex code requesting diff --git a/compiler/verifier_deps_test.cc b/compiler/verifier_deps_test.cc index 5fc9972d09..c892b25ed3 100644 --- a/compiler/verifier_deps_test.cc +++ b/compiler/verifier_deps_test.cc @@ -233,7 +233,7 @@ class VerifierDepsTest : public CommonCompilerTest { const DexFile::ClassDef& class_def = dex_file->GetClassDef(i); const char* descriptor = dex_file->GetClassDescriptor(class_def); cls.Assign(class_linker_->FindClass(soa.Self(), descriptor, class_loader_handle)); - if (cls.Get() == nullptr) { + if (cls == nullptr) { CHECK(soa.Self()->IsExceptionPending()); soa.Self()->ClearException(); } else if (set.find(class_def.class_idx_) == set.end()) { |