summaryrefslogtreecommitdiff
path: root/runtime/class_table-inl.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2022-02-08 12:01:07 +0000
committer Treehugger Robot <treehugger-gerrit@google.com> 2022-02-17 09:56:13 +0000
commit5f958f61f405609646109a37449858e9836f7f36 (patch)
treede989f3f6e4a6a726c31004c28c14f944d8fabd2 /runtime/class_table-inl.h
parentac8751516930ed941ada8c5f552dabd0eb62808c (diff)
Avoid unnecessary read barriers in `ImageWriter`.
Also avoid visiting native roots during the same stages, namely layout and writing (including copy-and-fixup). Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I0d62d67556109dbcbd8a04fd0e8408733dacce33
Diffstat (limited to 'runtime/class_table-inl.h')
-rw-r--r--runtime/class_table-inl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/class_table-inl.h b/runtime/class_table-inl.h
index 8e44ee3620..088ad3dbd8 100644
--- a/runtime/class_table-inl.h
+++ b/runtime/class_table-inl.h
@@ -102,7 +102,7 @@ void ClassTable::VisitRoots(const Visitor& visitor) {
}
}
-template <typename Visitor, ReadBarrierOption kReadBarrierOption>
+template <ReadBarrierOption kReadBarrierOption, typename Visitor>
bool ClassTable::Visit(Visitor& visitor) {
ReaderMutexLock mu(Thread::Current(), lock_);
for (ClassSet& class_set : classes_) {
@@ -115,7 +115,7 @@ bool ClassTable::Visit(Visitor& visitor) {
return true;
}
-template <typename Visitor, ReadBarrierOption kReadBarrierOption>
+template <ReadBarrierOption kReadBarrierOption, typename Visitor>
bool ClassTable::Visit(const Visitor& visitor) {
ReaderMutexLock mu(Thread::Current(), lock_);
for (ClassSet& class_set : classes_) {