diff options
author | Mathieu Chartier <mathieuc@google.com> | 2015-04-03 11:21:55 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2015-04-06 10:44:37 -0700 |
commit | bb87e0f1a52de656bc77cb01cb887e51a0e5198b (patch) | |
tree | 113f014c6e20fab3e936a3ac05f9f738639541f6 /runtime/indirect_reference_table.h | |
parent | e57fc0f0260fcb1d08cbb720ec95c04c0f394b91 (diff) | |
download | art-bb87e0f1a52de656bc77cb01cb887e51a0e5198b.tar.gz art-bb87e0f1a52de656bc77cb01cb887e51a0e5198b.tar.bz2 art-bb87e0f1a52de656bc77cb01cb887e51a0e5198b.zip |
Refactor and improve GC root handling
Changed GcRoot to use compressed references. Changed root visiting to
use virtual functions instead of function pointers. Changed root visting
interface to be an array of roots instead of a single root at a time.
Added buffered root marking helper to avoid dispatch overhead.
Root marking seems a bit faster on EvaluateAndApplyChanges due to batch
marking. Pause times unaffected.
Mips64 is untested but might work, maybe.
Before:
MarkConcurrentRoots: Sum: 67.678ms 99% C.I. 2us-664.999us Avg: 161.138us Max: 671us
After:
MarkConcurrentRoots: Sum: 54.806ms 99% C.I. 2us-499.986us Avg: 136.333us Max: 602us
Bug: 19264997
Change-Id: I0a71ebb5928f205b9b3f7945b25db6489d5657ca
Diffstat (limited to 'runtime/indirect_reference_table.h')
-rw-r--r-- | runtime/indirect_reference_table.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/indirect_reference_table.h b/runtime/indirect_reference_table.h index 576a60477e..25b0281767 100644 --- a/runtime/indirect_reference_table.h +++ b/runtime/indirect_reference_table.h @@ -218,7 +218,7 @@ class IrtEntry { uint32_t serial_; GcRoot<mirror::Object> references_[kIRTPrevCount]; }; -static_assert(sizeof(IrtEntry) == (1 + kIRTPrevCount) * sizeof(uintptr_t), +static_assert(sizeof(IrtEntry) == (1 + kIRTPrevCount) * sizeof(uint32_t), "Unexpected sizeof(IrtEntry)"); class IrtIterator { @@ -233,9 +233,9 @@ class IrtIterator { return *this; } - mirror::Object** operator*() { + GcRoot<mirror::Object>* operator*() { // This does not have a read barrier as this is used to visit roots. - return table_[i_].GetReference()->AddressWithoutBarrier(); + return table_[i_].GetReference(); } bool equals(const IrtIterator& rhs) const { @@ -320,7 +320,7 @@ class IndirectReferenceTable { return IrtIterator(table_, Capacity(), Capacity()); } - void VisitRoots(RootCallback* callback, void* arg, const RootInfo& root_info) + void VisitRoots(RootVisitor* visitor, const RootInfo& root_info) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); uint32_t GetSegmentState() const { |