From 2fd7e69505195cda4caaa3161aaf37315552a698 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Thu, 2 Apr 2015 11:11:19 +0200 Subject: Use specific exception class to abort transaction We used to throw a java.lang.InternalError when aborting a transaction (when preinitializing image classes at compilation time). We now use dedicated class dalvik.system.TransactionAbortError that is only thrown by the compiler to abort a transaction. This class has constructors taking a java.lang.Throwable "cause" so we can wrap exceptions causing the transaction to abort (for instance class java.lang.ClassNotFoundException) and give more information about the cause of the transaction abort. Bug: 20019689 Change-Id: I019a72a1c754d8bba6a7ad6bb0f02e4fd6668622 --- runtime/runtime.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/runtime.h') diff --git a/runtime/runtime.h b/runtime/runtime.h index 64b7183247..af3d8999fd 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -468,9 +468,9 @@ class Runtime { void ExitTransactionMode(); bool IsTransactionAborted() const; - void AbortTransactionAndThrowInternalError(Thread* self, const std::string& abort_message) + void AbortTransactionAndThrowAbortError(Thread* self, const std::string& abort_message) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - void ThrowInternalErrorForAbortedTransaction(Thread* self) + void ThrowTransactionAbortError(Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); void RecordWriteFieldBoolean(mirror::Object* obj, MemberOffset field_offset, uint8_t value, -- cgit v1.2.3