summaryrefslogtreecommitdiff
path: root/test/Transaction/Transaction.java
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2021-03-25 11:59:22 +0000
committer Vladimir Marko <vmarko@google.com> 2021-03-30 14:39:19 +0000
commit0685b981042acb57355e6742cf0ab18fbcfc4e25 (patch)
treeb9af226c72e2f173943c96c95a04349fe63134bb /test/Transaction/Transaction.java
parent579db19af4f718c1aac5ca95c180a70c5114c6bd (diff)
Abort transaction when Class.forName() fails.
And update VmClassLoader.findLoadedClass implementation in UnstartedRuntime which has erroneously diverged since https://android-review.googlesource.com/145075 . Also prevent transactional interpreter from transfering control to a catch handler for aborted transactions. Also clean up Transaction::kAbortExceptionDescriptor naming and some unused parameters. Test: TransactionTest.CatchClassForNameAbortClass Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Ibfc544283f5434efbaab238d11a6152ed2578050
Diffstat (limited to 'test/Transaction/Transaction.java')
-rw-r--r--test/Transaction/Transaction.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Transaction/Transaction.java b/test/Transaction/Transaction.java
index e7085c1734..6a4f5ef773 100644
--- a/test/Transaction/Transaction.java
+++ b/test/Transaction/Transaction.java
@@ -74,6 +74,31 @@ public class Transaction {
}
}
+ static class CatchClassForNameAbortClass {
+ static {
+ try {
+ Class.forName("non.existent.TestClass");
+ } catch (Throwable e) {
+ // ignore exception.
+ }
+ }
+ }
+
+ static class CatchClassForNameAbortClassTwice {
+ static {
+ try {
+ Class.forName("non.existent.TestClass");
+ } catch (Throwable e) {
+ // ignore exception.
+ }
+ try {
+ Class.forName("non.existent.TestClass");
+ } catch (Throwable e) {
+ // ignore exception.
+ }
+ }
+ }
+
// Helper class to abort transaction: finalizable class with natve methods.
static class AbortHelperClass {
public void finalize() throws Throwable {