From bbc6e7edb5fca4a61ac53dd9bce79cb4f0bb3403 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Fri, 24 Aug 2018 16:58:47 +0100 Subject: Use 'final' and 'override' specifiers directly in ART. Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with 'final' and 'override' specifiers. Remove all definitions of these macros as well, which were located in these files: - libartbase/base/macros.h - test/913-heaps/heaps.cc - test/ti-agent/ti_macros.h ART is now using C++14; the 'final' and 'override' specifiers have been introduced in C++11. Test: mmma art Change-Id: I256c7758155a71a2940ef2574925a44076feeebf --- compiler/utils/jni_macro_assembler.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compiler/utils/jni_macro_assembler.h') diff --git a/compiler/utils/jni_macro_assembler.h b/compiler/utils/jni_macro_assembler.h index f5df926749..e0c2992dea 100644 --- a/compiler/utils/jni_macro_assembler.h +++ b/compiler/utils/jni_macro_assembler.h @@ -259,19 +259,19 @@ inline JNIMacroLabel::~JNIMacroLabel() { template class JNIMacroAssemblerFwd : public JNIMacroAssembler { public: - void FinalizeCode() OVERRIDE { + void FinalizeCode() override { asm_.FinalizeCode(); } - size_t CodeSize() const OVERRIDE { + size_t CodeSize() const override { return asm_.CodeSize(); } - void FinalizeInstructions(const MemoryRegion& region) OVERRIDE { + void FinalizeInstructions(const MemoryRegion& region) override { asm_.FinalizeInstructions(region); } - DebugFrameOpCodeWriterForAssembler& cfi() OVERRIDE { + DebugFrameOpCodeWriterForAssembler& cfi() override { return asm_.cfi(); } @@ -299,7 +299,7 @@ class JNIMacroLabelCommon : public JNIMacroLabel { JNIMacroLabelCommon() : JNIMacroLabel(kIsa) { } - virtual ~JNIMacroLabelCommon() OVERRIDE {} + virtual ~JNIMacroLabelCommon() override {} private: PlatformLabel label_; -- cgit v1.2.3-59-g8ed1b From f73cacaae3d8f89327d8886b37792a849cabd9ac Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Fri, 24 Aug 2018 17:19:07 +0100 Subject: Remove superfluous 'virtual' specifiers in ART. Remove 'virtual' specifier on methods already bearing the 'override' specifier. Test: mmma art Change-Id: I114930969a5ca048d88de9ecd18e2c6403593e31 --- compiler/driver/compiler_driver.cc | 8 ++--- compiler/utils/jni_macro_assembler.h | 2 +- compiler/utils/x86/jni_macro_assembler_x86.cc | 2 +- .../utils/x86_64/jni_macro_assembler_x86_64.cc | 2 +- compiler/utils/x86_64/jni_macro_assembler_x86_64.h | 2 +- dex2oat/dex2oat_image_test.cc | 2 +- dex2oat/dex2oat_test.cc | 2 +- dex2oat/linker/elf_writer_quick.cc | 2 +- dex2oat/linker/image_writer.cc | 2 +- dex2oat/linker/oat_writer.cc | 9 +++--- dexlayout/dex_ir.h | 4 +-- dexlayout/dex_ir_builder.cc | 2 +- imgdiag/imgdiag.cc | 13 ++++---- imgdiag/imgdiag_test.cc | 2 +- libartbase/base/common_art_test.h | 4 +-- libdexfile/dex/art_dex_file_loader.cc | 2 +- libdexfile/dex/compact_dex_file.h | 10 +++--- libdexfile/dex/dex_file_loader.cc | 2 +- libdexfile/dex/standard_dex_file.h | 8 ++--- oatdump/oatdump.cc | 11 +++---- runtime/arch/x86/instruction_set_features_x86.h | 4 +-- runtime/class_linker_test.cc | 2 +- runtime/common_runtime_test.h | 4 +-- runtime/dex2oat_environment_test.h | 6 ++-- runtime/dexopt_test.h | 4 +-- runtime/gc/accounting/mod_union_table.h | 26 +++++++-------- runtime/gc/accounting/mod_union_table_test.cc | 6 ++-- runtime/gc/collector/concurrent_copying.cc | 6 ++-- runtime/gc/collector/concurrent_copying.h | 37 +++++++++++----------- runtime/gc/collector/mark_sweep.cc | 5 ++- runtime/gc/collector/mark_sweep.h | 29 ++++++++--------- runtime/gc/collector/partial_mark_sweep.h | 4 +-- runtime/gc/collector/semi_space.h | 25 ++++++++------- runtime/gc/collector/sticky_mark_sweep.h | 3 +- runtime/gc/heap.cc | 14 ++++---- runtime/gc/space/dlmalloc_space.h | 25 ++++++++------- runtime/gc/space/large_object_space.h | 2 +- runtime/gc/space/space.h | 2 +- runtime/gc/task_processor_test.cc | 6 ++-- runtime/jni/java_vm_ext_test.cc | 2 +- runtime/jni/jni_internal_test.cc | 2 +- runtime/mirror/dex_cache_test.cc | 2 +- runtime/monitor.cc | 2 +- runtime/runtime_callbacks_test.cc | 16 +++++----- runtime/verifier/reg_type.h | 6 ++-- test/common/stack_inspect.cc | 2 +- tools/art_verifier/art_verifier.cc | 5 ++- 47 files changed, 168 insertions(+), 170 deletions(-) (limited to 'compiler/utils/jni_macro_assembler.h') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index fd7a35f16a..21975dee68 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -971,7 +971,7 @@ class ResolveCatchBlockExceptionsClassVisitor : public ClassVisitor { public: ResolveCatchBlockExceptionsClassVisitor() : classes_() {} - virtual bool operator()(ObjPtr c) override REQUIRES_SHARED(Locks::mutator_lock_) { + bool operator()(ObjPtr c) override REQUIRES_SHARED(Locks::mutator_lock_) { classes_.push_back(c); return true; } @@ -1888,7 +1888,7 @@ class VerifyClassVisitor : public CompilationVisitor { VerifyClassVisitor(const ParallelCompilationManager* manager, verifier::HardFailLogMode log_level) : manager_(manager), log_level_(log_level) {} - virtual void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) override { + void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) override { ScopedTrace trace(__FUNCTION__); ScopedObjectAccess soa(Thread::Current()); const DexFile& dex_file = *manager_->GetDexFile(); @@ -2020,7 +2020,7 @@ class SetVerifiedClassVisitor : public CompilationVisitor { public: explicit SetVerifiedClassVisitor(const ParallelCompilationManager* manager) : manager_(manager) {} - virtual void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) override { + void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) override { ScopedTrace trace(__FUNCTION__); ScopedObjectAccess soa(Thread::Current()); const DexFile& dex_file = *manager_->GetDexFile(); @@ -2470,7 +2470,7 @@ class InitializeArrayClassesAndCreateConflictTablesVisitor : public ClassVisitor explicit InitializeArrayClassesAndCreateConflictTablesVisitor(VariableSizedHandleScope& hs) : hs_(hs) {} - virtual bool operator()(ObjPtr klass) override + bool operator()(ObjPtr klass) override REQUIRES_SHARED(Locks::mutator_lock_) { if (Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(klass)) { return true; diff --git a/compiler/utils/jni_macro_assembler.h b/compiler/utils/jni_macro_assembler.h index e0c2992dea..e6130cfc4c 100644 --- a/compiler/utils/jni_macro_assembler.h +++ b/compiler/utils/jni_macro_assembler.h @@ -299,7 +299,7 @@ class JNIMacroLabelCommon : public JNIMacroLabel { JNIMacroLabelCommon() : JNIMacroLabel(kIsa) { } - virtual ~JNIMacroLabelCommon() override {} + ~JNIMacroLabelCommon() override {} private: PlatformLabel label_; diff --git a/compiler/utils/x86/jni_macro_assembler_x86.cc b/compiler/utils/x86/jni_macro_assembler_x86.cc index df946bd229..540d72b28d 100644 --- a/compiler/utils/x86/jni_macro_assembler_x86.cc +++ b/compiler/utils/x86/jni_macro_assembler_x86.cc @@ -28,7 +28,7 @@ namespace x86 { class X86ExceptionSlowPath final : public SlowPath { public: explicit X86ExceptionSlowPath(size_t stack_adjust) : stack_adjust_(stack_adjust) {} - virtual void Emit(Assembler *sp_asm) override; + void Emit(Assembler *sp_asm) override; private: const size_t stack_adjust_; }; diff --git a/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc b/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc index d5c0878c95..5924a8bd08 100644 --- a/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc +++ b/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc @@ -577,7 +577,7 @@ void X86_64JNIMacroAssembler::GetCurrentThread(FrameOffset offset, ManagedRegist class X86_64ExceptionSlowPath final : public SlowPath { public: explicit X86_64ExceptionSlowPath(size_t stack_adjust) : stack_adjust_(stack_adjust) {} - virtual void Emit(Assembler *sp_asm) override; + void Emit(Assembler *sp_asm) override; private: const size_t stack_adjust_; }; diff --git a/compiler/utils/x86_64/jni_macro_assembler_x86_64.h b/compiler/utils/x86_64/jni_macro_assembler_x86_64.h index 4411558340..465ebbe6c3 100644 --- a/compiler/utils/x86_64/jni_macro_assembler_x86_64.h +++ b/compiler/utils/x86_64/jni_macro_assembler_x86_64.h @@ -165,7 +165,7 @@ class X86_64JNIMacroAssembler final : public JNIMacroAssemblerFwd class_loader) override + void Visit(ObjPtr class_loader) override REQUIRES_SHARED(Locks::mutator_lock_) { PruneClassesVisitor classes_visitor(image_writer_, class_loader); ClassTable* class_table = diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc index 4748c155f1..e8f57f5025 100644 --- a/dex2oat/linker/oat_writer.cc +++ b/dex2oat/linker/oat_writer.cc @@ -1248,7 +1248,7 @@ class OatWriter::LayoutReserveOffsetCodeMethodVisitor : public OrderedMethodVisi std::move(ordered_methods)) { } - virtual bool VisitComplete() override { + bool VisitComplete() override { offset_ = writer_->relative_patcher_->ReserveSpaceEnd(offset_); if (generate_debug_info_) { std::vector thunk_infos = @@ -1260,8 +1260,7 @@ class OatWriter::LayoutReserveOffsetCodeMethodVisitor : public OrderedMethodVisi return true; } - virtual bool VisitMethod(const OrderedMethodData& method_data) - override + bool VisitMethod(const OrderedMethodData& method_data) override REQUIRES_SHARED(Locks::mutator_lock_) { OatClass* oat_class = method_data.oat_class; CompiledMethod* compiled_method = method_data.compiled_method; @@ -1652,7 +1651,7 @@ class OatWriter::WriteCodeMethodVisitor : public OrderedMethodVisitor { } } - virtual bool VisitStart() override { + bool VisitStart() override { return true; } @@ -1681,7 +1680,7 @@ class OatWriter::WriteCodeMethodVisitor : public OrderedMethodVisitor { return true; } - virtual bool VisitMethod(const OrderedMethodData& method_data) override + bool VisitMethod(const OrderedMethodData& method_data) override REQUIRES_SHARED(Locks::mutator_lock_) { const MethodReference& method_ref = method_data.method_reference; UpdateDexFileAndDexCache(method_ref.dex_file); diff --git a/dexlayout/dex_ir.h b/dexlayout/dex_ir.h index b02ae50c70..178a4d4df1 100644 --- a/dexlayout/dex_ir.h +++ b/dexlayout/dex_ir.h @@ -233,7 +233,7 @@ template class CollectionVector : public CollectionBase { // Preallocate so that assignment does not invalidate pointers into the vector. collection_.reserve(size); } - virtual ~CollectionVector() override { } + ~CollectionVector() override { } template T* CreateAndAddItem(Args&&... args) { @@ -242,7 +242,7 @@ template class CollectionVector : public CollectionBase { return object; } - virtual uint32_t Size() const override { return collection_.size(); } + uint32_t Size() const override { return collection_.size(); } Iterator begin() const { return Iterator(collection_, 0U, Size()); } Iterator end() const { return Iterator(collection_, Size(), Size()); } diff --git a/dexlayout/dex_ir_builder.cc b/dexlayout/dex_ir_builder.cc index 601d7838e2..ca6ff9e514 100644 --- a/dexlayout/dex_ir_builder.cc +++ b/dexlayout/dex_ir_builder.cc @@ -92,7 +92,7 @@ static uint32_t GetDebugInfoStreamSize(const uint8_t* debug_info_stream) { template class CollectionMap : public CollectionBase { public: CollectionMap() = default; - virtual ~CollectionMap() override { } + ~CollectionMap() override { } template T* CreateAndAddItem(CollectionVector& vector, diff --git a/imgdiag/imgdiag.cc b/imgdiag/imgdiag.cc index 420cd123c5..ebc18fc5ff 100644 --- a/imgdiag/imgdiag.cc +++ b/imgdiag/imgdiag.cc @@ -347,9 +347,9 @@ class ImgObjectVisitor : public ObjectVisitor { begin_image_ptr_(begin_image_ptr), dirty_pages_(dirty_pages) { } - virtual ~ImgObjectVisitor() override { } + ~ImgObjectVisitor() override { } - virtual void Visit(mirror::Object* object) override REQUIRES_SHARED(Locks::mutator_lock_) { + void Visit(mirror::Object* object) override REQUIRES_SHARED(Locks::mutator_lock_) { // Sanity check that we are reading a real mirror::Object CHECK(object->GetClass() != nullptr) << "Image object at address " << object @@ -658,8 +658,8 @@ class ImgArtMethodVisitor : public ArtMethodVisitor { dirty_func_(std::move(dirty_func)), begin_image_ptr_(begin_image_ptr), dirty_pages_(dirty_pages) { } - virtual ~ImgArtMethodVisitor() override { } - virtual void Visit(ArtMethod* method) override { + ~ImgArtMethodVisitor() override { } + void Visit(ArtMethod* method) override { dirty_func_(method, begin_image_ptr_, dirty_pages_); } @@ -1671,8 +1671,7 @@ struct ImgDiagArgs : public CmdlineArgs { protected: using Base = CmdlineArgs; - virtual ParseStatus ParseCustom(const StringPiece& option, - std::string* error_msg) override { + ParseStatus ParseCustom(const StringPiece& option, std::string* error_msg) override { { ParseStatus base_parse = Base::ParseCustom(option, error_msg); if (base_parse != kParseUnknownArgument) { @@ -1703,7 +1702,7 @@ struct ImgDiagArgs : public CmdlineArgs { return kParseOk; } - virtual ParseStatus ParseChecks(std::string* error_msg) override { + ParseStatus ParseChecks(std::string* error_msg) override { // Perform the parent checks. ParseStatus parent_checks = Base::ParseChecks(error_msg); if (parent_checks != kParseOk) { diff --git a/imgdiag/imgdiag_test.cc b/imgdiag/imgdiag_test.cc index c46aaf4f72..cb40c7d89d 100644 --- a/imgdiag/imgdiag_test.cc +++ b/imgdiag/imgdiag_test.cc @@ -57,7 +57,7 @@ class ImgDiagTest : public CommonRuntimeTest { boot_image_location_ = image_spaces[0]->GetImageLocation(); } - virtual void SetUpRuntimeOptions(RuntimeOptions* options) override { + void SetUpRuntimeOptions(RuntimeOptions* options) override { // Needs to live until CommonRuntimeTest::SetUp finishes, since we pass it a cstring. runtime_args_image_ = android::base::StringPrintf("-Ximage:%s", GetCoreArtLocation().c_str()); options->push_back(std::make_pair(runtime_args_image_, nullptr)); diff --git a/libartbase/base/common_art_test.h b/libartbase/base/common_art_test.h index 95f2cbbcf2..d645fa11a4 100644 --- a/libartbase/base/common_art_test.h +++ b/libartbase/base/common_art_test.h @@ -209,11 +209,11 @@ class CommonArtTestBase : public TestType, public CommonArtTestImpl { virtual ~CommonArtTestBase() {} protected: - virtual void SetUp() override { + void SetUp() override { CommonArtTestImpl::SetUp(); } - virtual void TearDown() override { + void TearDown() override { CommonArtTestImpl::TearDown(); } }; diff --git a/libdexfile/dex/art_dex_file_loader.cc b/libdexfile/dex/art_dex_file_loader.cc index f50bf1cc9f..eb7d3d3308 100644 --- a/libdexfile/dex/art_dex_file_loader.cc +++ b/libdexfile/dex/art_dex_file_loader.cc @@ -40,7 +40,7 @@ namespace { class MemMapContainer : public DexFileContainer { public: explicit MemMapContainer(MemMap&& mem_map) : mem_map_(std::move(mem_map)) { } - virtual ~MemMapContainer() override { } + ~MemMapContainer() override { } int GetPermissions() override { if (!mem_map_.IsValid()) { diff --git a/libdexfile/dex/compact_dex_file.h b/libdexfile/dex/compact_dex_file.h index 6db68c025d..8eade6dba8 100644 --- a/libdexfile/dex/compact_dex_file.h +++ b/libdexfile/dex/compact_dex_file.h @@ -253,15 +253,15 @@ class CompactDexFile : public DexFile { // Returns true if the byte string points to the magic value. static bool IsMagicValid(const uint8_t* magic); - virtual bool IsMagicValid() const override; + bool IsMagicValid() const override; // Returns true if the byte string after the magic is the correct value. static bool IsVersionValid(const uint8_t* magic); - virtual bool IsVersionValid() const override; + bool IsVersionValid() const override; // TODO This is completely a guess. We really need to do better. b/72402467 // We ask for 64 megabytes which should be big enough for any realistic dex file. - virtual size_t GetDequickenedSize() const override { + size_t GetDequickenedSize() const override { return 64 * MB; } @@ -269,7 +269,7 @@ class CompactDexFile : public DexFile { return down_cast(DexFile::GetHeader()); } - virtual bool SupportsDefaultMethods() const override; + bool SupportsDefaultMethods() const override; uint32_t GetCodeItemSize(const DexFile::CodeItem& item) const override; @@ -281,7 +281,7 @@ class CompactDexFile : public DexFile { size_t base_size, const uint8_t* data_begin, size_t data_size); - virtual uint32_t CalculateChecksum() const override; + uint32_t CalculateChecksum() const override; private: CompactDexFile(const uint8_t* base, diff --git a/libdexfile/dex/dex_file_loader.cc b/libdexfile/dex/dex_file_loader.cc index d9e483d643..400c32b519 100644 --- a/libdexfile/dex/dex_file_loader.cc +++ b/libdexfile/dex/dex_file_loader.cc @@ -36,7 +36,7 @@ namespace { class VectorContainer : public DexFileContainer { public: explicit VectorContainer(std::vector&& vector) : vector_(std::move(vector)) { } - virtual ~VectorContainer() override { } + ~VectorContainer() override { } int GetPermissions() override { return 0; diff --git a/libdexfile/dex/standard_dex_file.h b/libdexfile/dex/standard_dex_file.h index a2896353de..fd7e78f19f 100644 --- a/libdexfile/dex/standard_dex_file.h +++ b/libdexfile/dex/standard_dex_file.h @@ -73,17 +73,17 @@ class StandardDexFile : public DexFile { // Returns true if the byte string points to the magic value. static bool IsMagicValid(const uint8_t* magic); - virtual bool IsMagicValid() const override; + bool IsMagicValid() const override; // Returns true if the byte string after the magic is the correct value. static bool IsVersionValid(const uint8_t* magic); - virtual bool IsVersionValid() const override; + bool IsVersionValid() const override; - virtual bool SupportsDefaultMethods() const override; + bool SupportsDefaultMethods() const override; uint32_t GetCodeItemSize(const DexFile::CodeItem& item) const override; - virtual size_t GetDequickenedSize() const override { + size_t GetDequickenedSize() const override { return Size(); } diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index 5e56c9adf2..fdf43d7632 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -1980,7 +1980,7 @@ class ImageDumper { public: explicit DumpArtMethodVisitor(ImageDumper* image_dumper) : image_dumper_(image_dumper) {} - virtual void Visit(ArtMethod* method) override REQUIRES_SHARED(Locks::mutator_lock_) { + void Visit(ArtMethod* method) override REQUIRES_SHARED(Locks::mutator_lock_) { std::ostream& indent_os = image_dumper_->vios_.Stream(); indent_os << method << " " << " ArtMethod: " << ArtMethod::PrettyMethod(method) << "\n"; image_dumper_->DumpMethod(method, indent_os); @@ -3350,8 +3350,7 @@ struct OatdumpArgs : public CmdlineArgs { protected: using Base = CmdlineArgs; - virtual ParseStatus ParseCustom(const StringPiece& option, - std::string* error_msg) override { + ParseStatus ParseCustom(const StringPiece& option, std::string* error_msg) override { { ParseStatus base_parse = Base::ParseCustom(option, error_msg); if (base_parse != kParseUnknownArgument) { @@ -3408,7 +3407,7 @@ struct OatdumpArgs : public CmdlineArgs { return kParseOk; } - virtual ParseStatus ParseChecks(std::string* error_msg) override { + ParseStatus ParseChecks(std::string* error_msg) override { // Infer boot image location from the image location if possible. if (boot_image_location_ == nullptr) { boot_image_location_ = image_location_; @@ -3536,7 +3535,7 @@ struct OatdumpArgs : public CmdlineArgs { }; struct OatdumpMain : public CmdlineMain { - virtual bool NeedsRuntime() override { + bool NeedsRuntime() override { CHECK(args_ != nullptr); // If we are only doing the oat file, disable absolute_addresses. Keep them for image dumping. @@ -3563,7 +3562,7 @@ struct OatdumpMain : public CmdlineMain { !args_->symbolize_; } - virtual bool ExecuteWithoutRuntime() override { + bool ExecuteWithoutRuntime() override { CHECK(args_ != nullptr); CHECK(args_->oat_filename_ != nullptr); diff --git a/runtime/arch/x86/instruction_set_features_x86.h b/runtime/arch/x86/instruction_set_features_x86.h index acf13c491e..6bd626319e 100644 --- a/runtime/arch/x86/instruction_set_features_x86.h +++ b/runtime/arch/x86/instruction_set_features_x86.h @@ -53,7 +53,7 @@ class X86InstructionSetFeatures : public InstructionSetFeatures { bool HasAtLeast(const InstructionSetFeatures* other) const override; - virtual InstructionSet GetInstructionSet() const override { + InstructionSet GetInstructionSet() const override { return InstructionSet::kX86; } @@ -69,7 +69,7 @@ class X86InstructionSetFeatures : public InstructionSetFeatures { protected: // Parse a string of the form "ssse3" adding these to a new InstructionSetFeatures. - virtual std::unique_ptr + std::unique_ptr AddFeaturesFromSplitString(const std::vector& features, std::string* error_msg) const override { return AddFeaturesFromSplitString(features, false, error_msg); diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc index 52ddd13ab7..ab7182a75e 100644 --- a/runtime/class_linker_test.cc +++ b/runtime/class_linker_test.cc @@ -450,7 +450,7 @@ class ClassLinkerTest : public CommonRuntimeTest { class ClassLinkerMethodHandlesTest : public ClassLinkerTest { protected: - virtual void SetUpRuntimeOptions(RuntimeOptions* options) override { + void SetUpRuntimeOptions(RuntimeOptions* options) override { CommonRuntimeTest::SetUpRuntimeOptions(options); } }; diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h index bf17e644af..a5157df36b 100644 --- a/runtime/common_runtime_test.h +++ b/runtime/common_runtime_test.h @@ -157,11 +157,11 @@ class CommonRuntimeTestBase : public TestType, public CommonRuntimeTestImpl { virtual ~CommonRuntimeTestBase() {} protected: - virtual void SetUp() override { + void SetUp() override { CommonRuntimeTestImpl::SetUp(); } - virtual void TearDown() override { + void TearDown() override { CommonRuntimeTestImpl::TearDown(); } }; diff --git a/runtime/dex2oat_environment_test.h b/runtime/dex2oat_environment_test.h index 0b99722652..2cbf557c1f 100644 --- a/runtime/dex2oat_environment_test.h +++ b/runtime/dex2oat_environment_test.h @@ -42,7 +42,7 @@ namespace art { // Test class that provides some helpers to set a test up for compilation using dex2oat. class Dex2oatEnvironmentTest : public CommonRuntimeTest { public: - virtual void SetUp() override { + void SetUp() override { CommonRuntimeTest::SetUp(); const ArtDexFileLoader dex_file_loader; @@ -106,7 +106,7 @@ class Dex2oatEnvironmentTest : public CommonRuntimeTest { ASSERT_NE(multi1[1]->GetLocationChecksum(), multi2[1]->GetLocationChecksum()); } - virtual void SetUpRuntimeOptions(RuntimeOptions* options) override { + void SetUpRuntimeOptions(RuntimeOptions* options) override { // options->push_back(std::make_pair("-verbose:oat", nullptr)); // Set up the image location. @@ -117,7 +117,7 @@ class Dex2oatEnvironmentTest : public CommonRuntimeTest { callbacks_.reset(); } - virtual void TearDown() override { + void TearDown() override { ClearDirectory(odex_dir_.c_str()); ASSERT_EQ(0, rmdir(odex_dir_.c_str())); diff --git a/runtime/dexopt_test.h b/runtime/dexopt_test.h index b4e52ac49c..df7181a1e7 100644 --- a/runtime/dexopt_test.h +++ b/runtime/dexopt_test.h @@ -26,11 +26,11 @@ namespace art { class DexoptTest : public Dex2oatEnvironmentTest { public: - virtual void SetUp() override; + void SetUp() override; virtual void PreRuntimeCreate(); - virtual void PostRuntimeCreate() override; + void PostRuntimeCreate() override; // Generate an oat file for the purposes of test. // The oat file will be generated for dex_location in the given oat_location diff --git a/runtime/gc/accounting/mod_union_table.h b/runtime/gc/accounting/mod_union_table.h index ec6f144fd9..8c471bc6c2 100644 --- a/runtime/gc/accounting/mod_union_table.h +++ b/runtime/gc/accounting/mod_union_table.h @@ -132,7 +132,7 @@ class ModUnionTableReferenceCache : public ModUnionTable { REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::heap_bitmap_lock_); - virtual void VisitObjects(ObjectCallback callback, void* arg) override + void VisitObjects(ObjectCallback callback, void* arg) override REQUIRES(Locks::heap_bitmap_lock_) REQUIRES_SHARED(Locks::mutator_lock_); @@ -145,13 +145,13 @@ class ModUnionTableReferenceCache : public ModUnionTable { // Function that tells whether or not to add a reference to the table. virtual bool ShouldAddReference(const mirror::Object* ref) const = 0; - virtual bool ContainsCardFor(uintptr_t addr) override; + bool ContainsCardFor(uintptr_t addr) override; - virtual void Dump(std::ostream& os) override REQUIRES_SHARED(Locks::mutator_lock_); + void Dump(std::ostream& os) override REQUIRES_SHARED(Locks::mutator_lock_); - virtual void SetCards() override; + void SetCards() override; - virtual void ClearTable() override; + void ClearTable() override; protected: // Cleared card array, used to update the mod-union table. @@ -172,27 +172,27 @@ class ModUnionTableCardCache : public ModUnionTable { virtual ~ModUnionTableCardCache() {} // Clear and store cards for a space. - virtual void ProcessCards() override; + void ProcessCards() override; // Mark all references to the alloc space(s). - virtual void UpdateAndMarkReferences(MarkObjectVisitor* visitor) override + void UpdateAndMarkReferences(MarkObjectVisitor* visitor) override REQUIRES(Locks::heap_bitmap_lock_) REQUIRES_SHARED(Locks::mutator_lock_); - virtual void VisitObjects(ObjectCallback callback, void* arg) override + void VisitObjects(ObjectCallback callback, void* arg) override REQUIRES(Locks::heap_bitmap_lock_) REQUIRES_SHARED(Locks::mutator_lock_); // Nothing to verify. - virtual void Verify() override {} + void Verify() override {} - virtual void Dump(std::ostream& os) override; + void Dump(std::ostream& os) override; - virtual bool ContainsCardFor(uintptr_t addr) override; + bool ContainsCardFor(uintptr_t addr) override; - virtual void SetCards() override; + void SetCards() override; - virtual void ClearTable() override; + void ClearTable() override; protected: // Cleared card bitmap, used to update the mod-union table. diff --git a/runtime/gc/accounting/mod_union_table_test.cc b/runtime/gc/accounting/mod_union_table_test.cc index 5aa55506a5..2a382d7df1 100644 --- a/runtime/gc/accounting/mod_union_table_test.cc +++ b/runtime/gc/accounting/mod_union_table_test.cc @@ -97,13 +97,13 @@ class ModUnionTableTest : public CommonRuntimeTest { class CollectVisitedVisitor : public MarkObjectVisitor { public: explicit CollectVisitedVisitor(std::set* out) : out_(out) {} - virtual void MarkHeapReference(mirror::HeapReference* ref, - bool do_atomic_update ATTRIBUTE_UNUSED) override + void MarkHeapReference(mirror::HeapReference* ref, + bool do_atomic_update ATTRIBUTE_UNUSED) override REQUIRES_SHARED(Locks::mutator_lock_) { DCHECK(ref != nullptr); MarkObject(ref->AsMirrorPtr()); } - virtual mirror::Object* MarkObject(mirror::Object* obj) override + mirror::Object* MarkObject(mirror::Object* obj) override REQUIRES_SHARED(Locks::mutator_lock_) { DCHECK(obj != nullptr); out_->insert(obj); diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc index f73ecf1c49..3ea88d6ec7 100644 --- a/runtime/gc/collector/concurrent_copying.cc +++ b/runtime/gc/collector/concurrent_copying.cc @@ -393,7 +393,7 @@ class ConcurrentCopying::ThreadFlipVisitor : public Closure, public RootVisitor : concurrent_copying_(concurrent_copying), use_tlab_(use_tlab) { } - virtual void Run(Thread* thread) override REQUIRES_SHARED(Locks::mutator_lock_) { + void Run(Thread* thread) override REQUIRES_SHARED(Locks::mutator_lock_) { // Note: self is not necessarily equal to thread since thread may be suspended. Thread* self = Thread::Current(); CHECK(thread == self || thread->IsSuspended() || thread->GetState() == kWaitingPerformingGc) @@ -467,7 +467,7 @@ class ConcurrentCopying::FlipCallback : public Closure { : concurrent_copying_(concurrent_copying) { } - virtual void Run(Thread* thread) override REQUIRES(Locks::mutator_lock_) { + void Run(Thread* thread) override REQUIRES(Locks::mutator_lock_) { ConcurrentCopying* cc = concurrent_copying_; TimingLogger::ScopedTiming split("(Paused)FlipCallback", cc->GetTimings()); // Note: self is not necessarily equal to thread since thread may be suspended. @@ -1457,7 +1457,7 @@ class ConcurrentCopying::RevokeThreadLocalMarkStackCheckpoint : public Closure { disable_weak_ref_access_(disable_weak_ref_access) { } - virtual void Run(Thread* thread) override NO_THREAD_SAFETY_ANALYSIS { + void Run(Thread* thread) override NO_THREAD_SAFETY_ANALYSIS { // Note: self is not necessarily equal to thread since thread may be suspended. Thread* self = Thread::Current(); CHECK(thread == self || thread->IsSuspended() || thread->GetState() == kWaitingPerformingGc) diff --git a/runtime/gc/collector/concurrent_copying.h b/runtime/gc/collector/concurrent_copying.h index a956d3807a..1a7464a05f 100644 --- a/runtime/gc/collector/concurrent_copying.h +++ b/runtime/gc/collector/concurrent_copying.h @@ -71,7 +71,7 @@ class ConcurrentCopying : public GarbageCollector { bool measure_read_barrier_slow_path = false); ~ConcurrentCopying(); - virtual void RunPhases() override + void RunPhases() override REQUIRES(!immune_gray_stack_lock_, !mark_stack_lock_, !rb_slow_path_histogram_lock_, @@ -87,15 +87,15 @@ class ConcurrentCopying : public GarbageCollector { void BindBitmaps() REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Locks::heap_bitmap_lock_); - virtual GcType GetGcType() const override { + GcType GetGcType() const override { return (kEnableGenerationalConcurrentCopyingCollection && young_gen_) ? kGcTypeSticky : kGcTypePartial; } - virtual CollectorType GetCollectorType() const override { + CollectorType GetCollectorType() const override { return kCollectorTypeCC; } - virtual void RevokeAllThreadLocalBuffers() override; + void RevokeAllThreadLocalBuffers() override; void SetRegionSpace(space::RegionSpace* region_space) { DCHECK(region_space != nullptr); region_space_ = region_space; @@ -144,7 +144,7 @@ class ConcurrentCopying : public GarbageCollector { void RevokeThreadLocalMarkStack(Thread* thread) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_); - virtual mirror::Object* IsMarked(mirror::Object* from_ref) override + mirror::Object* IsMarked(mirror::Object* from_ref) override REQUIRES_SHARED(Locks::mutator_lock_); private: @@ -166,21 +166,22 @@ class ConcurrentCopying : public GarbageCollector { void Process(mirror::Object* obj, MemberOffset offset) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_ , !skipped_blocks_lock_, !immune_gray_stack_lock_); - virtual void VisitRoots(mirror::Object*** roots, size_t count, const RootInfo& info) - override REQUIRES_SHARED(Locks::mutator_lock_) + void VisitRoots(mirror::Object*** roots, size_t count, const RootInfo& info) override + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_, !skipped_blocks_lock_, !immune_gray_stack_lock_); template void MarkRoot(Thread* const self, mirror::CompressedReference* root) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_, !skipped_blocks_lock_, !immune_gray_stack_lock_); - virtual void VisitRoots(mirror::CompressedReference** roots, size_t count, - const RootInfo& info) - override REQUIRES_SHARED(Locks::mutator_lock_) + void VisitRoots(mirror::CompressedReference** roots, + size_t count, + const RootInfo& info) override + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_, !skipped_blocks_lock_, !immune_gray_stack_lock_); void VerifyNoFromSpaceReferences() REQUIRES(Locks::mutator_lock_); accounting::ObjectStack* GetAllocationStack(); accounting::ObjectStack* GetLiveStack(); - virtual void ProcessMarkStack() override REQUIRES_SHARED(Locks::mutator_lock_) + void ProcessMarkStack() override REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_); bool ProcessMarkStackOnce() REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_); void ProcessMarkStackRef(mirror::Object* to_ref) REQUIRES_SHARED(Locks::mutator_lock_) @@ -204,21 +205,21 @@ class ConcurrentCopying : public GarbageCollector { void SwitchToSharedMarkStackMode() REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_); void SwitchToGcExclusiveMarkStackMode() REQUIRES_SHARED(Locks::mutator_lock_); - virtual void DelayReferenceReferent(ObjPtr klass, - ObjPtr reference) override + void DelayReferenceReferent(ObjPtr klass, + ObjPtr reference) override REQUIRES_SHARED(Locks::mutator_lock_); void ProcessReferences(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_); - virtual mirror::Object* MarkObject(mirror::Object* from_ref) override + mirror::Object* MarkObject(mirror::Object* from_ref) override REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_, !skipped_blocks_lock_, !immune_gray_stack_lock_); - virtual void MarkHeapReference(mirror::HeapReference* from_ref, - bool do_atomic_update) override + void MarkHeapReference(mirror::HeapReference* from_ref, + bool do_atomic_update) override REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_, !skipped_blocks_lock_, !immune_gray_stack_lock_); bool IsMarkedInUnevacFromSpace(mirror::Object* from_ref) REQUIRES_SHARED(Locks::mutator_lock_); - virtual bool IsNullOrMarkedHeapReference(mirror::HeapReference* field, - bool do_atomic_update) override + bool IsNullOrMarkedHeapReference(mirror::HeapReference* field, + bool do_atomic_update) override REQUIRES_SHARED(Locks::mutator_lock_); void SweepSystemWeaks(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Locks::heap_bitmap_lock_); diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc index 840a4b03dc..23b2719bf0 100644 --- a/runtime/gc/collector/mark_sweep.cc +++ b/runtime/gc/collector/mark_sweep.cc @@ -1109,8 +1109,7 @@ class MarkSweep::VerifySystemWeakVisitor : public IsMarkedVisitor { public: explicit VerifySystemWeakVisitor(MarkSweep* mark_sweep) : mark_sweep_(mark_sweep) {} - virtual mirror::Object* IsMarked(mirror::Object* obj) - override + mirror::Object* IsMarked(mirror::Object* obj) override REQUIRES_SHARED(Locks::mutator_lock_, Locks::heap_bitmap_lock_) { mark_sweep_->VerifyIsLive(obj); return obj; @@ -1161,7 +1160,7 @@ class MarkSweep::CheckpointMarkThreadRoots : public Closure, public RootVisitor } } - virtual void Run(Thread* thread) override NO_THREAD_SAFETY_ANALYSIS { + void Run(Thread* thread) override NO_THREAD_SAFETY_ANALYSIS { ScopedTrace trace("Marking thread roots"); // Note: self is not necessarily equal to thread since thread may be suspended. Thread* const self = Thread::Current(); diff --git a/runtime/gc/collector/mark_sweep.h b/runtime/gc/collector/mark_sweep.h index 012e17932f..ff9597cfe7 100644 --- a/runtime/gc/collector/mark_sweep.h +++ b/runtime/gc/collector/mark_sweep.h @@ -57,7 +57,7 @@ class MarkSweep : public GarbageCollector { ~MarkSweep() {} - virtual void RunPhases() override REQUIRES(!mark_stack_lock_); + void RunPhases() override REQUIRES(!mark_stack_lock_); void InitializePhase(); void MarkingPhase() REQUIRES(!mark_stack_lock_) REQUIRES_SHARED(Locks::mutator_lock_); void PausePhase() REQUIRES(Locks::mutator_lock_) REQUIRES(!mark_stack_lock_); @@ -72,11 +72,11 @@ class MarkSweep : public GarbageCollector { return is_concurrent_; } - virtual GcType GetGcType() const override { + GcType GetGcType() const override { return kGcTypeFull; } - virtual CollectorType GetCollectorType() const override { + CollectorType GetCollectorType() const override { return is_concurrent_ ? kCollectorTypeCMS : kCollectorTypeMS; } @@ -187,25 +187,25 @@ class MarkSweep : public GarbageCollector { void VerifyIsLive(const mirror::Object* obj) REQUIRES_SHARED(Locks::mutator_lock_, Locks::heap_bitmap_lock_); - virtual bool IsNullOrMarkedHeapReference(mirror::HeapReference* ref, - bool do_atomic_update) override + bool IsNullOrMarkedHeapReference(mirror::HeapReference* ref, + bool do_atomic_update) override REQUIRES(Locks::heap_bitmap_lock_) REQUIRES_SHARED(Locks::mutator_lock_); - virtual void VisitRoots(mirror::Object*** roots, size_t count, const RootInfo& info) override + void VisitRoots(mirror::Object*** roots, size_t count, const RootInfo& info) override REQUIRES(Locks::heap_bitmap_lock_) REQUIRES(!mark_stack_lock_) REQUIRES_SHARED(Locks::mutator_lock_); - virtual void VisitRoots(mirror::CompressedReference** roots, - size_t count, - const RootInfo& info) override + void VisitRoots(mirror::CompressedReference** roots, + size_t count, + const RootInfo& info) override REQUIRES(Locks::heap_bitmap_lock_) REQUIRES(!mark_stack_lock_) REQUIRES_SHARED(Locks::mutator_lock_); // Marks an object. - virtual mirror::Object* MarkObject(mirror::Object* obj) override + mirror::Object* MarkObject(mirror::Object* obj) override REQUIRES(Locks::heap_bitmap_lock_) REQUIRES(!mark_stack_lock_) REQUIRES_SHARED(Locks::mutator_lock_); @@ -215,8 +215,8 @@ class MarkSweep : public GarbageCollector { REQUIRES(!mark_stack_lock_) REQUIRES_SHARED(Locks::mutator_lock_); - virtual void MarkHeapReference(mirror::HeapReference* ref, - bool do_atomic_update) override + void MarkHeapReference(mirror::HeapReference* ref, + bool do_atomic_update) override REQUIRES(Locks::heap_bitmap_lock_) REQUIRES(!mark_stack_lock_) REQUIRES_SHARED(Locks::mutator_lock_); @@ -231,7 +231,7 @@ class MarkSweep : public GarbageCollector { protected: // Returns object if the object is marked in the heap bitmap, otherwise null. - virtual mirror::Object* IsMarked(mirror::Object* object) override + mirror::Object* IsMarked(mirror::Object* object) override REQUIRES_SHARED(Locks::heap_bitmap_lock_, Locks::mutator_lock_); void MarkObjectNonNull(mirror::Object* obj, @@ -278,8 +278,7 @@ class MarkSweep : public GarbageCollector { REQUIRES(!mark_stack_lock_) REQUIRES_SHARED(Locks::mutator_lock_); - virtual void ProcessMarkStack() - override + void ProcessMarkStack() override REQUIRES(Locks::heap_bitmap_lock_) REQUIRES(!mark_stack_lock_) REQUIRES_SHARED(Locks::mutator_lock_) { diff --git a/runtime/gc/collector/partial_mark_sweep.h b/runtime/gc/collector/partial_mark_sweep.h index 308699bf7e..76c44a35bb 100644 --- a/runtime/gc/collector/partial_mark_sweep.h +++ b/runtime/gc/collector/partial_mark_sweep.h @@ -26,7 +26,7 @@ namespace collector { class PartialMarkSweep : public MarkSweep { public: // Virtual as overridden by StickyMarkSweep. - virtual GcType GetGcType() const override { + GcType GetGcType() const override { return kGcTypePartial; } @@ -37,7 +37,7 @@ class PartialMarkSweep : public MarkSweep { // Bind the live bits to the mark bits of bitmaps for spaces that aren't collected for partial // collections, ie the Zygote space. Also mark this space is immune. Virtual as overridden by // StickyMarkSweep. - virtual void BindBitmaps() override REQUIRES_SHARED(Locks::mutator_lock_); + void BindBitmaps() override REQUIRES_SHARED(Locks::mutator_lock_); private: DISALLOW_IMPLICIT_CONSTRUCTORS(PartialMarkSweep); diff --git a/runtime/gc/collector/semi_space.h b/runtime/gc/collector/semi_space.h index 49cd02e99a..bb42be6cd4 100644 --- a/runtime/gc/collector/semi_space.h +++ b/runtime/gc/collector/semi_space.h @@ -63,7 +63,7 @@ class SemiSpace : public GarbageCollector { ~SemiSpace() {} - virtual void RunPhases() override NO_THREAD_SAFETY_ANALYSIS; + void RunPhases() override NO_THREAD_SAFETY_ANALYSIS; virtual void InitializePhase(); virtual void MarkingPhase() REQUIRES(Locks::mutator_lock_) REQUIRES(!Locks::heap_bitmap_lock_); @@ -72,10 +72,10 @@ class SemiSpace : public GarbageCollector { virtual void FinishPhase() REQUIRES(Locks::mutator_lock_); void MarkReachableObjects() REQUIRES(Locks::mutator_lock_, Locks::heap_bitmap_lock_); - virtual GcType GetGcType() const override { + GcType GetGcType() const override { return kGcTypePartial; } - virtual CollectorType GetCollectorType() const override { + CollectorType GetCollectorType() const override { return generational_ ? kCollectorTypeGSS : kCollectorTypeSS; } @@ -106,11 +106,11 @@ class SemiSpace : public GarbageCollector { void MarkObjectIfNotInToSpace(CompressedReferenceType* obj_ptr) REQUIRES(Locks::heap_bitmap_lock_, Locks::mutator_lock_); - virtual mirror::Object* MarkObject(mirror::Object* root) override + mirror::Object* MarkObject(mirror::Object* root) override REQUIRES(Locks::heap_bitmap_lock_, Locks::mutator_lock_); - virtual void MarkHeapReference(mirror::HeapReference* obj_ptr, - bool do_atomic_update) override + void MarkHeapReference(mirror::HeapReference* obj_ptr, + bool do_atomic_update) override REQUIRES(Locks::heap_bitmap_lock_, Locks::mutator_lock_); void ScanObject(mirror::Object* obj) @@ -145,11 +145,12 @@ class SemiSpace : public GarbageCollector { void SweepSystemWeaks() REQUIRES_SHARED(Locks::heap_bitmap_lock_, Locks::mutator_lock_); - virtual void VisitRoots(mirror::Object*** roots, size_t count, const RootInfo& info) override + void VisitRoots(mirror::Object*** roots, size_t count, const RootInfo& info) override REQUIRES(Locks::mutator_lock_, Locks::heap_bitmap_lock_); - virtual void VisitRoots(mirror::CompressedReference** roots, size_t count, - const RootInfo& info) override + void VisitRoots(mirror::CompressedReference** roots, + size_t count, + const RootInfo& info) override REQUIRES(Locks::mutator_lock_, Locks::heap_bitmap_lock_); virtual mirror::Object* MarkNonForwardedObject(mirror::Object* obj) @@ -162,12 +163,12 @@ class SemiSpace : public GarbageCollector { protected: // Returns null if the object is not marked, otherwise returns the forwarding address (same as // object for non movable things). - virtual mirror::Object* IsMarked(mirror::Object* object) override + mirror::Object* IsMarked(mirror::Object* object) override REQUIRES(Locks::mutator_lock_) REQUIRES_SHARED(Locks::heap_bitmap_lock_); - virtual bool IsNullOrMarkedHeapReference(mirror::HeapReference* object, - bool do_atomic_update) override + bool IsNullOrMarkedHeapReference(mirror::HeapReference* object, + bool do_atomic_update) override REQUIRES(Locks::mutator_lock_) REQUIRES_SHARED(Locks::heap_bitmap_lock_); diff --git a/runtime/gc/collector/sticky_mark_sweep.h b/runtime/gc/collector/sticky_mark_sweep.h index f92a103b13..f65413d153 100644 --- a/runtime/gc/collector/sticky_mark_sweep.h +++ b/runtime/gc/collector/sticky_mark_sweep.h @@ -33,8 +33,7 @@ class StickyMarkSweep final : public PartialMarkSweep { StickyMarkSweep(Heap* heap, bool is_concurrent, const std::string& name_prefix = ""); ~StickyMarkSweep() {} - virtual void MarkConcurrentRoots(VisitRootFlags flags) - override + void MarkConcurrentRoots(VisitRootFlags flags) override REQUIRES(Locks::heap_bitmap_lock_) REQUIRES(!mark_stack_lock_) REQUIRES_SHARED(Locks::mutator_lock_); diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 16fd78630d..b74071b8aa 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -1327,7 +1327,7 @@ class TrimIndirectReferenceTableClosure : public Closure { public: explicit TrimIndirectReferenceTableClosure(Barrier* barrier) : barrier_(barrier) { } - virtual void Run(Thread* thread) override NO_THREAD_SAFETY_ANALYSIS { + void Run(Thread* thread) override NO_THREAD_SAFETY_ANALYSIS { thread->GetJniEnv()->TrimLocals(); // If thread is a running mutator, then act on behalf of the trim thread. // See the code in ThreadList::RunCheckpoint. @@ -2826,7 +2826,7 @@ class VerifyReferenceVisitor : public SingleRootVisitor { root->AsMirrorPtr(), RootInfo(kRootVMInternal)); } - virtual void VisitRoot(mirror::Object* root, const RootInfo& root_info) override + void VisitRoot(mirror::Object* root, const RootInfo& root_info) override REQUIRES_SHARED(Locks::mutator_lock_) { if (root == nullptr) { LOG(ERROR) << "Root is null with info " << root_info.GetType(); @@ -3259,10 +3259,10 @@ void Heap::ProcessCards(TimingLogger* timings, } struct IdentityMarkHeapReferenceVisitor : public MarkObjectVisitor { - virtual mirror::Object* MarkObject(mirror::Object* obj) override { + mirror::Object* MarkObject(mirror::Object* obj) override { return obj; } - virtual void MarkHeapReference(mirror::HeapReference*, bool) override { + void MarkHeapReference(mirror::HeapReference*, bool) override { } }; @@ -3633,7 +3633,7 @@ class Heap::ConcurrentGCTask : public HeapTask { public: ConcurrentGCTask(uint64_t target_time, GcCause cause, bool force_full) : HeapTask(target_time), cause_(cause), force_full_(force_full) {} - virtual void Run(Thread* self) override { + void Run(Thread* self) override { gc::Heap* heap = Runtime::Current()->GetHeap(); heap->ConcurrentGC(self, cause_, force_full_); heap->ClearConcurrentGCRequest(); @@ -3691,7 +3691,7 @@ class Heap::CollectorTransitionTask : public HeapTask { public: explicit CollectorTransitionTask(uint64_t target_time) : HeapTask(target_time) {} - virtual void Run(Thread* self) override { + void Run(Thread* self) override { gc::Heap* heap = Runtime::Current()->GetHeap(); heap->DoPendingCollectorTransition(); heap->ClearPendingCollectorTransition(self); @@ -3733,7 +3733,7 @@ void Heap::RequestCollectorTransition(CollectorType desired_collector_type, uint class Heap::HeapTrimTask : public HeapTask { public: explicit HeapTrimTask(uint64_t delta_time) : HeapTask(NanoTime() + delta_time) { } - virtual void Run(Thread* self) override { + void Run(Thread* self) override { gc::Heap* heap = Runtime::Current()->GetHeap(); heap->Trim(self); heap->ClearPendingTrim(self); diff --git a/runtime/gc/space/dlmalloc_space.h b/runtime/gc/space/dlmalloc_space.h index 09f3970408..c63ff71849 100644 --- a/runtime/gc/space/dlmalloc_space.h +++ b/runtime/gc/space/dlmalloc_space.h @@ -50,27 +50,30 @@ class DlMallocSpace : public MallocSpace { size_t capacity, uint8_t* requested_begin, bool can_move_objects); // Virtual to allow MemoryToolMallocSpace to intercept. - virtual mirror::Object* AllocWithGrowth(Thread* self, size_t num_bytes, size_t* bytes_allocated, - size_t* usable_size, - size_t* bytes_tl_bulk_allocated) - override REQUIRES(!lock_); + mirror::Object* AllocWithGrowth(Thread* self, + size_t num_bytes, + size_t* bytes_allocated, + size_t* usable_size, + size_t* bytes_tl_bulk_allocated) override REQUIRES(!lock_); // Virtual to allow MemoryToolMallocSpace to intercept. - virtual mirror::Object* Alloc(Thread* self, size_t num_bytes, size_t* bytes_allocated, - size_t* usable_size, size_t* bytes_tl_bulk_allocated) - override REQUIRES(!lock_) { + mirror::Object* Alloc(Thread* self, + size_t num_bytes, + size_t* bytes_allocated, + size_t* usable_size, + size_t* bytes_tl_bulk_allocated) override REQUIRES(!lock_) { return AllocNonvirtual(self, num_bytes, bytes_allocated, usable_size, bytes_tl_bulk_allocated); } // Virtual to allow MemoryToolMallocSpace to intercept. - virtual size_t AllocationSize(mirror::Object* obj, size_t* usable_size) override { + size_t AllocationSize(mirror::Object* obj, size_t* usable_size) override { return AllocationSizeNonvirtual(obj, usable_size); } // Virtual to allow MemoryToolMallocSpace to intercept. - virtual size_t Free(Thread* self, mirror::Object* ptr) override + size_t Free(Thread* self, mirror::Object* ptr) override REQUIRES(!lock_) REQUIRES_SHARED(Locks::mutator_lock_); // Virtual to allow MemoryToolMallocSpace to intercept. - virtual size_t FreeList(Thread* self, size_t num_ptrs, mirror::Object** ptrs) override + size_t FreeList(Thread* self, size_t num_ptrs, mirror::Object** ptrs) override REQUIRES(!lock_) REQUIRES_SHARED(Locks::mutator_lock_); @@ -133,7 +136,7 @@ class DlMallocSpace : public MallocSpace { uint64_t GetBytesAllocated() override; uint64_t GetObjectsAllocated() override; - virtual void Clear() override; + void Clear() override; bool IsDlMallocSpace() const override { return true; diff --git a/runtime/gc/space/large_object_space.h b/runtime/gc/space/large_object_space.h index 39ff2c3e43..26c6463319 100644 --- a/runtime/gc/space/large_object_space.h +++ b/runtime/gc/space/large_object_space.h @@ -76,7 +76,7 @@ class LargeObjectSpace : public DiscontinuousSpace, public AllocSpace { return this; } collector::ObjectBytePair Sweep(bool swap_bitmaps); - virtual bool CanMoveObjects() const override { + bool CanMoveObjects() const override { return false; } // Current address at which the space begins, which may vary as the space is filled. diff --git a/runtime/gc/space/space.h b/runtime/gc/space/space.h index 2fe1f82547..545e3d83a4 100644 --- a/runtime/gc/space/space.h +++ b/runtime/gc/space/space.h @@ -352,7 +352,7 @@ class DiscontinuousSpace : public Space { return mark_bitmap_.get(); } - virtual bool IsDiscontinuousSpace() const override { + bool IsDiscontinuousSpace() const override { return true; } diff --git a/runtime/gc/task_processor_test.cc b/runtime/gc/task_processor_test.cc index caa8802823..7cb678ba7a 100644 --- a/runtime/gc/task_processor_test.cc +++ b/runtime/gc/task_processor_test.cc @@ -33,7 +33,7 @@ class RecursiveTask : public HeapTask { : HeapTask(NanoTime() + MsToNs(10)), task_processor_(task_processor), counter_(counter), max_recursion_(max_recursion) { } - virtual void Run(Thread* self) override { + void Run(Thread* self) override { if (max_recursion_ > 0) { task_processor_->AddTask(self, new RecursiveTask(task_processor_, counter_, max_recursion_ - 1)); @@ -52,7 +52,7 @@ class WorkUntilDoneTask : public SelfDeletingTask { WorkUntilDoneTask(TaskProcessor* task_processor, Atomic* done_running) : task_processor_(task_processor), done_running_(done_running) { } - virtual void Run(Thread* self) override { + void Run(Thread* self) override { task_processor_->RunAllTasks(self); done_running_->store(true, std::memory_order_seq_cst); } @@ -105,7 +105,7 @@ class TestOrderTask : public HeapTask { TestOrderTask(uint64_t expected_time, size_t expected_counter, size_t* counter) : HeapTask(expected_time), expected_counter_(expected_counter), counter_(counter) { } - virtual void Run(Thread* thread ATTRIBUTE_UNUSED) override { + void Run(Thread* thread ATTRIBUTE_UNUSED) override { ASSERT_EQ(*counter_, expected_counter_); ++*counter_; } diff --git a/runtime/jni/java_vm_ext_test.cc b/runtime/jni/java_vm_ext_test.cc index fe1c168db2..4049c6e699 100644 --- a/runtime/jni/java_vm_ext_test.cc +++ b/runtime/jni/java_vm_ext_test.cc @@ -34,7 +34,7 @@ class JavaVmExtTest : public CommonRuntimeTest { } - virtual void TearDown() override { + void TearDown() override { CommonRuntimeTest::TearDown(); } diff --git a/runtime/jni/jni_internal_test.cc b/runtime/jni/jni_internal_test.cc index a4b151a7e7..3040b905ec 100644 --- a/runtime/jni/jni_internal_test.cc +++ b/runtime/jni/jni_internal_test.cc @@ -84,7 +84,7 @@ class JniInternalTest : public CommonCompilerTest { } } - virtual void TearDown() override { + void TearDown() override { CleanUpJniEnv(); CommonCompilerTest::TearDown(); } diff --git a/runtime/mirror/dex_cache_test.cc b/runtime/mirror/dex_cache_test.cc index 528740bea9..e9e7ca8688 100644 --- a/runtime/mirror/dex_cache_test.cc +++ b/runtime/mirror/dex_cache_test.cc @@ -34,7 +34,7 @@ class DexCacheTest : public CommonRuntimeTest {}; class DexCacheMethodHandlesTest : public DexCacheTest { protected: - virtual void SetUpRuntimeOptions(RuntimeOptions* options) override { + void SetUpRuntimeOptions(RuntimeOptions* options) override { CommonRuntimeTest::SetUpRuntimeOptions(options); } }; diff --git a/runtime/monitor.cc b/runtime/monitor.cc index 6e5786a6c3..72eced2333 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -1574,7 +1574,7 @@ class MonitorDeflateVisitor : public IsMarkedVisitor { public: MonitorDeflateVisitor() : self_(Thread::Current()), deflate_count_(0) {} - virtual mirror::Object* IsMarked(mirror::Object* object) override + mirror::Object* IsMarked(mirror::Object* object) override REQUIRES_SHARED(Locks::mutator_lock_) { if (Monitor::Deflate(self_, object)) { DCHECK_NE(object->GetLockWord(true).GetState(), LockWord::kFatLocked); diff --git a/runtime/runtime_callbacks_test.cc b/runtime/runtime_callbacks_test.cc index e1e0e23dac..aaedb23e45 100644 --- a/runtime/runtime_callbacks_test.cc +++ b/runtime/runtime_callbacks_test.cc @@ -252,14 +252,14 @@ class ClassLoadCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest { } struct Callback : public ClassLoadCallback { - virtual void ClassPreDefine(const char* descriptor, - Handle klass ATTRIBUTE_UNUSED, - Handle class_loader ATTRIBUTE_UNUSED, - const DexFile& initial_dex_file, - const DexFile::ClassDef& initial_class_def ATTRIBUTE_UNUSED, - /*out*/DexFile const** final_dex_file ATTRIBUTE_UNUSED, - /*out*/DexFile::ClassDef const** final_class_def ATTRIBUTE_UNUSED) - override REQUIRES_SHARED(Locks::mutator_lock_) { + void ClassPreDefine(const char* descriptor, + Handle klass ATTRIBUTE_UNUSED, + Handle class_loader ATTRIBUTE_UNUSED, + const DexFile& initial_dex_file, + const DexFile::ClassDef& initial_class_def ATTRIBUTE_UNUSED, + /*out*/DexFile const** final_dex_file ATTRIBUTE_UNUSED, + /*out*/DexFile::ClassDef const** final_class_def ATTRIBUTE_UNUSED) override + REQUIRES_SHARED(Locks::mutator_lock_) { const std::string& location = initial_dex_file.GetLocation(); std::string event = std::string("PreDefine:") + descriptor + " <" + diff --git a/runtime/verifier/reg_type.h b/runtime/verifier/reg_type.h index 04a7dfba66..3099b231e2 100644 --- a/runtime/verifier/reg_type.h +++ b/runtime/verifier/reg_type.h @@ -699,7 +699,7 @@ class DoubleLoType final : public Cat2Type { class DoubleHiType final : public Cat2Type { public: std::string Dump() const override REQUIRES_SHARED(Locks::mutator_lock_); - virtual bool IsDoubleHi() const override { return true; } + bool IsDoubleHi() const override { return true; } static const DoubleHiType* CreateInstance(ObjPtr klass, const StringPiece& descriptor, uint16_t cache_id) @@ -772,7 +772,7 @@ class ConstantType : public RegType { ConstantValue() >= std::numeric_limits::min() && ConstantValue() <= std::numeric_limits::max(); } - virtual bool IsConstantTypes() const override { return true; } + bool IsConstantTypes() const override { return true; } AssignmentType GetAssignmentTypeImpl() const override { return AssignmentType::kNotAssignable; @@ -993,7 +993,7 @@ class UninitializedThisReferenceType final : public UninitializedType { CheckConstructorInvariants(this); } - virtual bool IsUninitializedThisReference() const override { return true; } + bool IsUninitializedThisReference() const override { return true; } bool HasClassVirtual() const override { return true; } diff --git a/test/common/stack_inspect.cc b/test/common/stack_inspect.cc index 97a589fa48..d74d2efa12 100644 --- a/test/common/stack_inspect.cc +++ b/test/common/stack_inspect.cc @@ -77,7 +77,7 @@ struct MethodIsInterpretedVisitor : public StackVisitor { prev_was_runtime_(true), require_deoptable_(require_deoptable) {} - virtual bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) { + bool VisitFrame() override REQUIRES_SHARED(Locks::mutator_lock_) { if (goal_ == GetMethod()) { method_is_interpreted_ = (require_deoptable_ && prev_was_runtime_) || IsShadowFrame(); method_found_ = true; diff --git a/tools/art_verifier/art_verifier.cc b/tools/art_verifier/art_verifier.cc index 500c1c5133..bb43e67bb6 100644 --- a/tools/art_verifier/art_verifier.cc +++ b/tools/art_verifier/art_verifier.cc @@ -92,8 +92,7 @@ struct MethodVerifierArgs : public CmdlineArgs { protected: using Base = CmdlineArgs; - virtual ParseStatus ParseCustom(const StringPiece& option, - std::string* error_msg) override { + ParseStatus ParseCustom(const StringPiece& option, std::string* error_msg) override { { ParseStatus base_parse = Base::ParseCustom(option, error_msg); if (base_parse != kParseUnknownArgument) { @@ -119,7 +118,7 @@ struct MethodVerifierArgs : public CmdlineArgs { return kParseOk; } - virtual ParseStatus ParseChecks(std::string* error_msg) override { + ParseStatus ParseChecks(std::string* error_msg) override { // Perform the parent checks. ParseStatus parent_checks = Base::ParseChecks(error_msg); if (parent_checks != kParseOk) { -- cgit v1.2.3-59-g8ed1b