summaryrefslogtreecommitdiffstats
path: root/runtime/debugger.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-04-03 11:21:55 -0700
committerMathieu Chartier <mathieuc@google.com>2015-04-06 10:44:37 -0700
commitbb87e0f1a52de656bc77cb01cb887e51a0e5198b (patch)
tree113f014c6e20fab3e936a3ac05f9f738639541f6 /runtime/debugger.cc
parente57fc0f0260fcb1d08cbb720ec95c04c0f394b91 (diff)
downloadandroid_art-bb87e0f1a52de656bc77cb01cb887e51a0e5198b.tar.gz
android_art-bb87e0f1a52de656bc77cb01cb887e51a0e5198b.tar.bz2
android_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/debugger.cc')
-rw-r--r--runtime/debugger.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index a767cf086f..3f67f9e72d 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -344,16 +344,14 @@ uint32_t Dbg::instrumentation_events_ = 0;
// Breakpoints.
static std::vector<Breakpoint> gBreakpoints GUARDED_BY(Locks::breakpoint_lock_);
-void DebugInvokeReq::VisitRoots(RootCallback* callback, void* arg, const RootInfo& root_info) {
- receiver.VisitRootIfNonNull(callback, arg, root_info); // null for static method call.
- klass.VisitRoot(callback, arg, root_info);
- method.VisitRoot(callback, arg, root_info);
+void DebugInvokeReq::VisitRoots(RootVisitor* visitor, const RootInfo& root_info) {
+ receiver.VisitRootIfNonNull(visitor, root_info); // null for static method call.
+ klass.VisitRoot(visitor, root_info);
+ method.VisitRoot(visitor, root_info);
}
-void SingleStepControl::VisitRoots(RootCallback* callback, void* arg, const RootInfo& root_info) {
- if (method_ != nullptr) {
- callback(reinterpret_cast<mirror::Object**>(&method_), arg, root_info);
- }
+void SingleStepControl::VisitRoots(RootVisitor* visitor, const RootInfo& root_info) {
+ visitor->VisitRootIfNonNull(reinterpret_cast<mirror::Object**>(&method_), root_info);
}
void SingleStepControl::AddDexPc(uint32_t dex_pc) {