Follow-up 128393

Avoids false warning when initializing the exception's class by
marking the transaction aborted after throwing the InternalError
exception.

Also uses VLOG(compiler) to print the warning since it's only useful
when investigating ahead-of-time class initialization.

Bug: 19202032
Change-Id: I3c53639cbb888086ad345d668d1e5b73c5aaf861
diff --git a/runtime/transaction.cc b/runtime/transaction.cc
index e26f955..c0fd7a5 100644
--- a/runtime/transaction.cc
+++ b/runtime/transaction.cc
@@ -70,8 +70,10 @@
   }
 }
 
-void Transaction::ThrowInternalError(Thread* self) {
-  DCHECK(IsAborted());
+void Transaction::ThrowInternalError(Thread* self, bool rethrow) {
+  if (kIsDebugBuild && rethrow) {
+    CHECK(IsAborted()) << "Rethrow InternalError while transaction is not aborted";
+  }
   std::string abort_msg(GetAbortMessage());
   self->ThrowNewException(self->GetCurrentLocationForThrow(), "Ljava/lang/InternalError;",
                           abort_msg.c_str());