diff options
author | 2022-02-08 12:01:07 +0000 | |
---|---|---|
committer | 2022-02-17 09:56:13 +0000 | |
commit | 5f958f61f405609646109a37449858e9836f7f36 (patch) | |
tree | de989f3f6e4a6a726c31004c28c14f944d8fabd2 /runtime/jni/java_vm_ext.h | |
parent | ac8751516930ed941ada8c5f552dabd0eb62808c (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/jni/java_vm_ext.h')
-rw-r--r-- | runtime/jni/java_vm_ext.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/jni/java_vm_ext.h b/runtime/jni/java_vm_ext.h index 50e84142d6..8fa716e0ae 100644 --- a/runtime/jni/java_vm_ext.h +++ b/runtime/jni/java_vm_ext.h @@ -27,6 +27,10 @@ namespace art { +namespace linker { +class ImageWriter; +} // namespace linker + namespace mirror { class Array; } // namespace mirror @@ -219,10 +223,7 @@ class JavaVMExt : public JavaVM { JavaVMExt(Runtime* runtime, const RuntimeArgumentMap& runtime_options, std::string* error_msg); // Return true if self can currently access weak globals. - bool MayAccessWeakGlobalsUnlocked(Thread* self) const REQUIRES_SHARED(Locks::mutator_lock_); - bool MayAccessWeakGlobals(Thread* self) const - REQUIRES_SHARED(Locks::mutator_lock_) - REQUIRES(Locks::jni_weak_globals_lock_); + bool MayAccessWeakGlobals(Thread* self) const REQUIRES_SHARED(Locks::mutator_lock_); void WaitForWeakGlobalsAccess(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) @@ -281,7 +282,7 @@ class JavaVMExt : public JavaVM { uint32_t global_ref_report_counter_ GUARDED_BY(Locks::jni_globals_lock_) = kGlobalRefReportInterval; - + friend class linker::ImageWriter; // Uses `globals_` and `weak_globals_` without read barrier. friend IndirectReferenceTable* GetIndirectReferenceTable(ScopedObjectAccess& soa, IndirectRefKind kind); |