summaryrefslogtreecommitdiff
path: root/runtime/mirror/executable.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mirror/executable.h')
-rw-r--r--runtime/mirror/executable.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/runtime/mirror/executable.h b/runtime/mirror/executable.h
index bf66d7952a..14c9d4c96f 100644
--- a/runtime/mirror/executable.h
+++ b/runtime/mirror/executable.h
@@ -18,7 +18,7 @@
#define ART_RUNTIME_MIRROR_EXECUTABLE_H_
#include "accessible_object.h"
-#include "object.h"
+#include "object-inl.h"
#include "read_barrier_option.h"
namespace art {
@@ -36,10 +36,19 @@ class MANAGED Executable : public AccessibleObject {
bool CreateFromArtMethod(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_)
REQUIRES(!Roles::uninterruptible_);
- ArtMethod* GetArtMethod() REQUIRES_SHARED(Locks::mutator_lock_);
- // Only used by the image writer.
- template <bool kTransactionActive = false>
- void SetArtMethod(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_);
+ template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags>
+ ArtMethod* GetArtMethod() REQUIRES_SHARED(Locks::mutator_lock_) {
+ return reinterpret_cast64<ArtMethod*>(GetField64<kVerifyFlags>(ArtMethodOffset()));
+ }
+
+ template <bool kTransactionActive = false,
+ bool kCheckTransaction = true,
+ VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags>
+ void SetArtMethod(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_) {
+ SetField64<kTransactionActive, kCheckTransaction, kVerifyFlags>(
+ ArtMethodOffset(), reinterpret_cast64<uint64_t>(method));
+ }
+
mirror::Class* GetDeclaringClass() REQUIRES_SHARED(Locks::mutator_lock_);
static MemberOffset ArtMethodOffset() {