summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2013-08-22 08:18:36 -0700
committerIan Rogers <irogers@google.com>2013-08-23 10:49:29 -0700
commit7dfb28c066159e6cde8181720f0c451a700ef966 (patch)
tree5279fb95da015365846eb48d931b9355b540cb9e /test
parenta7e885013753df3f07bf038a8c4a187fb97c78e1 (diff)
downloadart-7dfb28c066159e6cde8181720f0c451a700ef966.tar.gz
art-7dfb28c066159e6cde8181720f0c451a700ef966.tar.bz2
art-7dfb28c066159e6cde8181720f0c451a700ef966.zip
Don't scan image space when starting runtime.
Bug 10432288. Find Classes and Strings from dex caches lazily rather than when the image is loaded. Make class status changes do notifies when there can be waiters. For Class lookup there's a pathology if we always search dex caches and so after 1000 failures move all classes into the class table. Be consistent in using "const char*" for class linker descriptors as this most easily agrees with the type in the dex file. Improve the intern run-test so that it has a case of a literal contained in the image. Modify image_test to allow any valid lock word rather than expecting 0, ideally we wouldn't see inflated monitors but we do due to NotifyAll (see bug 6961405). Change-Id: Ia9bfa748eeccb9b4498784b97c6823141b1f6db8
Diffstat (limited to 'test')
-rw-r--r--test/016-intern/expected.txt2
-rw-r--r--test/016-intern/src/Main.java24
2 files changed, 23 insertions, 3 deletions
diff --git a/test/016-intern/expected.txt b/test/016-intern/expected.txt
index 7d919635fc..0b7ac3d3ce 100644
--- a/test/016-intern/expected.txt
+++ b/test/016-intern/expected.txt
@@ -1 +1,3 @@
good! foobar
+good! foo
+good! null
diff --git a/test/016-intern/src/Main.java b/test/016-intern/src/Main.java
index 430686302a..01cbf18c6d 100644
--- a/test/016-intern/src/Main.java
+++ b/test/016-intern/src/Main.java
@@ -20,15 +20,33 @@
public class Main {
public static void main(String args[]) {
String a, b;
- String foo = "foo";
- String bar = "bar";
+ final String foo = "foo";
+ final String bar = "bar";
+ // Two interned strings should match.
a = foo.concat(bar).intern();
b = foo.concat(bar).intern();
if (a == b && foo != bar) {
System.out.println("good! " + a);
} else {
- System.out.println("bad!");
+ System.out.println("bad! " + a + " != " + b);
+ }
+
+ // An interned string should match a string literal.
+ a = ("f" + foo.substring(1,3)).intern();
+ if (a == foo) {
+ System.out.println("good! " + a);
+ } else {
+ System.out.println("bad! " + a + " != " + b);
+ }
+
+ // Check that a string literal in libcore equals one in the app.
+ a = (new java.nio.charset.IllegalCharsetNameException(null)).getMessage();
+ b = "null";
+ if (a == b) {
+ System.out.println("good! " + a);
+ } else {
+ System.out.println("bad! " + a + " != " + b);
}
}
}