diff --git a/Android.bp b/Android.bp deleted file mode 100644 index 34a646915fd96b60049826a9dc9a7b244a9c07a0..0000000000000000000000000000000000000000 --- a/Android.bp +++ /dev/null @@ -1,56 +0,0 @@ -// TODO: These should be handled with transitive static library dependencies -art_static_dependencies = [ - // Note: the order is important because of static linking resolution. - "libziparchive", - "libnativehelper", - "libnativebridge", - "libnativeloader", - "libsigchain_dummy", - "liblog", - "libz", - "libbacktrace", - "libcutils", - "libunwindstack", - "libutils", - "libbase", - "liblz4", - "liblzma", - "libmetricslogger_static", -] - -subdirs = [ - "adbconnection", - "benchmark", - "build", - "cmdline", - "compiler", - "dalvikvm", - "dex2oat", - "dexdump", - "dexlayout", - "dexlist", - "dexoptanalyzer", - "disassembler", - "dt_fd_forward", - "dt_fd_forward/export", - "imgdiag", - "libartbase", - "libdexfile", - "libprofile", - "oatdump", - "openjdkjvm", - "openjdkjvmti", - "patchoat", - "profman", - "runtime", - "sigchainlib", - "simulator", - "test", - "tools", - "tools/breakpoint-logger", - "tools/cpp-define-generator", - "tools/dmtracedump", - "tools/hiddenapi", - "tools/titrace", - "tools/wrapagentproperties", -] diff --git a/Android.mk b/Android.mk index 19c65a1e67db9a90dd8101d514a2ebd1ebe6c88f..0c20973edc5d15913bb05a4c79380036b44126ba 100644 --- a/Android.mk +++ b/Android.mk @@ -41,18 +41,18 @@ endif .PHONY: clean-oat-target clean-oat-target: - adb root - adb wait-for-device remount - adb shell rm -rf $(ART_TARGET_NATIVETEST_DIR) - adb shell rm -rf $(ART_TARGET_TEST_DIR) - adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*/* - adb shell rm -rf $(DEXPREOPT_BOOT_JAR_DIR)/$(DEX2OAT_TARGET_ARCH) - adb shell rm -rf system/app/$(DEX2OAT_TARGET_ARCH) + $(ADB) root + $(ADB) wait-for-device remount + $(ADB) shell rm -rf $(ART_TARGET_NATIVETEST_DIR) + $(ADB) shell rm -rf $(ART_TARGET_TEST_DIR) + $(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*/* + $(ADB) shell rm -rf $(DEXPREOPT_BOOT_JAR_DIR)/$(DEX2OAT_TARGET_ARCH) + $(ADB) shell rm -rf system/app/$(DEX2OAT_TARGET_ARCH) ifdef TARGET_2ND_ARCH - adb shell rm -rf $(DEXPREOPT_BOOT_JAR_DIR)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) - adb shell rm -rf system/app/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) + $(ADB) shell rm -rf $(DEXPREOPT_BOOT_JAR_DIR)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) + $(ADB) shell rm -rf system/app/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) endif - adb shell rm -rf data/run-test/test-*/dalvik-cache/* + $(ADB) shell rm -rf data/run-test/test-*/dalvik-cache/* ######################################################################## # cpplint rules to style check art source files @@ -92,7 +92,7 @@ endif # test rules # All the dependencies that must be built ahead of sync-ing them onto the target device. -TEST_ART_TARGET_SYNC_DEPS := +TEST_ART_TARGET_SYNC_DEPS := $(ADB_EXECUTABLE) include $(art_path)/build/Android.common_test.mk include $(art_path)/build/Android.gtest.mk @@ -100,14 +100,14 @@ include $(art_path)/test/Android.run-test.mk # Make sure /system is writable on the device. TEST_ART_ADB_ROOT_AND_REMOUNT := \ - (adb root && \ - adb wait-for-device remount && \ - ((adb shell touch /system/testfile && \ - (adb shell rm /system/testfile || true)) || \ - (adb disable-verity && \ - adb reboot && \ - adb wait-for-device root && \ - adb wait-for-device remount))) + ($(ADB) root && \ + $(ADB) wait-for-device remount && \ + (($(ADB) shell touch /system/testfile && \ + ($(ADB) shell rm /system/testfile || true)) || \ + ($(ADB) disable-verity && \ + $(ADB) reboot && \ + $(ADB) wait-for-device root && \ + $(ADB) wait-for-device remount))) # Sync test files to the target, depends upon all things that must be pushed to the target. .PHONY: test-art-target-sync @@ -121,25 +121,25 @@ ifeq ($(ART_TEST_ANDROID_ROOT),) ifeq ($(ART_TEST_CHROOT),) test-art-target-sync: $(TEST_ART_TARGET_SYNC_DEPS) $(TEST_ART_ADB_ROOT_AND_REMOUNT) - adb sync system && adb sync data + $(ADB) sync system && $(ADB) sync data else # TEST_ART_ADB_ROOT_AND_REMOUNT is not needed here, as we are only # pushing things to the chroot dir, which is expected to be under # /data on the device. test-art-target-sync: $(TEST_ART_TARGET_SYNC_DEPS) - adb wait-for-device - adb push $(PRODUCT_OUT)/system $(ART_TEST_CHROOT)/ - adb push $(PRODUCT_OUT)/data $(ART_TEST_CHROOT)/ + $(ADB) wait-for-device + $(ADB) push $(PRODUCT_OUT)/system $(ART_TEST_CHROOT)/ + $(ADB) push $(PRODUCT_OUT)/data $(ART_TEST_CHROOT)/ endif else test-art-target-sync: $(TEST_ART_TARGET_SYNC_DEPS) $(TEST_ART_ADB_ROOT_AND_REMOUNT) - adb wait-for-device - adb push $(PRODUCT_OUT)/system $(ART_TEST_CHROOT)$(ART_TEST_ANDROID_ROOT) + $(ADB) wait-for-device + $(ADB) push $(PRODUCT_OUT)/system $(ART_TEST_CHROOT)$(ART_TEST_ANDROID_ROOT) # Push the contents of the `data` dir into `$(ART_TEST_CHROOT)/data` on the device (note # that $(ART_TEST_CHROOT) can be empty). If `$(ART_TEST_CHROOT)/data` already exists on # the device, it is not overwritten, but its content is updated. - adb push $(PRODUCT_OUT)/data $(ART_TEST_CHROOT)/ + $(ADB) push $(PRODUCT_OUT)/data $(ART_TEST_CHROOT)/ endif endif @@ -427,7 +427,7 @@ endif define build-art-hiddenapi $(shell if [ ! -d frameworks/base ]; then \ mkdir -p ${TARGET_OUT_COMMON_INTERMEDIATES}/PACKAGING; \ - touch ${TARGET_OUT_COMMON_INTERMEDIATES}/PACKAGING/hiddenapi-{blacklist,dark-greylist,light-greylist}.txt; \ + touch ${TARGET_OUT_COMMON_INTERMEDIATES}/PACKAGING/hiddenapi-{whitelist,blacklist,dark-greylist,light-greylist}.txt; \ fi;) endef @@ -493,90 +493,90 @@ build-art-target-tests: build-art-target $(TEST_ART_RUN_TEST_DEPENDENCIES) $(T .PHONY: use-art use-art: - adb root - adb wait-for-device shell stop - adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so - adb shell start + $(ADB) root + $(ADB) wait-for-device shell stop + $(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libart.so + $(ADB) shell start .PHONY: use-artd use-artd: - adb root - adb wait-for-device shell stop - adb shell setprop persist.sys.dalvik.vm.lib.2 libartd.so - adb shell start + $(ADB) root + $(ADB) wait-for-device shell stop + $(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libartd.so + $(ADB) shell start .PHONY: use-dalvik use-dalvik: - adb root - adb wait-for-device shell stop - adb shell setprop persist.sys.dalvik.vm.lib.2 libdvm.so - adb shell start + $(ADB) root + $(ADB) wait-for-device shell stop + $(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libdvm.so + $(ADB) shell start .PHONY: use-art-full use-art-full: - adb root - adb wait-for-device shell stop - adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* - adb shell setprop dalvik.vm.dex2oat-filter \"\" - adb shell setprop dalvik.vm.image-dex2oat-filter \"\" - adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so - adb shell setprop dalvik.vm.usejit false - adb shell start + $(ADB) root + $(ADB) wait-for-device shell stop + $(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* + $(ADB) shell setprop dalvik.vm.dex2oat-filter \"\" + $(ADB) shell setprop dalvik.vm.image-dex2oat-filter \"\" + $(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libart.so + $(ADB) shell setprop dalvik.vm.usejit false + $(ADB) shell start .PHONY: use-artd-full use-artd-full: - adb root - adb wait-for-device shell stop - adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* - adb shell setprop dalvik.vm.dex2oat-filter \"\" - adb shell setprop dalvik.vm.image-dex2oat-filter \"\" - adb shell setprop persist.sys.dalvik.vm.lib.2 libartd.so - adb shell setprop dalvik.vm.usejit false - adb shell start + $(ADB) root + $(ADB) wait-for-device shell stop + $(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* + $(ADB) shell setprop dalvik.vm.dex2oat-filter \"\" + $(ADB) shell setprop dalvik.vm.image-dex2oat-filter \"\" + $(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libartd.so + $(ADB) shell setprop dalvik.vm.usejit false + $(ADB) shell start .PHONY: use-art-jit use-art-jit: - adb root - adb wait-for-device shell stop - adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* - adb shell setprop dalvik.vm.dex2oat-filter "verify-at-runtime" - adb shell setprop dalvik.vm.image-dex2oat-filter "verify-at-runtime" - adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so - adb shell setprop dalvik.vm.usejit true - adb shell start + $(ADB) root + $(ADB) wait-for-device shell stop + $(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* + $(ADB) shell setprop dalvik.vm.dex2oat-filter "verify-at-runtime" + $(ADB) shell setprop dalvik.vm.image-dex2oat-filter "verify-at-runtime" + $(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libart.so + $(ADB) shell setprop dalvik.vm.usejit true + $(ADB) shell start .PHONY: use-art-interpret-only use-art-interpret-only: - adb root - adb wait-for-device shell stop - adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* - adb shell setprop dalvik.vm.dex2oat-filter "interpret-only" - adb shell setprop dalvik.vm.image-dex2oat-filter "interpret-only" - adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so - adb shell setprop dalvik.vm.usejit false - adb shell start + $(ADB) root + $(ADB) wait-for-device shell stop + $(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* + $(ADB) shell setprop dalvik.vm.dex2oat-filter "interpret-only" + $(ADB) shell setprop dalvik.vm.image-dex2oat-filter "interpret-only" + $(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libart.so + $(ADB) shell setprop dalvik.vm.usejit false + $(ADB) shell start .PHONY: use-artd-interpret-only use-artd-interpret-only: - adb root - adb wait-for-device shell stop - adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* - adb shell setprop dalvik.vm.dex2oat-filter "interpret-only" - adb shell setprop dalvik.vm.image-dex2oat-filter "interpret-only" - adb shell setprop persist.sys.dalvik.vm.lib.2 libartd.so - adb shell setprop dalvik.vm.usejit false - adb shell start + $(ADB) root + $(ADB) wait-for-device shell stop + $(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* + $(ADB) shell setprop dalvik.vm.dex2oat-filter "interpret-only" + $(ADB) shell setprop dalvik.vm.image-dex2oat-filter "interpret-only" + $(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libartd.so + $(ADB) shell setprop dalvik.vm.usejit false + $(ADB) shell start .PHONY: use-art-verify-none use-art-verify-none: - adb root - adb wait-for-device shell stop - adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* - adb shell setprop dalvik.vm.dex2oat-filter "verify-none" - adb shell setprop dalvik.vm.image-dex2oat-filter "verify-none" - adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so - adb shell setprop dalvik.vm.usejit false - adb shell start + $(ADB) root + $(ADB) wait-for-device shell stop + $(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/* + $(ADB) shell setprop dalvik.vm.dex2oat-filter "verify-none" + $(ADB) shell setprop dalvik.vm.image-dex2oat-filter "verify-none" + $(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libart.so + $(ADB) shell setprop dalvik.vm.usejit false + $(ADB) shell start ######################################################################## diff --git a/adbconnection/adbconnection.h b/adbconnection/adbconnection.h index 04e39bf4ff8a9392a461b6734696e33853e4d6e3..c51f981f40ebcba69838b9b65d0cc75d5fe5f551 100644 --- a/adbconnection/adbconnection.h +++ b/adbconnection/adbconnection.h @@ -46,12 +46,12 @@ struct AdbConnectionDebuggerController : public art::DebuggerControlCallback { : connection_(connection) {} // Begin running the debugger. - void StartDebugger() OVERRIDE; + void StartDebugger() override; // The debugger should begin shutting down since the runtime is ending. - void StopDebugger() OVERRIDE; + void StopDebugger() override; - bool IsDebuggerConfigured() OVERRIDE; + bool IsDebuggerConfigured() override; private: AdbConnectionState* connection_; diff --git a/build/Android.common.mk b/build/Android.common.mk index a6a9f0fc479635616edd32a8f985884b94bb9baf..316ce646abe3aca8e48a40e004ff14cfbdc1ae47 100644 --- a/build/Android.common.mk +++ b/build/Android.common.mk @@ -92,4 +92,7 @@ else 2ND_ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES) endif +ADB_EXECUTABLE := $(HOST_OUT_EXECUTABLES)/adb +ADB := $(ADB_EXECUTABLE) + endif # ART_ANDROID_COMMON_MK diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk index 81c82b74608ac829ee35301bd95a44bf109cb9d1..20f20c9f7b8a1c708124174c7ea24e1f921ad8a1 100644 --- a/build/Android.gtest.mk +++ b/build/Android.gtest.mk @@ -447,7 +447,8 @@ define define-art-gtest-rule-target $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so \ $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libopenjdkd.so \ $$(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar \ - $$(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar + $$(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar \ + $$(TARGET_OUT_JAVA_LIBRARIES)/core-simple-testdex.jar $$(gtest_rule): PRIVATE_TARGET_EXE := $$(gtest_target_exe) $$(gtest_rule): PRIVATE_MAYBE_CHROOT_COMMAND := $$(maybe_chroot_command) @@ -460,14 +461,14 @@ $$(gtest_rule): PRIVATE_GTEST_WITNESS := $$(gtest_witness) .PHONY: $$(gtest_rule) $$(gtest_rule): test-art-target-sync - $(hide) adb shell touch $$(PRIVATE_GTEST_WITNESS) - $(hide) adb shell rm $$(PRIVATE_GTEST_WITNESS) - $(hide) adb shell $$(PRIVATE_MAYBE_CHROOT_COMMAND) chmod 755 $$(PRIVATE_TARGET_EXE) + $(hide) $(ADB) shell touch $$(PRIVATE_GTEST_WITNESS) + $(hide) $(ADB) shell rm $$(PRIVATE_GTEST_WITNESS) + $(hide) $(ADB) shell $$(PRIVATE_MAYBE_CHROOT_COMMAND) chmod 755 $$(PRIVATE_TARGET_EXE) $(hide) $$(call ART_TEST_SKIP,$$@) && \ - (adb shell "$$(PRIVATE_MAYBE_CHROOT_COMMAND) env $(GCOV_ENV) LD_LIBRARY_PATH=$(4) \ + ($(ADB) shell "$$(PRIVATE_MAYBE_CHROOT_COMMAND) env $(GCOV_ENV) LD_LIBRARY_PATH=$(4) \ ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) $$(PRIVATE_TARGET_EXE) \ && touch $$(PRIVATE_GTEST_WITNESS)" \ - && (adb pull $$(PRIVATE_GTEST_WITNESS) /tmp/ && $$(call ART_TEST_PASSED,$$@)) \ + && ($(ADB) pull $$(PRIVATE_GTEST_WITNESS) /tmp/ && $$(call ART_TEST_PASSED,$$@)) \ || $$(call ART_TEST_FAILED,$$@)) $(hide) rm -f /tmp/$$@-$$$$PPID diff --git a/build/art.go b/build/art.go index 61b1a4e50132e6ea6505ef70f314a518663551f6..6c084867a768619c7b24a103a5087f8902f64509 100644 --- a/build/art.go +++ b/build/art.go @@ -283,6 +283,7 @@ func init() { android.RegisterModuleType("art_cc_test_library", artTestLibrary) android.RegisterModuleType("art_cc_defaults", artDefaultsFactory) android.RegisterModuleType("libart_cc_defaults", libartDefaultsFactory) + android.RegisterModuleType("libart_static_cc_defaults", libartStaticDefaultsFactory) android.RegisterModuleType("art_global_defaults", artGlobalDefaultsFactory) android.RegisterModuleType("art_debug_defaults", artDebugDefaultsFactory) } @@ -336,6 +337,33 @@ func libartDefaultsFactory() android.Module { return module } +func libartStaticDefaultsFactory() android.Module { + c := &codegenProperties{} + module := cc.DefaultsFactory(c) + android.AddLoadHook(module, func(ctx android.LoadHookContext) { + codegen(ctx, c, true) + + type props struct { + Target struct { + Android struct { + Static_libs []string + } + } + } + + p := &props{} + // TODO: express this in .bp instead b/79671158 + if !envTrue(ctx, "ART_TARGET_LINUX") { + p.Target.Android.Static_libs = []string{ + "libmetricslogger_static", + } + } + ctx.AppendProperties(p) + }) + + return module +} + func artLibrary() android.Module { m, _ := cc.NewLibrary(android.HostAndDeviceSupported) module := m.Init() diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc index a33d53741c0e5bd74295c8b9fb28abb356bb1272..97daafadd8098fed047c5440b0b481675ca2d702 100644 --- a/cmdline/cmdline_parser_test.cc +++ b/cmdline/cmdline_parser_test.cc @@ -131,7 +131,7 @@ class CmdlineParserTest : public ::testing::Test { art::InitLogging(nullptr, art::Runtime::Abort); // argv = null } - virtual void SetUp() { + void SetUp() override { parser_ = ParsedOptions::MakeParser(false); // do not ignore unrecognized options } @@ -558,13 +558,12 @@ TEST_F(CmdlineParserTest, TestIgnoredArguments) { TEST_F(CmdlineParserTest, MultipleArguments) { EXPECT_TRUE(IsResultSuccessful(parser_->Parse( "-help -XX:ForegroundHeapGrowthMultiplier=0.5 " - "-Xnodex2oat -Xmethod-trace -XX:LargeObjectSpace=map"))); + "-Xmethod-trace -XX:LargeObjectSpace=map"))); auto&& map = parser_->ReleaseArgumentsMap(); - EXPECT_EQ(5u, map.Size()); + EXPECT_EQ(4u, map.Size()); EXPECT_KEY_VALUE(map, M::Help, Unit{}); EXPECT_KEY_VALUE(map, M::ForegroundHeapGrowthMultiplier, 0.5); - EXPECT_KEY_VALUE(map, M::Dex2Oat, false); EXPECT_KEY_VALUE(map, M::MethodTrace, Unit{}); EXPECT_KEY_VALUE(map, M::LargeObjectSpace, gc::space::LargeObjectSpaceType::kMap); } // TEST_F diff --git a/compiler/Android.bp b/compiler/Android.bp index c36553779e9405afb8191a8d98b103bed5a61db1..c2f8e3c66e5cd0c280789eeb698ecf1c3e513ce2 100644 --- a/compiler/Android.bp +++ b/compiler/Android.bp @@ -191,6 +191,15 @@ art_cc_defaults { export_include_dirs: ["."], } +cc_defaults { + name: "libart-compiler_static_base_defaults", + static_libs: [ + "libbase", + "libcutils", + "liblzma", + ], +} + gensrcs { name: "art_compiler_operator_srcs", cmd: "$(location generate_operator_out) art/compiler $(in) > $(out)", @@ -260,6 +269,18 @@ art_cc_library { }, } +cc_defaults { + name: "libart-compiler_static_defaults", + defaults: [ + "libart-compiler_static_base_defaults", + "libart_static_defaults", + "libartbase_static_defaults", + "libdexfile_static_defaults", + "libprofile_static_defaults", + ], + static_libs: ["libart-compiler"], +} + art_cc_library { name: "libartd-compiler", defaults: [ @@ -302,6 +323,18 @@ art_cc_library { ], } +cc_defaults { + name: "libartd-compiler_static_defaults", + defaults: [ + "libart-compiler_static_base_defaults", + "libartd_static_defaults", + "libartbased_static_defaults", + "libdexfiled_static_defaults", + "libprofiled_static_defaults", + ], + static_libs: ["libartd-compiler"], +} + art_cc_library { name: "libart-compiler-gtest", defaults: ["libart-gtest-defaults"], diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index 2f017662e2200faefa7c5b4f925605ea30106df6..586891a3ff7fc9bcc4ca7789c75e597ef0d9abe9 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -108,7 +108,7 @@ void CommonCompilerTest::MakeExecutable(const void* code_start, size_t code_leng int result = mprotect(reinterpret_cast(base), len, PROT_READ | PROT_WRITE | PROT_EXEC); CHECK_EQ(result, 0); - FlushInstructionCache(reinterpret_cast(base), reinterpret_cast(base + len)); + FlushInstructionCache(reinterpret_cast(base), reinterpret_cast(base + len)); } void CommonCompilerTest::MakeExecutable(ObjPtr class_loader, @@ -328,7 +328,6 @@ void CommonCompilerTest::ReserveImageSpace() { (size_t)120 * 1024 * 1024, // 120MB PROT_NONE, false /* no need for 4gb flag with fixed mmap */, - false /* not reusing existing reservation */, &error_msg); CHECK(image_reservation_.IsValid()) << error_msg; } diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h index 366489c58ff8e20a5a21702ef5da5a919153d3fa..e6d15646216e9769ce146331aa3f2a9c5707078e 100644 --- a/compiler/common_compiler_test.h +++ b/compiler/common_compiler_test.h @@ -57,9 +57,9 @@ class CommonCompilerTest : public CommonRuntimeTest { REQUIRES_SHARED(Locks::mutator_lock_); protected: - void SetUp() OVERRIDE; + void SetUp() override; - void SetUpRuntimeOptions(RuntimeOptions* options) OVERRIDE; + void SetUpRuntimeOptions(RuntimeOptions* options) override; Compiler::Kind GetCompilerKind() const; void SetCompilerKind(Compiler::Kind compiler_kind); @@ -73,7 +73,7 @@ class CommonCompilerTest : public CommonRuntimeTest { return CompilerFilter::kDefaultCompilerFilter; } - void TearDown() OVERRIDE; + void TearDown() override; void CompileClass(mirror::ClassLoader* class_loader, const char* class_name) REQUIRES_SHARED(Locks::mutator_lock_); diff --git a/compiler/compiled_method.h b/compiler/compiled_method.h index f88028034de6a0156841bb9667232020dff44d22..864ce585cf515ac5f66a186d629e0cecaa9c1d8e 100644 --- a/compiler/compiled_method.h +++ b/compiler/compiled_method.h @@ -104,7 +104,7 @@ class CompiledCode { uint32_t packed_fields_; }; -class CompiledMethod FINAL : public CompiledCode { +class CompiledMethod final : public CompiledCode { public: // Constructs a CompiledMethod. // Note: Consider using the static allocation methods below that will allocate the CompiledMethod diff --git a/compiler/debug/dwarf/debug_abbrev_writer.h b/compiler/debug/dwarf/debug_abbrev_writer.h index cccca255c1dc7fd55d07f87c81d99650849df6d9..63a049b2cca265a31995cb526fd51e4737c3f014 100644 --- a/compiler/debug/dwarf/debug_abbrev_writer.h +++ b/compiler/debug/dwarf/debug_abbrev_writer.h @@ -37,7 +37,7 @@ namespace dwarf { // determines all the attributes and their format. // It is possible to think of them as type definitions. template > -class DebugAbbrevWriter FINAL : private Writer { +class DebugAbbrevWriter final : private Writer { static_assert(std::is_same::value, "Invalid value type"); public: diff --git a/compiler/debug/dwarf/debug_info_entry_writer.h b/compiler/debug/dwarf/debug_info_entry_writer.h index 89d16f2b2a4de8f7a12c22ad57c47380c873d52f..b198178d5db56056aaffadb96715094bd958d8d3 100644 --- a/compiler/debug/dwarf/debug_info_entry_writer.h +++ b/compiler/debug/dwarf/debug_info_entry_writer.h @@ -42,7 +42,7 @@ namespace dwarf { * EndTag(); */ template > -class DebugInfoEntryWriter FINAL : private Writer { +class DebugInfoEntryWriter final : private Writer { static_assert(std::is_same::value, "Invalid value type"); public: diff --git a/compiler/debug/dwarf/debug_line_opcode_writer.h b/compiler/debug/dwarf/debug_line_opcode_writer.h index b4a4d63f01362b33b3ee76bda5aca398991c65e0..bb4e87ff7e223c2361ebe770d48831019f768aec 100644 --- a/compiler/debug/dwarf/debug_line_opcode_writer.h +++ b/compiler/debug/dwarf/debug_line_opcode_writer.h @@ -31,7 +31,7 @@ namespace dwarf { // * Keep track of current state and convert absolute values to deltas. // * Divide by header-defined factors as appropriate. template> -class DebugLineOpCodeWriter FINAL : private Writer { +class DebugLineOpCodeWriter final : private Writer { static_assert(std::is_same::value, "Invalid value type"); public: diff --git a/compiler/debug/elf_debug_info_writer.h b/compiler/debug/elf_debug_info_writer.h index bda7108c740d5422fa7d6d72c269746d6b892d2e..fe059929605de06c2c3fd86c516a7fc1a4f8a4d5 100644 --- a/compiler/debug/elf_debug_info_writer.h +++ b/compiler/debug/elf_debug_info_writer.h @@ -41,26 +41,14 @@ namespace art { namespace debug { -typedef std::vector LocalInfos; - -static void LocalInfoCallback(void* ctx, const DexFile::LocalInfo& entry) { - static_cast(ctx)->push_back(entry); -} - static std::vector GetParamNames(const MethodDebugInfo* mi) { std::vector names; + DCHECK(mi->dex_file != nullptr); CodeItemDebugInfoAccessor accessor(*mi->dex_file, mi->code_item, mi->dex_method_index); if (accessor.HasCodeItem()) { - DCHECK(mi->dex_file != nullptr); - const uint8_t* stream = mi->dex_file->GetDebugInfoStream(accessor.DebugInfoOffset()); - if (stream != nullptr) { - DecodeUnsignedLeb128(&stream); // line. - uint32_t parameters_size = DecodeUnsignedLeb128(&stream); - for (uint32_t i = 0; i < parameters_size; ++i) { - uint32_t id = DecodeUnsignedLeb128P1(&stream); - names.push_back(mi->dex_file->StringDataByIdx(dex::StringIndex(id))); - } - } + accessor.VisitParameterNames([&](const dex::StringIndex& id) { + names.push_back(mi->dex_file->StringDataByIdx(id)); + }); } return names; } @@ -257,11 +245,12 @@ class ElfCompilationUnitWriter { } // Write local variables. - LocalInfos local_infos; + std::vector local_infos; if (accessor.DecodeDebugLocalInfo(is_static, mi->dex_method_index, - LocalInfoCallback, - &local_infos)) { + [&](const DexFile::LocalInfo& entry) { + local_infos.push_back(entry); + })) { for (const DexFile::LocalInfo& var : local_infos) { if (var.reg_ < accessor.RegistersSize() - accessor.InsSize()) { info_.StartTag(DW_TAG_variable); diff --git a/compiler/debug/elf_debug_line_writer.h b/compiler/debug/elf_debug_line_writer.h index 3d78943cd04475ae37edfac51e1f439d5c7df88f..0a13a92d078dc4cf9f636d6c44658dadf82cf5ac 100644 --- a/compiler/debug/elf_debug_line_writer.h +++ b/compiler/debug/elf_debug_line_writer.h @@ -34,11 +34,6 @@ namespace debug { typedef std::vector PositionInfos; -static bool PositionInfoCallback(void* ctx, const DexFile::PositionInfo& entry) { - static_cast(ctx)->push_back(entry); - return false; -} - template class ElfDebugLineWriter { using Elf_Addr = typename ElfTypes::Addr; @@ -154,11 +149,14 @@ class ElfDebugLineWriter { Elf_Addr method_address = base_address + mi->code_address; PositionInfos dex2line_map; - DCHECK(mi->dex_file != nullptr); const DexFile* dex = mi->dex_file; + DCHECK(dex != nullptr); CodeItemDebugInfoAccessor accessor(*dex, mi->code_item, mi->dex_method_index); - const uint32_t debug_info_offset = accessor.DebugInfoOffset(); - if (!dex->DecodeDebugPositionInfo(debug_info_offset, PositionInfoCallback, &dex2line_map)) { + if (!accessor.DecodeDebugPositionInfo( + [&](const DexFile::PositionInfo& entry) { + dex2line_map.push_back(entry); + return false; + })) { continue; } diff --git a/compiler/dex/quick_compiler_callbacks.h b/compiler/dex/quick_compiler_callbacks.h index 8a07e9c12cdcf4df7c65f3830248611e9eaf2227..b7117bd223c04b8c0f16c7c2d54cb7ce7278f9af 100644 --- a/compiler/dex/quick_compiler_callbacks.h +++ b/compiler/dex/quick_compiler_callbacks.h @@ -26,7 +26,7 @@ class CompilerDriver; class DexFile; class VerificationResults; -class QuickCompilerCallbacks FINAL : public CompilerCallbacks { +class QuickCompilerCallbacks final : public CompilerCallbacks { public: explicit QuickCompilerCallbacks(CompilerCallbacks::CallbackMode mode) : CompilerCallbacks(mode), dex_files_(nullptr) {} @@ -34,20 +34,20 @@ class QuickCompilerCallbacks FINAL : public CompilerCallbacks { ~QuickCompilerCallbacks() { } void MethodVerified(verifier::MethodVerifier* verifier) - REQUIRES_SHARED(Locks::mutator_lock_) OVERRIDE; + REQUIRES_SHARED(Locks::mutator_lock_) override; - void ClassRejected(ClassReference ref) OVERRIDE; + void ClassRejected(ClassReference ref) override; // We are running in an environment where we can call patchoat safely so we should. - bool IsRelocationPossible() OVERRIDE { + bool IsRelocationPossible() override { return true; } - verifier::VerifierDeps* GetVerifierDeps() const OVERRIDE { + verifier::VerifierDeps* GetVerifierDeps() const override { return verifier_deps_.get(); } - void SetVerifierDeps(verifier::VerifierDeps* deps) OVERRIDE { + void SetVerifierDeps(verifier::VerifierDeps* deps) override { verifier_deps_.reset(deps); } @@ -55,18 +55,18 @@ class QuickCompilerCallbacks FINAL : public CompilerCallbacks { verification_results_ = verification_results; } - ClassStatus GetPreviousClassState(ClassReference ref) OVERRIDE; + ClassStatus GetPreviousClassState(ClassReference ref) override; void SetDoesClassUnloading(bool does_class_unloading, CompilerDriver* compiler_driver) - OVERRIDE { + override { does_class_unloading_ = does_class_unloading; compiler_driver_ = compiler_driver; DCHECK(!does_class_unloading || compiler_driver_ != nullptr); } - void UpdateClassState(ClassReference ref, ClassStatus state) OVERRIDE; + void UpdateClassState(ClassReference ref, ClassStatus state) override; - bool CanUseOatStatusForVerification(mirror::Class* klass) OVERRIDE + bool CanUseOatStatusForVerification(mirror::Class* klass) override REQUIRES_SHARED(Locks::mutator_lock_); void SetDexFiles(const std::vector* dex_files) { diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 6eca30422386cc0e8fcb8f0edd8cba4763c1c55b..95d08b3c6462732eea0b4a497f9fc6cb27cef30d 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; } @@ -1034,7 +1034,7 @@ class RecordImageClassesVisitor : public ClassVisitor { explicit RecordImageClassesVisitor(HashSet* image_classes) : image_classes_(image_classes) {} - bool operator()(ObjPtr klass) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) { + bool operator()(ObjPtr klass) override REQUIRES_SHARED(Locks::mutator_lock_) { std::string temp; image_classes_->insert(klass->GetDescriptor(&temp)); return true; @@ -1210,7 +1210,7 @@ class ClinitImageUpdate { : data_(data), hs_(hs) {} - bool operator()(ObjPtr klass) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) { + bool operator()(ObjPtr klass) override REQUIRES_SHARED(Locks::mutator_lock_) { std::string temp; StringPiece name(klass->GetDescriptor(&temp)); if (data_->image_class_descriptors_->find(name) != data_->image_class_descriptors_->end()) { @@ -1475,7 +1475,7 @@ class ParallelCompilationManager { end_(end), fn_(fn) {} - void Run(Thread* self) OVERRIDE { + void Run(Thread* self) override { while (true) { const size_t index = manager_->NextIndex(); if (UNLIKELY(index >= end_)) { @@ -1486,7 +1486,7 @@ class ParallelCompilationManager { } } - void Finalize() OVERRIDE { + void Finalize() override { delete this; } @@ -1568,7 +1568,7 @@ class ResolveClassFieldsAndMethodsVisitor : public CompilationVisitor { explicit ResolveClassFieldsAndMethodsVisitor(const ParallelCompilationManager* manager) : manager_(manager) {} - void Visit(size_t class_def_index) OVERRIDE REQUIRES(!Locks::mutator_lock_) { + void Visit(size_t class_def_index) override REQUIRES(!Locks::mutator_lock_) { ScopedTrace trace(__FUNCTION__); Thread* const self = Thread::Current(); jobject jclass_loader = manager_->GetClassLoader(); @@ -1667,7 +1667,7 @@ class ResolveTypeVisitor : public CompilationVisitor { public: explicit ResolveTypeVisitor(const ParallelCompilationManager* manager) : manager_(manager) { } - void Visit(size_t type_idx) OVERRIDE REQUIRES(!Locks::mutator_lock_) { + void Visit(size_t type_idx) override REQUIRES(!Locks::mutator_lock_) { // Class derived values are more complicated, they require the linker and loader. ScopedObjectAccess soa(Thread::Current()); ClassLinker* class_linker = manager_->GetClassLinker(); @@ -1886,9 +1886,11 @@ void CompilerDriver::Verify(jobject jclass_loader, class VerifyClassVisitor : public CompilationVisitor { public: VerifyClassVisitor(const ParallelCompilationManager* manager, verifier::HardFailLogMode log_level) - : manager_(manager), log_level_(log_level) {} + : manager_(manager), + log_level_(log_level), + sdk_version_(Runtime::Current()->GetTargetSdkVersion()) {} - 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(); @@ -1923,6 +1925,7 @@ class VerifyClassVisitor : public CompilationVisitor { Runtime::Current()->GetCompilerCallbacks(), true /* allow soft failures */, log_level_, + sdk_version_, &error_msg); if (failure_kind == verifier::FailureKind::kHardFailure) { LOG(ERROR) << "Verification failed on class " << PrettyDescriptor(descriptor) @@ -1995,6 +1998,7 @@ class VerifyClassVisitor : public CompilationVisitor { private: const ParallelCompilationManager* const manager_; const verifier::HardFailLogMode log_level_; + const uint32_t sdk_version_; }; void CompilerDriver::VerifyDexFile(jobject class_loader, @@ -2020,7 +2024,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(); @@ -2085,7 +2089,7 @@ class InitializeClassVisitor : public CompilationVisitor { public: explicit InitializeClassVisitor(const ParallelCompilationManager* manager) : manager_(manager) {} - void Visit(size_t class_def_index) OVERRIDE { + void Visit(size_t class_def_index) override { ScopedTrace trace(__FUNCTION__); jobject jclass_loader = manager_->GetClassLoader(); const DexFile& dex_file = *manager_->GetDexFile(); @@ -2470,7 +2474,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; @@ -2560,8 +2564,8 @@ static void CompileDexFile(CompilerDriver* driver, thread_pool); auto compile = [&context, &compile_fn](size_t class_def_index) { - ScopedTrace trace(__FUNCTION__); const DexFile& dex_file = *context.GetDexFile(); + SCOPED_TRACE << "compile " << dex_file.GetLocation() << "@" << class_def_index; ClassLinker* class_linker = context.GetClassLinker(); jobject jclass_loader = context.GetClassLoader(); ClassReference ref(&dex_file, class_def_index); diff --git a/compiler/driver/compiler_driver_test.cc b/compiler/driver/compiler_driver_test.cc index 2eeb4399db7996d4a67a532d5fcae68a06711e02..fe1568da83b4f658db2cd95108e64e08c5786a0b 100644 --- a/compiler/driver/compiler_driver_test.cc +++ b/compiler/driver/compiler_driver_test.cc @@ -186,7 +186,7 @@ TEST_F(CompilerDriverTest, AbstractMethodErrorStub) { class CompilerDriverProfileTest : public CompilerDriverTest { protected: - ProfileCompilationInfo* GetProfileCompilationInfo() OVERRIDE { + ProfileCompilationInfo* GetProfileCompilationInfo() override { ScopedObjectAccess soa(Thread::Current()); std::vector> dex_files = OpenTestDexFiles("ProfileTestMultiDex"); @@ -200,7 +200,7 @@ class CompilerDriverProfileTest : public CompilerDriverTest { return &profile_info_; } - CompilerFilter::Filter GetCompilerFilter() const OVERRIDE { + CompilerFilter::Filter GetCompilerFilter() const override { // Use a profile based filter. return CompilerFilter::kSpeedProfile; } @@ -278,7 +278,7 @@ TEST_F(CompilerDriverProfileTest, ProfileGuidedCompilation) { // which will be used for OatClass. class CompilerDriverVerifyTest : public CompilerDriverTest { protected: - CompilerFilter::Filter GetCompilerFilter() const OVERRIDE { + CompilerFilter::Filter GetCompilerFilter() const override { return CompilerFilter::kVerify; } diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index 601c9140dde5c30e19abe51e1238906123fd0365..34aceba1c499360898155109049825d465a7003b 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -43,7 +43,7 @@ class DexFile; enum class InstructionSet; class InstructionSetFeatures; -class CompilerOptions FINAL { +class CompilerOptions final { public: // Guide heuristics to determine whether to compile method if profile data not available. static const size_t kDefaultHugeMethodThreshold = 10000; diff --git a/compiler/exception_test.cc b/compiler/exception_test.cc index fd17364c266a8368025fe77fa8da8a06d89c0bce..80c0a6883d696a08c2d6d01fbdc878297d573019 100644 --- a/compiler/exception_test.cc +++ b/compiler/exception_test.cc @@ -50,7 +50,7 @@ class ExceptionTest : public CommonRuntimeTest { // which always points to the first source statement. static constexpr const uint32_t kDexPc = 0; - virtual void SetUp() { + void SetUp() override { CommonRuntimeTest::SetUp(); ScopedObjectAccess soa(Thread::Current()); diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc index 3cb4a652ad513a9d1e740fba4b0bcdedd5f42353..92b9543c2797a42462293085f0809213e2a02cfe 100644 --- a/compiler/jni/jni_compiler_test.cc +++ b/compiler/jni/jni_compiler_test.cc @@ -221,12 +221,12 @@ struct jni_remove_extra_parameters : public remove_extra_parameters_helper(PointerSize::k32); -class ArmManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class ArmManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: ArmManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, is_synchronized, shorty, PointerSize::k32) {} - ~ArmManagedRuntimeCallingConvention() OVERRIDE {} + ~ArmManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: ManagedRegisterEntrySpills entry_spills_; @@ -50,37 +50,37 @@ class ArmManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingCon DISALLOW_COPY_AND_ASSIGN(ArmManagedRuntimeCallingConvention); }; -class ArmJniCallingConvention FINAL : public JniCallingConvention { +class ArmJniCallingConvention final : public JniCallingConvention { public: ArmJniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~ArmJniCallingConvention() OVERRIDE {} + ~ArmJniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - void Next() OVERRIDE; // Override default behavior for AAPCS - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + void Next() override; // Override default behavior for AAPCS + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // AAPCS mandates return values are extended. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return false; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: // Padding to ensure longs and doubles are not split in AAPCS diff --git a/compiler/jni/quick/arm64/calling_convention_arm64.h b/compiler/jni/quick/arm64/calling_convention_arm64.h index 56189427b66c1084bd0fc8f62e85a0314516f848..ed0ddeb1b2047028cf2dd8ce0acf304a95526b1a 100644 --- a/compiler/jni/quick/arm64/calling_convention_arm64.h +++ b/compiler/jni/quick/arm64/calling_convention_arm64.h @@ -25,24 +25,24 @@ namespace arm64 { constexpr size_t kFramePointerSize = static_cast(PointerSize::k64); -class Arm64ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class Arm64ManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: Arm64ManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, is_synchronized, shorty, PointerSize::k64) {} - ~Arm64ManagedRuntimeCallingConvention() OVERRIDE {} + ~Arm64ManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: ManagedRegisterEntrySpills entry_spills_; @@ -50,36 +50,36 @@ class Arm64ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingC DISALLOW_COPY_AND_ASSIGN(Arm64ManagedRuntimeCallingConvention); }; -class Arm64JniCallingConvention FINAL : public JniCallingConvention { +class Arm64JniCallingConvention final : public JniCallingConvention { public: Arm64JniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~Arm64JniCallingConvention() OVERRIDE {} + ~Arm64JniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // aarch64 calling convention leaves upper bits undefined. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return true; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: DISALLOW_COPY_AND_ASSIGN(Arm64JniCallingConvention); diff --git a/compiler/jni/quick/mips/calling_convention_mips.h b/compiler/jni/quick/mips/calling_convention_mips.h index ad3f118bad3585fab4a1083de102de2de35d9185..165fc6056e29641ddcb6f06f010bdc4d9bbf7751 100644 --- a/compiler/jni/quick/mips/calling_convention_mips.h +++ b/compiler/jni/quick/mips/calling_convention_mips.h @@ -27,24 +27,24 @@ constexpr size_t kFramePointerSize = 4; static_assert(kFramePointerSize == static_cast(PointerSize::k32), "Invalid frame pointer size"); -class MipsManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class MipsManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: MipsManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, is_synchronized, shorty, PointerSize::k32) {} - ~MipsManagedRuntimeCallingConvention() OVERRIDE {} + ~MipsManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: ManagedRegisterEntrySpills entry_spills_; @@ -52,37 +52,37 @@ class MipsManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingCo DISALLOW_COPY_AND_ASSIGN(MipsManagedRuntimeCallingConvention); }; -class MipsJniCallingConvention FINAL : public JniCallingConvention { +class MipsJniCallingConvention final : public JniCallingConvention { public: MipsJniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~MipsJniCallingConvention() OVERRIDE {} + ~MipsJniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - void Next() OVERRIDE; // Override default behavior for o32. - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + void Next() override; // Override default behavior for o32. + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // Mips does not need to extend small return types. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return false; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: // Padding to ensure longs and doubles are not split in o32. diff --git a/compiler/jni/quick/mips64/calling_convention_mips64.h b/compiler/jni/quick/mips64/calling_convention_mips64.h index faedaeff6c08373ffcc0f784f49db7b3a8bab620..d87f73a1ea0f2fe0fa893fd56e6fa772f7c4d4c7 100644 --- a/compiler/jni/quick/mips64/calling_convention_mips64.h +++ b/compiler/jni/quick/mips64/calling_convention_mips64.h @@ -27,24 +27,24 @@ constexpr size_t kFramePointerSize = 8; static_assert(kFramePointerSize == static_cast(PointerSize::k64), "Invalid frame pointer size"); -class Mips64ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class Mips64ManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: Mips64ManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, is_synchronized, shorty, PointerSize::k64) {} - ~Mips64ManagedRuntimeCallingConvention() OVERRIDE {} + ~Mips64ManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: ManagedRegisterEntrySpills entry_spills_; @@ -52,36 +52,36 @@ class Mips64ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCalling DISALLOW_COPY_AND_ASSIGN(Mips64ManagedRuntimeCallingConvention); }; -class Mips64JniCallingConvention FINAL : public JniCallingConvention { +class Mips64JniCallingConvention final : public JniCallingConvention { public: Mips64JniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~Mips64JniCallingConvention() OVERRIDE {} + ~Mips64JniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // Mips64 does not need to extend small return types. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return false; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: DISALLOW_COPY_AND_ASSIGN(Mips64JniCallingConvention); diff --git a/compiler/jni/quick/x86/calling_convention_x86.h b/compiler/jni/quick/x86/calling_convention_x86.h index be83cdaad0052177edb751e80ac96560713972df..d0c6198e77cb6b1daedb2e3744654f607460eac1 100644 --- a/compiler/jni/quick/x86/calling_convention_x86.h +++ b/compiler/jni/quick/x86/calling_convention_x86.h @@ -25,7 +25,7 @@ namespace x86 { constexpr size_t kFramePointerSize = static_cast(PointerSize::k32); -class X86ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class X86ManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: X86ManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, @@ -33,17 +33,17 @@ class X86ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingCon shorty, PointerSize::k32), gpr_arg_count_(0) {} - ~X86ManagedRuntimeCallingConvention() OVERRIDE {} + ~X86ManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: int gpr_arg_count_; @@ -53,36 +53,36 @@ class X86ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingCon }; // Implements the x86 cdecl calling convention. -class X86JniCallingConvention FINAL : public JniCallingConvention { +class X86JniCallingConvention final : public JniCallingConvention { public: X86JniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~X86JniCallingConvention() OVERRIDE {} + ~X86JniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // x86 needs to extend small return types. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return true; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: DISALLOW_COPY_AND_ASSIGN(X86JniCallingConvention); diff --git a/compiler/jni/quick/x86_64/calling_convention_x86_64.h b/compiler/jni/quick/x86_64/calling_convention_x86_64.h index cdba334d811d3aa2a19a14e2cca00256be12f413..dfab41b1545d23c4b6f14f5bd49cfd835e20e2de 100644 --- a/compiler/jni/quick/x86_64/calling_convention_x86_64.h +++ b/compiler/jni/quick/x86_64/calling_convention_x86_64.h @@ -23,59 +23,59 @@ namespace art { namespace x86_64 { -class X86_64ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class X86_64ManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: X86_64ManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, is_synchronized, shorty, PointerSize::k64) {} - ~X86_64ManagedRuntimeCallingConvention() OVERRIDE {} + ~X86_64ManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: ManagedRegisterEntrySpills entry_spills_; DISALLOW_COPY_AND_ASSIGN(X86_64ManagedRuntimeCallingConvention); }; -class X86_64JniCallingConvention FINAL : public JniCallingConvention { +class X86_64JniCallingConvention final : public JniCallingConvention { public: X86_64JniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~X86_64JniCallingConvention() OVERRIDE {} + ~X86_64JniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // x86-64 needs to extend small return types. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return true; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: DISALLOW_COPY_AND_ASSIGN(X86_64JniCallingConvention); diff --git a/compiler/linker/buffered_output_stream.h b/compiler/linker/buffered_output_stream.h index 512409cb2f5409ba225f329f20abc58da884d386..cb1c44ba235a032639061d78fa85233acb12d436 100644 --- a/compiler/linker/buffered_output_stream.h +++ b/compiler/linker/buffered_output_stream.h @@ -26,17 +26,17 @@ namespace art { namespace linker { -class BufferedOutputStream FINAL : public OutputStream { +class BufferedOutputStream final : public OutputStream { public: explicit BufferedOutputStream(std::unique_ptr out); - ~BufferedOutputStream() OVERRIDE; + ~BufferedOutputStream() override; - bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE; + bool WriteFully(const void* buffer, size_t byte_count) override; - off_t Seek(off_t offset, Whence whence) OVERRIDE; + off_t Seek(off_t offset, Whence whence) override; - bool Flush() OVERRIDE; + bool Flush() override; private: static const size_t kBufferSize = 8 * KB; diff --git a/compiler/linker/elf_builder.h b/compiler/linker/elf_builder.h index 974c590a65eb815dbe57ad2273a7ae4d8d3d413b..81ecc175b5e0134f7089542f914cd0fbfde0bbc5 100644 --- a/compiler/linker/elf_builder.h +++ b/compiler/linker/elf_builder.h @@ -75,7 +75,7 @@ namespace linker { // The debug sections are written last for easier stripping. // template -class ElfBuilder FINAL { +class ElfBuilder final { public: static constexpr size_t kMaxProgramHeaders = 16; // SHA-1 digest. Not using SHA_DIGEST_LENGTH from openssl/sha.h to avoid @@ -173,21 +173,21 @@ class ElfBuilder FINAL { // This function always succeeds to simplify code. // Use builder's Good() to check the actual status. - bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE { + bool WriteFully(const void* buffer, size_t byte_count) override { CHECK(owner_->current_section_ == this); return owner_->stream_.WriteFully(buffer, byte_count); } // This function always succeeds to simplify code. // Use builder's Good() to check the actual status. - off_t Seek(off_t offset, Whence whence) OVERRIDE { + off_t Seek(off_t offset, Whence whence) override { // Forward the seek as-is and trust the caller to use it reasonably. return owner_->stream_.Seek(offset, whence); } // This function flushes the output and returns whether it succeeded. // If there was a previous failure, this does nothing and returns false, i.e. failed. - bool Flush() OVERRIDE { + bool Flush() override { return owner_->stream_.Flush(); } @@ -271,7 +271,7 @@ class ElfBuilder FINAL { }; // Writer of .dynstr section. - class CachedStringSection FINAL : public CachedSection { + class CachedStringSection final : public CachedSection { public: CachedStringSection(ElfBuilder* owner, const std::string& name, @@ -295,7 +295,7 @@ class ElfBuilder FINAL { }; // Writer of .strtab and .shstrtab sections. - class StringSection FINAL : public Section { + class StringSection final : public Section { public: StringSection(ElfBuilder* owner, const std::string& name, @@ -338,7 +338,7 @@ class ElfBuilder FINAL { }; // Writer of .dynsym and .symtab sections. - class SymbolSection FINAL : public Section { + class SymbolSection final : public Section { public: SymbolSection(ElfBuilder* owner, const std::string& name, @@ -410,7 +410,7 @@ class ElfBuilder FINAL { std::vector syms_; // Buffered/cached content of the whole section. }; - class AbiflagsSection FINAL : public Section { + class AbiflagsSection final : public Section { public: // Section with Mips abiflag info. static constexpr uint8_t MIPS_AFL_REG_NONE = 0; // no registers @@ -480,7 +480,7 @@ class ElfBuilder FINAL { } abiflags_; }; - class BuildIdSection FINAL : public Section { + class BuildIdSection final : public Section { public: BuildIdSection(ElfBuilder* owner, const std::string& name, diff --git a/compiler/linker/error_delaying_output_stream.h b/compiler/linker/error_delaying_output_stream.h index 659f1dc0937a846824872c569cde194b9430248e..cadd71c3f0ebaf9b4584d0da1e47a48079f4c7c5 100644 --- a/compiler/linker/error_delaying_output_stream.h +++ b/compiler/linker/error_delaying_output_stream.h @@ -27,7 +27,7 @@ namespace art { namespace linker { // OutputStream wrapper that delays reporting an error until Flush(). -class ErrorDelayingOutputStream FINAL : public OutputStream { +class ErrorDelayingOutputStream final : public OutputStream { public: explicit ErrorDelayingOutputStream(OutputStream* output) : OutputStream(output->GetLocation()), @@ -37,7 +37,7 @@ class ErrorDelayingOutputStream FINAL : public OutputStream { // This function always succeeds to simplify code. // Use Good() to check the actual status of the output stream. - bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE { + bool WriteFully(const void* buffer, size_t byte_count) override { if (output_good_) { if (!output_->WriteFully(buffer, byte_count)) { PLOG(ERROR) << "Failed to write " << byte_count @@ -51,7 +51,7 @@ class ErrorDelayingOutputStream FINAL : public OutputStream { // This function always succeeds to simplify code. // Use Good() to check the actual status of the output stream. - off_t Seek(off_t offset, Whence whence) OVERRIDE { + off_t Seek(off_t offset, Whence whence) override { // We keep shadow copy of the offset so that we return // the expected value even if the output stream failed. off_t new_offset; @@ -81,7 +81,7 @@ class ErrorDelayingOutputStream FINAL : public OutputStream { // Flush the output and return whether all operations have succeeded. // Do nothing if we already have a pending error. - bool Flush() OVERRIDE { + bool Flush() override { if (output_good_) { output_good_ = output_->Flush(); } diff --git a/compiler/linker/file_output_stream.h b/compiler/linker/file_output_stream.h index deb051fca4517cc9277f1ce7bbc3d73dcaaeb5e8..1417132981d8bbea54ee0599cd372a51127f7c18 100644 --- a/compiler/linker/file_output_stream.h +++ b/compiler/linker/file_output_stream.h @@ -24,17 +24,17 @@ namespace art { namespace linker { -class FileOutputStream FINAL : public OutputStream { +class FileOutputStream final : public OutputStream { public: explicit FileOutputStream(File* file); - ~FileOutputStream() OVERRIDE {} + ~FileOutputStream() override {} - bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE; + bool WriteFully(const void* buffer, size_t byte_count) override; - off_t Seek(off_t offset, Whence whence) OVERRIDE; + off_t Seek(off_t offset, Whence whence) override; - bool Flush() OVERRIDE; + bool Flush() override; private: File* const file_; diff --git a/compiler/linker/output_stream_test.cc b/compiler/linker/output_stream_test.cc index f93ea7a7094ca279efc93c0e2d3047f17e97c6fe..bcb129c2da6756f080fe0e5a51108590b7a8c3e0 100644 --- a/compiler/linker/output_stream_test.cc +++ b/compiler/linker/output_stream_test.cc @@ -106,20 +106,20 @@ TEST_F(OutputStreamTest, BufferedFlush) { CheckingOutputStream() : OutputStream("dummy"), flush_called(false) { } - ~CheckingOutputStream() OVERRIDE {} + ~CheckingOutputStream() override {} bool WriteFully(const void* buffer ATTRIBUTE_UNUSED, - size_t byte_count ATTRIBUTE_UNUSED) OVERRIDE { + size_t byte_count ATTRIBUTE_UNUSED) override { LOG(FATAL) << "UNREACHABLE"; UNREACHABLE(); } - off_t Seek(off_t offset ATTRIBUTE_UNUSED, Whence whence ATTRIBUTE_UNUSED) OVERRIDE { + off_t Seek(off_t offset ATTRIBUTE_UNUSED, Whence whence ATTRIBUTE_UNUSED) override { LOG(FATAL) << "UNREACHABLE"; UNREACHABLE(); } - bool Flush() OVERRIDE { + bool Flush() override { flush_called = true; return true; } diff --git a/compiler/linker/vector_output_stream.h b/compiler/linker/vector_output_stream.h index 92caf596abbebfc7716d92d0466e18121a1acaa6..0d34da6cba2a3a3ab9031f94b3924fffc8870ac1 100644 --- a/compiler/linker/vector_output_stream.h +++ b/compiler/linker/vector_output_stream.h @@ -26,13 +26,13 @@ namespace art { namespace linker { -class VectorOutputStream FINAL : public OutputStream { +class VectorOutputStream final : public OutputStream { public: VectorOutputStream(const std::string& location, std::vector* vector); - ~VectorOutputStream() OVERRIDE {} + ~VectorOutputStream() override {} - bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE { + bool WriteFully(const void* buffer, size_t byte_count) override { if (static_cast(offset_) == vector_->size()) { const uint8_t* start = reinterpret_cast(buffer); vector_->insert(vector_->end(), &start[0], &start[byte_count]); @@ -46,9 +46,9 @@ class VectorOutputStream FINAL : public OutputStream { return true; } - off_t Seek(off_t offset, Whence whence) OVERRIDE; + off_t Seek(off_t offset, Whence whence) override; - bool Flush() OVERRIDE { + bool Flush() override { return true; } diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index dfefa524bf56ba0260110d6873504e057b75de34..1c3660c0a77def5028cd355159d95b35574050d9 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -388,10 +388,10 @@ class MonotonicValueRange : public ValueRange { return induction_variable_->GetBlock(); } - MonotonicValueRange* AsMonotonicValueRange() OVERRIDE { return this; } + MonotonicValueRange* AsMonotonicValueRange() override { return this; } // If it's certain that this value range fits in other_range. - bool FitsIn(ValueRange* other_range) const OVERRIDE { + bool FitsIn(ValueRange* other_range) const override { if (other_range == nullptr) { return true; } @@ -402,7 +402,7 @@ class MonotonicValueRange : public ValueRange { // Try to narrow this MonotonicValueRange given another range. // Ideally it will return a normal ValueRange. But due to // possible overflow/underflow, that may not be possible. - ValueRange* Narrow(ValueRange* range) OVERRIDE { + ValueRange* Narrow(ValueRange* range) override { if (range == nullptr) { return this; } @@ -530,7 +530,7 @@ class BCEVisitor : public HGraphVisitor { induction_range_(induction_analysis), next_(nullptr) {} - void VisitBasicBlock(HBasicBlock* block) OVERRIDE { + void VisitBasicBlock(HBasicBlock* block) override { DCHECK(!IsAddedBlock(block)); first_index_bounds_check_map_.clear(); // Visit phis and instructions using a safe iterator. The iteration protects @@ -820,7 +820,7 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitBoundsCheck(HBoundsCheck* bounds_check) OVERRIDE { + void VisitBoundsCheck(HBoundsCheck* bounds_check) override { HBasicBlock* block = bounds_check->GetBlock(); HInstruction* index = bounds_check->InputAt(0); HInstruction* array_length = bounds_check->InputAt(1); @@ -945,7 +945,7 @@ class BCEVisitor : public HGraphVisitor { return true; } - void VisitPhi(HPhi* phi) OVERRIDE { + void VisitPhi(HPhi* phi) override { if (phi->IsLoopHeaderPhi() && (phi->GetType() == DataType::Type::kInt32) && HasSameInputAtBackEdges(phi)) { @@ -992,14 +992,14 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitIf(HIf* instruction) OVERRIDE { + void VisitIf(HIf* instruction) override { if (instruction->InputAt(0)->IsCondition()) { HCondition* cond = instruction->InputAt(0)->AsCondition(); HandleIf(instruction, cond->GetLeft(), cond->GetRight(), cond->GetCondition()); } } - void VisitAdd(HAdd* add) OVERRIDE { + void VisitAdd(HAdd* add) override { HInstruction* right = add->GetRight(); if (right->IsIntConstant()) { ValueRange* left_range = LookupValueRange(add->GetLeft(), add->GetBlock()); @@ -1013,7 +1013,7 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitSub(HSub* sub) OVERRIDE { + void VisitSub(HSub* sub) override { HInstruction* left = sub->GetLeft(); HInstruction* right = sub->GetRight(); if (right->IsIntConstant()) { @@ -1115,19 +1115,19 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitDiv(HDiv* div) OVERRIDE { + void VisitDiv(HDiv* div) override { FindAndHandlePartialArrayLength(div); } - void VisitShr(HShr* shr) OVERRIDE { + void VisitShr(HShr* shr) override { FindAndHandlePartialArrayLength(shr); } - void VisitUShr(HUShr* ushr) OVERRIDE { + void VisitUShr(HUShr* ushr) override { FindAndHandlePartialArrayLength(ushr); } - void VisitAnd(HAnd* instruction) OVERRIDE { + void VisitAnd(HAnd* instruction) override { if (instruction->GetRight()->IsIntConstant()) { int32_t constant = instruction->GetRight()->AsIntConstant()->GetValue(); if (constant > 0) { @@ -1142,7 +1142,7 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitRem(HRem* instruction) OVERRIDE { + void VisitRem(HRem* instruction) override { HInstruction* left = instruction->GetLeft(); HInstruction* right = instruction->GetRight(); @@ -1202,7 +1202,7 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitNewArray(HNewArray* new_array) OVERRIDE { + void VisitNewArray(HNewArray* new_array) override { HInstruction* len = new_array->GetLength(); if (!len->IsIntConstant()) { HInstruction *left; @@ -1240,7 +1240,7 @@ class BCEVisitor : public HGraphVisitor { * has occurred (see AddCompareWithDeoptimization()), since in those cases it would be * unsafe to hoist array references across their deoptimization instruction inside a loop. */ - void VisitArrayGet(HArrayGet* array_get) OVERRIDE { + void VisitArrayGet(HArrayGet* array_get) override { if (!has_dom_based_dynamic_bce_ && array_get->IsInLoop()) { HLoopInformation* loop = array_get->GetBlock()->GetLoopInformation(); if (loop->IsDefinedOutOfTheLoop(array_get->InputAt(0)) && diff --git a/compiler/optimizing/bounds_check_elimination.h b/compiler/optimizing/bounds_check_elimination.h index 92ab7984c80bcb115b6cf3ce02b57807f7433d31..ef08877daa4474dbccc8e5dd12fb27ec5defaa01 100644 --- a/compiler/optimizing/bounds_check_elimination.h +++ b/compiler/optimizing/bounds_check_elimination.h @@ -34,7 +34,7 @@ class BoundsCheckElimination : public HOptimization { side_effects_(side_effects), induction_analysis_(induction_analysis) {} - bool Run() OVERRIDE; + bool Run() override; static constexpr const char* kBoundsCheckEliminationPassName = "BCE"; diff --git a/compiler/optimizing/cha_guard_optimization.cc b/compiler/optimizing/cha_guard_optimization.cc index bdc395b52dd6a60448c99ec3a266ea9d61f7d2af..c6232ef6613e1c31b958ca592dda6b66f0b0092b 100644 --- a/compiler/optimizing/cha_guard_optimization.cc +++ b/compiler/optimizing/cha_guard_optimization.cc @@ -44,9 +44,9 @@ class CHAGuardVisitor : HGraphVisitor { GetGraph()->SetNumberOfCHAGuards(0); } - void VisitShouldDeoptimizeFlag(HShouldDeoptimizeFlag* flag) OVERRIDE; + void VisitShouldDeoptimizeFlag(HShouldDeoptimizeFlag* flag) override; - void VisitBasicBlock(HBasicBlock* block) OVERRIDE; + void VisitBasicBlock(HBasicBlock* block) override; private: void RemoveGuard(HShouldDeoptimizeFlag* flag); diff --git a/compiler/optimizing/cha_guard_optimization.h b/compiler/optimizing/cha_guard_optimization.h index d2c5a344b72439534b965080db7e95786c6426ea..440d51a96950a9414d0d804aa2add7cd06ea4ea7 100644 --- a/compiler/optimizing/cha_guard_optimization.h +++ b/compiler/optimizing/cha_guard_optimization.h @@ -30,7 +30,7 @@ class CHAGuardOptimization : public HOptimization { const char* name = kCHAGuardOptimizationPassName) : HOptimization(graph, name) {} - bool Run() OVERRIDE; + bool Run() override; static constexpr const char* kCHAGuardOptimizationPassName = "cha_guard_optimization"; diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index a13efcaee2db09d942385ccd41029a7038444f22..e84896b113f13e5dd64bc9f3047a2d90cb7cb4ba 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -1394,37 +1394,12 @@ void CodeGenerator::EmitEnvironment(HEnvironment* environment, SlowPathCode* slo } bool CodeGenerator::CanMoveNullCheckToUser(HNullCheck* null_check) { - HInstruction* first_next_not_move = null_check->GetNextDisregardingMoves(); - - return (first_next_not_move != nullptr) - && first_next_not_move->CanDoImplicitNullCheckOn(null_check->InputAt(0)); + return null_check->IsEmittedAtUseSite(); } void CodeGenerator::MaybeRecordImplicitNullCheck(HInstruction* instr) { - if (!compiler_options_.GetImplicitNullChecks()) { - return; - } - - // If we are from a static path don't record the pc as we can't throw NPE. - // NB: having the checks here makes the code much less verbose in the arch - // specific code generators. - if (instr->IsStaticFieldSet() || instr->IsStaticFieldGet()) { - return; - } - - if (!instr->CanDoImplicitNullCheckOn(instr->InputAt(0))) { - return; - } - - // Find the first previous instruction which is not a move. - HInstruction* first_prev_not_move = instr->GetPreviousDisregardingMoves(); - - // If the instruction is a null check it means that `instr` is the first user - // and needs to record the pc. - if (first_prev_not_move != nullptr && first_prev_not_move->IsNullCheck()) { - HNullCheck* null_check = first_prev_not_move->AsNullCheck(); - // TODO: The parallel moves modify the environment. Their changes need to be - // reverted otherwise the stack maps at the throw point will not be correct. + HNullCheck* null_check = instr->GetImplicitNullCheck(); + if (null_check != nullptr) { RecordPcInfo(null_check, null_check->GetDexPc()); } } @@ -1514,7 +1489,12 @@ void CodeGenerator::ValidateInvokeRuntime(QuickEntrypointEnum entrypoint, << " instruction->GetSideEffects().ToString()=" << instruction->GetSideEffects().ToString(); } else { - DCHECK(instruction->GetSideEffects().Includes(SideEffects::CanTriggerGC()) || + // 'CanTriggerGC' side effect is used to restrict optimization of instructions which depend + // on GC (e.g. IntermediateAddress) - to ensure they are not alive across GC points. However + // if execution never returns to the compiled code from a GC point this restriction is + // unnecessary - in particular for fatal slow paths which might trigger GC. + DCHECK((slow_path->IsFatal() && !instruction->GetLocations()->WillCall()) || + instruction->GetSideEffects().Includes(SideEffects::CanTriggerGC()) || // When (non-Baker) read barriers are enabled, some instructions // use a slow path to emit a read barrier, which does not trigger // GC. diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index 462225aafb308487522c65b81fda0a6e2fdc6ead..d56f7aaca148c2712d22f0d9e8163640badffb03 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -247,7 +247,7 @@ class BoundsCheckSlowPathARM64 : public SlowPathCodeARM64 { public: explicit BoundsCheckSlowPathARM64(HBoundsCheck* instruction) : SlowPathCodeARM64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorARM64* arm64_codegen = down_cast(codegen); @@ -273,9 +273,9 @@ class BoundsCheckSlowPathARM64 : public SlowPathCodeARM64 { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathARM64"; } + const char* GetDescription() const override { return "BoundsCheckSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathARM64); @@ -285,16 +285,16 @@ class DivZeroCheckSlowPathARM64 : public SlowPathCodeARM64 { public: explicit DivZeroCheckSlowPathARM64(HDivZeroCheck* instruction) : SlowPathCodeARM64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARM64* arm64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); arm64_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathARM64"; } + const char* GetDescription() const override { return "DivZeroCheckSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathARM64); @@ -308,7 +308,7 @@ class LoadClassSlowPathARM64 : public SlowPathCodeARM64 { DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); const uint32_t dex_pc = instruction_->GetDexPc(); @@ -349,7 +349,7 @@ class LoadClassSlowPathARM64 : public SlowPathCodeARM64 { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathARM64"; } + const char* GetDescription() const override { return "LoadClassSlowPathARM64"; } private: // The class this slow path will load. @@ -363,7 +363,7 @@ class LoadStringSlowPathARM64 : public SlowPathCodeARM64 { explicit LoadStringSlowPathARM64(HLoadString* instruction) : SlowPathCodeARM64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); CodeGeneratorARM64* arm64_codegen = down_cast(codegen); @@ -384,7 +384,7 @@ class LoadStringSlowPathARM64 : public SlowPathCodeARM64 { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathARM64"; } + const char* GetDescription() const override { return "LoadStringSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathARM64); @@ -394,7 +394,7 @@ class NullCheckSlowPathARM64 : public SlowPathCodeARM64 { public: explicit NullCheckSlowPathARM64(HNullCheck* instr) : SlowPathCodeARM64(instr) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARM64* arm64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); if (instruction_->CanThrowIntoCatchBlock()) { @@ -408,9 +408,9 @@ class NullCheckSlowPathARM64 : public SlowPathCodeARM64 { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathARM64"; } + const char* GetDescription() const override { return "NullCheckSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathARM64); @@ -421,7 +421,7 @@ class SuspendCheckSlowPathARM64 : public SlowPathCodeARM64 { SuspendCheckSlowPathARM64(HSuspendCheck* instruction, HBasicBlock* successor) : SlowPathCodeARM64(instruction), successor_(successor) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorARM64* arm64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -445,7 +445,7 @@ class SuspendCheckSlowPathARM64 : public SlowPathCodeARM64 { return successor_; } - const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathARM64"; } + const char* GetDescription() const override { return "SuspendCheckSlowPathARM64"; } private: // If not null, the block to branch to after the suspend check. @@ -462,7 +462,7 @@ class TypeCheckSlowPathARM64 : public SlowPathCodeARM64 { TypeCheckSlowPathARM64(HInstruction* instruction, bool is_fatal) : SlowPathCodeARM64(instruction), is_fatal_(is_fatal) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DCHECK(instruction_->IsCheckCast() @@ -503,8 +503,8 @@ class TypeCheckSlowPathARM64 : public SlowPathCodeARM64 { } } - const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathARM64"; } - bool IsFatal() const OVERRIDE { return is_fatal_; } + const char* GetDescription() const override { return "TypeCheckSlowPathARM64"; } + bool IsFatal() const override { return is_fatal_; } private: const bool is_fatal_; @@ -517,7 +517,7 @@ class DeoptimizationSlowPathARM64 : public SlowPathCodeARM64 { explicit DeoptimizationSlowPathARM64(HDeoptimize* instruction) : SlowPathCodeARM64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARM64* arm64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); LocationSummary* locations = instruction_->GetLocations(); @@ -529,7 +529,7 @@ class DeoptimizationSlowPathARM64 : public SlowPathCodeARM64 { CheckEntrypointTypes(); } - const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathARM64"; } + const char* GetDescription() const override { return "DeoptimizationSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathARM64); @@ -539,7 +539,7 @@ class ArraySetSlowPathARM64 : public SlowPathCodeARM64 { public: explicit ArraySetSlowPathARM64(HInstruction* instruction) : SlowPathCodeARM64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); @@ -570,7 +570,7 @@ class ArraySetSlowPathARM64 : public SlowPathCodeARM64 { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ArraySetSlowPathARM64"; } + const char* GetDescription() const override { return "ArraySetSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathARM64); @@ -628,7 +628,7 @@ class ReadBarrierForHeapReferenceSlowPathARM64 : public SlowPathCodeARM64 { DCHECK(!obj.Equals(ref)) << "obj=" << obj << " ref=" << ref; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARM64* arm64_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); DataType::Type type = DataType::Type::kReference; @@ -754,7 +754,7 @@ class ReadBarrierForHeapReferenceSlowPathARM64 : public SlowPathCodeARM64 { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForHeapReferenceSlowPathARM64"; } + const char* GetDescription() const override { return "ReadBarrierForHeapReferenceSlowPathARM64"; } private: Register FindAvailableCallerSaveRegister(CodeGenerator* codegen) { @@ -794,7 +794,7 @@ class ReadBarrierForRootSlowPathARM64 : public SlowPathCodeARM64 { DCHECK(kEmitCompilerReadBarrier); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DataType::Type type = DataType::Type::kReference; DCHECK(locations->CanCall()); @@ -831,7 +831,7 @@ class ReadBarrierForRootSlowPathARM64 : public SlowPathCodeARM64 { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForRootSlowPathARM64"; } + const char* GetDescription() const override { return "ReadBarrierForRootSlowPathARM64"; } private: const Location out_; @@ -5065,7 +5065,7 @@ void CodeGeneratorARM64::GenerateImplicitNullCheck(HNullCheck* instruction) { return; } { - // Ensure that between load and MaybeRecordImplicitNullCheck there are no pools emitted. + // Ensure that between load and RecordPcInfo there are no pools emitted. EmissionCheckScope guard(GetVIXLAssembler(), kMaxMacroInstructionSizeInBytes); Location obj = instruction->GetLocations()->InAt(0); __ Ldr(wzr, HeapOperandFrom(obj, Offset(0))); diff --git a/compiler/optimizing/code_generator_arm64.h b/compiler/optimizing/code_generator_arm64.h index 4f6a44fe4d6e67daa47cfa631e9d0b973d5c3c19..2e7a20b5532d48f3aefe1b7f519cfd80871841c0 100644 --- a/compiler/optimizing/code_generator_arm64.h +++ b/compiler/optimizing/code_generator_arm64.h @@ -125,8 +125,8 @@ class SlowPathCodeARM64 : public SlowPathCode { vixl::aarch64::Label* GetEntryLabel() { return &entry_label_; } vixl::aarch64::Label* GetExitLabel() { return &exit_label_; } - void SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) OVERRIDE; - void RestoreLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) OVERRIDE; + void SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) override; + void RestoreLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) override; private: vixl::aarch64::Label entry_label_; @@ -216,11 +216,11 @@ class InvokeDexCallingConventionVisitorARM64 : public InvokeDexCallingConvention InvokeDexCallingConventionVisitorARM64() {} virtual ~InvokeDexCallingConventionVisitorARM64() {} - Location GetNextLocation(DataType::Type type) OVERRIDE; - Location GetReturnLocation(DataType::Type return_type) const OVERRIDE { + Location GetNextLocation(DataType::Type type) override; + Location GetReturnLocation(DataType::Type return_type) const override { return calling_convention.GetReturnLocation(return_type); } - Location GetMethodLocation() const OVERRIDE; + Location GetMethodLocation() const override; private: InvokeDexCallingConvention calling_convention; @@ -232,22 +232,22 @@ class FieldAccessCallingConventionARM64 : public FieldAccessCallingConvention { public: FieldAccessCallingConventionARM64() {} - Location GetObjectLocation() const OVERRIDE { + Location GetObjectLocation() const override { return helpers::LocationFrom(vixl::aarch64::x1); } - Location GetFieldIndexLocation() const OVERRIDE { + Location GetFieldIndexLocation() const override { return helpers::LocationFrom(vixl::aarch64::x0); } - Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const override { return helpers::LocationFrom(vixl::aarch64::x0); } Location GetSetValueLocation(DataType::Type type ATTRIBUTE_UNUSED, - bool is_instance) const OVERRIDE { + bool is_instance) const override { return is_instance ? helpers::LocationFrom(vixl::aarch64::x2) : helpers::LocationFrom(vixl::aarch64::x1); } - Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const override { return helpers::LocationFrom(vixl::aarch64::d0); } @@ -260,7 +260,7 @@ class InstructionCodeGeneratorARM64 : public InstructionCodeGenerator { InstructionCodeGeneratorARM64(HGraph* graph, CodeGeneratorARM64* codegen); #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_ARM64(DECLARE_VISIT_INSTRUCTION) @@ -268,7 +268,7 @@ class InstructionCodeGeneratorARM64 : public InstructionCodeGenerator { #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -360,7 +360,7 @@ class LocationsBuilderARM64 : public HGraphVisitor { : HGraphVisitor(graph), codegen_(codegen) {} #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_ARM64(DECLARE_VISIT_INSTRUCTION) @@ -368,7 +368,7 @@ class LocationsBuilderARM64 : public HGraphVisitor { #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -393,11 +393,11 @@ class ParallelMoveResolverARM64 : public ParallelMoveResolverNoSwap { : ParallelMoveResolverNoSwap(allocator), codegen_(codegen), vixl_temps_() {} protected: - void PrepareForEmitNativeCode() OVERRIDE; - void FinishEmitNativeCode() OVERRIDE; - Location AllocateScratchLocationFor(Location::Kind kind) OVERRIDE; - void FreeScratchLocation(Location loc) OVERRIDE; - void EmitMove(size_t index) OVERRIDE; + void PrepareForEmitNativeCode() override; + void FinishEmitNativeCode() override; + Location AllocateScratchLocationFor(Location::Kind kind) override; + void FreeScratchLocation(Location loc) override; + void EmitMove(size_t index) override; private: Arm64Assembler* GetAssembler() const; @@ -418,39 +418,39 @@ class CodeGeneratorARM64 : public CodeGenerator { OptimizingCompilerStats* stats = nullptr); virtual ~CodeGeneratorARM64() {} - void GenerateFrameEntry() OVERRIDE; - void GenerateFrameExit() OVERRIDE; + void GenerateFrameEntry() override; + void GenerateFrameExit() override; vixl::aarch64::CPURegList GetFramePreservedCoreRegisters() const; vixl::aarch64::CPURegList GetFramePreservedFPRegisters() const; - void Bind(HBasicBlock* block) OVERRIDE; + void Bind(HBasicBlock* block) override; vixl::aarch64::Label* GetLabelOf(HBasicBlock* block) { block = FirstNonEmptyBlock(block); return &(block_labels_[block->GetBlockId()]); } - size_t GetWordSize() const OVERRIDE { + size_t GetWordSize() const override { return kArm64WordSize; } - size_t GetFloatingPointSpillSlotSize() const OVERRIDE { + size_t GetFloatingPointSpillSlotSize() const override { return GetGraph()->HasSIMD() ? 2 * kArm64WordSize // 16 bytes == 2 arm64 words for each spill : 1 * kArm64WordSize; // 8 bytes == 1 arm64 words for each spill } - uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { + uintptr_t GetAddressOf(HBasicBlock* block) override { vixl::aarch64::Label* block_entry_label = GetLabelOf(block); DCHECK(block_entry_label->IsBound()); return block_entry_label->GetLocation(); } - HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } - HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } - Arm64Assembler* GetAssembler() OVERRIDE { return &assembler_; } - const Arm64Assembler& GetAssembler() const OVERRIDE { return assembler_; } + HGraphVisitor* GetLocationBuilder() override { return &location_builder_; } + HGraphVisitor* GetInstructionVisitor() override { return &instruction_visitor_; } + Arm64Assembler* GetAssembler() override { return &assembler_; } + const Arm64Assembler& GetAssembler() const override { return assembler_; } vixl::aarch64::MacroAssembler* GetVIXLAssembler() { return GetAssembler()->GetVIXLAssembler(); } // Emit a write barrier. @@ -462,12 +462,12 @@ class CodeGeneratorARM64 : public CodeGenerator { // Register allocation. - void SetupBlockedRegisters() const OVERRIDE; + void SetupBlockedRegisters() const override; - size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; + size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; // The number of registers that can be allocated. The register allocator may // decide to reserve and not use a few of them. @@ -479,35 +479,35 @@ class CodeGeneratorARM64 : public CodeGenerator { static const int kNumberOfAllocatableFPRegisters = vixl::aarch64::kNumberOfFPRegisters; static constexpr int kNumberOfAllocatableRegisterPairs = 0; - void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; - void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; + void DumpCoreRegister(std::ostream& stream, int reg) const override; + void DumpFloatingPointRegister(std::ostream& stream, int reg) const override; - InstructionSet GetInstructionSet() const OVERRIDE { + InstructionSet GetInstructionSet() const override { return InstructionSet::kArm64; } const Arm64InstructionSetFeatures& GetInstructionSetFeatures() const; - void Initialize() OVERRIDE { + void Initialize() override { block_labels_.resize(GetGraph()->GetBlocks().size()); } // We want to use the STP and LDP instructions to spill and restore registers for slow paths. // These instructions can only encode offsets that are multiples of the register size accessed. - uint32_t GetPreferredSlotsAlignment() const OVERRIDE { return vixl::aarch64::kXRegSizeInBytes; } + uint32_t GetPreferredSlotsAlignment() const override { return vixl::aarch64::kXRegSizeInBytes; } JumpTableARM64* CreateJumpTable(HPackedSwitch* switch_instr) { jump_tables_.emplace_back(new (GetGraph()->GetAllocator()) JumpTableARM64(switch_instr)); return jump_tables_.back().get(); } - void Finalize(CodeAllocator* allocator) OVERRIDE; + void Finalize(CodeAllocator* allocator) override; // Code generation helpers. void MoveConstant(vixl::aarch64::CPURegister destination, HConstant* constant); - void MoveConstant(Location destination, int32_t value) OVERRIDE; - void MoveLocation(Location dst, Location src, DataType::Type dst_type) OVERRIDE; - void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; + void MoveConstant(Location destination, int32_t value) override; + void MoveLocation(Location dst, Location src, DataType::Type dst_type) override; + void AddLocationAsTemp(Location location, LocationSummary* locations) override; void Load(DataType::Type type, vixl::aarch64::CPURegister dst, @@ -529,7 +529,7 @@ class CodeGeneratorARM64 : public CodeGenerator { void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, - SlowPathCode* slow_path = nullptr) OVERRIDE; + SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record // PC-related information in a stack map. @@ -537,35 +537,35 @@ class CodeGeneratorARM64 : public CodeGenerator { HInstruction* instruction, SlowPathCode* slow_path); - ParallelMoveResolverARM64* GetMoveResolver() OVERRIDE { return &move_resolver_; } + ParallelMoveResolverARM64* GetMoveResolver() override { return &move_resolver_; } - bool NeedsTwoRegisters(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + bool NeedsTwoRegisters(DataType::Type type ATTRIBUTE_UNUSED) const override { return false; } // Check if the desired_string_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadString::LoadKind GetSupportedLoadStringKind( - HLoadString::LoadKind desired_string_load_kind) OVERRIDE; + HLoadString::LoadKind desired_string_load_kind) override; // Check if the desired_class_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadClass::LoadKind GetSupportedLoadClassKind( - HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; + HLoadClass::LoadKind desired_class_load_kind) override; // Check if the desired_dispatch_info is supported. If it is, return it, // otherwise return a fall-back info that should be used instead. HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, - HInvokeStaticOrDirect* invoke) OVERRIDE; + HInvokeStaticOrDirect* invoke) override; void GenerateStaticOrDirectCall( - HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void GenerateVirtualCall( - HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void MoveFromReturnRegister(Location trg ATTRIBUTE_UNUSED, - DataType::Type type ATTRIBUTE_UNUSED) OVERRIDE { + DataType::Type type ATTRIBUTE_UNUSED) override { UNIMPLEMENTED(FATAL); } @@ -652,13 +652,13 @@ class CodeGeneratorARM64 : public CodeGenerator { void LoadBootImageAddress(vixl::aarch64::Register reg, uint32_t boot_image_reference); void AllocateInstanceForIntrinsic(HInvokeStaticOrDirect* invoke, uint32_t boot_image_offset); - void EmitLinkerPatches(ArenaVector* linker_patches) OVERRIDE; - bool NeedsThunkCode(const linker::LinkerPatch& patch) const OVERRIDE; + void EmitLinkerPatches(ArenaVector* linker_patches) override; + bool NeedsThunkCode(const linker::LinkerPatch& patch) const override; void EmitThunkCode(const linker::LinkerPatch& patch, /*out*/ ArenaVector* code, - /*out*/ std::string* debug_name) OVERRIDE; + /*out*/ std::string* debug_name) override; - void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) OVERRIDE; + void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) override; // Generate a GC root reference load: // @@ -765,10 +765,10 @@ class CodeGeneratorARM64 : public CodeGenerator { // artReadBarrierForRootSlow. void GenerateReadBarrierForRootSlow(HInstruction* instruction, Location out, Location root); - void GenerateNop() OVERRIDE; + void GenerateNop() override; - void GenerateImplicitNullCheck(HNullCheck* instruction) OVERRIDE; - void GenerateExplicitNullCheck(HNullCheck* instruction) OVERRIDE; + void GenerateImplicitNullCheck(HNullCheck* instruction) override; + void GenerateExplicitNullCheck(HNullCheck* instruction) override; private: // Encoding of thunk type and data for link-time generated thunks for Baker read barriers. diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc index 8c5eafd0bbb77f9f6a76a6c98427b1d21992a7d1..3580975c62adbba928cb5748740a2b8180a0bf49 100644 --- a/compiler/optimizing/code_generator_arm_vixl.cc +++ b/compiler/optimizing/code_generator_arm_vixl.cc @@ -383,7 +383,7 @@ class NullCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { public: explicit NullCheckSlowPathARMVIXL(HNullCheck* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); if (instruction_->CanThrowIntoCatchBlock()) { @@ -397,9 +397,9 @@ class NullCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathARMVIXL"; } + const char* GetDescription() const override { return "NullCheckSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathARMVIXL); @@ -410,16 +410,16 @@ class DivZeroCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { explicit DivZeroCheckSlowPathARMVIXL(HDivZeroCheck* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); arm_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathARMVIXL"; } + const char* GetDescription() const override { return "DivZeroCheckSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathARMVIXL); @@ -430,7 +430,7 @@ class SuspendCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { SuspendCheckSlowPathARMVIXL(HSuspendCheck* instruction, HBasicBlock* successor) : SlowPathCodeARMVIXL(instruction), successor_(successor) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); arm_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, instruction_->GetDexPc(), this); @@ -451,7 +451,7 @@ class SuspendCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { return successor_; } - const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathARMVIXL"; } + const char* GetDescription() const override { return "SuspendCheckSlowPathARMVIXL"; } private: // If not null, the block to branch to after the suspend check. @@ -468,7 +468,7 @@ class BoundsCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { explicit BoundsCheckSlowPathARMVIXL(HBoundsCheck* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); @@ -495,9 +495,9 @@ class BoundsCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathARMVIXL"; } + const char* GetDescription() const override { return "BoundsCheckSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathARMVIXL); @@ -511,7 +511,7 @@ class LoadClassSlowPathARMVIXL : public SlowPathCodeARMVIXL { DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); const uint32_t dex_pc = instruction_->GetDexPc(); @@ -549,7 +549,7 @@ class LoadClassSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathARMVIXL"; } + const char* GetDescription() const override { return "LoadClassSlowPathARMVIXL"; } private: // The class this slow path will load. @@ -563,7 +563,7 @@ class LoadStringSlowPathARMVIXL : public SlowPathCodeARMVIXL { explicit LoadStringSlowPathARMVIXL(HLoadString* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { DCHECK(instruction_->IsLoadString()); DCHECK_EQ(instruction_->AsLoadString()->GetLoadKind(), HLoadString::LoadKind::kBssEntry); LocationSummary* locations = instruction_->GetLocations(); @@ -585,7 +585,7 @@ class LoadStringSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathARMVIXL"; } + const char* GetDescription() const override { return "LoadStringSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathARMVIXL); @@ -596,7 +596,7 @@ class TypeCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { TypeCheckSlowPathARMVIXL(HInstruction* instruction, bool is_fatal) : SlowPathCodeARMVIXL(instruction), is_fatal_(is_fatal) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DCHECK(instruction_->IsCheckCast() || !locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); @@ -640,9 +640,9 @@ class TypeCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { } } - const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathARMVIXL"; } + const char* GetDescription() const override { return "TypeCheckSlowPathARMVIXL"; } - bool IsFatal() const OVERRIDE { return is_fatal_; } + bool IsFatal() const override { return is_fatal_; } private: const bool is_fatal_; @@ -655,7 +655,7 @@ class DeoptimizationSlowPathARMVIXL : public SlowPathCodeARMVIXL { explicit DeoptimizationSlowPathARMVIXL(HDeoptimize* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); LocationSummary* locations = instruction_->GetLocations(); @@ -668,7 +668,7 @@ class DeoptimizationSlowPathARMVIXL : public SlowPathCodeARMVIXL { CheckEntrypointTypes(); } - const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathARMVIXL"; } + const char* GetDescription() const override { return "DeoptimizationSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathARMVIXL); @@ -678,7 +678,7 @@ class ArraySetSlowPathARMVIXL : public SlowPathCodeARMVIXL { public: explicit ArraySetSlowPathARMVIXL(HInstruction* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); @@ -709,7 +709,7 @@ class ArraySetSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ArraySetSlowPathARMVIXL"; } + const char* GetDescription() const override { return "ArraySetSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathARMVIXL); @@ -744,7 +744,7 @@ class ReadBarrierForHeapReferenceSlowPathARMVIXL : public SlowPathCodeARMVIXL { DCHECK(!obj.Equals(ref)) << "obj=" << obj << " ref=" << ref; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); vixl32::Register reg_out = RegisterFrom(out_); @@ -868,7 +868,7 @@ class ReadBarrierForHeapReferenceSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { + const char* GetDescription() const override { return "ReadBarrierForHeapReferenceSlowPathARMVIXL"; } @@ -910,7 +910,7 @@ class ReadBarrierForRootSlowPathARMVIXL : public SlowPathCodeARMVIXL { DCHECK(kEmitCompilerReadBarrier); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); vixl32::Register reg_out = RegisterFrom(out_); DCHECK(locations->CanCall()); @@ -936,7 +936,7 @@ class ReadBarrierForRootSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForRootSlowPathARMVIXL"; } + const char* GetDescription() const override { return "ReadBarrierForRootSlowPathARMVIXL"; } private: const Location out_; diff --git a/compiler/optimizing/code_generator_arm_vixl.h b/compiler/optimizing/code_generator_arm_vixl.h index cb131a7ac11bb6389eb9323e964a85dcd7e59915..33502d4f681c011a79a1d831e31c32ee6ff353ea 100644 --- a/compiler/optimizing/code_generator_arm_vixl.h +++ b/compiler/optimizing/code_generator_arm_vixl.h @@ -178,9 +178,9 @@ class InvokeDexCallingConventionVisitorARMVIXL : public InvokeDexCallingConventi InvokeDexCallingConventionVisitorARMVIXL() {} virtual ~InvokeDexCallingConventionVisitorARMVIXL() {} - Location GetNextLocation(DataType::Type type) OVERRIDE; - Location GetReturnLocation(DataType::Type type) const OVERRIDE; - Location GetMethodLocation() const OVERRIDE; + Location GetNextLocation(DataType::Type type) override; + Location GetReturnLocation(DataType::Type type) const override; + Location GetMethodLocation() const override; private: InvokeDexCallingConventionARMVIXL calling_convention; @@ -193,25 +193,25 @@ class FieldAccessCallingConventionARMVIXL : public FieldAccessCallingConvention public: FieldAccessCallingConventionARMVIXL() {} - Location GetObjectLocation() const OVERRIDE { + Location GetObjectLocation() const override { return helpers::LocationFrom(vixl::aarch32::r1); } - Location GetFieldIndexLocation() const OVERRIDE { + Location GetFieldIndexLocation() const override { return helpers::LocationFrom(vixl::aarch32::r0); } - Location GetReturnLocation(DataType::Type type) const OVERRIDE { + Location GetReturnLocation(DataType::Type type) const override { return DataType::Is64BitType(type) ? helpers::LocationFrom(vixl::aarch32::r0, vixl::aarch32::r1) : helpers::LocationFrom(vixl::aarch32::r0); } - Location GetSetValueLocation(DataType::Type type, bool is_instance) const OVERRIDE { + Location GetSetValueLocation(DataType::Type type, bool is_instance) const override { return DataType::Is64BitType(type) ? helpers::LocationFrom(vixl::aarch32::r2, vixl::aarch32::r3) : (is_instance ? helpers::LocationFrom(vixl::aarch32::r2) : helpers::LocationFrom(vixl::aarch32::r1)); } - Location GetFpuLocation(DataType::Type type) const OVERRIDE { + Location GetFpuLocation(DataType::Type type) const override { return DataType::Is64BitType(type) ? helpers::LocationFrom(vixl::aarch32::s0, vixl::aarch32::s1) : helpers::LocationFrom(vixl::aarch32::s0); @@ -229,8 +229,8 @@ class SlowPathCodeARMVIXL : public SlowPathCode { vixl::aarch32::Label* GetEntryLabel() { return &entry_label_; } vixl::aarch32::Label* GetExitLabel() { return &exit_label_; } - void SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) OVERRIDE; - void RestoreLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) OVERRIDE; + void SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) override; + void RestoreLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) override; private: vixl::aarch32::Label entry_label_; @@ -244,10 +244,10 @@ class ParallelMoveResolverARMVIXL : public ParallelMoveResolverWithSwap { ParallelMoveResolverARMVIXL(ArenaAllocator* allocator, CodeGeneratorARMVIXL* codegen) : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {} - void EmitMove(size_t index) OVERRIDE; - void EmitSwap(size_t index) OVERRIDE; - void SpillScratch(int reg) OVERRIDE; - void RestoreScratch(int reg) OVERRIDE; + void EmitMove(size_t index) override; + void EmitSwap(size_t index) override; + void SpillScratch(int reg) override; + void RestoreScratch(int reg) override; ArmVIXLAssembler* GetAssembler() const; @@ -266,7 +266,7 @@ class LocationsBuilderARMVIXL : public HGraphVisitor { : HGraphVisitor(graph), codegen_(codegen) {} #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_ARM(DECLARE_VISIT_INSTRUCTION) @@ -274,7 +274,7 @@ class LocationsBuilderARMVIXL : public HGraphVisitor { #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -304,7 +304,7 @@ class InstructionCodeGeneratorARMVIXL : public InstructionCodeGenerator { InstructionCodeGeneratorARMVIXL(HGraph* graph, CodeGeneratorARMVIXL* codegen); #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_ARM(DECLARE_VISIT_INSTRUCTION) @@ -312,7 +312,7 @@ class InstructionCodeGeneratorARMVIXL : public InstructionCodeGenerator { #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -432,48 +432,48 @@ class CodeGeneratorARMVIXL : public CodeGenerator { OptimizingCompilerStats* stats = nullptr); virtual ~CodeGeneratorARMVIXL() {} - void GenerateFrameEntry() OVERRIDE; - void GenerateFrameExit() OVERRIDE; - void Bind(HBasicBlock* block) OVERRIDE; - void MoveConstant(Location destination, int32_t value) OVERRIDE; - void MoveLocation(Location dst, Location src, DataType::Type dst_type) OVERRIDE; - void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; + void GenerateFrameEntry() override; + void GenerateFrameExit() override; + void Bind(HBasicBlock* block) override; + void MoveConstant(Location destination, int32_t value) override; + void MoveLocation(Location dst, Location src, DataType::Type dst_type) override; + void AddLocationAsTemp(Location location, LocationSummary* locations) override; - size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; + size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; - size_t GetWordSize() const OVERRIDE { + size_t GetWordSize() const override { return static_cast(kArmPointerSize); } - size_t GetFloatingPointSpillSlotSize() const OVERRIDE { return vixl::aarch32::kRegSizeInBytes; } + size_t GetFloatingPointSpillSlotSize() const override { return vixl::aarch32::kRegSizeInBytes; } - HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } + HGraphVisitor* GetLocationBuilder() override { return &location_builder_; } - HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } + HGraphVisitor* GetInstructionVisitor() override { return &instruction_visitor_; } - ArmVIXLAssembler* GetAssembler() OVERRIDE { return &assembler_; } + ArmVIXLAssembler* GetAssembler() override { return &assembler_; } - const ArmVIXLAssembler& GetAssembler() const OVERRIDE { return assembler_; } + const ArmVIXLAssembler& GetAssembler() const override { return assembler_; } ArmVIXLMacroAssembler* GetVIXLAssembler() { return GetAssembler()->GetVIXLAssembler(); } - uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { + uintptr_t GetAddressOf(HBasicBlock* block) override { vixl::aarch32::Label* block_entry_label = GetLabelOf(block); DCHECK(block_entry_label->IsBound()); return block_entry_label->GetLocation(); } void FixJumpTables(); - void SetupBlockedRegisters() const OVERRIDE; + void SetupBlockedRegisters() const override; - void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; - void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; + void DumpCoreRegister(std::ostream& stream, int reg) const override; + void DumpFloatingPointRegister(std::ostream& stream, int reg) const override; - ParallelMoveResolver* GetMoveResolver() OVERRIDE { return &move_resolver_; } - InstructionSet GetInstructionSet() const OVERRIDE { return InstructionSet::kThumb2; } + ParallelMoveResolver* GetMoveResolver() override { return &move_resolver_; } + InstructionSet GetInstructionSet() const override { return InstructionSet::kThumb2; } const ArmInstructionSetFeatures& GetInstructionSetFeatures() const; @@ -495,7 +495,7 @@ class CodeGeneratorARMVIXL : public CodeGenerator { void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, - SlowPathCode* slow_path = nullptr) OVERRIDE; + SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record // PC-related information in a stack map. @@ -519,42 +519,42 @@ class CodeGeneratorARMVIXL : public CodeGenerator { vixl32::Label* GetFinalLabel(HInstruction* instruction, vixl32::Label* final_label); - void Initialize() OVERRIDE { + void Initialize() override { block_labels_.resize(GetGraph()->GetBlocks().size()); } - void Finalize(CodeAllocator* allocator) OVERRIDE; + void Finalize(CodeAllocator* allocator) override; - bool NeedsTwoRegisters(DataType::Type type) const OVERRIDE { + bool NeedsTwoRegisters(DataType::Type type) const override { return type == DataType::Type::kFloat64 || type == DataType::Type::kInt64; } - void ComputeSpillMask() OVERRIDE; + void ComputeSpillMask() override; vixl::aarch32::Label* GetFrameEntryLabel() { return &frame_entry_label_; } // Check if the desired_string_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadString::LoadKind GetSupportedLoadStringKind( - HLoadString::LoadKind desired_string_load_kind) OVERRIDE; + HLoadString::LoadKind desired_string_load_kind) override; // Check if the desired_class_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadClass::LoadKind GetSupportedLoadClassKind( - HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; + HLoadClass::LoadKind desired_class_load_kind) override; // Check if the desired_dispatch_info is supported. If it is, return it, // otherwise return a fall-back info that should be used instead. HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, - HInvokeStaticOrDirect* invoke) OVERRIDE; + HInvokeStaticOrDirect* invoke) override; void GenerateStaticOrDirectCall( - HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void GenerateVirtualCall( - HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; - void MoveFromReturnRegister(Location trg, DataType::Type type) OVERRIDE; + void MoveFromReturnRegister(Location trg, DataType::Type type) override; // The PcRelativePatchInfo is used for PC-relative addressing of methods/strings/types, // whether through .data.bimg.rel.ro, .bss, or directly in the boot image. @@ -604,13 +604,13 @@ class CodeGeneratorARMVIXL : public CodeGenerator { void LoadBootImageAddress(vixl::aarch32::Register reg, uint32_t boot_image_reference); void AllocateInstanceForIntrinsic(HInvokeStaticOrDirect* invoke, uint32_t boot_image_offset); - void EmitLinkerPatches(ArenaVector* linker_patches) OVERRIDE; - bool NeedsThunkCode(const linker::LinkerPatch& patch) const OVERRIDE; + void EmitLinkerPatches(ArenaVector* linker_patches) override; + bool NeedsThunkCode(const linker::LinkerPatch& patch) const override; void EmitThunkCode(const linker::LinkerPatch& patch, /*out*/ ArenaVector* code, - /*out*/ std::string* debug_name) OVERRIDE; + /*out*/ std::string* debug_name) override; - void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) OVERRIDE; + void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) override; // Generate a GC root reference load: // @@ -722,10 +722,10 @@ class CodeGeneratorARMVIXL : public CodeGenerator { // artReadBarrierForRootSlow. void GenerateReadBarrierForRootSlow(HInstruction* instruction, Location out, Location root); - void GenerateNop() OVERRIDE; + void GenerateNop() override; - void GenerateImplicitNullCheck(HNullCheck* instruction) OVERRIDE; - void GenerateExplicitNullCheck(HNullCheck* instruction) OVERRIDE; + void GenerateImplicitNullCheck(HNullCheck* instruction) override; + void GenerateExplicitNullCheck(HNullCheck* instruction) override; JumpTableARMVIXL* CreateJumpTable(HPackedSwitch* switch_instr) { jump_tables_.emplace_back(new (GetGraph()->GetAllocator()) JumpTableARMVIXL(switch_instr)); diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc index aed334b02474e2e5bf53730c3b7099e321fc4674..d74a7a760f216b5b8c22b7dc2a988f3cabe9d754 100644 --- a/compiler/optimizing/code_generator_mips.cc +++ b/compiler/optimizing/code_generator_mips.cc @@ -176,7 +176,7 @@ class BoundsCheckSlowPathMIPS : public SlowPathCodeMIPS { public: explicit BoundsCheckSlowPathMIPS(HBoundsCheck* instruction) : SlowPathCodeMIPS(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorMIPS* mips_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -201,9 +201,9 @@ class BoundsCheckSlowPathMIPS : public SlowPathCodeMIPS { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathMIPS"; } + const char* GetDescription() const override { return "BoundsCheckSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathMIPS); @@ -213,16 +213,16 @@ class DivZeroCheckSlowPathMIPS : public SlowPathCodeMIPS { public: explicit DivZeroCheckSlowPathMIPS(HDivZeroCheck* instruction) : SlowPathCodeMIPS(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS* mips_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); mips_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathMIPS"; } + const char* GetDescription() const override { return "DivZeroCheckSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathMIPS); @@ -236,7 +236,7 @@ class LoadClassSlowPathMIPS : public SlowPathCodeMIPS { DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); const uint32_t dex_pc = instruction_->GetDexPc(); @@ -280,7 +280,7 @@ class LoadClassSlowPathMIPS : public SlowPathCodeMIPS { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathMIPS"; } + const char* GetDescription() const override { return "LoadClassSlowPathMIPS"; } private: // The class this slow path will load. @@ -294,7 +294,7 @@ class LoadStringSlowPathMIPS : public SlowPathCodeMIPS { explicit LoadStringSlowPathMIPS(HLoadString* instruction) : SlowPathCodeMIPS(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { DCHECK(instruction_->IsLoadString()); DCHECK_EQ(instruction_->AsLoadString()->GetLoadKind(), HLoadString::LoadKind::kBssEntry); LocationSummary* locations = instruction_->GetLocations(); @@ -318,7 +318,7 @@ class LoadStringSlowPathMIPS : public SlowPathCodeMIPS { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathMIPS"; } + const char* GetDescription() const override { return "LoadStringSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathMIPS); @@ -328,7 +328,7 @@ class NullCheckSlowPathMIPS : public SlowPathCodeMIPS { public: explicit NullCheckSlowPathMIPS(HNullCheck* instr) : SlowPathCodeMIPS(instr) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS* mips_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); if (instruction_->CanThrowIntoCatchBlock()) { @@ -342,9 +342,9 @@ class NullCheckSlowPathMIPS : public SlowPathCodeMIPS { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathMIPS"; } + const char* GetDescription() const override { return "NullCheckSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathMIPS); @@ -355,7 +355,7 @@ class SuspendCheckSlowPathMIPS : public SlowPathCodeMIPS { SuspendCheckSlowPathMIPS(HSuspendCheck* instruction, HBasicBlock* successor) : SlowPathCodeMIPS(instruction), successor_(successor) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorMIPS* mips_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -375,7 +375,7 @@ class SuspendCheckSlowPathMIPS : public SlowPathCodeMIPS { return &return_label_; } - const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathMIPS"; } + const char* GetDescription() const override { return "SuspendCheckSlowPathMIPS"; } HBasicBlock* GetSuccessor() const { return successor_; @@ -396,7 +396,7 @@ class TypeCheckSlowPathMIPS : public SlowPathCodeMIPS { explicit TypeCheckSlowPathMIPS(HInstruction* instruction, bool is_fatal) : SlowPathCodeMIPS(instruction), is_fatal_(is_fatal) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); uint32_t dex_pc = instruction_->GetDexPc(); DCHECK(instruction_->IsCheckCast() @@ -435,9 +435,9 @@ class TypeCheckSlowPathMIPS : public SlowPathCodeMIPS { } } - const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathMIPS"; } + const char* GetDescription() const override { return "TypeCheckSlowPathMIPS"; } - bool IsFatal() const OVERRIDE { return is_fatal_; } + bool IsFatal() const override { return is_fatal_; } private: const bool is_fatal_; @@ -450,7 +450,7 @@ class DeoptimizationSlowPathMIPS : public SlowPathCodeMIPS { explicit DeoptimizationSlowPathMIPS(HDeoptimize* instruction) : SlowPathCodeMIPS(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS* mips_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); LocationSummary* locations = instruction_->GetLocations(); @@ -462,7 +462,7 @@ class DeoptimizationSlowPathMIPS : public SlowPathCodeMIPS { CheckEntrypointTypes(); } - const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathMIPS"; } + const char* GetDescription() const override { return "DeoptimizationSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathMIPS); @@ -472,7 +472,7 @@ class ArraySetSlowPathMIPS : public SlowPathCodeMIPS { public: explicit ArraySetSlowPathMIPS(HInstruction* instruction) : SlowPathCodeMIPS(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); @@ -503,7 +503,7 @@ class ArraySetSlowPathMIPS : public SlowPathCodeMIPS { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ArraySetSlowPathMIPS"; } + const char* GetDescription() const override { return "ArraySetSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathMIPS); @@ -533,9 +533,9 @@ class ReadBarrierMarkSlowPathMIPS : public SlowPathCodeMIPS { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierMarkSlowPathMIPS"; } + const char* GetDescription() const override { return "ReadBarrierMarkSlowPathMIPS"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -627,11 +627,11 @@ class ReadBarrierMarkAndUpdateFieldSlowPathMIPS : public SlowPathCodeMIPS { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { + const char* GetDescription() const override { return "ReadBarrierMarkAndUpdateFieldSlowPathMIPS"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -798,7 +798,7 @@ class ReadBarrierForHeapReferenceSlowPathMIPS : public SlowPathCodeMIPS { DCHECK(!obj.Equals(ref)) << "obj=" << obj << " ref=" << ref; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS* mips_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); Register reg_out = out_.AsRegister(); @@ -922,7 +922,7 @@ class ReadBarrierForHeapReferenceSlowPathMIPS : public SlowPathCodeMIPS { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForHeapReferenceSlowPathMIPS"; } + const char* GetDescription() const override { return "ReadBarrierForHeapReferenceSlowPathMIPS"; } private: Register FindAvailableCallerSaveRegister(CodeGenerator* codegen) { @@ -965,7 +965,7 @@ class ReadBarrierForRootSlowPathMIPS : public SlowPathCodeMIPS { DCHECK(kEmitCompilerReadBarrier); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register reg_out = out_.AsRegister(); DCHECK(locations->CanCall()); @@ -995,7 +995,7 @@ class ReadBarrierForRootSlowPathMIPS : public SlowPathCodeMIPS { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForRootSlowPathMIPS"; } + const char* GetDescription() const override { return "ReadBarrierForRootSlowPathMIPS"; } private: const Location out_; diff --git a/compiler/optimizing/code_generator_mips.h b/compiler/optimizing/code_generator_mips.h index 4830ac9bc6470436f601825bb2fd5a1d794ac0ed..bf9589331be22ad94fa86d5e7638a3e86bc1993c 100644 --- a/compiler/optimizing/code_generator_mips.h +++ b/compiler/optimizing/code_generator_mips.h @@ -81,9 +81,9 @@ class InvokeDexCallingConventionVisitorMIPS : public InvokeDexCallingConventionV InvokeDexCallingConventionVisitorMIPS() {} virtual ~InvokeDexCallingConventionVisitorMIPS() {} - Location GetNextLocation(DataType::Type type) OVERRIDE; - Location GetReturnLocation(DataType::Type type) const OVERRIDE; - Location GetMethodLocation() const OVERRIDE; + Location GetNextLocation(DataType::Type type) override; + Location GetReturnLocation(DataType::Type type) const override; + Location GetMethodLocation() const override; private: InvokeDexCallingConvention calling_convention; @@ -110,23 +110,23 @@ class FieldAccessCallingConventionMIPS : public FieldAccessCallingConvention { public: FieldAccessCallingConventionMIPS() {} - Location GetObjectLocation() const OVERRIDE { + Location GetObjectLocation() const override { return Location::RegisterLocation(A1); } - Location GetFieldIndexLocation() const OVERRIDE { + Location GetFieldIndexLocation() const override { return Location::RegisterLocation(A0); } - Location GetReturnLocation(DataType::Type type) const OVERRIDE { + Location GetReturnLocation(DataType::Type type) const override { return DataType::Is64BitType(type) ? Location::RegisterPairLocation(V0, V1) : Location::RegisterLocation(V0); } - Location GetSetValueLocation(DataType::Type type, bool is_instance) const OVERRIDE { + Location GetSetValueLocation(DataType::Type type, bool is_instance) const override { return DataType::Is64BitType(type) ? Location::RegisterPairLocation(A2, A3) : (is_instance ? Location::RegisterLocation(A2) : Location::RegisterLocation(A1)); } - Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const override { return Location::FpuRegisterLocation(F0); } @@ -139,10 +139,10 @@ class ParallelMoveResolverMIPS : public ParallelMoveResolverWithSwap { ParallelMoveResolverMIPS(ArenaAllocator* allocator, CodeGeneratorMIPS* codegen) : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {} - void EmitMove(size_t index) OVERRIDE; - void EmitSwap(size_t index) OVERRIDE; - void SpillScratch(int reg) OVERRIDE; - void RestoreScratch(int reg) OVERRIDE; + void EmitMove(size_t index) override; + void EmitSwap(size_t index) override; + void SpillScratch(int reg) override; + void RestoreScratch(int reg) override; void Exchange(int index1, int index2, bool double_slot); void ExchangeQuadSlots(int index1, int index2); @@ -176,14 +176,14 @@ class LocationsBuilderMIPS : public HGraphVisitor { : HGraphVisitor(graph), codegen_(codegen) {} #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_MIPS(DECLARE_VISIT_INSTRUCTION) #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -210,14 +210,14 @@ class InstructionCodeGeneratorMIPS : public InstructionCodeGenerator { InstructionCodeGeneratorMIPS(HGraph* graph, CodeGeneratorMIPS* codegen); #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_MIPS(DECLARE_VISIT_INSTRUCTION) #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -374,35 +374,35 @@ class CodeGeneratorMIPS : public CodeGenerator { OptimizingCompilerStats* stats = nullptr); virtual ~CodeGeneratorMIPS() {} - void ComputeSpillMask() OVERRIDE; - bool HasAllocatedCalleeSaveRegisters() const OVERRIDE; - void GenerateFrameEntry() OVERRIDE; - void GenerateFrameExit() OVERRIDE; + void ComputeSpillMask() override; + bool HasAllocatedCalleeSaveRegisters() const override; + void GenerateFrameEntry() override; + void GenerateFrameExit() override; - void Bind(HBasicBlock* block) OVERRIDE; + void Bind(HBasicBlock* block) override; void MoveConstant(Location location, HConstant* c); - size_t GetWordSize() const OVERRIDE { return kMipsWordSize; } + size_t GetWordSize() const override { return kMipsWordSize; } - size_t GetFloatingPointSpillSlotSize() const OVERRIDE { + size_t GetFloatingPointSpillSlotSize() const override { return GetGraph()->HasSIMD() ? 2 * kMipsDoublewordSize // 16 bytes for each spill. : 1 * kMipsDoublewordSize; // 8 bytes for each spill. } - uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { + uintptr_t GetAddressOf(HBasicBlock* block) override { return assembler_.GetLabelLocation(GetLabelOf(block)); } - HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } - HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } - MipsAssembler* GetAssembler() OVERRIDE { return &assembler_; } - const MipsAssembler& GetAssembler() const OVERRIDE { return assembler_; } + HGraphVisitor* GetLocationBuilder() override { return &location_builder_; } + HGraphVisitor* GetInstructionVisitor() override { return &instruction_visitor_; } + MipsAssembler* GetAssembler() override { return &assembler_; } + const MipsAssembler& GetAssembler() const override { return assembler_; } // Emit linker patches. - void EmitLinkerPatches(ArenaVector* linker_patches) OVERRIDE; - void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) OVERRIDE; + void EmitLinkerPatches(ArenaVector* linker_patches) override; + void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) override; // Fast path implementation of ReadBarrier::Barrier for a heap // reference field load when Baker's read barriers are used. @@ -493,20 +493,20 @@ class CodeGeneratorMIPS : public CodeGenerator { // Register allocation. - void SetupBlockedRegisters() const OVERRIDE; + void SetupBlockedRegisters() const override; - size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; + size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; void ClobberRA() { clobbered_ra_ = true; } - void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; - void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; + void DumpCoreRegister(std::ostream& stream, int reg) const override; + void DumpFloatingPointRegister(std::ostream& stream, int reg) const override; - InstructionSet GetInstructionSet() const OVERRIDE { return InstructionSet::kMips; } + InstructionSet GetInstructionSet() const override { return InstructionSet::kMips; } const MipsInstructionSetFeatures& GetInstructionSetFeatures() const; @@ -514,25 +514,25 @@ class CodeGeneratorMIPS : public CodeGenerator { return CommonGetLabelOf(block_labels_, block); } - void Initialize() OVERRIDE { + void Initialize() override { block_labels_ = CommonInitializeLabels(); } - void Finalize(CodeAllocator* allocator) OVERRIDE; + void Finalize(CodeAllocator* allocator) override; // Code generation helpers. - void MoveLocation(Location dst, Location src, DataType::Type dst_type) OVERRIDE; + void MoveLocation(Location dst, Location src, DataType::Type dst_type) override; - void MoveConstant(Location destination, int32_t value) OVERRIDE; + void MoveConstant(Location destination, int32_t value) override; - void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; + void AddLocationAsTemp(Location location, LocationSummary* locations) override; // Generate code to invoke a runtime entry point. void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, - SlowPathCode* slow_path = nullptr) OVERRIDE; + SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record // PC-related information in a stack map. @@ -543,41 +543,41 @@ class CodeGeneratorMIPS : public CodeGenerator { void GenerateInvokeRuntime(int32_t entry_point_offset, bool direct); - ParallelMoveResolver* GetMoveResolver() OVERRIDE { return &move_resolver_; } + ParallelMoveResolver* GetMoveResolver() override { return &move_resolver_; } - bool NeedsTwoRegisters(DataType::Type type) const OVERRIDE { + bool NeedsTwoRegisters(DataType::Type type) const override { return type == DataType::Type::kInt64; } // Check if the desired_string_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadString::LoadKind GetSupportedLoadStringKind( - HLoadString::LoadKind desired_string_load_kind) OVERRIDE; + HLoadString::LoadKind desired_string_load_kind) override; // Check if the desired_class_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadClass::LoadKind GetSupportedLoadClassKind( - HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; + HLoadClass::LoadKind desired_class_load_kind) override; // Check if the desired_dispatch_info is supported. If it is, return it, // otherwise return a fall-back info that should be used instead. HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, - HInvokeStaticOrDirect* invoke) OVERRIDE; + HInvokeStaticOrDirect* invoke) override; void GenerateStaticOrDirectCall( - HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void GenerateVirtualCall( - HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void MoveFromReturnRegister(Location trg ATTRIBUTE_UNUSED, - DataType::Type type ATTRIBUTE_UNUSED) OVERRIDE { + DataType::Type type ATTRIBUTE_UNUSED) override { UNIMPLEMENTED(FATAL) << "Not implemented on MIPS"; } - void GenerateNop() OVERRIDE; - void GenerateImplicitNullCheck(HNullCheck* instruction) OVERRIDE; - void GenerateExplicitNullCheck(HNullCheck* instruction) OVERRIDE; + void GenerateNop() override; + void GenerateImplicitNullCheck(HNullCheck* instruction) override; + void GenerateExplicitNullCheck(HNullCheck* instruction) override; // The PcRelativePatchInfo is used for PC-relative addressing of methods/strings/types, // whether through .data.bimg.rel.ro, .bss, or directly in the boot image. diff --git a/compiler/optimizing/code_generator_mips64.cc b/compiler/optimizing/code_generator_mips64.cc index 72318e98b0eb2672a1f3edb76221eb9f8b64f1d7..7c89808d54bc957b6c19ce7a955caee1e8625414 100644 --- a/compiler/optimizing/code_generator_mips64.cc +++ b/compiler/optimizing/code_generator_mips64.cc @@ -128,7 +128,7 @@ class BoundsCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { public: explicit BoundsCheckSlowPathMIPS64(HBoundsCheck* instruction) : SlowPathCodeMIPS64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -153,9 +153,9 @@ class BoundsCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathMIPS64"; } + const char* GetDescription() const override { return "BoundsCheckSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathMIPS64); @@ -166,16 +166,16 @@ class DivZeroCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { explicit DivZeroCheckSlowPathMIPS64(HDivZeroCheck* instruction) : SlowPathCodeMIPS64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); mips64_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathMIPS64"; } + const char* GetDescription() const override { return "DivZeroCheckSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathMIPS64); @@ -189,7 +189,7 @@ class LoadClassSlowPathMIPS64 : public SlowPathCodeMIPS64 { DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); const uint32_t dex_pc = instruction_->GetDexPc(); @@ -233,7 +233,7 @@ class LoadClassSlowPathMIPS64 : public SlowPathCodeMIPS64 { __ Bc(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathMIPS64"; } + const char* GetDescription() const override { return "LoadClassSlowPathMIPS64"; } private: // The class this slow path will load. @@ -247,7 +247,7 @@ class LoadStringSlowPathMIPS64 : public SlowPathCodeMIPS64 { explicit LoadStringSlowPathMIPS64(HLoadString* instruction) : SlowPathCodeMIPS64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { DCHECK(instruction_->IsLoadString()); DCHECK_EQ(instruction_->AsLoadString()->GetLoadKind(), HLoadString::LoadKind::kBssEntry); LocationSummary* locations = instruction_->GetLocations(); @@ -274,7 +274,7 @@ class LoadStringSlowPathMIPS64 : public SlowPathCodeMIPS64 { __ Bc(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathMIPS64"; } + const char* GetDescription() const override { return "LoadStringSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathMIPS64); @@ -284,7 +284,7 @@ class NullCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { public: explicit NullCheckSlowPathMIPS64(HNullCheck* instr) : SlowPathCodeMIPS64(instr) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); if (instruction_->CanThrowIntoCatchBlock()) { @@ -298,9 +298,9 @@ class NullCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathMIPS64"; } + const char* GetDescription() const override { return "NullCheckSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathMIPS64); @@ -311,7 +311,7 @@ class SuspendCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { SuspendCheckSlowPathMIPS64(HSuspendCheck* instruction, HBasicBlock* successor) : SlowPathCodeMIPS64(instruction), successor_(successor) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -331,7 +331,7 @@ class SuspendCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { return &return_label_; } - const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathMIPS64"; } + const char* GetDescription() const override { return "SuspendCheckSlowPathMIPS64"; } HBasicBlock* GetSuccessor() const { return successor_; @@ -352,7 +352,7 @@ class TypeCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { explicit TypeCheckSlowPathMIPS64(HInstruction* instruction, bool is_fatal) : SlowPathCodeMIPS64(instruction), is_fatal_(is_fatal) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); uint32_t dex_pc = instruction_->GetDexPc(); @@ -392,9 +392,9 @@ class TypeCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { } } - const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathMIPS64"; } + const char* GetDescription() const override { return "TypeCheckSlowPathMIPS64"; } - bool IsFatal() const OVERRIDE { return is_fatal_; } + bool IsFatal() const override { return is_fatal_; } private: const bool is_fatal_; @@ -407,7 +407,7 @@ class DeoptimizationSlowPathMIPS64 : public SlowPathCodeMIPS64 { explicit DeoptimizationSlowPathMIPS64(HDeoptimize* instruction) : SlowPathCodeMIPS64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); LocationSummary* locations = instruction_->GetLocations(); @@ -419,7 +419,7 @@ class DeoptimizationSlowPathMIPS64 : public SlowPathCodeMIPS64 { CheckEntrypointTypes(); } - const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathMIPS64"; } + const char* GetDescription() const override { return "DeoptimizationSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathMIPS64); @@ -429,7 +429,7 @@ class ArraySetSlowPathMIPS64 : public SlowPathCodeMIPS64 { public: explicit ArraySetSlowPathMIPS64(HInstruction* instruction) : SlowPathCodeMIPS64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); @@ -460,7 +460,7 @@ class ArraySetSlowPathMIPS64 : public SlowPathCodeMIPS64 { __ Bc(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ArraySetSlowPathMIPS64"; } + const char* GetDescription() const override { return "ArraySetSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathMIPS64); @@ -490,9 +490,9 @@ class ReadBarrierMarkSlowPathMIPS64 : public SlowPathCodeMIPS64 { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierMarkSlowPathMIPS"; } + const char* GetDescription() const override { return "ReadBarrierMarkSlowPathMIPS"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); GpuRegister ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -583,11 +583,11 @@ class ReadBarrierMarkAndUpdateFieldSlowPathMIPS64 : public SlowPathCodeMIPS64 { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { + const char* GetDescription() const override { return "ReadBarrierMarkAndUpdateFieldSlowPathMIPS64"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); GpuRegister ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -744,7 +744,7 @@ class ReadBarrierForHeapReferenceSlowPathMIPS64 : public SlowPathCodeMIPS64 { DCHECK(!obj.Equals(ref)) << "obj=" << obj << " ref=" << ref; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); DataType::Type type = DataType::Type::kReference; @@ -864,7 +864,7 @@ class ReadBarrierForHeapReferenceSlowPathMIPS64 : public SlowPathCodeMIPS64 { __ Bc(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { + const char* GetDescription() const override { return "ReadBarrierForHeapReferenceSlowPathMIPS64"; } @@ -909,7 +909,7 @@ class ReadBarrierForRootSlowPathMIPS64 : public SlowPathCodeMIPS64 { DCHECK(kEmitCompilerReadBarrier); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DataType::Type type = DataType::Type::kReference; GpuRegister reg_out = out_.AsRegister(); @@ -938,7 +938,7 @@ class ReadBarrierForRootSlowPathMIPS64 : public SlowPathCodeMIPS64 { __ Bc(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForRootSlowPathMIPS64"; } + const char* GetDescription() const override { return "ReadBarrierForRootSlowPathMIPS64"; } private: const Location out_; diff --git a/compiler/optimizing/code_generator_mips64.h b/compiler/optimizing/code_generator_mips64.h index fc0908b2cb92344b7e4f68f2bd141dbbbe4b4a45..ddc154d40f88250a56029e99e7b61213a65e6b91 100644 --- a/compiler/optimizing/code_generator_mips64.h +++ b/compiler/optimizing/code_generator_mips64.h @@ -79,9 +79,9 @@ class InvokeDexCallingConventionVisitorMIPS64 : public InvokeDexCallingConventio InvokeDexCallingConventionVisitorMIPS64() {} virtual ~InvokeDexCallingConventionVisitorMIPS64() {} - Location GetNextLocation(DataType::Type type) OVERRIDE; - Location GetReturnLocation(DataType::Type type) const OVERRIDE; - Location GetMethodLocation() const OVERRIDE; + Location GetNextLocation(DataType::Type type) override; + Location GetReturnLocation(DataType::Type type) const override; + Location GetMethodLocation() const override; private: InvokeDexCallingConvention calling_convention; @@ -108,22 +108,22 @@ class FieldAccessCallingConventionMIPS64 : public FieldAccessCallingConvention { public: FieldAccessCallingConventionMIPS64() {} - Location GetObjectLocation() const OVERRIDE { + Location GetObjectLocation() const override { return Location::RegisterLocation(A1); } - Location GetFieldIndexLocation() const OVERRIDE { + Location GetFieldIndexLocation() const override { return Location::RegisterLocation(A0); } - Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const override { return Location::RegisterLocation(V0); } Location GetSetValueLocation(DataType::Type type ATTRIBUTE_UNUSED, - bool is_instance) const OVERRIDE { + bool is_instance) const override { return is_instance ? Location::RegisterLocation(A2) : Location::RegisterLocation(A1); } - Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const override { return Location::FpuRegisterLocation(F0); } @@ -136,10 +136,10 @@ class ParallelMoveResolverMIPS64 : public ParallelMoveResolverWithSwap { ParallelMoveResolverMIPS64(ArenaAllocator* allocator, CodeGeneratorMIPS64* codegen) : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {} - void EmitMove(size_t index) OVERRIDE; - void EmitSwap(size_t index) OVERRIDE; - void SpillScratch(int reg) OVERRIDE; - void RestoreScratch(int reg) OVERRIDE; + void EmitMove(size_t index) override; + void EmitSwap(size_t index) override; + void SpillScratch(int reg) override; + void RestoreScratch(int reg) override; void Exchange(int index1, int index2, bool double_slot); void ExchangeQuadSlots(int index1, int index2); @@ -173,14 +173,14 @@ class LocationsBuilderMIPS64 : public HGraphVisitor { : HGraphVisitor(graph), codegen_(codegen) {} #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_MIPS64(DECLARE_VISIT_INSTRUCTION) #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -207,14 +207,14 @@ class InstructionCodeGeneratorMIPS64 : public InstructionCodeGenerator { InstructionCodeGeneratorMIPS64(HGraph* graph, CodeGeneratorMIPS64* codegen); #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_MIPS64(DECLARE_VISIT_INSTRUCTION) #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -356,31 +356,31 @@ class CodeGeneratorMIPS64 : public CodeGenerator { OptimizingCompilerStats* stats = nullptr); virtual ~CodeGeneratorMIPS64() {} - void GenerateFrameEntry() OVERRIDE; - void GenerateFrameExit() OVERRIDE; + void GenerateFrameEntry() override; + void GenerateFrameExit() override; - void Bind(HBasicBlock* block) OVERRIDE; + void Bind(HBasicBlock* block) override; - size_t GetWordSize() const OVERRIDE { return kMips64DoublewordSize; } + size_t GetWordSize() const override { return kMips64DoublewordSize; } - size_t GetFloatingPointSpillSlotSize() const OVERRIDE { + size_t GetFloatingPointSpillSlotSize() const override { return GetGraph()->HasSIMD() ? 2 * kMips64DoublewordSize // 16 bytes for each spill. : 1 * kMips64DoublewordSize; // 8 bytes for each spill. } - uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { + uintptr_t GetAddressOf(HBasicBlock* block) override { return assembler_.GetLabelLocation(GetLabelOf(block)); } - HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } - HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } - Mips64Assembler* GetAssembler() OVERRIDE { return &assembler_; } - const Mips64Assembler& GetAssembler() const OVERRIDE { return assembler_; } + HGraphVisitor* GetLocationBuilder() override { return &location_builder_; } + HGraphVisitor* GetInstructionVisitor() override { return &instruction_visitor_; } + Mips64Assembler* GetAssembler() override { return &assembler_; } + const Mips64Assembler& GetAssembler() const override { return assembler_; } // Emit linker patches. - void EmitLinkerPatches(ArenaVector* linker_patches) OVERRIDE; - void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) OVERRIDE; + void EmitLinkerPatches(ArenaVector* linker_patches) override; + void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) override; // Fast path implementation of ReadBarrier::Barrier for a heap // reference field load when Baker's read barriers are used. @@ -471,17 +471,17 @@ class CodeGeneratorMIPS64 : public CodeGenerator { // Register allocation. - void SetupBlockedRegisters() const OVERRIDE; + void SetupBlockedRegisters() const override; - size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; + size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; - void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; - void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; + void DumpCoreRegister(std::ostream& stream, int reg) const override; + void DumpFloatingPointRegister(std::ostream& stream, int reg) const override; - InstructionSet GetInstructionSet() const OVERRIDE { return InstructionSet::kMips64; } + InstructionSet GetInstructionSet() const override { return InstructionSet::kMips64; } const Mips64InstructionSetFeatures& GetInstructionSetFeatures() const; @@ -489,22 +489,22 @@ class CodeGeneratorMIPS64 : public CodeGenerator { return CommonGetLabelOf(block_labels_, block); } - void Initialize() OVERRIDE { + void Initialize() override { block_labels_ = CommonInitializeLabels(); } // We prefer aligned loads and stores (less code), so spill and restore registers in slow paths // at aligned locations. - uint32_t GetPreferredSlotsAlignment() const OVERRIDE { return kMips64DoublewordSize; } + uint32_t GetPreferredSlotsAlignment() const override { return kMips64DoublewordSize; } - void Finalize(CodeAllocator* allocator) OVERRIDE; + void Finalize(CodeAllocator* allocator) override; // Code generation helpers. - void MoveLocation(Location dst, Location src, DataType::Type dst_type) OVERRIDE; + void MoveLocation(Location dst, Location src, DataType::Type dst_type) override; - void MoveConstant(Location destination, int32_t value) OVERRIDE; + void MoveConstant(Location destination, int32_t value) override; - void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; + void AddLocationAsTemp(Location location, LocationSummary* locations) override; void SwapLocations(Location loc1, Location loc2, DataType::Type type); @@ -513,7 +513,7 @@ class CodeGeneratorMIPS64 : public CodeGenerator { void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, - SlowPathCode* slow_path = nullptr) OVERRIDE; + SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record // PC-related information in a stack map. @@ -523,39 +523,39 @@ class CodeGeneratorMIPS64 : public CodeGenerator { void GenerateInvokeRuntime(int32_t entry_point_offset); - ParallelMoveResolver* GetMoveResolver() OVERRIDE { return &move_resolver_; } + ParallelMoveResolver* GetMoveResolver() override { return &move_resolver_; } - bool NeedsTwoRegisters(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { return false; } + bool NeedsTwoRegisters(DataType::Type type ATTRIBUTE_UNUSED) const override { return false; } // Check if the desired_string_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadString::LoadKind GetSupportedLoadStringKind( - HLoadString::LoadKind desired_string_load_kind) OVERRIDE; + HLoadString::LoadKind desired_string_load_kind) override; // Check if the desired_class_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadClass::LoadKind GetSupportedLoadClassKind( - HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; + HLoadClass::LoadKind desired_class_load_kind) override; // Check if the desired_dispatch_info is supported. If it is, return it, // otherwise return a fall-back info that should be used instead. HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, - HInvokeStaticOrDirect* invoke) OVERRIDE; + HInvokeStaticOrDirect* invoke) override; void GenerateStaticOrDirectCall( - HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void GenerateVirtualCall( - HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void MoveFromReturnRegister(Location trg ATTRIBUTE_UNUSED, - DataType::Type type ATTRIBUTE_UNUSED) OVERRIDE { + DataType::Type type ATTRIBUTE_UNUSED) override { UNIMPLEMENTED(FATAL) << "Not implemented on MIPS64"; } - void GenerateNop() OVERRIDE; - void GenerateImplicitNullCheck(HNullCheck* instruction) OVERRIDE; - void GenerateExplicitNullCheck(HNullCheck* instruction) OVERRIDE; + void GenerateNop() override; + void GenerateImplicitNullCheck(HNullCheck* instruction) override; + void GenerateExplicitNullCheck(HNullCheck* instruction) override; // The PcRelativePatchInfo is used for PC-relative addressing of methods/strings/types, // whether through .data.bimg.rel.ro, .bss, or directly in the boot image. diff --git a/compiler/optimizing/code_generator_vector_arm64.cc b/compiler/optimizing/code_generator_vector_arm64.cc index 6d135a9bfb7248dd81451863abb3d20f0570b6e7..43169ba7ebb8247b8fc7d7996642c14199df2881 100644 --- a/compiler/optimizing/code_generator_vector_arm64.cc +++ b/compiler/optimizing/code_generator_vector_arm64.cc @@ -1354,6 +1354,7 @@ void InstructionCodeGeneratorARM64::VisitVecLoad(HVecLoad* instruction) { Register scratch; switch (instruction->GetPackedType()) { + case DataType::Type::kInt16: // (short) s.charAt(.) can yield HVecLoad/Int16/StringCharAt. case DataType::Type::kUint16: DCHECK_EQ(8u, instruction->GetVectorLength()); // Special handling of compressed/uncompressed string load. @@ -1385,7 +1386,6 @@ void InstructionCodeGeneratorARM64::VisitVecLoad(HVecLoad* instruction) { case DataType::Type::kBool: case DataType::Type::kUint8: case DataType::Type::kInt8: - case DataType::Type::kInt16: case DataType::Type::kInt32: case DataType::Type::kFloat32: case DataType::Type::kInt64: diff --git a/compiler/optimizing/code_generator_vector_x86.cc b/compiler/optimizing/code_generator_vector_x86.cc index 086ae07a0644f74c4f2d09298bd554a665e2dc39..2502275b3a3dd6340335079f3fd9443b2a8a6f8e 100644 --- a/compiler/optimizing/code_generator_vector_x86.cc +++ b/compiler/optimizing/code_generator_vector_x86.cc @@ -1205,6 +1205,7 @@ void InstructionCodeGeneratorX86::VisitVecLoad(HVecLoad* instruction) { XmmRegister reg = locations->Out().AsFpuRegister(); bool is_aligned16 = instruction->GetAlignment().IsAlignedAt(16); switch (instruction->GetPackedType()) { + case DataType::Type::kInt16: // (short) s.charAt(.) can yield HVecLoad/Int16/StringCharAt. case DataType::Type::kUint16: DCHECK_EQ(8u, instruction->GetVectorLength()); // Special handling of compressed/uncompressed string load. @@ -1232,7 +1233,6 @@ void InstructionCodeGeneratorX86::VisitVecLoad(HVecLoad* instruction) { case DataType::Type::kBool: case DataType::Type::kUint8: case DataType::Type::kInt8: - case DataType::Type::kInt16: case DataType::Type::kInt32: case DataType::Type::kInt64: DCHECK_LE(2u, instruction->GetVectorLength()); diff --git a/compiler/optimizing/code_generator_vector_x86_64.cc b/compiler/optimizing/code_generator_vector_x86_64.cc index 4d31ab68d11878741f76abcd9f3b2c08f6c68e9e..4a67dafd8adbc036fa559644af5307b7f462a30a 100644 --- a/compiler/optimizing/code_generator_vector_x86_64.cc +++ b/compiler/optimizing/code_generator_vector_x86_64.cc @@ -1178,6 +1178,7 @@ void InstructionCodeGeneratorX86_64::VisitVecLoad(HVecLoad* instruction) { XmmRegister reg = locations->Out().AsFpuRegister(); bool is_aligned16 = instruction->GetAlignment().IsAlignedAt(16); switch (instruction->GetPackedType()) { + case DataType::Type::kInt16: // (short) s.charAt(.) can yield HVecLoad/Int16/StringCharAt. case DataType::Type::kUint16: DCHECK_EQ(8u, instruction->GetVectorLength()); // Special handling of compressed/uncompressed string load. @@ -1205,7 +1206,6 @@ void InstructionCodeGeneratorX86_64::VisitVecLoad(HVecLoad* instruction) { case DataType::Type::kBool: case DataType::Type::kUint8: case DataType::Type::kInt8: - case DataType::Type::kInt16: case DataType::Type::kInt32: case DataType::Type::kInt64: DCHECK_LE(2u, instruction->GetVectorLength()); diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index df00ec7d3046add20138646e627cc4bd9104b95f..6a27081dab90f15e377d64e9de801f543e62d15c 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -72,7 +72,7 @@ class NullCheckSlowPathX86 : public SlowPathCode { public: explicit NullCheckSlowPathX86(HNullCheck* instruction) : SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorX86* x86_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); if (instruction_->CanThrowIntoCatchBlock()) { @@ -86,9 +86,9 @@ class NullCheckSlowPathX86 : public SlowPathCode { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathX86"; } + const char* GetDescription() const override { return "NullCheckSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathX86); @@ -98,16 +98,16 @@ class DivZeroCheckSlowPathX86 : public SlowPathCode { public: explicit DivZeroCheckSlowPathX86(HDivZeroCheck* instruction) : SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorX86* x86_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); x86_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathX86"; } + const char* GetDescription() const override { return "DivZeroCheckSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathX86); @@ -118,7 +118,7 @@ class DivRemMinusOneSlowPathX86 : public SlowPathCode { DivRemMinusOneSlowPathX86(HInstruction* instruction, Register reg, bool is_div) : SlowPathCode(instruction), reg_(reg), is_div_(is_div) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { __ Bind(GetEntryLabel()); if (is_div_) { __ negl(reg_); @@ -128,7 +128,7 @@ class DivRemMinusOneSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "DivRemMinusOneSlowPathX86"; } + const char* GetDescription() const override { return "DivRemMinusOneSlowPathX86"; } private: Register reg_; @@ -140,7 +140,7 @@ class BoundsCheckSlowPathX86 : public SlowPathCode { public: explicit BoundsCheckSlowPathX86(HBoundsCheck* instruction) : SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorX86* x86_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -187,9 +187,9 @@ class BoundsCheckSlowPathX86 : public SlowPathCode { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathX86"; } + const char* GetDescription() const override { return "BoundsCheckSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathX86); @@ -200,7 +200,7 @@ class SuspendCheckSlowPathX86 : public SlowPathCode { SuspendCheckSlowPathX86(HSuspendCheck* instruction, HBasicBlock* successor) : SlowPathCode(instruction), successor_(successor) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorX86* x86_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -224,7 +224,7 @@ class SuspendCheckSlowPathX86 : public SlowPathCode { return successor_; } - const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathX86"; } + const char* GetDescription() const override { return "SuspendCheckSlowPathX86"; } private: HBasicBlock* const successor_; @@ -237,7 +237,7 @@ class LoadStringSlowPathX86 : public SlowPathCode { public: explicit LoadStringSlowPathX86(HLoadString* instruction): SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); @@ -256,7 +256,7 @@ class LoadStringSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathX86"; } + const char* GetDescription() const override { return "LoadStringSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathX86); @@ -270,7 +270,7 @@ class LoadClassSlowPathX86 : public SlowPathCode { DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); const uint32_t dex_pc = instruction_->GetDexPc(); @@ -308,7 +308,7 @@ class LoadClassSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathX86"; } + const char* GetDescription() const override { return "LoadClassSlowPathX86"; } private: // The class this slow path will load. @@ -322,7 +322,7 @@ class TypeCheckSlowPathX86 : public SlowPathCode { TypeCheckSlowPathX86(HInstruction* instruction, bool is_fatal) : SlowPathCode(instruction), is_fatal_(is_fatal) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DCHECK(instruction_->IsCheckCast() || !locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); @@ -375,8 +375,8 @@ class TypeCheckSlowPathX86 : public SlowPathCode { } } - const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathX86"; } - bool IsFatal() const OVERRIDE { return is_fatal_; } + const char* GetDescription() const override { return "TypeCheckSlowPathX86"; } + bool IsFatal() const override { return is_fatal_; } private: const bool is_fatal_; @@ -389,7 +389,7 @@ class DeoptimizationSlowPathX86 : public SlowPathCode { explicit DeoptimizationSlowPathX86(HDeoptimize* instruction) : SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorX86* x86_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); LocationSummary* locations = instruction_->GetLocations(); @@ -402,7 +402,7 @@ class DeoptimizationSlowPathX86 : public SlowPathCode { CheckEntrypointTypes(); } - const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathX86"; } + const char* GetDescription() const override { return "DeoptimizationSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathX86); @@ -412,7 +412,7 @@ class ArraySetSlowPathX86 : public SlowPathCode { public: explicit ArraySetSlowPathX86(HInstruction* instruction) : SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); @@ -443,7 +443,7 @@ class ArraySetSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ArraySetSlowPathX86"; } + const char* GetDescription() const override { return "ArraySetSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathX86); @@ -471,9 +471,9 @@ class ReadBarrierMarkSlowPathX86 : public SlowPathCode { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierMarkSlowPathX86"; } + const char* GetDescription() const override { return "ReadBarrierMarkSlowPathX86"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -558,9 +558,9 @@ class ReadBarrierMarkAndUpdateFieldSlowPathX86 : public SlowPathCode { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierMarkAndUpdateFieldSlowPathX86"; } + const char* GetDescription() const override { return "ReadBarrierMarkAndUpdateFieldSlowPathX86"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -724,7 +724,7 @@ class ReadBarrierForHeapReferenceSlowPathX86 : public SlowPathCode { DCHECK(!obj.Equals(ref)) << "obj=" << obj << " ref=" << ref; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorX86* x86_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); Register reg_out = out_.AsRegister(); @@ -843,7 +843,7 @@ class ReadBarrierForHeapReferenceSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForHeapReferenceSlowPathX86"; } + const char* GetDescription() const override { return "ReadBarrierForHeapReferenceSlowPathX86"; } private: Register FindAvailableCallerSaveRegister(CodeGenerator* codegen) { @@ -883,7 +883,7 @@ class ReadBarrierForRootSlowPathX86 : public SlowPathCode { DCHECK(kEmitCompilerReadBarrier); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register reg_out = out_.AsRegister(); DCHECK(locations->CanCall()); @@ -909,7 +909,7 @@ class ReadBarrierForRootSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForRootSlowPathX86"; } + const char* GetDescription() const override { return "ReadBarrierForRootSlowPathX86"; } private: const Location out_; @@ -8100,7 +8100,7 @@ class RIPFixup : public AssemblerFixup, public ArenaObjectDebugName() << " (id " << instruction->GetId() << ")"; } @@ -186,14 +186,14 @@ class InstructionCodeGeneratorX86 : public InstructionCodeGenerator { InstructionCodeGeneratorX86(HGraph* graph, CodeGeneratorX86* codegen); #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_X86(DECLARE_VISIT_INSTRUCTION) #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -320,23 +320,23 @@ class CodeGeneratorX86 : public CodeGenerator { OptimizingCompilerStats* stats = nullptr); virtual ~CodeGeneratorX86() {} - void GenerateFrameEntry() OVERRIDE; - void GenerateFrameExit() OVERRIDE; - void Bind(HBasicBlock* block) OVERRIDE; - void MoveConstant(Location destination, int32_t value) OVERRIDE; - void MoveLocation(Location dst, Location src, DataType::Type dst_type) OVERRIDE; - void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; + void GenerateFrameEntry() override; + void GenerateFrameExit() override; + void Bind(HBasicBlock* block) override; + void MoveConstant(Location destination, int32_t value) override; + void MoveLocation(Location dst, Location src, DataType::Type dst_type) override; + void AddLocationAsTemp(Location location, LocationSummary* locations) override; - size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; + size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; // Generate code to invoke a runtime entry point. void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, - SlowPathCode* slow_path = nullptr) OVERRIDE; + SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record // PC-related information in a stack map. @@ -346,46 +346,46 @@ class CodeGeneratorX86 : public CodeGenerator { void GenerateInvokeRuntime(int32_t entry_point_offset); - size_t GetWordSize() const OVERRIDE { + size_t GetWordSize() const override { return kX86WordSize; } - size_t GetFloatingPointSpillSlotSize() const OVERRIDE { + size_t GetFloatingPointSpillSlotSize() const override { return GetGraph()->HasSIMD() ? 4 * kX86WordSize // 16 bytes == 4 words for each spill : 2 * kX86WordSize; // 8 bytes == 2 words for each spill } - HGraphVisitor* GetLocationBuilder() OVERRIDE { + HGraphVisitor* GetLocationBuilder() override { return &location_builder_; } - HGraphVisitor* GetInstructionVisitor() OVERRIDE { + HGraphVisitor* GetInstructionVisitor() override { return &instruction_visitor_; } - X86Assembler* GetAssembler() OVERRIDE { + X86Assembler* GetAssembler() override { return &assembler_; } - const X86Assembler& GetAssembler() const OVERRIDE { + const X86Assembler& GetAssembler() const override { return assembler_; } - uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { + uintptr_t GetAddressOf(HBasicBlock* block) override { return GetLabelOf(block)->Position(); } - void SetupBlockedRegisters() const OVERRIDE; + void SetupBlockedRegisters() const override; - void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; - void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; + void DumpCoreRegister(std::ostream& stream, int reg) const override; + void DumpFloatingPointRegister(std::ostream& stream, int reg) const override; - ParallelMoveResolverX86* GetMoveResolver() OVERRIDE { + ParallelMoveResolverX86* GetMoveResolver() override { return &move_resolver_; } - InstructionSet GetInstructionSet() const OVERRIDE { + InstructionSet GetInstructionSet() const override { return InstructionSet::kX86; } @@ -399,25 +399,25 @@ class CodeGeneratorX86 : public CodeGenerator { // Check if the desired_string_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadString::LoadKind GetSupportedLoadStringKind( - HLoadString::LoadKind desired_string_load_kind) OVERRIDE; + HLoadString::LoadKind desired_string_load_kind) override; // Check if the desired_class_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadClass::LoadKind GetSupportedLoadClassKind( - HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; + HLoadClass::LoadKind desired_class_load_kind) override; // Check if the desired_dispatch_info is supported. If it is, return it, // otherwise return a fall-back info that should be used instead. HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, - HInvokeStaticOrDirect* invoke) OVERRIDE; + HInvokeStaticOrDirect* invoke) override; // Generate a call to a static or direct method. void GenerateStaticOrDirectCall( - HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; // Generate a call to a virtual method. void GenerateVirtualCall( - HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void RecordBootImageIntrinsicPatch(HX86ComputeBaseMethodAddress* method_address, uint32_t intrinsic_data); @@ -442,16 +442,16 @@ class CodeGeneratorX86 : public CodeGenerator { dex::TypeIndex type_index, Handle handle); - void MoveFromReturnRegister(Location trg, DataType::Type type) OVERRIDE; + void MoveFromReturnRegister(Location trg, DataType::Type type) override; // Emit linker patches. - void EmitLinkerPatches(ArenaVector* linker_patches) OVERRIDE; + void EmitLinkerPatches(ArenaVector* linker_patches) override; void PatchJitRootUse(uint8_t* code, const uint8_t* roots_data, const PatchInfo