diff options
author | 2020-07-28 15:53:04 +0100 | |
---|---|---|
committer | 2020-07-28 16:40:36 +0000 | |
commit | 6aaa49dd4a3467e8d05aee4a1de9753e896ee96b (patch) | |
tree | 593e79da914087e991ad0a6d0421962806485e04 | |
parent | 72e27b0b29fd1bdea6747f62c5bd865d26a0bdcd (diff) |
Inclusive language fixes
Based on:
https://source.android.com/setup/contribute/respectful-code
#inclusivefixit
Bug: 161336379
Bug: 161896447
Test: art/test.py --host --64
Change-Id: I02c96aa477c4be6af8384222f1f111cc7ae1eeac
-rw-r--r-- | runtime/base/timing_logger.cc | 4 | ||||
-rw-r--r-- | runtime/debugger.cc | 6 | ||||
-rw-r--r-- | runtime/entrypoints/quick/quick_trampoline_entrypoints.cc | 14 | ||||
-rw-r--r-- | runtime/mirror/var_handle.cc | 3 | ||||
-rw-r--r-- | runtime/stack.cc | 6 | ||||
-rw-r--r-- | runtime/stack.h | 2 |
6 files changed, 18 insertions, 17 deletions
diff --git a/runtime/base/timing_logger.cc b/runtime/base/timing_logger.cc index bd39192a44..c4034b0c02 100644 --- a/runtime/base/timing_logger.cc +++ b/runtime/base/timing_logger.cc @@ -96,8 +96,8 @@ void CumulativeLogger::AddPair(const std::string& label, uint64_t delta_time) { delta_time /= kAdjust; total_time_ += delta_time; Histogram<uint64_t>* histogram; - Histogram<uint64_t> dummy(label.c_str()); - auto it = histograms_.find(&dummy); + Histogram<uint64_t> candidate(label.c_str()); + auto it = histograms_.find(&candidate); if (it == histograms_.end()) { const size_t max_buckets = Runtime::Current()->GetHeap()->IsLowMemoryMode() ? kLowMemoryBucketCount : kDefaultBucketCount; diff --git a/runtime/debugger.cc b/runtime/debugger.cc index d2cb939566..2da3e418d3 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -951,12 +951,12 @@ jbyteArray Dbg::GetRecentAllocations() { { MutexLock mu(self, *Locks::alloc_tracker_lock_); gc::AllocRecordObjectMap* records = Runtime::Current()->GetHeap()->GetAllocationRecords(); - // In case this method is called when allocation tracker is disabled, + // In case this method is called when allocation tracker is not enabled, // we should still send some data back. - gc::AllocRecordObjectMap dummy; + gc::AllocRecordObjectMap fallback_record_map; if (records == nullptr) { CHECK(!Runtime::Current()->GetHeap()->IsAllocTrackingEnabled()); - records = &dummy; + records = &fallback_record_map; } // We don't need to wait on the condition variable records->new_record_condition_, because this // function only reads the class objects, which are already marked so it doesn't change their diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc index 92d28cf593..82f97d6df1 100644 --- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc @@ -617,19 +617,19 @@ static void HandleDeoptimization(JValue* result, // Ensure that the stack is still in order. if (kIsDebugBuild) { - class DummyStackVisitor : public StackVisitor { + class EntireStackVisitor : public StackVisitor { public: - explicit DummyStackVisitor(Thread* self_in) REQUIRES_SHARED(Locks::mutator_lock_) + explicit EntireStackVisitor(Thread* self_in) REQUIRES_SHARED(Locks::mutator_lock_) : StackVisitor(self_in, nullptr, StackVisitor::StackWalkKind::kIncludeInlinedFrames) {} bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) { - // Nothing to do here. In a debug build, SanityCheckFrame will do the work in the walking + // Nothing to do here. In a debug build, ValidateFrame will do the work in the walking // logic. Just always say we want to continue. return true; } }; - DummyStackVisitor dsv(self); - dsv.WalkStack(); + EntireStackVisitor esv(self); + esv.WalkStack(); } // Restore the exception that was pending before deoptimization then interpret the @@ -1311,9 +1311,9 @@ extern "C" const void* artQuickResolutionTrampoline( // Resolve method filling in dex cache. if (!called_method_known_on_entry) { StackHandleScope<1> hs(self); - mirror::Object* dummy = nullptr; + mirror::Object* fake_receiver = nullptr; HandleWrapper<mirror::Object> h_receiver( - hs.NewHandleWrapper(virtual_or_interface ? &receiver : &dummy)); + hs.NewHandleWrapper(virtual_or_interface ? &receiver : &fake_receiver)); DCHECK_EQ(caller->GetDexFile(), called_method.dex_file); called = linker->ResolveMethod<ClassLinker::ResolveMode::kCheckICCEAndIAE>( self, called_method.index, caller, invoke_type); diff --git a/runtime/mirror/var_handle.cc b/runtime/mirror/var_handle.cc index 3079c350d2..9a78758608 100644 --- a/runtime/mirror/var_handle.cc +++ b/runtime/mirror/var_handle.cc @@ -1668,7 +1668,8 @@ bool VarHandle::GetAccessModeByMethodName(const char* method_name, AccessMode* a if (method_name == nullptr) { return false; } - VarHandleAccessorToAccessModeEntry target = { method_name, /*dummy*/VarHandle::AccessMode::kGet }; + const auto kUnusedAccessMode = VarHandle::AccessMode::kGet; // arbitrary value. + VarHandleAccessorToAccessModeEntry target = { method_name, kUnusedAccessMode }; auto last = std::cend(kAccessorToAccessMode); auto it = std::lower_bound(std::cbegin(kAccessorToAccessMode), last, diff --git a/runtime/stack.cc b/runtime/stack.cc index 1fca012a7f..526386d0f1 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -713,7 +713,7 @@ static void AssertPcIsWithinQuickCode(ArtMethod* method, uintptr_t pc) << " code_size=" << code_size; } -void StackVisitor::SanityCheckFrame() const { +void StackVisitor::ValidateFrame() const { if (kIsDebugBuild) { ArtMethod* method = GetMethod(); ObjPtr<mirror::Class> declaring_class = method->GetDeclaringClass(); @@ -886,7 +886,7 @@ void StackVisitor::WalkStack(bool include_transitions) { cur_oat_quick_method_header_ = method->GetOatQuickMethodHeader(cur_quick_frame_pc_); } header_retrieved = false; // Force header retrieval in next iteration. - SanityCheckFrame(); + ValidateFrame(); if ((walk_kind_ == StackWalkKind::kIncludeInlinedFrames) && (cur_oat_quick_method_header_ != nullptr) @@ -980,7 +980,7 @@ void StackVisitor::WalkStack(bool include_transitions) { cur_oat_quick_method_header_ = nullptr; } else if (cur_shadow_frame_ != nullptr) { do { - SanityCheckFrame(); + ValidateFrame(); bool should_continue = VisitFrame(); if (UNLIKELY(!should_continue)) { return; diff --git a/runtime/stack.h b/runtime/stack.h index a7d9d53c8f..30d7533cfe 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -346,7 +346,7 @@ class StackVisitor { ShadowFrame* PrepareSetVReg(ArtMethod* m, uint16_t vreg, bool wide) REQUIRES_SHARED(Locks::mutator_lock_); - void SanityCheckFrame() const REQUIRES_SHARED(Locks::mutator_lock_); + void ValidateFrame() const REQUIRES_SHARED(Locks::mutator_lock_); ALWAYS_INLINE CodeInfo* GetCurrentInlineInfo() const; ALWAYS_INLINE StackMap* GetCurrentStackMap() const; |