Re-enable concurrent system weak sweeping.
Enabled by disallowing new system weaks during the pause and
re-allowing it after the system weaks have been swept. Reduces
GC pause by ~1ms.
Fixes pause regression caused by fix for
Bug: 10626133
Change-Id: If49d33e7ef19cb728ed3cef5187acfa53b9b05d8
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index f7b5f74..657735a 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1237,6 +1237,18 @@
return method.get();
}
+void Runtime::DisallowNewSystemWeaks() {
+ monitor_list_->DisallowNewMonitors();
+ intern_table_->DisallowNewInterns();
+ java_vm_->DisallowNewWeakGlobals();
+}
+
+void Runtime::AllowNewSystemWeaks() {
+ monitor_list_->AllowNewMonitors();
+ intern_table_->AllowNewInterns();
+ java_vm_->AllowNewWeakGlobals();
+}
+
void Runtime::SetCalleeSaveMethod(mirror::ArtMethod* method, CalleeSaveType type) {
DCHECK_LT(static_cast<int>(type), static_cast<int>(kLastCalleeSaveType));
callee_save_methods_[type] = method;