Add some more uninterruptible annotations

Added to mirror sites, class linker, and intern table.

Bug: 20072211
Change-Id: I2224bcefefaab05d325f14844b1514e3d719e649
diff --git a/runtime/mirror/abstract_method.h b/runtime/mirror/abstract_method.h
index 845d156..dc084be 100644
--- a/runtime/mirror/abstract_method.h
+++ b/runtime/mirror/abstract_method.h
@@ -34,7 +34,8 @@
 class MANAGED AbstractMethod : public AccessibleObject {
  public:
   // Called from Constructor::CreateFromArtMethod, Method::CreateFromArtMethod.
-  bool CreateFromArtMethod(ArtMethod* method) SHARED_REQUIRES(Locks::mutator_lock_);
+  bool CreateFromArtMethod(ArtMethod* method) SHARED_REQUIRES(Locks::mutator_lock_)
+      REQUIRES(!Roles::uninterruptible_);
 
   ArtMethod* GetArtMethod() SHARED_REQUIRES(Locks::mutator_lock_);
   // Only used by the image writer.
diff --git a/runtime/mirror/array.h b/runtime/mirror/array.h
index d21cfae..b27a884 100644
--- a/runtime/mirror/array.h
+++ b/runtime/mirror/array.h
@@ -88,7 +88,8 @@
       REQUIRES(!Roles::uninterruptible_);
 
  protected:
-  void ThrowArrayStoreException(Object* object) SHARED_REQUIRES(Locks::mutator_lock_);
+  void ThrowArrayStoreException(Object* object) SHARED_REQUIRES(Locks::mutator_lock_)
+      REQUIRES(!Roles::uninterruptible_);
 
  private:
   void ThrowArrayIndexOutOfBoundsException(int32_t index)
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index f1eb9be..c01a5e8 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -135,7 +135,7 @@
 
   // This is static because 'this' may be moved by GC.
   static void SetStatus(Handle<Class> h_this, Status new_status, Thread* self)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   static MemberOffset StatusOffset() {
     return OFFSET_OF_OBJECT_MEMBER(Class, status_);
@@ -314,7 +314,8 @@
   String* GetName() SHARED_REQUIRES(Locks::mutator_lock_);  // Returns the cached name.
   void SetName(String* name) SHARED_REQUIRES(Locks::mutator_lock_);  // Sets the cached name.
   // Computes the name, then sets the cached value.
-  static String* ComputeName(Handle<Class> h_this) SHARED_REQUIRES(Locks::mutator_lock_);
+  static String* ComputeName(Handle<Class> h_this) SHARED_REQUIRES(Locks::mutator_lock_)
+      REQUIRES(!Roles::uninterruptible_);
 
   template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags>
   bool IsProxyClass() SHARED_REQUIRES(Locks::mutator_lock_) {
@@ -682,7 +683,7 @@
   ALWAYS_INLINE IterationRange<StrideIterator<ArtMethod>> GetDirectMethods(size_t pointer_size)
       SHARED_REQUIRES(Locks::mutator_lock_);
 
-  ArtMethod* GetDirectMethodsPtr() SHARED_REQUIRES(Locks::mutator_lock_);\
+  ArtMethod* GetDirectMethodsPtr() SHARED_REQUIRES(Locks::mutator_lock_);
 
   void SetDirectMethodsPtr(ArtMethod* new_direct_methods)
       SHARED_REQUIRES(Locks::mutator_lock_);
@@ -1090,7 +1091,8 @@
       SHARED_REQUIRES(Locks::mutator_lock_);
 
   Class* CopyOf(Thread* self, int32_t new_length, ArtMethod* const (&imt)[mirror::Class::kImtSize],
-                size_t pointer_size) SHARED_REQUIRES(Locks::mutator_lock_);
+                size_t pointer_size)
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   // For proxy class only.
   ObjectArray<Class>* GetInterfaces() SHARED_REQUIRES(Locks::mutator_lock_);
diff --git a/runtime/mirror/field.h b/runtime/mirror/field.h
index b5a954f..edaddbd 100644
--- a/runtime/mirror/field.h
+++ b/runtime/mirror/field.h
@@ -95,7 +95,7 @@
   template <bool kTransactionActive = false>
   static mirror::Field* CreateFromArtField(Thread* self, ArtField* field,
                                            bool force_resolve)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
  private:
   HeapReference<mirror::Class> declaring_class_;
diff --git a/runtime/mirror/method.h b/runtime/mirror/method.h
index fe021db..0c28e4f 100644
--- a/runtime/mirror/method.h
+++ b/runtime/mirror/method.h
@@ -29,7 +29,7 @@
 class MANAGED Method : public AbstractMethod {
  public:
   static Method* CreateFromArtMethod(Thread* self, ArtMethod* method)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   static mirror::Class* StaticClass() SHARED_REQUIRES(Locks::mutator_lock_) {
     return static_class_.Read();
@@ -60,7 +60,7 @@
 class MANAGED Constructor: public AbstractMethod {
  public:
   static Constructor* CreateFromArtMethod(Thread* self, ArtMethod* method)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   static mirror::Class* StaticClass() SHARED_REQUIRES(Locks::mutator_lock_) {
     return static_class_.Read();
diff --git a/runtime/mirror/stack_trace_element.h b/runtime/mirror/stack_trace_element.h
index d58c0b6..1167391 100644
--- a/runtime/mirror/stack_trace_element.h
+++ b/runtime/mirror/stack_trace_element.h
@@ -50,7 +50,7 @@
   static StackTraceElement* Alloc(Thread* self, Handle<String> declaring_class,
                                   Handle<String> method_name, Handle<String> file_name,
                                   int32_t line_number)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   static void SetClass(Class* java_lang_StackTraceElement);
   static void ResetClass();
diff --git a/runtime/mirror/string.h b/runtime/mirror/string.h
index b4a2d1d..eb2e1f6 100644
--- a/runtime/mirror/string.h
+++ b/runtime/mirror/string.h
@@ -85,38 +85,38 @@
   ALWAYS_INLINE static String* Alloc(Thread* self, int32_t utf16_length,
                                      gc::AllocatorType allocator_type,
                                      const PreFenceVisitor& pre_fence_visitor)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   template <bool kIsInstrumented>
   ALWAYS_INLINE static String* AllocFromByteArray(Thread* self, int32_t byte_length,
                                                   Handle<ByteArray> array, int32_t offset,
                                                   int32_t high_byte,
                                                   gc::AllocatorType allocator_type)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   template <bool kIsInstrumented>
   ALWAYS_INLINE static String* AllocFromCharArray(Thread* self, int32_t count,
                                                   Handle<CharArray> array, int32_t offset,
                                                   gc::AllocatorType allocator_type)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   template <bool kIsInstrumented>
   ALWAYS_INLINE static String* AllocFromString(Thread* self, int32_t string_length,
                                                Handle<String> string, int32_t offset,
                                                gc::AllocatorType allocator_type)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   static String* AllocFromStrings(Thread* self, Handle<String> string, Handle<String> string2)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   static String* AllocFromUtf16(Thread* self, int32_t utf16_length, const uint16_t* utf16_data_in)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   static String* AllocFromModifiedUtf8(Thread* self, const char* utf)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   static String* AllocFromModifiedUtf8(Thread* self, int32_t utf16_length, const char* utf8_data_in)
-      SHARED_REQUIRES(Locks::mutator_lock_);
+      SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
 
   // TODO: This is only used in the interpreter to compare against
   // entries from a dex files constant pool (ArtField names). Should
@@ -146,7 +146,8 @@
 
   int32_t CompareTo(String* other) SHARED_REQUIRES(Locks::mutator_lock_);
 
-  CharArray* ToCharArray(Thread* self) SHARED_REQUIRES(Locks::mutator_lock_);
+  CharArray* ToCharArray(Thread* self) SHARED_REQUIRES(Locks::mutator_lock_)
+      REQUIRES(!Roles::uninterruptible_);
 
   void GetChars(int32_t start, int32_t end, Handle<CharArray> array, int32_t index)
       SHARED_REQUIRES(Locks::mutator_lock_);