Clean up GC callbacks to be virtual methods
Change-Id: Ia08034a4e5931c4fcb329c3bd3c4b1f301135735
diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc
index 36adbea..36e3aa3 100644
--- a/runtime/java_vm_ext.cc
+++ b/runtime/java_vm_ext.cc
@@ -766,7 +766,7 @@
return native_method;
}
-void JavaVMExt::SweepJniWeakGlobals(IsMarkedCallback* callback, void* arg) {
+void JavaVMExt::SweepJniWeakGlobals(IsMarkedVisitor* visitor) {
MutexLock mu(Thread::Current(), weak_globals_lock_);
Runtime* const runtime = Runtime::Current();
for (auto* entry : weak_globals_) {
@@ -774,7 +774,7 @@
if (!entry->IsNull()) {
// Since this is called by the GC, we don't need a read barrier.
mirror::Object* obj = entry->Read<kWithoutReadBarrier>();
- mirror::Object* new_obj = callback(obj, arg);
+ mirror::Object* new_obj = visitor->IsMarked(obj);
if (new_obj == nullptr) {
new_obj = runtime->GetClearedJniWeakGlobal();
}