diff options
Diffstat (limited to 'runtime/art_method.h')
-rw-r--r-- | runtime/art_method.h | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/runtime/art_method.h b/runtime/art_method.h index bf1b4631c6..a23969aa73 100644 --- a/runtime/art_method.h +++ b/runtime/art_method.h @@ -359,11 +359,15 @@ class EXPORT ArtMethod final { } void SetMemorySharedMethod() REQUIRES_SHARED(Locks::mutator_lock_) { - uint32_t access_flags = GetAccessFlags(); - if (!IsIntrinsic(access_flags) && !IsAbstract(access_flags)) { - AddAccessFlags(kAccMemorySharedMethod); - SetHotCounter(); - } + DCHECK(!IsIntrinsic()); + DCHECK(!IsAbstract()); + AddAccessFlags(kAccMemorySharedMethod); + } + + static uint32_t SetMemorySharedMethod(uint32_t access_flags) { + DCHECK(!IsIntrinsic(access_flags)); + DCHECK(!IsAbstract(access_flags)); + return access_flags | kAccMemorySharedMethod; } void ClearMemorySharedMethod() REQUIRES_SHARED(Locks::mutator_lock_) { @@ -597,6 +601,15 @@ class EXPORT ArtMethod final { ClearAccessFlags(kAccNterpInvokeFastPathFlag); } + static uint32_t ClearNterpFastPathFlags(uint32_t access_flags) { + // `kAccNterpEntryPointFastPathFlag` has a different use for native methods. + if (!IsNative(access_flags)) { + access_flags &= ~kAccNterpEntryPointFastPathFlag; + } + access_flags &= ~kAccNterpInvokeFastPathFlag; + return access_flags; + } + // Returns whether the method is a string constructor. The method must not // be a class initializer. (Class initializers are called from a different // context where we do not need to check for string constructors.) @@ -810,6 +823,15 @@ class EXPORT ArtMethod final { return (GetAccessFlags() & kAccSingleImplementation) != 0; } + static uint32_t SetHasSingleImplementation(uint32_t access_flags, bool single_impl) { + DCHECK(!IsIntrinsic(access_flags)) << "conflict with intrinsic bits"; + if (single_impl) { + return access_flags | kAccSingleImplementation; + } else { + return access_flags & ~kAccSingleImplementation; + } + } + // Takes a method and returns a 'canonical' one if the method is default (and therefore // potentially copied from some other class). For example, this ensures that the debugger does not // get confused as to which method we are in. |