diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-09-19 17:52:37 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-09-19 18:57:47 -0700 |
commit | 2d5f39ed5aeaeb7ca22b07b4c6e8c56348ef8893 (patch) | |
tree | b0b9a8d4c386555f009b825bd5fbd8ab31909c3b /compiler/driver | |
parent | 24f4b816dd50793e8456dc60fe1b50856004d708 (diff) | |
download | art-2d5f39ed5aeaeb7ca22b07b4c6e8c56348ef8893.zip art-2d5f39ed5aeaeb7ca22b07b4c6e8c56348ef8893.tar.gz art-2d5f39ed5aeaeb7ca22b07b4c6e8c56348ef8893.tar.bz2 |
Add ScopedAssertNoThreadSuspension
Added a new class, ScopedAssertNoThreadSuspension.
Deleted some unnecessary ScopedAssertNoThreadSuspension since
VisitObjects already has a ScopedAssertNoThreadSuspension.
Change-Id: I29ec0006120c39a27184d30e2d1d0c179e203776
Diffstat (limited to 'compiler/driver')
-rw-r--r-- | compiler/driver/compiler_driver.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index d743f90..990c1c8 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -795,14 +795,11 @@ void CompilerDriver::UpdateImageClasses(TimingLogger* timings) { if (IsImage()) { TimingLogger::ScopedTiming t("UpdateImageClasses", timings); // Update image_classes_ with classes for objects created by <clinit> methods. - Thread* self = Thread::Current(); - const char* old_cause = self->StartAssertNoThreadSuspension("ImageWriter"); gc::Heap* heap = Runtime::Current()->GetHeap(); // TODO: Image spaces only? ScopedObjectAccess soa(Thread::Current()); - WriterMutexLock mu(self, *Locks::heap_bitmap_lock_); + WriterMutexLock mu(soa.Self(), *Locks::heap_bitmap_lock_); heap->VisitObjects(FindClinitImageClassesCallback, this); - self->EndAssertNoThreadSuspension(old_cause); } } @@ -1872,7 +1869,8 @@ static void InitializeClass(const ParallelCompilationManager* manager, size_t cl // TODO we detach transaction from runtime to indicate we quit the transactional // mode which prevents the GC from visiting objects modified during the transaction. // Ensure GC is not run so don't access freed objects when aborting transaction. - const char* old_casue = soa.Self()->StartAssertNoThreadSuspension("Transaction end"); + + ScopedAssertNoThreadSuspension ants(soa.Self(), "Transaction end"); runtime->ExitTransactionMode(); if (!success) { @@ -1885,7 +1883,6 @@ static void InitializeClass(const ParallelCompilationManager* manager, size_t cl transaction.Abort(); CHECK_EQ(old_status, klass->GetStatus()) << "Previous class status not restored"; } - soa.Self()->EndAssertNoThreadSuspension(old_casue); } } soa.Self()->AssertNoPendingException(); |