Update language to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference
Bug: 161896447
Bug: 161850439
Bug: 161336379
Test: m -j checkbuild cts docs tests
Change-Id: I32d869c274a5d9a3dac63221e25874fe685d38c4
diff --git a/runtime/arch/x86/thread_x86.cc b/runtime/arch/x86/thread_x86.cc
index cc8f1fa..cca9a91 100644
--- a/runtime/arch/x86/thread_x86.cc
+++ b/runtime/arch/x86/thread_x86.cc
@@ -135,7 +135,7 @@
// Allow easy indirection back to Thread*.
tlsPtr_.self = this;
- // Sanity check that reads from %fs point to this Thread*.
+ // Check that the reads from %fs point to this Thread*.
Thread* self_check;
CHECK_EQ(THREAD_SELF_OFFSET, SelfOffset<PointerSize::k32>().Int32Value());
__asm__ __volatile__("movl %%fs:(%1), %0"
@@ -144,7 +144,7 @@
:); // clobber
CHECK_EQ(self_check, this);
- // Sanity check other offsets.
+ // Check the other offsets
CHECK_EQ(THREAD_EXCEPTION_OFFSET, ExceptionOffset<PointerSize::k32>().Int32Value());
CHECK_EQ(THREAD_CARD_TABLE_OFFSET, CardTableOffset<PointerSize::k32>().Int32Value());
CHECK_EQ(THREAD_ID_OFFSET, ThinLockIdOffset<PointerSize::k32>().Int32Value());
@@ -153,7 +153,7 @@
void Thread::CleanupCpu() {
MutexLock mu(this, *Locks::modify_ldt_lock_);
- // Sanity check that reads from %fs point to this Thread*.
+ // Check that the reads from %fs point to this Thread*.
Thread* self_check;
__asm__ __volatile__("movl %%fs:(%1), %0"
: "=r"(self_check) // output
diff --git a/runtime/arch/x86_64/thread_x86_64.cc b/runtime/arch/x86_64/thread_x86_64.cc
index 5c0446f..b01a1d3 100644
--- a/runtime/arch/x86_64/thread_x86_64.cc
+++ b/runtime/arch/x86_64/thread_x86_64.cc
@@ -58,7 +58,7 @@
// Allow easy indirection back to Thread*.
tlsPtr_.self = this;
- // Sanity check that reads from %gs point to this Thread*.
+ // Check that the reads from %gs point to this Thread*.
Thread* self_check;
__asm__ __volatile__("movq %%gs:(%1), %0"
: "=r"(self_check) // output
@@ -68,7 +68,7 @@
}
void Thread::CleanupCpu() {
- // Sanity check that reads from %gs point to this Thread*.
+ // Check that the reads from %gs point to this Thread*.
Thread* self_check;
__asm__ __volatile__("movq %%gs:(%1), %0"
: "=r"(self_check) // output
diff --git a/runtime/base/mutex-inl.h b/runtime/base/mutex-inl.h
index 821c75d..2a1a08d 100644
--- a/runtime/base/mutex-inl.h
+++ b/runtime/base/mutex-inl.h
@@ -57,8 +57,8 @@
}
static inline void CheckUnattachedThread(LockLevel level) NO_THREAD_SAFETY_ANALYSIS {
- // The check below enumerates the cases where we expect not to be able to sanity check locks
- // on a thread. Lock checking is disabled to avoid deadlock when checking shutdown lock.
+ // The check below enumerates the cases where we expect not to be able to check the validity of
+ // locks on a thread. Lock checking is disabled to avoid deadlock when checking shutdown lock.
// TODO: tighten this check.
if (kDebugLocking) {
CHECK(!Locks::IsSafeToCallAbortRacy() ||
@@ -227,7 +227,7 @@
DCHECK(self == nullptr || self == Thread::Current());
bool result = (GetExclusiveOwnerTid() == SafeGetTid(self));
if (kDebugLocking) {
- // Sanity debug check that if we think it is locked we have it in our held mutexes.
+ // Debug check that if we think it is locked we have it in our held mutexes.
if (result && self != nullptr && level_ != kMonitorLock && !gAborting) {
if (level_ == kThreadWaitLock && self->GetHeldMutex(kThreadWaitLock) != this) {
CHECK_EQ(self->GetHeldMutex(kThreadWaitWakeLock), this);
@@ -257,7 +257,7 @@
DCHECK(self == nullptr || self == Thread::Current());
bool result = (GetExclusiveOwnerTid() == SafeGetTid(self));
if (kDebugLocking) {
- // Sanity that if the pthread thinks we own the lock the Thread agrees.
+ // Verify that if the pthread thinks we own the lock the Thread agrees.
if (self != nullptr && result) {
CHECK_EQ(self->GetHeldMutex(level_), this);
}
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index a7561de..ef85191 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -1768,7 +1768,7 @@
// in the top parent.
VerifyClassResolution("LDefinedInAC;", class_loader_d, class_loader_a);
- // Sanity check that we don't find an undefined class.
+ // Check that we don't find an undefined class.
VerifyClassResolution("LNotDefined;", class_loader_d, nullptr, /*should_find=*/ false);
}
diff --git a/runtime/class_table.cc b/runtime/class_table.cc
index b7d37e2..c854dc5 100644
--- a/runtime/class_table.cc
+++ b/runtime/class_table.cc
@@ -266,7 +266,7 @@
}
}
const size_t ret = combined.WriteToMemory(ptr);
- // Sanity check.
+ // Validity check
if (kIsDebugBuild && ptr != nullptr) {
size_t read_count;
ClassSet class_set(ptr, /*make copy*/false, &read_count);
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index f218c4e..d2cb939 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -510,7 +510,7 @@
Write4BE(&p_, reinterpret_cast<uintptr_t>(chunk_ptr)); // virtual address of segment start.
Write4BE(&p_, 0); // offset of this piece (relative to the virtual address).
// [u4]: length of piece, in allocation units
- // We won't know this until we're done, so save the offset and stuff in a dummy value.
+ // We won't know this until we're done, so save the offset and stuff in a fake value.
pieceLenField_ = p_;
Write4BE(&p_, 0x55555555);
needHeader_ = false;
diff --git a/runtime/elf_file.cc b/runtime/elf_file.cc
index 88992f1..3c6fd85 100644
--- a/runtime/elf_file.cc
+++ b/runtime/elf_file.cc
@@ -549,33 +549,32 @@
template <typename ElfTypes>
typename ElfTypes::Ehdr& ElfFileImpl<ElfTypes>::GetHeader() const {
- CHECK(header_ != nullptr); // Header has been checked in SetMap. This is a sanity check.
+ CHECK(header_ != nullptr); // Header has been checked in SetMap
return *header_;
}
template <typename ElfTypes>
uint8_t* ElfFileImpl<ElfTypes>::GetProgramHeadersStart() const {
- CHECK(program_headers_start_ != nullptr); // Header has been set in Setup. This is a sanity
- // check.
+ CHECK(program_headers_start_ != nullptr); // Header has been set in Setup
return program_headers_start_;
}
template <typename ElfTypes>
uint8_t* ElfFileImpl<ElfTypes>::GetSectionHeadersStart() const {
CHECK(!program_header_only_); // Only used in "full" mode.
- CHECK(section_headers_start_ != nullptr); // Is checked in CheckSectionsExist. Sanity check.
+ CHECK(section_headers_start_ != nullptr); // Is checked in CheckSectionsExist
return section_headers_start_;
}
template <typename ElfTypes>
typename ElfTypes::Phdr& ElfFileImpl<ElfTypes>::GetDynamicProgramHeader() const {
- CHECK(dynamic_program_header_ != nullptr); // Is checked in CheckSectionsExist. Sanity check.
+ CHECK(dynamic_program_header_ != nullptr); // Is checked in CheckSectionsExist
return *dynamic_program_header_;
}
template <typename ElfTypes>
typename ElfTypes::Dyn* ElfFileImpl<ElfTypes>::GetDynamicSectionStart() const {
- CHECK(dynamic_section_start_ != nullptr); // Is checked in CheckSectionsExist. Sanity check.
+ CHECK(dynamic_section_start_ != nullptr); // Is checked in CheckSectionsExist
return dynamic_section_start_;
}
@@ -678,7 +677,7 @@
template <typename ElfTypes>
typename ElfTypes::Phdr* ElfFileImpl<ElfTypes>::GetProgramHeader(Elf_Word i) const {
- CHECK_LT(i, GetProgramHeaderNum()) << file_path_; // Sanity check for caller.
+ CHECK_LT(i, GetProgramHeaderNum()) << file_path_; // Validity check for caller.
uint8_t* program_header = GetProgramHeadersStart() + (i * GetHeader().e_phentsize);
CHECK_LT(program_header, End());
return reinterpret_cast<Elf_Phdr*>(program_header);