summaryrefslogtreecommitdiffstats
path: root/oatdump
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-02-24 15:16:06 -0800
committerMathieu Chartier <mathieuc@google.com>2014-02-25 11:10:31 -0800
commitc22c59ef8513b4cbbfd25073d1afbf58196b522a (patch)
tree416fd01407baa5f4ee5f0f64ea8c1b328965a7b5 /oatdump
parent661425e1f90d4f4ed44c66f5e74f48b92a3798df (diff)
downloadart-c22c59ef8513b4cbbfd25073d1afbf58196b522a.tar.gz
art-c22c59ef8513b4cbbfd25073d1afbf58196b522a.tar.bz2
art-c22c59ef8513b4cbbfd25073d1afbf58196b522a.zip
Remove started runtime check in RevokeAllThreadLocalAllocationStacks
This check occasionally caused some thread local allocation stacks to incorrectly not get revoked when multiple threads were allocating without a started runtime. This showed up in image_test with compaction enabled when we were initializing classes in the compiler driver. Change-Id: I7f28d072feea333c2503e35265ba25c51a6308fe
Diffstat (limited to 'oatdump')
-rw-r--r--oatdump/oatdump.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 0d9b9910b7..330a307df7 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -49,6 +49,7 @@
#include "runtime.h"
#include "safe_map.h"
#include "scoped_thread_state_change.h"
+#include "thread_list.h"
#include "verifier/dex_gc_map.h"
#include "verifier/method_verifier.h"
#include "vmap_table.h"
@@ -817,12 +818,21 @@ class ImageDumper {
const std::vector<gc::space::ContinuousSpace*>& spaces = heap->GetContinuousSpaces();
Thread* self = Thread::Current();
{
- WriterMutexLock mu(self, *Locks::heap_bitmap_lock_);
- heap->FlushAllocStack();
+ {
+ WriterMutexLock mu(self, *Locks::heap_bitmap_lock_);
+ heap->FlushAllocStack();
+ }
// Since FlushAllocStack() above resets the (active) allocation
// stack. Need to revoke the thread-local allocation stacks that
// point into it.
- heap->RevokeAllThreadLocalAllocationStacks(self);
+ {
+ self->TransitionFromRunnableToSuspended(kNative);
+ ThreadList* thread_list = Runtime::Current()->GetThreadList();
+ thread_list->SuspendAll();
+ heap->RevokeAllThreadLocalAllocationStacks(self);
+ thread_list->ResumeAll();
+ self->TransitionFromSuspendedToRunnable();
+ }
}
{
std::ostream* saved_os = os_;
@@ -1548,7 +1558,6 @@ static int oatdump(int argc, char** argv) {
// give it away now and then switch to a more managable ScopedObjectAccess.
Thread::Current()->TransitionFromRunnableToSuspended(kNative);
ScopedObjectAccess soa(Thread::Current());
-
gc::Heap* heap = Runtime::Current()->GetHeap();
gc::space::ImageSpace* image_space = heap->GetImageSpace();
CHECK(image_space != NULL);