summaryrefslogtreecommitdiffstats
path: root/runtime/thread.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-04-29 14:37:57 -0700
committerMathieu Chartier <mathieuc@google.com>2014-04-30 15:23:36 -0700
commit0651d41e41341fb2e9ef3ee41dc1f1bfc832dbbb (patch)
treead060fe7f37f4958d15d15d868e0cf6fb074d2cb /runtime/thread.h
parentadcfc69aa94cc1d406ef78e194b1ac36e389ad95 (diff)
downloadart-0651d41e41341fb2e9ef3ee41dc1f1bfc832dbbb.zip
art-0651d41e41341fb2e9ef3ee41dc1f1bfc832dbbb.tar.gz
art-0651d41e41341fb2e9ef3ee41dc1f1bfc832dbbb.tar.bz2
Add thread unsafe allocation methods to spaces.
Used by SS/GSS collectors since these run with mutators suspended and only allocate from a single thread. Added AllocThreadUnsafe to BumpPointerSpace and RosAllocSpace. Added AllocThreadUnsafe which uses current runs as thread local runs for a thread unsafe allocation. Added code to revoke current runs which are the same idx as thread local runs. Changed: The number of thread local runs in each thread is now the the number of thread local runs in RosAlloc instead of the number of size brackets. Total GC time / time on EvaluateAndApplyChanges. TLAB SS: Before: 36.7s / 7254 After: 16.1s / 4837 TLAB GSS: Before: 6.9s / 3973 After: 5.7s / 3778 Bug: 8981901 Change-Id: Id1d264ade3799f431bf7ebbdcca6146aefbeb632
Diffstat (limited to 'runtime/thread.h')
-rw-r--r--runtime/thread.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/runtime/thread.h b/runtime/thread.h
index f869285..8c17082 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -29,6 +29,7 @@
#include "entrypoints/jni/jni_entrypoints.h"
#include "entrypoints/portable/portable_entrypoints.h"
#include "entrypoints/quick/quick_entrypoints.h"
+#include "gc/allocator/rosalloc.h"
#include "globals.h"
#include "jvalue.h"
#include "object_callbacks.h"
@@ -783,9 +784,6 @@ class Thread {
return tlsPtr_.thread_local_objects;
}
- // ROS alloc TLS.
- static constexpr size_t kRosAllocNumOfSizeBrackets = 34;
-
void* GetRosAllocRun(size_t index) const {
return tlsPtr_.rosalloc_runs[index];
}
@@ -1060,12 +1058,8 @@ class Thread {
byte* thread_local_end;
size_t thread_local_objects;
- // Thread-local rosalloc runs. There are 34 size brackets in rosalloc
- // runs (RosAlloc::kNumOfSizeBrackets). We can't refer to the
- // RosAlloc class due to a header file circular dependency issue.
- // To compensate, we check that the two values match at RosAlloc
- // initialization time.
- void* rosalloc_runs[kRosAllocNumOfSizeBrackets];
+ // There are RosAlloc::kNumThreadLocalSizeBrackets thread-local size brackets per thread.
+ void* rosalloc_runs[gc::allocator::RosAlloc::kNumThreadLocalSizeBrackets];
// Thread-local allocation stack data/routines.
mirror::Object** thread_local_alloc_stack_top;