Remove unneeded mutator_lock_ requires from fixed_up_dex_file
The REQUIRES_SHARED(art::Locks::mutator_lock_) is not required for the
FixedUpDexFile functions. Remove them to allow callers to avoid a
possible suspend point.
Test: Build
Change-Id: Id8e47f45026168f04be5df795766f6cfb5a69a16
diff --git a/openjdkjvmti/fixed_up_dex_file.cc b/openjdkjvmti/fixed_up_dex_file.cc
index 6c66f12..85d69df 100644
--- a/openjdkjvmti/fixed_up_dex_file.cc
+++ b/openjdkjvmti/fixed_up_dex_file.cc
@@ -44,14 +44,13 @@
namespace openjdkjvmti {
-static void RecomputeDexChecksum(art::DexFile* dex_file)
- REQUIRES_SHARED(art::Locks::mutator_lock_) {
+static void RecomputeDexChecksum(art::DexFile* dex_file) {
reinterpret_cast<art::DexFile::Header*>(const_cast<uint8_t*>(dex_file->Begin()))->checksum_ =
dex_file->CalculateChecksum();
}
-static void DoDexUnquicken(const art::DexFile& new_dex_file, const art::DexFile& original_dex_file)
- REQUIRES_SHARED(art::Locks::mutator_lock_) {
+static void DoDexUnquicken(const art::DexFile& new_dex_file,
+ const art::DexFile& original_dex_file) {
const art::OatDexFile* oat_dex = original_dex_file.GetOatDexFile();
if (oat_dex == nullptr) {
return;
diff --git a/openjdkjvmti/fixed_up_dex_file.h b/openjdkjvmti/fixed_up_dex_file.h
index 7f05a29..594e8a7 100644
--- a/openjdkjvmti/fixed_up_dex_file.h
+++ b/openjdkjvmti/fixed_up_dex_file.h
@@ -50,8 +50,7 @@
class FixedUpDexFile {
public:
static std::unique_ptr<FixedUpDexFile> Create(const art::DexFile& original,
- const char* descriptor)
- REQUIRES_SHARED(art::Locks::mutator_lock_);
+ const char* descriptor);
const art::DexFile& GetDexFile() {
return *dex_file_;