diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-09-12 17:33:56 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2013-09-13 10:30:24 -0700 |
commit | 423d2a3dcbb260b020efb5da59f784c9f02accbf (patch) | |
tree | 79ed739e6072f8308c1cd880f9420a1c63539c95 /runtime/runtime.cc | |
parent | b048dd2b662c19644361f4396a1e8d6213445ee8 (diff) | |
download | art-423d2a3dcbb260b020efb5da59f784c9f02accbf.zip art-423d2a3dcbb260b020efb5da59f784c9f02accbf.tar.gz art-423d2a3dcbb260b020efb5da59f784c9f02accbf.tar.bz2 |
Add support for changing roots through the root visitor callback.
Needed for copying collectors.
Change-Id: Icc4a342a57e0cfb79587edb02ef8c85e08808877
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 09cbd0b..477fcaf 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1142,12 +1142,17 @@ void Runtime::VisitConcurrentRoots(RootVisitor* visitor, void* arg, bool only_di void Runtime::VisitNonThreadRoots(RootVisitor* visitor, void* arg) { java_vm_->VisitRoots(visitor, arg); - if (pre_allocated_OutOfMemoryError_ != NULL) { - visitor(pre_allocated_OutOfMemoryError_, arg); + if (pre_allocated_OutOfMemoryError_ != nullptr) { + pre_allocated_OutOfMemoryError_ = reinterpret_cast<mirror::Throwable*>( + visitor(pre_allocated_OutOfMemoryError_, arg)); + DCHECK(pre_allocated_OutOfMemoryError_ != nullptr); } - visitor(resolution_method_, arg); + resolution_method_ = reinterpret_cast<mirror::ArtMethod*>(visitor(resolution_method_, arg)); + DCHECK(resolution_method_ != nullptr); for (int i = 0; i < Runtime::kLastCalleeSaveType; i++) { - visitor(callee_save_methods_[i], arg); + callee_save_methods_[i] = reinterpret_cast<mirror::ArtMethod*>( + visitor(callee_save_methods_[i], arg)); + DCHECK(callee_save_methods_[i] != nullptr); } } |