diff options
author | 2020-07-27 16:51:00 +0100 | |
---|---|---|
committer | 2020-07-28 11:13:37 +0000 | |
commit | 346fd964a826cfb5626582452b7519c04aee2f8a (patch) | |
tree | 49fb6cf2ab865391ba4027389b0049474df38c7b | |
parent | d3ee902ed06b635eedebc796543a67299eb6cd05 (diff) |
More inclusive language in the runtime
Test: m
Bug: 161896447
Bug: 161850439
Bug: 161336379
Change-Id: Iabc29fa43b4b5a403699d6bca95e9a2cb8945d77
-rw-r--r-- | compiler/optimizing/optimization.cc | 2 | ||||
-rw-r--r-- | dex2oat/linker/image_writer.cc | 2 | ||||
-rw-r--r-- | runtime/class_linker.cc | 13 | ||||
-rw-r--r-- | runtime/entrypoints/quick/quick_trampoline_entrypoints.cc | 6 | ||||
-rw-r--r-- | runtime/gc/accounting/mod_union_table.h | 4 | ||||
-rw-r--r-- | runtime/gc/collector/semi_space-inl.h | 2 | ||||
-rw-r--r-- | runtime/gc/heap.cc | 2 | ||||
-rw-r--r-- | runtime/gc/heap.h | 2 | ||||
-rw-r--r-- | runtime/gc/space/malloc_space.cc | 2 | ||||
-rw-r--r-- | runtime/gc/space/space_test.h | 10 | ||||
-rw-r--r-- | runtime/gtest_test.cc | 2 | ||||
-rw-r--r-- | runtime/image.h | 2 | ||||
-rw-r--r-- | runtime/instrumentation.cc | 2 | ||||
-rw-r--r-- | runtime/mirror/class.cc | 4 | ||||
-rw-r--r-- | runtime/mirror/class.h | 2 | ||||
-rw-r--r-- | runtime/mirror/dex_cache.cc | 2 | ||||
-rw-r--r-- | runtime/monitor.cc | 2 | ||||
-rw-r--r-- | runtime/stack.cc | 2 | ||||
-rw-r--r-- | runtime/thread.cc | 6 | ||||
-rw-r--r-- | runtime/verifier/method_verifier.cc | 5 | ||||
-rw-r--r-- | runtime/verifier/reg_type_test.cc | 2 | ||||
-rw-r--r-- | runtime/verify_object.cc | 4 | ||||
-rw-r--r-- | runtime/verify_object.h | 6 |
23 files changed, 43 insertions, 43 deletions
diff --git a/compiler/optimizing/optimization.cc b/compiler/optimizing/optimization.cc index 424fbd9f45..3a2d067f4d 100644 --- a/compiler/optimizing/optimization.cc +++ b/compiler/optimizing/optimization.cc @@ -309,7 +309,7 @@ ArenaVector<HOptimization*> ConstructOptimizations( // Add each next optimization to result vector. CHECK(opt != nullptr); - DCHECK_STREQ(pass_name, opt->GetPassName()); // sanity + DCHECK_STREQ(pass_name, opt->GetPassName()); // Consistency check. optimizations.push_back(opt); } diff --git a/dex2oat/linker/image_writer.cc b/dex2oat/linker/image_writer.cc index 31d5e99296..ff4c7b2a49 100644 --- a/dex2oat/linker/image_writer.cc +++ b/dex2oat/linker/image_writer.cc @@ -1583,7 +1583,7 @@ void ImageWriter::RecordNativeRelocations(ObjPtr<mirror::Object> obj, size_t oat DCHECK_EQ(oat_index, GetOatIndexForClass(as_klass)); DCHECK(!as_klass->IsErroneous()) << as_klass->GetStatus(); if (compiler_options_.IsAppImage()) { - // Extra sanity, no boot loader classes should be left! + // Extra consistency check: no boot loader classes should be left! CHECK(!IsBootClassLoaderClass(as_klass)) << as_klass->PrettyClass(); } LengthPrefixedArray<ArtField>* fields[] = { diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 3ea4a8d06f..67ce2ed363 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -575,8 +575,8 @@ static void WrapExceptionInInitializer(Handle<mirror::Class> klass) ScopedLocalRef<jthrowable> cause(env, env->ExceptionOccurred()); CHECK(cause.get() != nullptr); - // Boot classpath classes should not fail initialization. This is a sanity debug check. This - // cannot in general be guaranteed, but in all likelihood leads to breakage down the line. + // Boot classpath classes should not fail initialization. This is a consistency debug check. + // This cannot in general be guaranteed, but in all likelihood leads to breakage down the line. if (klass->GetClassLoader() == nullptr && !Runtime::Current()->IsAotCompiler()) { std::string tmp; // We want to LOG(FATAL) on debug builds since this really shouldn't be happening but we need to @@ -965,8 +965,7 @@ bool ClassLinker::InitWithoutImage(std::vector<std::unique_ptr<const DexFile>> b object_array_class->GetIfTable()->SetInterface(0, java_lang_Cloneable.Get()); object_array_class->GetIfTable()->SetInterface(1, java_io_Serializable.Get()); - // Sanity check Class[] and Object[]'s interfaces. GetDirectInterface may cause thread - // suspension. + // Check Class[] and Object[]'s interfaces. GetDirectInterface may cause thread suspension. CHECK_EQ(java_lang_Cloneable.Get(), mirror::Class::GetDirectInterface(self, class_array_class.Get(), 0)); CHECK_EQ(java_io_Serializable.Get(), @@ -1797,7 +1796,7 @@ void AppImageLoadingHelper::HandleAppImageStrings(gc::space::ImageSpace* space) } }, /*visit_boot_images=*/false, /*visit_non_boot_images=*/true); } - // Sanity check to ensure correctness. + // Consistency check to ensure correctness. if (kIsDebugBuild) { for (GcRoot<mirror::String>& root : interns) { ObjPtr<mirror::String> string = root.Read(); @@ -5230,7 +5229,7 @@ ObjPtr<mirror::Class> ClassLinker::CreateProxyClass(ScopedObjectAccessAlreadyRun callback->MakeVisible(self); } - // sanity checks + // Consistency checks. if (kIsDebugBuild) { CHECK(klass->GetIFieldsPtr() == nullptr); CheckProxyConstructor(klass->GetDirectMethod(0, image_pointer_size_)); @@ -5324,7 +5323,7 @@ void ClassLinker::CreateProxyMethod(Handle<mirror::Class> klass, ArtMethod* prot } void ClassLinker::CheckProxyMethod(ArtMethod* method, ArtMethod* prototype) const { - // Basic sanity + // Basic consistency checks. CHECK(!prototype->IsFinal()); CHECK(method->IsFinal()); CHECK(method->IsInvokable()); diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc index 77a9cfa7e7..92d28cf593 100644 --- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc @@ -588,8 +588,8 @@ static void HandleDeoptimization(JValue* result, // Coming from partial-fragment deopt. Thread* self = Thread::Current(); if (kIsDebugBuild) { - // Sanity-check: are the methods as expected? We check that the last shadow frame (the bottom - // of the call-stack) corresponds to the called method. + // Consistency-check: are the methods as expected? We check that the last shadow frame + // (the bottom of the call-stack) corresponds to the called method. ShadowFrame* linked = deopt_frame; while (linked->GetLink() != nullptr) { linked = linked->GetLink(); @@ -1094,7 +1094,7 @@ extern "C" TwoWordReturn artInstrumentationMethodExitFromCode(Thread* self, // Instrumentation exit stub must not be entered with a pending exception. CHECK(!self->IsExceptionPending()) << "Enter instrumentation exit stub with pending exception " << self->GetException()->Dump(); - // Compute address of return PC and sanity check that it currently holds 0. + // Compute address of return PC and check that it currently holds 0. constexpr size_t return_pc_offset = RuntimeCalleeSaveFrame::GetReturnPcOffset(CalleeSaveType::kSaveEverything); uintptr_t* return_pc_addr = reinterpret_cast<uintptr_t*>(reinterpret_cast<uint8_t*>(sp) + diff --git a/runtime/gc/accounting/mod_union_table.h b/runtime/gc/accounting/mod_union_table.h index 011e95c442..5f6fd3e9b2 100644 --- a/runtime/gc/accounting/mod_union_table.h +++ b/runtime/gc/accounting/mod_union_table.h @@ -82,8 +82,8 @@ class ModUnionTable { // Visit all of the objects that may contain references to other spaces. virtual void VisitObjects(ObjectCallback callback, void* arg) = 0; - // Verification, sanity checks that we don't have clean cards which conflict with out cached data - // for said cards. Exclusive lock is required since verify sometimes uses + // Verification: consistency checks that we don't have clean cards which conflict with out + // cached data for said cards. Exclusive lock is required since verify sometimes uses // SpaceBitmap::VisitMarkedRange and VisitMarkedRange can't know if the callback will modify the // bitmap or not. virtual void Verify() REQUIRES(Locks::heap_bitmap_lock_) = 0; diff --git a/runtime/gc/collector/semi_space-inl.h b/runtime/gc/collector/semi_space-inl.h index 065a12512b..86ab1fcccf 100644 --- a/runtime/gc/collector/semi_space-inl.h +++ b/runtime/gc/collector/semi_space-inl.h @@ -62,7 +62,7 @@ inline void SemiSpace::MarkObject(CompressedReferenceType* obj_ptr) { DCHECK(!to_space_->HasAddress(obj)) << "Tried to mark " << obj << " in to-space"; auto slow_path = [this](const mirror::Object* ref) { CHECK(!to_space_->HasAddress(ref)) << "Marking " << ref << " in to_space_"; - // Marking a large object, make sure its aligned as a sanity check. + // Marking a large object, make sure its aligned as a consistency check. CHECK_ALIGNED(ref, kPageSize); }; if (!mark_bitmap_->Set(obj, slow_path)) { diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 624e65a2f8..fcf4afcf4c 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -2401,7 +2401,7 @@ void Heap::PreZygoteFork() { // the old alloc space's bitmaps to null. RemoveSpace(old_alloc_space); if (collector::SemiSpace::kUseRememberedSet) { - // Sanity bound check. + // Consistency bound check. FindRememberedSetFromSpace(old_alloc_space)->AssertAllDirtyCardsAreWithinSpace(); // Remove the remembered set for the now zygote space (the old // non-moving space). Note now that we have compacted objects into diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h index fdcb0ad423..9f558f3e68 100644 --- a/runtime/gc/heap.h +++ b/runtime/gc/heap.h @@ -332,7 +332,7 @@ class Heap { // proper lock ordering for it. void VerifyObjectBody(ObjPtr<mirror::Object> o) NO_THREAD_SAFETY_ANALYSIS; - // Check sanity of all live references. + // Consistency check of all live references. void VerifyHeap() REQUIRES(!Locks::heap_bitmap_lock_); // Returns how many failures occured. size_t VerifyHeapReferences(bool verify_referents = true) diff --git a/runtime/gc/space/malloc_space.cc b/runtime/gc/space/malloc_space.cc index 281d9c2342..a9402d21c3 100644 --- a/runtime/gc/space/malloc_space.cc +++ b/runtime/gc/space/malloc_space.cc @@ -84,7 +84,7 @@ MemMap MallocSpace::CreateMemMap(const std::string& name, size_t* initial_size, size_t* growth_limit, size_t* capacity) { - // Sanity check arguments + // Consistency check of the arguments. if (starting_size > *initial_size) { *initial_size = starting_size; } diff --git a/runtime/gc/space/space_test.h b/runtime/gc/space/space_test.h index 01d0d6817f..e40ee50853 100644 --- a/runtime/gc/space/space_test.h +++ b/runtime/gc/space/space_test.h @@ -242,7 +242,7 @@ void SpaceTest<Super>::SizeFootPrintGrowthLimitAndTrimBody(MallocSpace* space, space->Trim(); } - // Bounds sanity + // Bounds consistency check. footprint = space->GetFootprint(); EXPECT_LE(amount_allocated, growth_limit); EXPECT_GE(footprint, amount_allocated); @@ -299,16 +299,16 @@ void SpaceTest<Super>::SizeFootPrintGrowthLimitAndTrimBody(MallocSpace* space, } EXPECT_TRUE(large_object != nullptr); - // Sanity check footprint + // Consistency check of the footprint. footprint = space->GetFootprint(); EXPECT_LE(footprint, growth_limit); EXPECT_GE(space->Size(), footprint); EXPECT_LE(space->Size(), growth_limit); - // Clean up + // Clean up. space->Free(self, large_object.Assign(nullptr)); - // Sanity check footprint + // Consistency check of the footprint. footprint = space->GetFootprint(); EXPECT_LE(footprint, growth_limit); EXPECT_GE(space->Size(), footprint); @@ -328,7 +328,7 @@ void SpaceTest<Super>::SizeFootPrintGrowthLimitAndTrimDriver(size_t object_size, MallocSpace* space(create_space("test", initial_size, growth_limit, capacity)); ASSERT_TRUE(space != nullptr); - // Basic sanity + // Basic consistency check. EXPECT_EQ(space->Capacity(), growth_limit); EXPECT_EQ(space->NonGrowthLimitCapacity(), capacity); diff --git a/runtime/gtest_test.cc b/runtime/gtest_test.cc index a40751d6f8..ab02a79bdf 100644 --- a/runtime/gtest_test.cc +++ b/runtime/gtest_test.cc @@ -16,5 +16,5 @@ #include "gtest/gtest.h" -// Sanity test that gtest alone works on host and target +// Trivial test that gtest alone works on host and target TEST(GTest, Nop) {} diff --git a/runtime/image.h b/runtime/image.h index ca585e7683..cdeb79b87f 100644 --- a/runtime/image.h +++ b/runtime/image.h @@ -457,7 +457,7 @@ class PACKED(8) ImageHeader { // Image file checksum (calculated with the checksum field set to 0). uint32_t image_checksum_ = 0u; - // Checksum of the oat file we link to for load time sanity check. + // Checksum of the oat file we link to for load time consistency check. uint32_t oat_checksum_ = 0u; // Start address for oat file. Will be before oat_data_begin_ for .so files. diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc index 8cd94e6b3e..23355b1ce8 100644 --- a/runtime/instrumentation.cc +++ b/runtime/instrumentation.cc @@ -1511,7 +1511,7 @@ TwoWordReturn Instrumentation::PopInstrumentationStackFrame(Thread* self, InstrumentationStackFrame instrumentation_frame = it->second; stack->erase(it); - // Set return PC and check the sanity of the stack. + // Set return PC and check the consistency of the stack. // We don't cache the return pc value in a local as it may change after // sending a method exit event. *return_pc_addr = instrumentation_frame.return_pc_; diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc index 6915eb052b..fb2b4a76a4 100644 --- a/runtime/mirror/class.cc +++ b/runtime/mirror/class.cc @@ -496,8 +496,8 @@ void Class::DumpClass(std::ostream& os, int flags) { void Class::SetReferenceInstanceOffsets(uint32_t new_reference_offsets) { if (kIsDebugBuild && new_reference_offsets != kClassWalkSuper) { - // Sanity check that the number of bits set in the reference offset bitmap - // agrees with the number of references + // Check that the number of bits set in the reference offset bitmap + // agrees with the number of references. uint32_t count = 0; for (ObjPtr<Class> c = this; c != nullptr; c = c->GetSuperClass()) { count += c->NumReferenceInstanceFieldsDuringLinking(); diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h index 11a5ce528c..c2f1c59d84 100644 --- a/runtime/mirror/class.h +++ b/runtime/mirror/class.h @@ -523,7 +523,7 @@ class MANAGED Class final : public Object { }; // Creates a raw object instance but does not invoke the default constructor. - // kCheckAddFinalizer controls whether we use a DCHECK to sanity check that we create a + // kCheckAddFinalizer controls whether we use a DCHECK to check that we create a // finalizer-reference if needed. This should only be disabled when doing structural class // redefinition. template <bool kIsInstrumented = true, diff --git a/runtime/mirror/dex_cache.cc b/runtime/mirror/dex_cache.cc index 40997f6ff7..b7adcc2d78 100644 --- a/runtime/mirror/dex_cache.cc +++ b/runtime/mirror/dex_cache.cc @@ -118,7 +118,7 @@ void DexCache::InitializeDexCache(Thread* self, static_assert(alignof(StringDexCacheType) == 8u, "Expected StringDexCacheType to have align of 8."); if (kIsDebugBuild) { - // Sanity check to make sure all the dex cache arrays are empty. b/28992179 + // Consistency check to make sure all the dex cache arrays are empty. b/28992179 for (size_t i = 0; i < num_strings; ++i) { CHECK_EQ(strings[i].load(std::memory_order_relaxed).index, 0u); CHECK(strings[i].load(std::memory_order_relaxed).object.IsNull()); diff --git a/runtime/monitor.cc b/runtime/monitor.cc index a581131d93..870936c20e 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -1541,7 +1541,7 @@ bool Monitor::IsValidLockWord(LockWord lock_word) { // Nothing to check. return true; case LockWord::kThinLocked: - // Basic sanity check of owner. + // Basic consistency check of owner. return lock_word.ThinLockOwner() != ThreadList::kInvalidThreadId; case LockWord::kFatLocked: { // Check the monitor appears in the monitor list. diff --git a/runtime/stack.cc b/runtime/stack.cc index a5e2f4402c..1fca012a7f 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -758,7 +758,7 @@ void StackVisitor::SanityCheckFrame() const { } if (cur_quick_frame_ != nullptr) { AssertPcIsWithinQuickCode(method, cur_quick_frame_pc_); - // Frame sanity. + // Frame consistency checks. size_t frame_size = GetCurrentQuickFrameInfo().FrameSizeInBytes(); CHECK_NE(frame_size, 0u); // For compiled code, we could try to have a rough guess at an upper size we expect diff --git a/runtime/thread.cc b/runtime/thread.cc index b71c41e48e..c831f3e4e1 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -501,7 +501,7 @@ static FrameIdToShadowFrame* FindFrameIdToShadowFrame(FrameIdToShadowFrame* head for (FrameIdToShadowFrame* record = head; record != nullptr; record = record->GetNext()) { if (record->GetFrameId() == frame_id) { if (kIsDebugBuild) { - // Sanity check we have at most one record for this frame. + // Check we have at most one record for this frame. CHECK(found == nullptr) << "Multiple records for the frame " << frame_id; found = record; } else { @@ -678,7 +678,7 @@ Thread* Thread::FromManagedThread(const ScopedObjectAccessAlreadyRunnable& soa, ObjPtr<mirror::Object> thread_peer) { ArtField* f = jni::DecodeArtField(WellKnownClasses::java_lang_Thread_nativePeer); Thread* result = reinterpret_cast64<Thread*>(f->GetLong(thread_peer)); - // Sanity check that if we have a result it is either suspended or we hold the thread_list_lock_ + // Check that if we have a result it is either suspended or we hold the thread_list_lock_ // to stop it from going away. if (kIsDebugBuild) { MutexLock mu(soa.Self(), *Locks::thread_suspend_count_lock_); @@ -1356,7 +1356,7 @@ bool Thread::InitStackHwm() { InstallImplicitProtection(); } - // Sanity check. + // Consistency check. CHECK_GT(FindStackTop(), reinterpret_cast<void*>(tlsPtr_.stack_end)); return true; diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index 84f0a7f63c..c33e646823 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -1036,7 +1036,8 @@ bool MethodVerifier<kVerifierDebug>::Verify() { } } - // Sanity-check the register counts. ins + locals = registers, so make sure that ins <= registers. + // Consistency-check of the register counts. + // ins + locals = registers, so make sure that ins <= registers. if (code_item_accessor_.InsSize() > code_item_accessor_.RegistersSize()) { Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "bad register counts (ins=" << code_item_accessor_.InsSize() @@ -1900,7 +1901,7 @@ bool MethodVerifier<kVerifierDebug>::CodeFlowVerifyMethod() { work_line_->CopyFromLine(reg_table_.GetLine(insn_idx)); } else if (kIsDebugBuild) { /* - * Sanity check: retrieve the stored register line (assuming + * Consistency check: retrieve the stored register line (assuming * a full table) and make sure it actually matches. */ RegisterLine* register_line = reg_table_.GetLine(insn_idx); diff --git a/runtime/verifier/reg_type_test.cc b/runtime/verifier/reg_type_test.cc index 9cac5fb867..207bb5d685 100644 --- a/runtime/verifier/reg_type_test.cc +++ b/runtime/verifier/reg_type_test.cc @@ -69,7 +69,7 @@ TEST_F(RegTypeTest, Pairs) { const RegType& precise_const = cache.FromCat1Const(static_cast<int32_t>(val >> 32), true); const RegType& long_lo = cache.LongLo(); const RegType& long_hi = cache.LongHi(); - // Check sanity of types. + // Check the expectations for types. EXPECT_TRUE(precise_lo.IsLowHalf()); EXPECT_FALSE(precise_hi.IsLowHalf()); EXPECT_FALSE(precise_lo.IsHighHalf()); diff --git a/runtime/verify_object.cc b/runtime/verify_object.cc index 2b8c7da76b..61b502df97 100644 --- a/runtime/verify_object.cc +++ b/runtime/verify_object.cc @@ -30,8 +30,8 @@ void VerifyObjectImpl(ObjPtr<mirror::Object> obj) { // Slow object verification, try the heap right away. Runtime::Current()->GetHeap()->VerifyObjectBody(obj); } else { - // Fast object verification, only call the heap if our quick sanity tests fail. The heap will - // print the diagnostic message. + // Fast object verification, only call the heap if our quick checks fail. + // The heap will print the diagnostic message. bool failed = !IsAligned<kObjectAlignment>(obj.Ptr()); if (!failed) { mirror::Class* c = obj->GetClass<kVerifyNone>(); diff --git a/runtime/verify_object.h b/runtime/verify_object.h index cc288e7a88..ae87cad9ab 100644 --- a/runtime/verify_object.h +++ b/runtime/verify_object.h @@ -29,11 +29,11 @@ class Class; class Object; } // namespace mirror -// How we want to sanity check the heap's correctness. +// How we want to check the heap's correctness. enum VerifyObjectMode { kVerifyObjectModeDisabled, // Heap verification is disabled. - kVerifyObjectModeFast, // Sanity heap accesses quickly by using VerifyClassClass. - kVerifyObjectModeAll // Sanity heap accesses thoroughly. + kVerifyObjectModeFast, // Check heap accesses quickly by using VerifyClassClass. + kVerifyObjectModeAll // Check heap accesses thoroughly. }; enum VerifyObjectFlags { |