diff options
author | 2019-03-27 16:41:41 +0000 | |
---|---|---|
committer | 2019-03-28 09:22:07 +0000 | |
commit | 0984e483c1b8033250a32b11f112ae3e65eef39b (patch) | |
tree | 267b4f59818e5080dff726adf25e5b5710111377 | |
parent | 621c8807f38fedab56ea701370a18df123177f67 (diff) |
Style cleanup for ObjPtr<>-ify changes.
Replace "ObjPtr<.> const" with "const ObjPtr<.>".
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 31113334
Change-Id: I5a1c080bc88b091e15ee9eb0bb1ef6f6f290701c
-rw-r--r-- | dex2oat/linker/image_writer.cc | 2 | ||||
-rw-r--r-- | runtime/class_linker.cc | 10 | ||||
-rw-r--r-- | runtime/class_loader_context.cc | 4 | ||||
-rw-r--r-- | runtime/class_table-inl.h | 4 | ||||
-rw-r--r-- | runtime/gc/collector/concurrent_copying.cc | 2 | ||||
-rw-r--r-- | runtime/gc/reference_processor.cc | 2 | ||||
-rw-r--r-- | runtime/gc/reference_queue.cc | 2 | ||||
-rw-r--r-- | runtime/interpreter/unstarted_runtime.cc | 4 | ||||
-rw-r--r-- | runtime/jni/java_vm_ext.cc | 2 | ||||
-rw-r--r-- | runtime/mirror/class-inl.h | 4 | ||||
-rw-r--r-- | runtime/mirror/field.cc | 2 | ||||
-rw-r--r-- | runtime/mirror/iftable-inl.h | 4 | ||||
-rw-r--r-- | runtime/mirror/method_handles_lookup.cc | 3 | ||||
-rw-r--r-- | runtime/mirror/method_type.cc | 16 | ||||
-rw-r--r-- | runtime/mirror/object-inl.h | 4 | ||||
-rw-r--r-- | runtime/mirror/object.cc | 2 | ||||
-rw-r--r-- | runtime/mirror/throwable.cc | 4 | ||||
-rw-r--r-- | runtime/native/dalvik_system_VMRuntime.cc | 2 | ||||
-rw-r--r-- | runtime/native/java_lang_ref_FinalizerReference.cc | 6 | ||||
-rw-r--r-- | runtime/native/java_lang_ref_Reference.cc | 6 | ||||
-rw-r--r-- | runtime/thread.cc | 4 | ||||
-rw-r--r-- | runtime/verifier/reg_type_cache.cc | 2 |
22 files changed, 46 insertions, 45 deletions
diff --git a/dex2oat/linker/image_writer.cc b/dex2oat/linker/image_writer.cc index d154569d0f..e8786783db 100644 --- a/dex2oat/linker/image_writer.cc +++ b/dex2oat/linker/image_writer.cc @@ -1831,7 +1831,7 @@ void ImageWriter::DumpImageClasses() { mirror::String* ImageWriter::FindInternedString(mirror::String* string) { Thread* const self = Thread::Current(); for (const ImageInfo& image_info : image_infos_) { - ObjPtr<mirror::String> const found = image_info.intern_table_->LookupStrong(self, string); + const ObjPtr<mirror::String> found = image_info.intern_table_->LookupStrong(self, string); DCHECK(image_info.intern_table_->LookupWeak(self, string) == nullptr) << string->ToModifiedUtf8(); if (found != nullptr) { diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 97234afc50..dde4f366de 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2353,7 +2353,7 @@ class VisitClassLoaderClassesVisitor : public ClassLoaderVisitor { return (*visitor_)(klass); } - ObjPtr<mirror::ClassLoader> const defining_class_loader_; + const ObjPtr<mirror::ClassLoader> defining_class_loader_; ClassVisitor* const visitor_; }; @@ -4241,7 +4241,7 @@ ObjPtr<mirror::Class> ClassLinker::InsertClass(const char* descriptor, } { WriterMutexLock mu(Thread::Current(), *Locks::classlinker_classes_lock_); - ObjPtr<mirror::ClassLoader> const class_loader = klass->GetClassLoader(); + const ObjPtr<mirror::ClassLoader> class_loader = klass->GetClassLoader(); ClassTable* const class_table = InsertClassTableForClassLoader(class_loader); ObjPtr<mirror::Class> existing = class_table->Lookup(descriptor, hash); if (existing != nullptr) { @@ -5851,10 +5851,10 @@ bool ClassLinker::LinkClass(Thread* self, { WriterMutexLock mu(self, *Locks::classlinker_classes_lock_); - ObjPtr<mirror::ClassLoader> const class_loader = h_new_class.Get()->GetClassLoader(); + const ObjPtr<mirror::ClassLoader> class_loader = h_new_class.Get()->GetClassLoader(); ClassTable* const table = InsertClassTableForClassLoader(class_loader); - ObjPtr<mirror::Class> existing = table->UpdateClass(descriptor, h_new_class.Get(), - ComputeModifiedUtf8Hash(descriptor)); + const ObjPtr<mirror::Class> existing = + table->UpdateClass(descriptor, h_new_class.Get(), ComputeModifiedUtf8Hash(descriptor)); if (class_loader != nullptr) { // We updated the class in the class table, perform the write barrier so that the GC knows // about the change. diff --git a/runtime/class_loader_context.cc b/runtime/class_loader_context.cc index e811afdb58..e890c1f66b 100644 --- a/runtime/class_loader_context.cc +++ b/runtime/class_loader_context.cc @@ -956,9 +956,9 @@ static bool GetDexFilesFromDexElementsArray( jni::DecodeArtField(WellKnownClasses::dalvik_system_DexFile_cookie); ArtField* const dex_file_field = jni::DecodeArtField(WellKnownClasses::dalvik_system_DexPathList__Element_dexFile); - ObjPtr<mirror::Class> const element_class = soa.Decode<mirror::Class>( + const ObjPtr<mirror::Class> element_class = soa.Decode<mirror::Class>( WellKnownClasses::dalvik_system_DexPathList__Element); - ObjPtr<mirror::Class> const dexfile_class = soa.Decode<mirror::Class>( + const ObjPtr<mirror::Class> dexfile_class = soa.Decode<mirror::Class>( WellKnownClasses::dalvik_system_DexFile); for (int32_t i = 0; i < dex_elements->GetLength(); ++i) { diff --git a/runtime/class_table-inl.h b/runtime/class_table-inl.h index a2cdb2c28c..5f8a0b03c8 100644 --- a/runtime/class_table-inl.h +++ b/runtime/class_table-inl.h @@ -91,8 +91,8 @@ bool ClassTable::Visit(const Visitor& visitor) { template<ReadBarrierOption kReadBarrierOption> inline mirror::Class* ClassTable::TableSlot::Read() const { const uint32_t before = data_.load(std::memory_order_relaxed); - ObjPtr<mirror::Class> const before_ptr(ExtractPtr(before)); - ObjPtr<mirror::Class> const after_ptr( + const ObjPtr<mirror::Class> before_ptr(ExtractPtr(before)); + const ObjPtr<mirror::Class> after_ptr( GcRoot<mirror::Class>(before_ptr).Read<kReadBarrierOption>()); if (kReadBarrierOption != kWithoutReadBarrier && before_ptr != after_ptr) { // If another thread raced and updated the reference, do not store the read barrier updated diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc index 5483364600..9b67030d7e 100644 --- a/runtime/gc/collector/concurrent_copying.cc +++ b/runtime/gc/collector/concurrent_copying.cc @@ -705,7 +705,7 @@ class ConcurrentCopying::VerifyNoMissingCardMarkVisitor { private: ConcurrentCopying* const cc_; - ObjPtr<mirror::Object> const holder_; + const ObjPtr<mirror::Object> holder_; }; void ConcurrentCopying::VerifyNoMissingCardMarks() { diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc index 49446399fd..b0fc7a6ae4 100644 --- a/runtime/gc/reference_processor.cc +++ b/runtime/gc/reference_processor.cc @@ -91,7 +91,7 @@ ObjPtr<mirror::Object> ReferenceProcessor::GetReferent(Thread* self, // Under read barrier / concurrent copying collector, it's not safe to call GetReferent() when // weak ref access is disabled as the call includes a read barrier which may push a ref onto the // mark stack and interfere with termination of marking. - ObjPtr<mirror::Object> const referent = reference->GetReferent(); + const ObjPtr<mirror::Object> referent = reference->GetReferent(); // If the referent is null then it is already cleared, we can just return null since there is no // scenario where it becomes non-null during the reference processing phase. if (UNLIKELY(!SlowPathEnabled()) || referent == nullptr) { diff --git a/runtime/gc/reference_queue.cc b/runtime/gc/reference_queue.cc index 95871dae85..1c751e1fbd 100644 --- a/runtime/gc/reference_queue.cc +++ b/runtime/gc/reference_queue.cc @@ -181,7 +181,7 @@ void ReferenceQueue::ForwardSoftReferences(MarkObjectVisitor* visitor) { if (UNLIKELY(IsEmpty())) { return; } - ObjPtr<mirror::Reference> const head = list_; + const ObjPtr<mirror::Reference> head = list_; ObjPtr<mirror::Reference> ref = head; do { mirror::HeapReference<mirror::Object>* referent_addr = ref->GetReferentReferenceAddr(); diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc index 46108cfb63..8b8567e94a 100644 --- a/runtime/interpreter/unstarted_runtime.cc +++ b/runtime/interpreter/unstarted_runtime.cc @@ -1403,13 +1403,13 @@ void UnstartedRuntime::UnstartedStringToCharArray( // This allows statically initializing ConcurrentHashMap and SynchronousQueue. void UnstartedRuntime::UnstartedReferenceGetReferent( Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) { - ObjPtr<mirror::Reference> const ref = down_cast<mirror::Reference*>( + const ObjPtr<mirror::Reference> ref = down_cast<mirror::Reference*>( shadow_frame->GetVRegReference(arg_offset)); if (ref == nullptr) { AbortTransactionOrFail(self, "Reference.getReferent() with null object"); return; } - ObjPtr<mirror::Object> const referent = + const ObjPtr<mirror::Object> referent = Runtime::Current()->GetHeap()->GetReferenceProcessor()->GetReferent(self, ref); result->SetL(referent); } diff --git a/runtime/jni/java_vm_ext.cc b/runtime/jni/java_vm_ext.cc index bbd6d6898a..370a456826 100644 --- a/runtime/jni/java_vm_ext.cc +++ b/runtime/jni/java_vm_ext.cc @@ -272,7 +272,7 @@ class Libraries { REQUIRES_SHARED(Locks::mutator_lock_) { std::string jni_short_name(m->JniShortName()); std::string jni_long_name(m->JniLongName()); - ObjPtr<mirror::ClassLoader> const declaring_class_loader = + const ObjPtr<mirror::ClassLoader> declaring_class_loader = m->GetDeclaringClass()->GetClassLoader(); ScopedObjectAccessUnchecked soa(Thread::Current()); void* const declaring_class_loader_allocator = diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h index fe67a5b241..cf0fd9ae2a 100644 --- a/runtime/mirror/class-inl.h +++ b/runtime/mirror/class-inl.h @@ -1044,7 +1044,7 @@ template<VerifyObjectFlags kVerifyFlags> inline bool Class::IsObjectArrayClass() { // We do not need a read barrier here as the primitive type is constant, // both from-space and to-space component type classes shall yield the same result. - ObjPtr<Class> const component_type = GetComponentType<kVerifyFlags, kWithoutReadBarrier>(); + const ObjPtr<Class> component_type = GetComponentType<kVerifyFlags, kWithoutReadBarrier>(); constexpr VerifyObjectFlags kNewFlags = RemoveThisFlags(kVerifyFlags); return component_type != nullptr && !component_type->IsPrimitive<kNewFlags>(); } @@ -1053,7 +1053,7 @@ template<VerifyObjectFlags kVerifyFlags> bool Class::IsPrimitiveArray() { // We do not need a read barrier here as the primitive type is constant, // both from-space and to-space component type classes shall yield the same result. - ObjPtr<Class> const component_type = GetComponentType<kVerifyFlags, kWithoutReadBarrier>(); + const ObjPtr<Class> component_type = GetComponentType<kVerifyFlags, kWithoutReadBarrier>(); constexpr VerifyObjectFlags kNewFlags = RemoveThisFlags(kVerifyFlags); return component_type != nullptr && component_type->IsPrimitive<kNewFlags>(); } diff --git a/runtime/mirror/field.cc b/runtime/mirror/field.cc index e885d41b86..f4d1e730a3 100644 --- a/runtime/mirror/field.cc +++ b/runtime/mirror/field.cc @@ -37,7 +37,7 @@ ArtField* Field::GetArtField() { return &declaring_class->GetSFieldsPtr()->At(1); } } - ObjPtr<mirror::DexCache> const dex_cache = declaring_class->GetDexCache(); + const ObjPtr<mirror::DexCache> dex_cache = declaring_class->GetDexCache(); ArtField* art_field = dex_cache->GetResolvedField(GetDexFieldIndex(), kRuntimePointerSize); if (UNLIKELY(art_field == nullptr)) { if (IsStatic()) { diff --git a/runtime/mirror/iftable-inl.h b/runtime/mirror/iftable-inl.h index b9bd21c778..c96082f560 100644 --- a/runtime/mirror/iftable-inl.h +++ b/runtime/mirror/iftable-inl.h @@ -27,7 +27,7 @@ namespace mirror { template<VerifyObjectFlags kVerifyFlags, ReadBarrierOption kReadBarrierOption> inline ObjPtr<Class> IfTable::GetInterface(int32_t i) { - Class* interface = + ObjPtr<Class> interface = GetWithoutChecks<kVerifyFlags, kReadBarrierOption>((i * kMax) + kInterface)->AsClass(); DCHECK(interface != nullptr); return interface; @@ -37,7 +37,7 @@ inline void IfTable::SetInterface(int32_t i, ObjPtr<Class> interface) { DCHECK(interface != nullptr); DCHECK(interface->IsInterface()); const size_t idx = i * kMax + kInterface; - DCHECK_EQ(Get(idx), static_cast<Object*>(nullptr)); + DCHECK(Get(idx) == nullptr); SetWithoutChecks<false>(idx, interface); } diff --git a/runtime/mirror/method_handles_lookup.cc b/runtime/mirror/method_handles_lookup.cc index a32fe333a7..c26948d934 100644 --- a/runtime/mirror/method_handles_lookup.cc +++ b/runtime/mirror/method_handles_lookup.cc @@ -29,7 +29,8 @@ namespace art { namespace mirror { -ObjPtr<MethodHandlesLookup> MethodHandlesLookup::Create(Thread* const self, Handle<Class> lookup_class) +ObjPtr<MethodHandlesLookup> MethodHandlesLookup::Create(Thread* const self, + Handle<Class> lookup_class) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_) { static constexpr uint32_t kAllModes = kAccPublic | kAccPrivate | kAccProtected | kAccStatic; diff --git a/runtime/mirror/method_type.cc b/runtime/mirror/method_type.cc index 005bb710eb..1d88d85e59 100644 --- a/runtime/mirror/method_type.cc +++ b/runtime/mirror/method_type.cc @@ -95,8 +95,8 @@ ObjPtr<MethodType> MethodType::CollectTrailingArguments(Thread* self, return Create(self, dst_rtype, dst_ptypes); } -size_t MethodType::NumberOfVRegs() REQUIRES_SHARED(Locks::mutator_lock_) { - ObjPtr<ObjectArray<Class>> const p_types = GetPTypes(); +size_t MethodType::NumberOfVRegs() { + const ObjPtr<ObjectArray<Class>> p_types = GetPTypes(); const int32_t p_types_length = p_types->GetLength(); // Initialize |num_vregs| with number of parameters and only increment it for @@ -112,10 +112,10 @@ size_t MethodType::NumberOfVRegs() REQUIRES_SHARED(Locks::mutator_lock_) { } bool MethodType::IsExactMatch(ObjPtr<MethodType> target) { - ObjPtr<ObjectArray<Class>> const p_types = GetPTypes(); + const ObjPtr<ObjectArray<Class>> p_types = GetPTypes(); const int32_t params_length = p_types->GetLength(); - ObjPtr<ObjectArray<Class>> const target_p_types = target->GetPTypes(); + const ObjPtr<ObjectArray<Class>> target_p_types = target->GetPTypes(); if (params_length != target_p_types->GetLength()) { return false; } @@ -128,10 +128,10 @@ bool MethodType::IsExactMatch(ObjPtr<MethodType> target) { } bool MethodType::IsConvertible(ObjPtr<MethodType> target) { - ObjPtr<ObjectArray<Class>> const p_types = GetPTypes(); + const ObjPtr<ObjectArray<Class>> p_types = GetPTypes(); const int32_t params_length = p_types->GetLength(); - ObjPtr<ObjectArray<Class>> const target_p_types = target->GetPTypes(); + const ObjPtr<ObjectArray<Class>> target_p_types = target->GetPTypes(); if (params_length != target_p_types->GetLength()) { return false; } @@ -152,11 +152,11 @@ bool MethodType::IsConvertible(ObjPtr<MethodType> target) { return true; } -std::string MethodType::PrettyDescriptor() REQUIRES_SHARED(Locks::mutator_lock_) { +std::string MethodType::PrettyDescriptor() { std::ostringstream ss; ss << "("; - ObjPtr<ObjectArray<Class>> const p_types = GetPTypes(); + const ObjPtr<ObjectArray<Class>> p_types = GetPTypes(); const int32_t params_length = p_types->GetLength(); for (int32_t i = 0; i < params_length; ++i) { ss << p_types->GetWithoutChecks(i)->PrettyDescriptor(); diff --git a/runtime/mirror/object-inl.h b/runtime/mirror/object-inl.h index 814d86a3e9..3fa5d8074d 100644 --- a/runtime/mirror/object-inl.h +++ b/runtime/mirror/object-inl.h @@ -197,9 +197,9 @@ template<VerifyObjectFlags kVerifyFlags, Primitive::Type kType> ALWAYS_INLINE bool Object::IsSpecificPrimitiveArray() { // We do not need a read barrier here as the primitive type is constant, both from-space // and to-space component type classes shall yield the same result. See ReadBarrierOption. - ObjPtr<Class> klass = GetClass<kVerifyFlags, kWithoutReadBarrier>(); + const ObjPtr<Class> klass = GetClass<kVerifyFlags, kWithoutReadBarrier>(); constexpr VerifyObjectFlags kNewFlags = RemoveThisFlags(kVerifyFlags); - ObjPtr<Class> const component_type = klass->GetComponentType<kNewFlags, kWithoutReadBarrier>(); + const ObjPtr<Class> component_type = klass->GetComponentType<kNewFlags, kWithoutReadBarrier>(); return component_type != nullptr && component_type->GetPrimitiveType<kNewFlags>() == kType; } diff --git a/runtime/mirror/object.cc b/runtime/mirror/object.cc index f6adc800e4..b8d1d3fd38 100644 --- a/runtime/mirror/object.cc +++ b/runtime/mirror/object.cc @@ -71,7 +71,7 @@ class CopyReferenceFieldsWithReadBarrierVisitor { void VisitRoot(mirror::CompressedReference<mirror::Object>* root ATTRIBUTE_UNUSED) const {} private: - ObjPtr<Object> const dest_obj_; + const ObjPtr<Object> dest_obj_; }; Object* Object::CopyObject(ObjPtr<mirror::Object> dest, diff --git a/runtime/mirror/throwable.cc b/runtime/mirror/throwable.cc index 28ae76c677..c6afca0163 100644 --- a/runtime/mirror/throwable.cc +++ b/runtime/mirror/throwable.cc @@ -80,11 +80,11 @@ bool Throwable::IsError() { } int32_t Throwable::GetStackDepth() { - ObjPtr<Object> stack_state = GetStackState(); + const ObjPtr<Object> stack_state = GetStackState(); if (stack_state == nullptr || !stack_state->IsObjectArray()) { return -1; } - ObjPtr<mirror::ObjectArray<Object>> const trace = stack_state->AsObjectArray<Object>(); + const ObjPtr<mirror::ObjectArray<Object>> trace = stack_state->AsObjectArray<Object>(); const int32_t array_len = trace->GetLength(); DCHECK_GT(array_len, 0); // See method BuildInternalStackTraceVisitor::Init for the format. diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc index b77519bd58..7fb3c40f88 100644 --- a/runtime/native/dalvik_system_VMRuntime.cc +++ b/runtime/native/dalvik_system_VMRuntime.cc @@ -519,7 +519,7 @@ static void PreloadDexCachesStatsFilled(DexCacheStats* filled) if (!class_linker->IsDexFileRegistered(self, *dex_file)) { continue; } - ObjPtr<mirror::DexCache> const dex_cache = class_linker->FindDexCache(self, *dex_file); + const ObjPtr<mirror::DexCache> dex_cache = class_linker->FindDexCache(self, *dex_file); DCHECK(dex_cache != nullptr); // Boot class path dex caches are never unloaded. for (size_t j = 0, num_strings = dex_cache->NumStrings(); j < num_strings; ++j) { auto pair = dex_cache->GetStrings()[j].load(std::memory_order_relaxed); diff --git a/runtime/native/java_lang_ref_FinalizerReference.cc b/runtime/native/java_lang_ref_FinalizerReference.cc index c89188c99c..535b243411 100644 --- a/runtime/native/java_lang_ref_FinalizerReference.cc +++ b/runtime/native/java_lang_ref_FinalizerReference.cc @@ -30,14 +30,14 @@ namespace art { static jboolean FinalizerReference_makeCircularListIfUnenqueued(JNIEnv* env, jobject javaThis) { ScopedFastNativeObjectAccess soa(env); - ObjPtr<mirror::FinalizerReference> ref = soa.Decode<mirror::FinalizerReference>(javaThis); + const ObjPtr<mirror::FinalizerReference> ref = soa.Decode<mirror::FinalizerReference>(javaThis); return Runtime::Current()->GetHeap()->GetReferenceProcessor()->MakeCircularListIfUnenqueued(ref); } static jobject FinalizerReference_getReferent(JNIEnv* env, jobject javaThis) { ScopedFastNativeObjectAccess soa(env); - ObjPtr<mirror::Reference> ref = soa.Decode<mirror::Reference>(javaThis); - ObjPtr<mirror::Object> const referent = + const ObjPtr<mirror::Reference> ref = soa.Decode<mirror::Reference>(javaThis); + const ObjPtr<mirror::Object> referent = Runtime::Current()->GetHeap()->GetReferenceProcessor()->GetReferent(soa.Self(), ref); return soa.AddLocalReference<jobject>(referent); } diff --git a/runtime/native/java_lang_ref_Reference.cc b/runtime/native/java_lang_ref_Reference.cc index fc018d15c4..b241b1de25 100644 --- a/runtime/native/java_lang_ref_Reference.cc +++ b/runtime/native/java_lang_ref_Reference.cc @@ -30,15 +30,15 @@ namespace art { static jobject Reference_getReferent(JNIEnv* env, jobject javaThis) { ScopedFastNativeObjectAccess soa(env); - ObjPtr<mirror::Reference> ref = soa.Decode<mirror::Reference>(javaThis); - ObjPtr<mirror::Object> const referent = + const ObjPtr<mirror::Reference> ref = soa.Decode<mirror::Reference>(javaThis); + const ObjPtr<mirror::Object> referent = Runtime::Current()->GetHeap()->GetReferenceProcessor()->GetReferent(soa.Self(), ref); return soa.AddLocalReference<jobject>(referent); } static void Reference_clearReferent(JNIEnv* env, jobject javaThis) { ScopedFastNativeObjectAccess soa(env); - ObjPtr<mirror::Reference> ref = soa.Decode<mirror::Reference>(javaThis); + const ObjPtr<mirror::Reference> ref = soa.Decode<mirror::Reference>(javaThis); Runtime::Current()->GetHeap()->GetReferenceProcessor()->ClearReferent(ref); } diff --git a/runtime/thread.cc b/runtime/thread.cc index 9080418187..77849a4c24 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -2938,13 +2938,13 @@ jobjectArray Thread::InternalStackTraceToStackTraceElementArray( soa.Decode<mirror::Object>(internal)->AsObjectArray<mirror::Object>(); // Methods and dex PC trace is element 0. DCHECK(decoded_traces->Get(0)->IsIntArray() || decoded_traces->Get(0)->IsLongArray()); - ObjPtr<mirror::PointerArray> const method_trace = + const ObjPtr<mirror::PointerArray> method_trace = ObjPtr<mirror::PointerArray>::DownCast(MakeObjPtr(decoded_traces->Get(0))); // Prepare parameters for StackTraceElement(String cls, String method, String file, int line) ArtMethod* method = method_trace->GetElementPtrSize<ArtMethod*>(i, kRuntimePointerSize); uint32_t dex_pc = method_trace->GetElementPtrSize<uint32_t>( i + method_trace->GetLength() / 2, kRuntimePointerSize); - ObjPtr<mirror::StackTraceElement> obj = CreateStackTraceElement(soa, method, dex_pc); + const ObjPtr<mirror::StackTraceElement> obj = CreateStackTraceElement(soa, method, dex_pc); if (obj == nullptr) { return nullptr; } diff --git a/runtime/verifier/reg_type_cache.cc b/runtime/verifier/reg_type_cache.cc index 7bff2551b8..1553017a8e 100644 --- a/runtime/verifier/reg_type_cache.cc +++ b/runtime/verifier/reg_type_cache.cc @@ -243,7 +243,7 @@ const RegType* RegTypeCache::FindClass(ObjPtr<mirror::Class> klass, bool precise return &RegTypeFromPrimitiveType(klass->GetPrimitiveType()); } for (auto& pair : klass_entries_) { - ObjPtr<mirror::Class> const reg_klass = pair.first.Read(); + const ObjPtr<mirror::Class> reg_klass = pair.first.Read(); if (reg_klass == klass) { const RegType* reg_type = pair.second; if (MatchingPrecisionForClass(reg_type, precise)) { |