Revert "More run-test with Jack"
This reverts commit c94ff128d770f5126d7685972b95a789c0b55cb0.
Fixes 3 more test failures with javac/dx.
004-ReferenceMap and 004-StackWalk now always use javac+dx because the
dex offsets are hardcoded into the C++ file.
Conflicts:
test/004-ReferenceMap/stack_walk_refmap_jni.cc
Test: ANDROID_COMPILE_WITH_JACK=false art/test.py
Bug: 36902714
Change-Id: I31f5b5512b71fcb1a634cadf2012017e723f78ca
diff --git a/test/004-ReferenceMap/build b/test/004-ReferenceMap/build
new file mode 100644
index 0000000..08987b5
--- /dev/null
+++ b/test/004-ReferenceMap/build
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# Copyright (C) 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Stop if something fails.
+set -e
+
+# The test relies on DEX file produced by javac+dx so keep building with them for now
+# (see b/19467889)
+mkdir classes
+${JAVAC} -d classes `find src -name '*.java'`
+${DX} -JXmx256m --debug --dex --dump-to=classes.lst --output=classes.dex \
+ --dump-width=1000 ${DX_FLAGS} classes
+zip $TEST_NAME.jar classes.dex
diff --git a/test/004-ReferenceMap/stack_walk_refmap_jni.cc b/test/004-ReferenceMap/stack_walk_refmap_jni.cc
index 6c16100..1ce20e2 100644
--- a/test/004-ReferenceMap/stack_walk_refmap_jni.cc
+++ b/test/004-ReferenceMap/stack_walk_refmap_jni.cc
@@ -60,10 +60,10 @@
// We eliminate the non-live registers at a return, so only v3 is live.
// Note that it is OK for a compiler to not have a dex map at this dex PC because
// a return is not necessarily a safepoint.
- CHECK_REGS_CONTAIN_REFS(0x14U, false, 2); // v2: y
+ CHECK_REGS_CONTAIN_REFS(0x13U, false, 3); // v3: y
// Note that v0: ex can be eliminated because it's a dead merge of two different exceptions.
CHECK_REGS_CONTAIN_REFS(0x18U, true, 8, 2, 1); // v8: this, v2: y, v1: x (dead v0: ex)
- CHECK_REGS_CONTAIN_REFS(0x22U, true, 8, 2, 1); // v8: this, v2: y, v1: x (dead v0: ex)
+ CHECK_REGS_CONTAIN_REFS(0x21U, true, 8, 2, 1); // v8: this, v2: y, v1: x (dead v0: ex)
if (!GetCurrentOatQuickMethodHeader()->IsOptimized()) {
CHECK_REGS_CONTAIN_REFS(0x27U, true, 8, 4, 2, 1); // v8: this, v4: ex, v2: y, v1: x
@@ -80,79 +80,124 @@
}
};
-// DEX code
+// Dex instructions for the function 'f' in ReferenceMap.java
+// Virtual methods -
+// #0 : (in LReferenceMap;)
+// name : 'f'
+// type : '()Ljava/lang/Object;'
+// access : 0x0000 ()
+// code -
+// registers : 9
+// ins : 1
+// outs : 2
+// insns size : 51 16-bit code units
+// |[0001e8] ReferenceMap.f:()Ljava/lang/Object;
+// |0000: const/4 v4, #int 2 // #2
+// |0001: const/4 v7, #int 0 // #0
+// |0002: const/4 v6, #int 1 // #1
//
-// 0000: const/4 v4, #int 2 // #2
-// 0001: const/4 v7, #int 0 // #0
-// 0002: const/4 v6, #int 1 // #1
-// 0003: new-array v1, v4, [Ljava/lang/Object; // type@0007
-// 0005: const/4 v2, #int 0 // #0
-// 0006: new-instance v3, Ljava/lang/Object; // type@0003
-// 0008: invoke-direct {v3}, Ljava/lang/Object;.<init>:()V // method@0004
-// 000b: const/4 v4, #int 2 // #2
-// 000c: aput-object v3, v1, v4
-// 000e: aput-object v3, v1, v6
-// 0010: invoke-virtual {v8, v7}, LMain;.refmap:(I)I // method@0003
-// 0013: move-object v2, v3
-// 0014: return-object v2
-// 0015: move-exception v0
-// 0016: if-nez v2, 0020 // +000a
-// 0018: new-instance v4, Ljava/lang/Object; // type@0003
-// 001a: invoke-direct {v4}, Ljava/lang/Object;.<init>:()V // method@0004
-// 001d: const/4 v5, #int 1 // #1
-// 001e: aput-object v4, v1, v5
-// 0020: aput-object v2, v1, v6
-// 0022: invoke-virtual {v8, v7}, LMain;.refmap:(I)I // method@0003
-// 0025: goto 0014 // -0011
-// 0026: move-exception v4
-// 0027: aput-object v2, v1, v6
-// 0029: invoke-virtual {v8, v7}, LMain;.refmap:(I)I // method@0003
-// 002c: throw v4
-// 002d: move-exception v4
-// 002e: move-object v2, v3
-// 002f: goto 0027 // -0008
-// 0030: move-exception v0
-// 0031: move-object v2, v3
-// 0032: goto 0016 // -001c
-// catches : 3
-// 0x0006 - 0x000b
-// Ljava/lang/Exception; -> 0x0015
-// <any> -> 0x0026
-// 0x000c - 0x000e
-// Ljava/lang/Exception; -> 0x0030
-// <any> -> 0x002d
-// 0x0018 - 0x0020
-// <any> -> 0x0026
-// positions :
-// 0x0003 line=22
-// 0x0005 line=23
-// 0x0006 line=25
-// 0x000b line=26
-// 0x000e line=32
-// 0x0010 line=33
-// 0x0014 line=35
-// 0x0015 line=27
-// 0x0016 line=28
-// 0x0018 line=29
-// 0x0020 line=32
-// 0x0022 line=33
-// 0x0026 line=31
-// 0x0027 line=32
-// 0x0029 line=33
-// 0x002c line=31
-// 0x0030 line=27
-// locals :
-// 0x0006 - 0x000b reg=2 y Ljava/lang/Object;
-// 0x000b - 0x0014 reg=3 y Ljava/lang/Object;
-// 0x0015 - 0x0016 reg=2 y Ljava/lang/Object;
-// 0x0016 - 0x0026 reg=0 ex Ljava/lang/Exception;
-// 0x002d - 0x002f reg=3 y Ljava/lang/Object;
-// 0x002f - 0x0030 reg=2 y Ljava/lang/Object;
-// 0x0030 - 0x0032 reg=3 y Ljava/lang/Object;
-// 0x0031 - 0x0033 reg=0 ex Ljava/lang/Exception;
-// 0x0005 - 0x0033 reg=1 x [Ljava/lang/Object;
-// 0x0032 - 0x0033 reg=2 y Ljava/lang/Object;
-// 0x0000 - 0x0033 reg=8 this LMain;
+// 0:[Unknown],1:[Unknown],2:[Unknown],3:[Unknown],4:[32-bit Constant: 2],5:[Unknown],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0003: new-array v1, v4, [Ljava/lang/Object; // type@0007
+// |0005: const/4 v2, #int 0 // #0
+
+// 0:[Unknown],1:[Reference: java.lang.Object[]],2:[Zero],3:[Unknown],4:[32-bit Constant: 2],5:[Unknown],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0006: new-instance v3, Ljava/lang/Object; // type@0003
+
+// [Unknown],1:[Reference: java.lang.Object[]],2:[Zero],3:[Uninitialized Reference: java.lang.Object],4:[32-bit Constant: 2],5:[Unknown],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0008: +invoke-object-init/range {}, Ljava/lang/Object;.<init>:()V // method@0005
+// |000b: const/4 v4, #int 2 // #2
+
+// 0:[Unknown],1:[Reference: java.lang.Object[]],2:[Zero],3:[Reference: java.lang.Object],4:[32-bit Constant: 2],5:[Unknown],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |000c: aput-object v3, v1, v4
+
+// 0:[Unknown],1:[Reference: java.lang.Object[]],2:[Zero],3:[Reference: java.lang.Object],4:[32-bit Constant: 2],5:[Unknown],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |000e: aput-object v3, v1, v6
+
+// 0:[Unknown],1:[Reference: java.lang.Object[]],2:[Zero],3:[Reference: java.lang.Object],4:[32-bit Constant: 2],5:[Unknown],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0010: +invoke-virtual-quick {v8, v7}, [000c] // vtable #000c
+
+// 0:[Conflict],1:[Conflict],2:[Conflict],3:[Reference: java.lang.Object],4:[Conflict],5:[Conflict],6:[Conflict],7:[Conflict],8:[Conflict],
+// |0013: return-object v3
+// |0014: move-exception v0
+
+// 0:[Reference: java.lang.Exception],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Conflict],4:[32-bit Constant: 2],5:[Unknown],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0015: if-nez v2, 001f // +000a
+// |0017: const/4 v4, #int 1 // #1
+
+// 0:[Reference: java.lang.Exception],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Conflict],4:[32-bit Constant: 1],5:[Unknown],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0018: new-instance v5, Ljava/lang/Object; // type@0003
+
+// 0:[Reference: java.lang.Exception],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Conflict],4:[32-bit Constant: 1],5:[Uninitialized Reference: java.lang.Object],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |001a: +invoke-object-init/range {}, Ljava/lang/Object;.<init>:()V // method@0005
+
+// 0:[Reference: java.lang.Exception],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Conflict],4:[32-bit Constant: 1],5:[Reference: java.lang.Object],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |001d: aput-object v5, v1, v4
+
+// 0:[Reference: java.lang.Exception],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Conflict],4:[32-bit Constant: 2],5:[Conflict],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |001f: aput-object v2, v1, v6
+
+// 0:[Reference: java.lang.Exception],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Conflict],4:[32-bit Constant: 2],5:[Conflict],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0021: +invoke-virtual-quick {v8, v7}, [000c] // vtable #000c
+// |0024: move-object v3, v2
+
+// 0:[Reference: java.lang.Exception],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Reference: java.lang.Object],4:[32-bit Constant: 2],5:[Conflict],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0025: goto 0013 // -0012
+// |0026: move-exception v4
+
+// 0:[Conflict],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Conflict],4:[Reference: java.lang.Throwable],5:[Conflict],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0027: aput-object v2, v1, v6
+
+// 0:[Conflict],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Conflict],4:[Reference: java.lang.Throwable],5:[Conflict],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0029: +invoke-virtual-quick {v8, v7}, [000c] // vtable #000c
+
+// 0:[Conflict],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Conflict],4:[Reference: java.lang.Throwable],5:[Conflict],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |002c: throw v4
+// |002d: move-exception v4
+// |002e: move-object v2, v3
+
+// 0:[Unknown],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Reference: java.lang.Object],4:[Reference: java.lang.Throwable],5:[Unknown],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |002f: goto 0027 // -0008
+// |0030: move-exception v0
+// |0031: move-object v2, v3
+
+// 0:[Reference: java.lang.Exception],1:[Reference: java.lang.Object[]],2:[Reference: java.lang.Object],3:[Reference: java.lang.Object],4:[32-bit Constant: 2],5:[Unknown],6:[32-bit Constant: 1],7:[Zero],8:[Reference: ReferenceMap],
+// |0032: goto 0015 // -001d
+// catches : 3
+// 0x0006 - 0x000b
+// Ljava/lang/Exception; -> 0x0014
+// <any> -> 0x0026
+// 0x000c - 0x000e
+// Ljava/lang/Exception; -> 0x0030
+// <any> -> 0x002d
+// 0x0018 - 0x001f
+// <any> -> 0x0026
+// positions :
+// 0x0003 line=8
+// 0x0005 line=9
+// 0x0006 line=11
+// 0x000b line=12
+// 0x000e line=18
+// 0x0010 line=19
+// 0x0013 line=21
+// 0x0014 line=13
+// 0x0015 line=14
+// 0x0017 line=15
+// 0x001f line=18
+// 0x0021 line=19
+// 0x0025 line=20
+// 0x0026 line=18
+// 0x0029 line=19
+// 0x002d line=18
+// 0x0030 line=13
+// locals :
+// 0x0006 - 0x000b reg=2 y Ljava/lang/Object;
+// 0x000b - 0x0013 reg=3 y Ljava/lang/Object;
+// 0x0014 - 0x0015 reg=2 y Ljava/lang/Object;
+// 0x0015 - 0x0026 reg=0 ex Ljava/lang/Exception;
+// 0x002d - 0x0032 reg=3 y Ljava/lang/Object;
+// 0x0005 - 0x0033 reg=1 x [Ljava/lang/Object;
+// 0x0032 - 0x0033 reg=2 y Ljava/lang/Object;
+// 0x0000 - 0x0033 reg=8 this LReferenceMap;
extern "C" JNIEXPORT jint JNICALL Java_Main_refmap(JNIEnv*, jobject, jint count) {
// Visitor
diff --git a/test/004-StackWalk/build b/test/004-StackWalk/build
new file mode 100644
index 0000000..08987b5
--- /dev/null
+++ b/test/004-StackWalk/build
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# Copyright (C) 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Stop if something fails.
+set -e
+
+# The test relies on DEX file produced by javac+dx so keep building with them for now
+# (see b/19467889)
+mkdir classes
+${JAVAC} -d classes `find src -name '*.java'`
+${DX} -JXmx256m --debug --dex --dump-to=classes.lst --output=classes.dex \
+ --dump-width=1000 ${DX_FLAGS} classes
+zip $TEST_NAME.jar classes.dex
diff --git a/test/004-StackWalk/stack_walk_jni.cc b/test/004-StackWalk/stack_walk_jni.cc
index 795f168..89e2e66 100644
--- a/test/004-StackWalk/stack_walk_jni.cc
+++ b/test/004-StackWalk/stack_walk_jni.cc
@@ -43,31 +43,31 @@
// Given the method name and the number of times the method has been called,
// we know the Dex registers with live reference values. Assert that what we
// find is what is expected.
- if (m_name == "$noinline$f") {
+ if (m_name == "f") {
if (gJava_StackWalk_refmap_calls == 1) {
CHECK_EQ(1U, GetDexPc());
- CHECK_REGS(1); // v1: this
+ CHECK_REGS(4);
} else {
CHECK_EQ(gJava_StackWalk_refmap_calls, 2);
CHECK_EQ(5U, GetDexPc());
- CHECK_REGS(1); // v1: this
+ CHECK_REGS(4);
}
} else if (m_name == "g") {
if (gJava_StackWalk_refmap_calls == 1) {
- CHECK_EQ(0xdU, GetDexPc());
- CHECK_REGS(0, 2); // v2: this (Note that v1 is not in the minimal root set)
+ CHECK_EQ(0xcU, GetDexPc());
+ CHECK_REGS(0, 2); // Note that v1 is not in the minimal root set
} else {
CHECK_EQ(gJava_StackWalk_refmap_calls, 2);
- CHECK_EQ(0xdU, GetDexPc());
+ CHECK_EQ(0xcU, GetDexPc());
CHECK_REGS(0, 2);
}
} else if (m_name == "shlemiel") {
if (gJava_StackWalk_refmap_calls == 1) {
- CHECK_EQ(0x393U, GetDexPc());
+ CHECK_EQ(0x380U, GetDexPc());
CHECK_REGS(2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 25);
} else {
CHECK_EQ(gJava_StackWalk_refmap_calls, 2);
- CHECK_EQ(0x393U, GetDexPc());
+ CHECK_EQ(0x380U, GetDexPc());
CHECK_REGS(2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 25);
}
}
diff --git a/test/089-many-methods/build b/test/089-many-methods/build
index 58144e1..ff77c60 100644
--- a/test/089-many-methods/build
+++ b/test/089-many-methods/build
@@ -43,4 +43,8 @@
printf("}\n") > fileName;
}'
-./default-build
+# The test relies on the error message produced by dx, not jack, so keep building with dx for now
+# (b/19467889).
+mkdir classes
+${JAVAC} -d classes `find src -name '*.java'`
+${DX} -JXmx1024m --dex --no-optimize classes
diff --git a/test/089-many-methods/expected.txt b/test/089-many-methods/expected.txt
index bfee8b3..786df7c 100644
--- a/test/089-many-methods/expected.txt
+++ b/test/089-many-methods/expected.txt
@@ -1,2 +1,6 @@
-ERROR: Dex writing phase: classes.dex has too many IDs. Try using multi-dex
-build exit status: 4
+
+trouble writing output: Too many field references to fit in one dex file: 131000; max is 65536.
+You may try using multi-dex. If multi-dex is enabled then the list of classes for the main dex list is too large.
+References by package:
+131000 default
+build exit status: 2
diff --git a/test/knownfailures.json b/test/knownfailures.json
index 614a258..cc6025f 100644
--- a/test/knownfailures.json
+++ b/test/knownfailures.json
@@ -596,9 +596,6 @@
},
{
"tests": [
- "004-ReferenceMap",
- "004-StackWalk",
- "089-many-methods",
"636-wrong-static-access",
"910-methods",
"911-get-stack-trace",