summaryrefslogtreecommitdiffstats
path: root/runtime/mirror
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-09-10 19:48:05 -0700
committerAndreas Gampe <agampe@google.com>2014-09-11 08:04:35 -0700
commit48498591b90a8ff7b24b1ce05c220e3bc42013df (patch)
tree39ca61335fafc57cbcf91c5087335f367ccbedc4 /runtime/mirror
parentb9620f305c79914f5159cf9279a7ccd173af1186 (diff)
downloadart-48498591b90a8ff7b24b1ce05c220e3bc42013df.tar.gz
art-48498591b90a8ff7b24b1ce05c220e3bc42013df.tar.bz2
art-48498591b90a8ff7b24b1ce05c220e3bc42013df.zip
ART: Correctly make methods preverified
Bug: 16828525 (cherry picked from commit df1532b9ba0cda2d00b78fbdef461f8a6cf8a737) Change-Id: I66756348b2aa50e41dacca59769b6810a91c73b0
Diffstat (limited to 'runtime/mirror')
-rw-r--r--runtime/mirror/class-inl.h9
-rw-r--r--runtime/mirror/class.h5
2 files changed, 10 insertions, 4 deletions
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h
index 726e928598..3f67468148 100644
--- a/runtime/mirror/class-inl.h
+++ b/runtime/mirror/class-inl.h
@@ -741,6 +741,15 @@ inline void Class::InitializeClassVisitor::operator()(
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
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index cf9501ad3c..cff8236f6b 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -219,10 +219,7 @@ class MANAGED Class FINAL : public Object {
template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags>
uint32_t GetAccessFlags() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- void SetAccessFlags(uint32_t new_access_flags) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- // Not called within a transaction.
- SetField32<false>(OFFSET_OF_OBJECT_MEMBER(Class, access_flags_), new_access_flags);
- }
+ void SetAccessFlags(uint32_t new_access_flags) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
// Returns true if the class is an interface.
bool IsInterface() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {