ART: Correctly make methods preverified
Bug: 16828525
(cherry picked from commit df1532b9ba0cda2d00b78fbdef461f8a6cf8a737)
Change-Id: I66756348b2aa50e41dacca59769b6810a91c73b0
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h
index 726e928..3f67468 100644
--- a/runtime/mirror/class-inl.h
+++ b/runtime/mirror/class-inl.h
@@ -741,6 +741,15 @@
klass->SetDexTypeIndex(DexFile::kDexNoIndex16); // Default to no valid type index.
}
+inline void Class::SetAccessFlags(uint32_t new_access_flags) {
+ // Called inside a transaction when setting pre-verified flag during boot image compilation.
+ if (Runtime::Current()->IsActiveTransaction()) {
+ SetField32<true>(OFFSET_OF_OBJECT_MEMBER(Class, access_flags_), new_access_flags);
+ } else {
+ SetField32<false>(OFFSET_OF_OBJECT_MEMBER(Class, access_flags_), new_access_flags);
+ }
+}
+
} // namespace mirror
} // namespace art