summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2019-03-08 12:58:06 -0800
committer Mathieu Chartier <mathieuc@google.com> 2019-03-11 22:36:42 +0000
commit7cb707ffe41774150cd41283ebb6f9b3b86060ea (patch)
tree09ec0318b2578de9b89987669f63e822ea95a8ad
parenta75e5892fba6d0208f33e9ab8e19e732daf94996 (diff)
Use resolve-startup-const-strings=true for run tests
Get extra test coverage for the feature. Fixed DCHECK in image writer since there may be more preresolved strings than the NumStrings. Added no-inline to test 137 to fix inlining that started happening causing a failure. Test: test/run-test --always-clean --dex2oat-jobs 4 --host --prebuild --compact-dex-level fast --jit --no-relocate --runtime-option -Xcheck:jni --64 968-default-partial-compile-gen Test: test-art-host Bug: 123377072 Bug: 124377920 Change-Id: Ic9034a1e2a55a0bb1e5776b9073e37955009948c
-rw-r--r--dex2oat/linker/image_writer.cc4
-rw-r--r--test/137-cfi/cfi.cc4
-rw-r--r--test/137-cfi/src-multidex/Base.java2
-rw-r--r--test/137-cfi/src/Main.java2
-rwxr-xr-xtest/etc/run-test-jar2
5 files changed, 8 insertions, 6 deletions
diff --git a/dex2oat/linker/image_writer.cc b/dex2oat/linker/image_writer.cc
index 15ced720c6..2fdae308c8 100644
--- a/dex2oat/linker/image_writer.cc
+++ b/dex2oat/linker/image_writer.cc
@@ -471,7 +471,9 @@ std::vector<ImageWriter::HeapReferencePointerInfo> ImageWriter::CollectStringRef
size_t string_info_collected = 0;
ObjPtr<mirror::DexCache> dex_cache = object->AsDexCache();
- DCHECK_LE(visitor.GetDexCacheStringRefCount(), dex_cache->NumStrings());
+ // Both of the dex cache string arrays are visited, so add up the total in the check.
+ DCHECK_LE(visitor.GetDexCacheStringRefCount(),
+ dex_cache->NumPreResolvedStrings() + dex_cache->NumStrings());
for (uint32_t index = 0; index < dex_cache->NumStrings(); ++index) {
// GetResolvedString() can't be used here due to the circular
diff --git a/test/137-cfi/cfi.cc b/test/137-cfi/cfi.cc
index 0cb220e49f..4d886f5a4d 100644
--- a/test/137-cfi/cfi.cc
+++ b/test/137-cfi/cfi.cc
@@ -149,7 +149,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_Main_unwindInProcess(JNIEnv*, jclass)
std::vector<std::string> seq = {
"Java_Main_unwindInProcess", // This function.
"java.util.Arrays.binarySearch0", // Framework method.
- "Base.runTest", // Method in other dex file.
+ "Base.$noinline$runTest", // Method in other dex file.
"Main.main" // The Java entry method.
};
@@ -239,7 +239,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_Main_unwindOtherProcess(JNIEnv*, jcla
std::vector<std::string> seq = {
"Java_Main_sigstop", // The stop function in the other process.
"java.util.Arrays.binarySearch0", // Framework method.
- "Base.runTest", // Method in other dex file.
+ "Base.$noinline$runTest", // Method in other dex file.
"Main.main" // The Java entry method.
};
diff --git a/test/137-cfi/src-multidex/Base.java b/test/137-cfi/src-multidex/Base.java
index 986a3c2226..6b9282c61c 100644
--- a/test/137-cfi/src-multidex/Base.java
+++ b/test/137-cfi/src-multidex/Base.java
@@ -15,7 +15,7 @@
*/
public abstract class Base {
- public void runTest() throws Exception {
+ public void $noinline$runTest() throws Exception {
// Conditionally throw exception to prevent the compiler from inlining the code.
if (!this.getClass().getName().equals("Main")) {
throw new Exception("Who is calling?");
diff --git a/test/137-cfi/src/Main.java b/test/137-cfi/src/Main.java
index 5b32d8e1fe..ed5f332734 100644
--- a/test/137-cfi/src/Main.java
+++ b/test/137-cfi/src/Main.java
@@ -46,7 +46,7 @@ public class Main extends Base implements Comparator<Main> {
}
// Call test() via base class to test unwinding through multidex.
- new Main().runTest();
+ new Main().$noinline$runTest();
}
public void test() {
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index 7ed12366a0..0fe148f3a3 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -825,7 +825,7 @@ if [ "$PREBUILD" = "y" ]; then
mkdir_locations="${mkdir_locations} ${DEX_LOCATION}/oat/$ISA"
if [ "$APP_IMAGE" = "y" ]; then
# Pick a base that will force the app image to get relocated.
- app_image="--base=0x4000 --app-image-file=$DEX_LOCATION/oat/$ISA/$TEST_NAME.art"
+ app_image="--base=0x4000 --app-image-file=$DEX_LOCATION/oat/$ISA/$TEST_NAME.art --resolve-startup-const-strings=true"
fi
dex2oat_binary=${DEX2OAT_DEBUG_BINARY}