From bb87e0f1a52de656bc77cb01cb887e51a0e5198b Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 3 Apr 2015 11:21:55 -0700 Subject: 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 --- runtime/stack.h | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'runtime/stack.h') diff --git a/runtime/stack.h b/runtime/stack.h index aab54ba628..fbb0aa4c0f 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -59,19 +59,7 @@ std::ostream& operator<<(std::ostream& os, const VRegKind& rhs); // A reference from the shadow stack to a MirrorType object within the Java heap. template -class MANAGED StackReference : public mirror::ObjectReference { - public: - StackReference() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) - : mirror::ObjectReference(nullptr) {} - - static StackReference FromMirrorPtr(MirrorType* p) - SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - return StackReference(p); - } - - private: - StackReference(MirrorType* p) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) - : mirror::ObjectReference(p) {} +class MANAGED StackReference : public mirror::CompressedReference { }; // ShadowFrame has 2 possible layouts: -- cgit v1.2.3-59-g8ed1b