diff options
author | Sebastien Hertz <shertz@google.com> | 2014-02-21 15:46:30 +0100 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2014-04-02 09:21:12 +0200 |
commit | ee1d79a603c77c0667b27c075a983579d5c51f7e (patch) | |
tree | 7b23516402105319ab4736cd179a1de9101eeb46 /runtime/runtime.cc | |
parent | 78bd9b2198f0ccc48036c1517b2d9a9023157dfb (diff) | |
download | art-ee1d79a603c77c0667b27c075a983579d5c51f7e.zip art-ee1d79a603c77c0667b27c075a983579d5c51f7e.tar.gz art-ee1d79a603c77c0667b27c075a983579d5c51f7e.tar.bz2 |
Cleanup transaction support
Updates Thread::CreateInternalStackTrace to support both transactional and
non-transactional modes using template.
Generalizes non-transactional mode for invariant fields (which are set only
once).
Removes ArrayLog::VisitRoots as we never create Array logs of ObjectArray. As
ObjectArray elements are set using Object::SetFieldObject, they are already
recorded in the object logs: the object is the array itself and the offset
corresponds to the element index in this array. And also checks we never log
ObjectArray in array logs.
Fixes location of thrown exception when calling native method during class
initialization.
Change-Id: Idbc368d3b8292b85ff40bc8a7c559e085477bf89
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index a8da2f8..c4010e3 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -124,7 +124,7 @@ Runtime::Runtime() system_thread_group_(nullptr), system_class_loader_(nullptr), dump_gc_performance_on_shutdown_(false), - preinitialization_transaction(nullptr), + preinitialization_transaction_(nullptr), null_pointer_handler_(nullptr), suspend_handler_(nullptr), stack_overflow_handler_(nullptr) { @@ -894,8 +894,8 @@ void Runtime::VisitNonThreadRoots(RootCallback* callback, void* arg) { verifier->VisitRoots(callback, arg); } } - if (preinitialization_transaction != nullptr) { - preinitialization_transaction->VisitRoots(callback, arg); + if (preinitialization_transaction_ != nullptr) { + preinitialization_transaction_->VisitRoots(callback, arg); } instrumentation_.VisitRoots(callback, arg); } @@ -1141,73 +1141,68 @@ void Runtime::StartProfiler(const char* appDir, const char* procName, bool start } // Transaction support. -// TODO move them to header file for inlining. -bool Runtime::IsActiveTransaction() const { - return preinitialization_transaction != nullptr; -} - void Runtime::EnterTransactionMode(Transaction* transaction) { DCHECK(IsCompiler()); DCHECK(transaction != nullptr); DCHECK(!IsActiveTransaction()); - preinitialization_transaction = transaction; + preinitialization_transaction_ = transaction; } void Runtime::ExitTransactionMode() { DCHECK(IsCompiler()); DCHECK(IsActiveTransaction()); - preinitialization_transaction = nullptr; + preinitialization_transaction_ = nullptr; } void Runtime::RecordWriteField32(mirror::Object* obj, MemberOffset field_offset, uint32_t value, bool is_volatile) const { DCHECK(IsCompiler()); DCHECK(IsActiveTransaction()); - preinitialization_transaction->RecordWriteField32(obj, field_offset, value, is_volatile); + preinitialization_transaction_->RecordWriteField32(obj, field_offset, value, is_volatile); } void Runtime::RecordWriteField64(mirror::Object* obj, MemberOffset field_offset, uint64_t value, bool is_volatile) const { DCHECK(IsCompiler()); DCHECK(IsActiveTransaction()); - preinitialization_transaction->RecordWriteField64(obj, field_offset, value, is_volatile); + preinitialization_transaction_->RecordWriteField64(obj, field_offset, value, is_volatile); } void Runtime::RecordWriteFieldReference(mirror::Object* obj, MemberOffset field_offset, mirror::Object* value, bool is_volatile) const { DCHECK(IsCompiler()); DCHECK(IsActiveTransaction()); - preinitialization_transaction->RecordWriteFieldReference(obj, field_offset, value, is_volatile); + preinitialization_transaction_->RecordWriteFieldReference(obj, field_offset, value, is_volatile); } void Runtime::RecordWriteArray(mirror::Array* array, size_t index, uint64_t value) const { DCHECK(IsCompiler()); DCHECK(IsActiveTransaction()); - preinitialization_transaction->RecordWriteArray(array, index, value); + preinitialization_transaction_->RecordWriteArray(array, index, value); } void Runtime::RecordStrongStringInsertion(mirror::String* s, uint32_t hash_code) const { DCHECK(IsCompiler()); DCHECK(IsActiveTransaction()); - preinitialization_transaction->RecordStrongStringInsertion(s, hash_code); + preinitialization_transaction_->RecordStrongStringInsertion(s, hash_code); } void Runtime::RecordWeakStringInsertion(mirror::String* s, uint32_t hash_code) const { DCHECK(IsCompiler()); DCHECK(IsActiveTransaction()); - preinitialization_transaction->RecordWeakStringInsertion(s, hash_code); + preinitialization_transaction_->RecordWeakStringInsertion(s, hash_code); } void Runtime::RecordStrongStringRemoval(mirror::String* s, uint32_t hash_code) const { DCHECK(IsCompiler()); DCHECK(IsActiveTransaction()); - preinitialization_transaction->RecordStrongStringRemoval(s, hash_code); + preinitialization_transaction_->RecordStrongStringRemoval(s, hash_code); } void Runtime::RecordWeakStringRemoval(mirror::String* s, uint32_t hash_code) const { DCHECK(IsCompiler()); DCHECK(IsActiveTransaction()); - preinitialization_transaction->RecordWeakStringRemoval(s, hash_code); + preinitialization_transaction_->RecordWeakStringRemoval(s, hash_code); } void Runtime::SetFaultMessage(const std::string& message) { |