From 5abb0696dacb90ad35a571a5b660efb0c4dc3c01 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Mon, 19 Mar 2018 13:40:56 +0000 Subject: Fix running some run-tests with -Xjitthreshold:0 Do not JIT non-compilable methods. Honor the $noinline$ directive for JIT and fix core image recognition. Make sure the 597-deopt-invoke-stub that actually relies on its own -Xjitthreshold: overrides the threshold we pass, work around already running compiled code in 570-checker-osr (and drop obsolete "doThrow" pattern replaced by $noinline$) and add a few necessary $noinline$ directives. Partial cherry-pick of commit be0c7cfdbb2b73d6beb1284fdedb8e07766630e9. Test: for t in \ 461-get-reference-vreg \ 536-checker-needs-access-check \ 570-checker-osr \ 597-deopt-invoke-stub \ 655-jit-clinit \ ; do \ art/test/run-test --host --jit $t \ --runtime-option -Xjitthreshold:0; \ done Test: testrunner.py --host --jit Bug: 62611253 Merged-In: Ia0a05c93e3fc8d913fe8556d3d7f23e7e61076c2 Change-Id: Ia0a05c93e3fc8d913fe8556d3d7f23e7e61076c2 --- compiler/driver/compiler_driver.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'compiler/driver/compiler_driver.h') diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index fffa3b345f..682cf16d45 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -371,9 +371,18 @@ class CompilerDriver { // Is `boot_image_filename` the name of a core image (small boot // image used for ART testing only)? static bool IsCoreImageFilename(const std::string& boot_image_filename) { - // TODO: This is under-approximating... - return android::base::EndsWith(boot_image_filename, "core.art") - || android::base::EndsWith(boot_image_filename, "core-optimizing.art"); + // Look for "core.art" or "core-*.art". + if (android::base::EndsWith(boot_image_filename, "core.art")) { + return true; + } + if (!android::base::EndsWith(boot_image_filename, ".art")) { + return false; + } + size_t dash_pos = boot_image_filename.find_last_of("-/"); + if (dash_pos == std::string::npos || boot_image_filename[dash_pos] != '-') { + return false; + } + return (dash_pos >= 4u) && (boot_image_filename.compare(dash_pos - 4u, 4u, "core") == 0); } optimizer::DexToDexCompiler& GetDexToDexCompiler() { -- cgit v1.2.3-59-g8ed1b From da802f86c4361c23e827b88573583ee91f0edede Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 11 Apr 2018 15:44:19 -0700 Subject: ART: Fix core image detection Accept any .art name starting with "core-." Correctly detects images with multiple dashes. Bug: 64382372 Test: mmma art Test: art/test/testrunner/testrunner.py -b --host Test: Device boots Merged-In: I6c8006411b0ec16225b137dd349d53d9bc0ac03d Change-Id: I6c8006411b0ec16225b137dd349d53d9bc0ac03d --- compiler/driver/compiler_driver.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/driver/compiler_driver.h') diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 682cf16d45..a5462eefe2 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -378,11 +378,11 @@ class CompilerDriver { if (!android::base::EndsWith(boot_image_filename, ".art")) { return false; } - size_t dash_pos = boot_image_filename.find_last_of("-/"); - if (dash_pos == std::string::npos || boot_image_filename[dash_pos] != '-') { - return false; + size_t slash_pos = boot_image_filename.rfind('/'); + if (slash_pos == std::string::npos) { + return android::base::StartsWith(boot_image_filename, "core-"); } - return (dash_pos >= 4u) && (boot_image_filename.compare(dash_pos - 4u, 4u, "core") == 0); + return boot_image_filename.compare(slash_pos + 1, 5u, "core-") == 0; } optimizer::DexToDexCompiler& GetDexToDexCompiler() { -- cgit v1.2.3-59-g8ed1b