diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-03-10 17:28:50 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-03-10 17:28:51 +0000 |
commit | e2d080ca23ee6146bc28c2caa6c856bd5af41043 (patch) | |
tree | e8164b8b35b8696e6c19ee4c6f45657b054df7a1 /runtime | |
parent | 37991f98812acf0f58f69ec75f4221a32fcc0d09 (diff) | |
parent | d6534315596326f1a65aa2d300144c09205c5122 (diff) | |
download | art-e2d080ca23ee6146bc28c2caa6c856bd5af41043.zip art-e2d080ca23ee6146bc28c2caa6c856bd5af41043.tar.gz art-e2d080ca23ee6146bc28c2caa6c856bd5af41043.tar.bz2 |
Merge "Add timing split for RevokeAllThreadLocalBuffers."
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/gc/collector/garbage_collector.cc | 12 | ||||
-rw-r--r-- | runtime/gc/collector/garbage_collector.h | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/runtime/gc/collector/garbage_collector.cc b/runtime/gc/collector/garbage_collector.cc index 094e274..1e1e447 100644 --- a/runtime/gc/collector/garbage_collector.cc +++ b/runtime/gc/collector/garbage_collector.cc @@ -64,6 +64,12 @@ void GarbageCollector::ResetCumulativeStatistics() { total_freed_bytes_ = 0; } +void GarbageCollector::RevokeAllThreadLocalBuffers() { + timings_.StartSplit("(Paused)RevokeAllThreadLocalBuffers"); + GetHeap()->RevokeAllThreadLocalBuffers(); + timings_.EndSplit(); +} + void GarbageCollector::Run(GcCause gc_cause, bool clear_soft_references) { ThreadList* thread_list = Runtime::Current()->GetThreadList(); Thread* self = Thread::Current(); @@ -89,14 +95,14 @@ void GarbageCollector::Run(GcCause gc_cause, bool clear_soft_references) { // current collector / allocator during process state updates. if (Locks::mutator_lock_->IsExclusiveHeld(self)) { // PreGcRosAllocVerification() is called in Heap::TransitionCollector(). - GetHeap()->RevokeAllThreadLocalBuffers(); + RevokeAllThreadLocalBuffers(); MarkingPhase(); ReclaimPhase(); // PostGcRosAllocVerification() is called in Heap::TransitionCollector(). } else { thread_list->SuspendAll(); GetHeap()->PreGcRosAllocVerification(&timings_); - GetHeap()->RevokeAllThreadLocalBuffers(); + RevokeAllThreadLocalBuffers(); MarkingPhase(); ReclaimPhase(); GetHeap()->PostGcRosAllocVerification(&timings_); @@ -121,7 +127,7 @@ void GarbageCollector::Run(GcCause gc_cause, bool clear_soft_references) { GetHeap()->PreGcRosAllocVerification(&timings_); done = HandleDirtyObjectsPhase(); if (done) { - GetHeap()->RevokeAllThreadLocalBuffers(); + RevokeAllThreadLocalBuffers(); } GetHeap()->PostGcRosAllocVerification(&timings_); ATRACE_END(); diff --git a/runtime/gc/collector/garbage_collector.h b/runtime/gc/collector/garbage_collector.h index 8d401b8..8259cf0 100644 --- a/runtime/gc/collector/garbage_collector.h +++ b/runtime/gc/collector/garbage_collector.h @@ -127,6 +127,8 @@ class GarbageCollector { // Called after the GC is finished. Done without mutators paused. virtual void FinishPhase() = 0; + void RevokeAllThreadLocalBuffers(); + static constexpr size_t kPauseBucketSize = 500; static constexpr size_t kPauseBucketCount = 32; |