diff options
author | Ian Rogers <irogers@google.com> | 2014-10-24 14:20:06 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-10-24 14:23:42 -0700 |
commit | 2c4257be8191c5eefde744e8965fcefc80a0a97d (patch) | |
tree | 9db3e1f1c60f2df29638ba3ce9d5d5bb8b26ca2c | |
parent | 98c271d517bc4d25fc6879b4b8e35ea93885d9e2 (diff) | |
download | art-2c4257be8191c5eefde744e8965fcefc80a0a97d.tar.gz art-2c4257be8191c5eefde744e8965fcefc80a0a97d.tar.bz2 art-2c4257be8191c5eefde744e8965fcefc80a0a97d.zip |
Tidy logging code not using UNIMPLEMENTED.
Change-Id: I7a79c1671a6ff8b2040887133b3e0925ef9a3cfe
34 files changed, 79 insertions, 65 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index 359d6af57d..7e19e15961 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -111,7 +111,7 @@ void CommonCompilerTest::MakeExecutable(const void* code_start, size_t code_leng #else // Only warn if not Intel as Intel doesn't have cache flush instructions. #if !defined(__i386__) && !defined(__x86_64__) - LOG(WARNING) << "UNIMPLEMENTED: cache flush"; + UNIMPLEMENTED(WARNING) << "cache flush"; #endif #endif } diff --git a/compiler/compiler.cc b/compiler/compiler.cc index fbfd8e6415..36213ca417 100644 --- a/compiler/compiler.cc +++ b/compiler/compiler.cc @@ -75,8 +75,8 @@ Compiler* Compiler::Create(CompilerDriver* driver, Compiler::Kind kind) { default: LOG(FATAL) << "UNREACHABLE"; + UNREACHABLE(); } - return nullptr; } } // namespace art diff --git a/compiler/dex/quick/arm64/utility_arm64.cc b/compiler/dex/quick/arm64/utility_arm64.cc index 0883694033..6985b73845 100644 --- a/compiler/dex/quick/arm64/utility_arm64.cc +++ b/compiler/dex/quick/arm64/utility_arm64.cc @@ -768,8 +768,8 @@ LIR* Arm64Mir2Lir::OpRegRegRegExtend(OpKind op, RegStorage r_dest, RegStorage r_ opcode = kA64Sub4RRre; break; default: - LOG(FATAL) << "Unimplemented opcode: " << op; - break; + UNIMPLEMENTED(FATAL) << "Unimplemented opcode: " << op; + UNREACHABLE(); } A64Opcode widened_opcode = r_dest.Is64Bit() ? WIDE(opcode) : opcode; diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc index 35a3d4b3b2..235aba823c 100644 --- a/compiler/image_writer.cc +++ b/compiler/image_writer.cc @@ -206,7 +206,7 @@ void ImageWriter::SetImageOffset(mirror::Object* object, size_t offset) { break; default: LOG(FATAL) << "Unreachable."; - break; + UNREACHABLE(); } object->SetLockWord(LockWord::FromForwardingAddress(offset), false); DCHECK(IsImageOffsetAssigned(object)); diff --git a/compiler/jni/portable/jni_compiler.cc b/compiler/jni/portable/jni_compiler.cc index d2f54f8090..ff37d858ad 100644 --- a/compiler/jni/portable/jni_compiler.cc +++ b/compiler/jni/portable/jni_compiler.cc @@ -298,6 +298,7 @@ void JniCompiler::CreateFunction(const std::string& func_name) { case 'D': ret_type = irb_.getJDoubleTy(); break; case 'L': ret_type = irb_.getJObjectTy(); break; default: LOG(FATAL) << "Unreachable: unexpected return type in shorty " << shorty; + UNREACHABLE(); } // Get argument type std::vector< ::llvm::Type*> args_type; diff --git a/compiler/utils/arena_object.h b/compiler/utils/arena_object.h index 50909f7532..8f6965edc5 100644 --- a/compiler/utils/arena_object.h +++ b/compiler/utils/arena_object.h @@ -31,6 +31,7 @@ class ArenaObject { void operator delete(void*, size_t) { LOG(FATAL) << "UNREACHABLE"; + UNREACHABLE(); } }; diff --git a/compiler/utils/arm/assembler_arm.cc b/compiler/utils/arm/assembler_arm.cc index b430c7ee97..db42b4620d 100644 --- a/compiler/utils/arm/assembler_arm.cc +++ b/compiler/utils/arm/assembler_arm.cc @@ -324,7 +324,7 @@ bool Address::CanHoldLoadOffsetArm(LoadOperandType type, int offset) { return IsAbsoluteUint(10, offset); // VFP addressing mode. default: LOG(FATAL) << "UNREACHABLE"; - return false; + UNREACHABLE(); } } @@ -342,7 +342,7 @@ bool Address::CanHoldStoreOffsetArm(StoreOperandType type, int offset) { return IsAbsoluteUint(10, offset); // VFP addressing mode. default: LOG(FATAL) << "UNREACHABLE"; - return false; + UNREACHABLE(); } } @@ -359,9 +359,9 @@ bool Address::CanHoldLoadOffsetThumb(LoadOperandType type, int offset) { return IsAbsoluteUint(10, offset); // VFP addressing mode. case kLoadWordPair: return IsAbsoluteUint(10, offset); - default: + default: LOG(FATAL) << "UNREACHABLE"; - return false; + UNREACHABLE(); } } @@ -377,9 +377,9 @@ bool Address::CanHoldStoreOffsetThumb(StoreOperandType type, int offset) { return IsAbsoluteUint(10, offset); // VFP addressing mode. case kStoreWordPair: return IsAbsoluteUint(10, offset); - default: + default: LOG(FATAL) << "UNREACHABLE"; - return false; + UNREACHABLE(); } } diff --git a/compiler/utils/arm/assembler_arm32.cc b/compiler/utils/arm/assembler_arm32.cc index 6af69c86ce..3d46617079 100644 --- a/compiler/utils/arm/assembler_arm32.cc +++ b/compiler/utils/arm/assembler_arm32.cc @@ -1356,6 +1356,7 @@ void Arm32Assembler::LoadFromOffset(LoadOperandType type, break; default: LOG(FATAL) << "UNREACHABLE"; + UNREACHABLE(); } } @@ -1427,6 +1428,7 @@ void Arm32Assembler::StoreToOffset(StoreOperandType type, break; default: LOG(FATAL) << "UNREACHABLE"; + UNREACHABLE(); } } diff --git a/compiler/utils/arm/assembler_thumb2.cc b/compiler/utils/arm/assembler_thumb2.cc index 7968a7774e..37478c4ac1 100644 --- a/compiler/utils/arm/assembler_thumb2.cc +++ b/compiler/utils/arm/assembler_thumb2.cc @@ -2406,6 +2406,7 @@ void Thumb2Assembler::LoadFromOffset(LoadOperandType type, break; default: LOG(FATAL) << "UNREACHABLE"; + UNREACHABLE(); } } @@ -2477,6 +2478,7 @@ void Thumb2Assembler::StoreToOffset(StoreOperandType type, break; default: LOG(FATAL) << "UNREACHABLE"; + UNREACHABLE(); } } diff --git a/disassembler/disassembler_x86.cc b/disassembler/disassembler_x86.cc index e12559f010..b9e98f6cb0 100644 --- a/disassembler/disassembler_x86.cc +++ b/disassembler/disassembler_x86.cc @@ -508,7 +508,7 @@ DISASSEMBLER_ENTRY(cmp, case 0x5D: opcode << "min"; break; case 0x5E: opcode << "div"; break; case 0x5F: opcode << "max"; break; - default: LOG(FATAL) << "Unreachable"; + default: LOG(FATAL) << "Unreachable"; UNREACHABLE(); } if (prefix[2] == 0x66) { opcode << "pd"; @@ -1239,7 +1239,7 @@ DISASSEMBLER_ENTRY(cmp, case 0xF2: prefixed_opcode << "repne "; break; case 0xF3: prefixed_opcode << "repe "; break; case 0: break; - default: LOG(FATAL) << "Unreachable"; + default: LOG(FATAL) << "Unreachable"; UNREACHABLE(); } prefixed_opcode << opcode.str(); os << FormatInstructionPointer(begin_instr) diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index f6717fb006..854effd772 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -5284,6 +5284,7 @@ mirror::ArtMethod* ClassLinker::ResolveMethod(const DexFile& dex_file, uint32_t break; default: LOG(FATAL) << "Unreachable - invocation type: " << type; + UNREACHABLE(); } if (resolved == nullptr) { // Search by name, which works across dex files. diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc index 78cbe58416..761441eae6 100644 --- a/runtime/dex_file.cc +++ b/runtime/dex_file.cc @@ -1182,13 +1182,14 @@ void EncodedStaticFieldValueIterator::Next() { case kArray: case kAnnotation: UNIMPLEMENTED(FATAL) << ": type " << type_; - break; + UNREACHABLE(); case kNull: jval_.l = NULL; width = 0; break; default: LOG(FATAL) << "Unreached"; + UNREACHABLE(); } ptr_ += width; } diff --git a/runtime/dex_instruction.cc b/runtime/dex_instruction.cc index af38433abc..a802759474 100644 --- a/runtime/dex_instruction.cc +++ b/runtime/dex_instruction.cc @@ -113,7 +113,7 @@ size_t Instruction::SizeInCodeUnitsComplexOpcode() const { return 1; // NOP. } else { LOG(FATAL) << "Unreachable: " << DumpString(nullptr); - return 0; + UNREACHABLE(); } } } diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h index 9fb9a3ba56..ccc5d835c9 100644 --- a/runtime/entrypoints/entrypoint_utils-inl.h +++ b/runtime/entrypoints/entrypoint_utils-inl.h @@ -499,11 +499,8 @@ static inline mirror::ArtField* FindFieldFast(uint32_t field_idx, case StaticPrimitiveRead: is_primitive = true; is_set = false; is_static = true; break; case StaticPrimitiveWrite: is_primitive = true; is_set = true; is_static = true; break; default: - LOG(FATAL) << "UNREACHABLE"; // Assignment below to avoid GCC warnings. - is_primitive = true; - is_set = true; - is_static = true; - break; + LOG(FATAL) << "UNREACHABLE"; + UNREACHABLE(); } if (UNLIKELY(resolved_field->IsStatic() != is_static)) { // Incompatible class change. diff --git a/runtime/entrypoints/portable/portable_trampoline_entrypoints.cc b/runtime/entrypoints/portable/portable_trampoline_entrypoints.cc index c3664bfac6..61d66ba461 100644 --- a/runtime/entrypoints/portable/portable_trampoline_entrypoints.cc +++ b/runtime/entrypoints/portable/portable_trampoline_entrypoints.cc @@ -172,7 +172,7 @@ class BuildPortableShadowFrameVisitor : public PortableArgumentVisitor { break; case Primitive::kPrimVoid: LOG(FATAL) << "UNREACHABLE"; - break; + UNREACHABLE(); } ++cur_reg_; } @@ -261,8 +261,7 @@ class BuildPortableArgumentVisitor : public PortableArgumentVisitor { break; case Primitive::kPrimVoid: LOG(FATAL) << "UNREACHABLE"; - val.j = 0; - break; + UNREACHABLE(); } args_.push_back(val); } diff --git a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc index a2869ecc45..7dbfdd5679 100644 --- a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc @@ -248,7 +248,8 @@ void ResetQuickAllocEntryPoints(QuickEntryPoints* qpoints) { } #endif default: { - LOG(FATAL) << "Unimplemented"; + UNIMPLEMENTED(FATAL); + UNREACHABLE(); } } } diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc index af341bb1fa..2e38c3a08a 100644 --- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc @@ -456,7 +456,7 @@ void BuildQuickShadowFrameVisitor::Visit() { break; case Primitive::kPrimVoid: LOG(FATAL) << "UNREACHABLE"; - break; + UNREACHABLE(); } ++cur_reg_; } @@ -564,8 +564,7 @@ void BuildQuickArgumentVisitor::Visit() { break; case Primitive::kPrimVoid: LOG(FATAL) << "UNREACHABLE"; - val.j = 0; - break; + UNREACHABLE(); } args_->push_back(val); } @@ -1557,7 +1556,7 @@ void BuildGenericJniFrameVisitor::Visit() { break; case Primitive::kPrimVoid: LOG(FATAL) << "UNREACHABLE"; - break; + UNREACHABLE(); } } diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc index 83da0639ea..ad3bb11d80 100644 --- a/runtime/gc/collector/mark_sweep.cc +++ b/runtime/gc/collector/mark_sweep.cc @@ -813,6 +813,7 @@ void MarkSweep::ScanGrayObjects(bool paused, uint8_t minimum_age) { break; default: LOG(FATAL) << "Unreachable"; + UNREACHABLE(); } TimingLogger::ScopedTiming t(name, GetTimings()); ScanObjectVisitor visitor(this); diff --git a/runtime/gc/gc_cause.cc b/runtime/gc/gc_cause.cc index f0e1512adf..6be683df48 100644 --- a/runtime/gc/gc_cause.cc +++ b/runtime/gc/gc_cause.cc @@ -35,8 +35,8 @@ const char* PrettyCause(GcCause cause) { case kGcCauseTrim: return "HeapTrim"; default: LOG(FATAL) << "Unreachable"; + UNREACHABLE(); } - return ""; } std::ostream& operator<<(std::ostream& os, const GcCause& gc_cause) { diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index bceac4403d..c0008aac84 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -1325,8 +1325,9 @@ mirror::Object* Heap::AllocateInternalWithGc(Thread* self, AllocatorType allocat // Throw OOM by default. break; default: { - LOG(FATAL) << "Unimplemented homogeneous space compaction result " - << static_cast<size_t>(result); + UNIMPLEMENTED(FATAL) << "homogeneous space compaction result: " + << static_cast<size_t>(result); + UNREACHABLE(); } } // Always print that we ran homogeneous space compation since this can cause jank. @@ -1761,7 +1762,8 @@ void Heap::ChangeCollector(CollectorType collector_type) { break; } default: { - LOG(FATAL) << "Unimplemented"; + UNIMPLEMENTED(FATAL); + UNREACHABLE(); } } if (IsGcConcurrent()) { diff --git a/runtime/gc/space/bump_pointer_space.cc b/runtime/gc/space/bump_pointer_space.cc index 8f42642b17..0a55b52c08 100644 --- a/runtime/gc/space/bump_pointer_space.cc +++ b/runtime/gc/space/bump_pointer_space.cc @@ -201,8 +201,8 @@ void BumpPointerSpace::Walk(ObjectCallback* callback, void* arg) { } accounting::ContinuousSpaceBitmap::SweepCallback* BumpPointerSpace::GetSweepCallback() { - LOG(FATAL) << "Unimplemented"; - return nullptr; + UNIMPLEMENTED(FATAL); + UNREACHABLE(); } uint64_t BumpPointerSpace::GetBytesAllocated() { diff --git a/runtime/gc/space/space.cc b/runtime/gc/space/space.cc index bff28f6d19..b233805e4c 100644 --- a/runtime/gc/space/space.cc +++ b/runtime/gc/space/space.cc @@ -39,33 +39,33 @@ std::ostream& operator<<(std::ostream& os, const Space& space) { } DlMallocSpace* Space::AsDlMallocSpace() { - LOG(FATAL) << "Unreachable"; - return nullptr; + UNIMPLEMENTED(FATAL) << "Unreachable"; + UNREACHABLE(); } RosAllocSpace* Space::AsRosAllocSpace() { - LOG(FATAL) << "Unreachable"; - return nullptr; + UNIMPLEMENTED(FATAL) << "Unreachable"; + UNREACHABLE(); } ZygoteSpace* Space::AsZygoteSpace() { - LOG(FATAL) << "Unreachable"; - return nullptr; + UNIMPLEMENTED(FATAL) << "Unreachable"; + UNREACHABLE(); } BumpPointerSpace* Space::AsBumpPointerSpace() { - LOG(FATAL) << "Unreachable"; - return nullptr; + UNIMPLEMENTED(FATAL) << "Unreachable"; + UNREACHABLE(); } AllocSpace* Space::AsAllocSpace() { - LOG(FATAL) << "Unimplemented"; - return nullptr; + UNIMPLEMENTED(FATAL) << "Unreachable"; + UNREACHABLE(); } ContinuousMemMapAllocSpace* Space::AsContinuousMemMapAllocSpace() { - LOG(FATAL) << "Unimplemented"; - return nullptr; + UNIMPLEMENTED(FATAL) << "Unreachable"; + UNREACHABLE(); } DiscontinuousSpace::DiscontinuousSpace(const std::string& name, diff --git a/runtime/gc/space/zygote_space.cc b/runtime/gc/space/zygote_space.cc index 51d84f5acb..9de0548561 100644 --- a/runtime/gc/space/zygote_space.cc +++ b/runtime/gc/space/zygote_space.cc @@ -58,7 +58,8 @@ ZygoteSpace* ZygoteSpace::Create(const std::string& name, MemMap* mem_map, } void ZygoteSpace::Clear() { - LOG(FATAL) << "Unimplemented"; + UNIMPLEMENTED(FATAL); + UNREACHABLE(); } ZygoteSpace::ZygoteSpace(const std::string& name, MemMap* mem_map, size_t objects_allocated) diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc index dfb03cdeb8..9de12f2401 100644 --- a/runtime/interpreter/interpreter.cc +++ b/runtime/interpreter/interpreter.cc @@ -325,7 +325,7 @@ template<bool do_access_check, bool transaction_active> JValue ExecuteGotoImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item, ShadowFrame& shadow_frame, JValue result_register) { LOG(FATAL) << "UNREACHABLE"; - exit(0); + UNREACHABLE(); } // Explicit definitions of ExecuteGotoImpl. template<> SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index 3ccdd03136..c887a8877f 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -80,6 +80,7 @@ bool DoFieldGet(Thread* self, ShadowFrame& shadow_frame, const Instruction* inst break; default: LOG(FATAL) << "Unreachable: " << field_type; + UNREACHABLE(); } return true; } @@ -153,6 +154,7 @@ bool DoIGetQuick(ShadowFrame& shadow_frame, const Instruction* inst, uint16_t in break; default: LOG(FATAL) << "Unreachable: " << field_type; + UNREACHABLE(); } return true; } @@ -195,7 +197,7 @@ static JValue GetFieldValue(const ShadowFrame& shadow_frame, uint32_t vreg) break; default: LOG(FATAL) << "Unreachable: " << field_type; - break; + UNREACHABLE(); } return field_value; } @@ -285,6 +287,7 @@ bool DoFieldPut(Thread* self, const ShadowFrame& shadow_frame, const Instruction } default: LOG(FATAL) << "Unreachable: " << field_type; + UNREACHABLE(); } return true; } @@ -369,6 +372,7 @@ bool DoIPutQuick(const ShadowFrame& shadow_frame, const Instruction* inst, uint1 break; default: LOG(FATAL) << "Unreachable: " << field_type; + UNREACHABLE(); } return true; } diff --git a/runtime/mirror/art_method-inl.h b/runtime/mirror/art_method-inl.h index 664a412292..d262fd5211 100644 --- a/runtime/mirror/art_method-inl.h +++ b/runtime/mirror/art_method-inl.h @@ -171,7 +171,7 @@ inline bool ArtMethod::CheckIncompatibleClassChange(InvokeType type) { } default: LOG(FATAL) << "Unreachable - invocation type: " << type; - return true; + UNREACHABLE(); } } @@ -223,9 +223,7 @@ inline const uint8_t* ArtMethod::GetVmapTable() { } inline const uint8_t* ArtMethod::GetVmapTable(const void* code_pointer) { - if (IsOptimized()) { - LOG(FATAL) << "Unimplemented vmap table for optimized compiler"; - } + CHECK(!IsOptimized()) << "Unimplemented vmap table for optimized compiler"; DCHECK(code_pointer != nullptr); DCHECK(code_pointer == GetQuickOatCodePointer()); uint32_t offset = diff --git a/runtime/mirror/object-inl.h b/runtime/mirror/object-inl.h index b89da9d4fe..c9e60bc0b2 100644 --- a/runtime/mirror/object-inl.h +++ b/runtime/mirror/object-inl.h @@ -121,7 +121,7 @@ inline Object* Object::GetReadBarrierPointer() { OFFSET_OF_OBJECT_MEMBER(Object, x_rb_ptr_)); #else LOG(FATAL) << "Unreachable"; - return nullptr; + UNREACHABLE(); #endif } @@ -134,6 +134,7 @@ inline void Object::SetReadBarrierPointer(Object* rb_ptr) { OFFSET_OF_OBJECT_MEMBER(Object, x_rb_ptr_), rb_ptr); #else LOG(FATAL) << "Unreachable"; + UNREACHABLE(); #endif } @@ -156,7 +157,7 @@ inline bool Object::AtomicSetReadBarrierPointer(Object* expected_rb_ptr, Object* return true; #else LOG(FATAL) << "Unreachable"; - return false; + UNREACHABLE(); #endif } @@ -166,13 +167,12 @@ inline void Object::AssertReadBarrierPointer() const { DCHECK(obj->GetReadBarrierPointer() == nullptr) << "Bad Baker pointer: obj=" << reinterpret_cast<void*>(obj) << " ptr=" << reinterpret_cast<void*>(obj->GetReadBarrierPointer()); - } else if (kUseBrooksReadBarrier) { + } else { + CHECK(kUseBrooksReadBarrier); Object* obj = const_cast<Object*>(this); DCHECK_EQ(obj, obj->GetReadBarrierPointer()) << "Bad Brooks pointer: obj=" << reinterpret_cast<void*>(obj) << " ptr=" << reinterpret_cast<void*>(obj->GetReadBarrierPointer()); - } else { - LOG(FATAL) << "Unreachable"; } } diff --git a/runtime/monitor.cc b/runtime/monitor.cc index 6123934d3c..5020ced396 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -877,7 +877,7 @@ uint32_t Monitor::GetLockOwnerThreadId(mirror::Object* obj) { } default: { LOG(FATAL) << "Unreachable"; - return ThreadList::kInvalidThreadId; + UNREACHABLE(); } } } @@ -1032,7 +1032,7 @@ bool Monitor::IsValidLockWord(LockWord lock_word) { return true; default: LOG(FATAL) << "Unreachable"; - return false; + UNREACHABLE(); } } diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc index ec7d82db8e..c35bb30b48 100644 --- a/runtime/native/dalvik_system_VMRuntime.cc +++ b/runtime/native/dalvik_system_VMRuntime.cc @@ -326,6 +326,7 @@ static void PreloadDexCachesResolveMethod(Handle<mirror::DexCache> dex_cache, ui break; default: LOG(FATAL) << "Unreachable - invocation type: " << invoke_type; + UNREACHABLE(); } if (method == NULL) { return; diff --git a/runtime/native/java_lang_System.cc b/runtime/native/java_lang_System.cc index ee99e78067..43681a70fd 100644 --- a/runtime/native/java_lang_System.cc +++ b/runtime/native/java_lang_System.cc @@ -93,7 +93,7 @@ static void System_arraycopy(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, switch (dstComponentPrimitiveType) { case Primitive::kPrimVoid: LOG(FATAL) << "Unreachable, cannot have arrays of type void"; - return; + UNREACHABLE(); case Primitive::kPrimBoolean: case Primitive::kPrimByte: DCHECK_EQ(Primitive::ComponentSize(dstComponentPrimitiveType), 1U); @@ -122,7 +122,7 @@ static void System_arraycopy(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, } default: LOG(FATAL) << "Unknown array type: " << PrettyTypeOf(srcArray); - return; + UNREACHABLE(); } } // If one of the arrays holds a primitive type the other array must hold the exact same type. diff --git a/runtime/quick_exception_handler.h b/runtime/quick_exception_handler.h index b93769cb97..cf1ecbf29a 100644 --- a/runtime/quick_exception_handler.h +++ b/runtime/quick_exception_handler.h @@ -40,6 +40,7 @@ class QuickExceptionHandler { ~QuickExceptionHandler() { LOG(FATAL) << "UNREACHABLE"; // Expected to take long jump. + UNREACHABLE(); } void FindCatch(const ThrowLocation& throw_location, mirror::Throwable* exception, diff --git a/runtime/stack.cc b/runtime/stack.cc index 0cdc984e87..0adf0313ff 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -127,7 +127,8 @@ mirror::Object* StackVisitor::GetThisObject() const { } } else if (m->IsOptimized()) { // TODO: Implement, currently only used for exceptions when jdwp is enabled. - LOG(WARNING) << "StackVisitor::GetThisObject is unimplemented with the optimizing compiler"; + UNIMPLEMENTED(WARNING) + << "StackVisitor::GetThisObject is unimplemented with the optimizing compiler"; return nullptr; } else { const DexFile::CodeItem* code_item = m->GetCodeItem(); diff --git a/runtime/stack_map.h b/runtime/stack_map.h index b1c46a9771..a58ecab17d 100644 --- a/runtime/stack_map.h +++ b/runtime/stack_map.h @@ -286,7 +286,7 @@ class CodeInfo { } } LOG(FATAL) << "Unreachable"; - return StackMap(MemoryRegion()); + UNREACHABLE(); } StackMap GetStackMapForNativePcOffset(uint32_t native_pc_offset) { @@ -298,7 +298,7 @@ class CodeInfo { } } LOG(FATAL) << "Unreachable"; - return StackMap(MemoryRegion()); + UNREACHABLE(); } private: diff --git a/runtime/thread.cc b/runtime/thread.cc index 9c04133e3a..da82c766f0 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -1971,6 +1971,7 @@ void Thread::QuickDeliverException() { exception_handler.UpdateInstrumentationStack(); exception_handler.DoLongJump(); LOG(FATAL) << "UNREACHABLE"; + UNREACHABLE(); } Context* Thread::GetLongJumpContext() { |