diff options
author | Sebastien Hertz <shertz@google.com> | 2015-04-02 11:11:19 +0200 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2015-04-03 09:31:59 +0200 |
commit | 2fd7e69505195cda4caaa3161aaf37315552a698 (patch) | |
tree | 2bd681443ad36a8616f237a12e56ecbdb7054f8e /runtime/runtime.cc | |
parent | c6e949a6d93fae2351fc59ed825657adee8185dc (diff) | |
download | art-2fd7e69505195cda4caaa3161aaf37315552a698.zip art-2fd7e69505195cda4caaa3161aaf37315552a698.tar.gz art-2fd7e69505195cda4caaa3161aaf37315552a698.tar.bz2 |
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
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index b5d2e15..b82e897 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1533,21 +1533,20 @@ bool Runtime::IsTransactionAborted() const { } } -void Runtime::AbortTransactionAndThrowInternalError(Thread* self, - const std::string& abort_message) { +void Runtime::AbortTransactionAndThrowAbortError(Thread* self, const std::string& abort_message) { DCHECK(IsAotCompiler()); DCHECK(IsActiveTransaction()); // Throwing an exception may cause its class initialization. If we mark the transaction // aborted before that, we may warn with a false alarm. Throwing the exception before // marking the transaction aborted avoids that. - preinitialization_transaction_->ThrowInternalError(self, false); + preinitialization_transaction_->ThrowAbortError(self, false); preinitialization_transaction_->Abort(abort_message); } -void Runtime::ThrowInternalErrorForAbortedTransaction(Thread* self) { +void Runtime::ThrowTransactionAbortError(Thread* self) { DCHECK(IsAotCompiler()); DCHECK(IsActiveTransaction()); - preinitialization_transaction_->ThrowInternalError(self, true); + preinitialization_transaction_->ThrowAbortError(self, true); } void Runtime::RecordWriteFieldBoolean(mirror::Object* obj, MemberOffset field_offset, |