Merge "Enable mod union table" into ics-mr1-plus-art
diff --git a/src/monitor.cc b/src/monitor.cc
index 50deba6..dde67ea 100644
--- a/src/monitor.cc
+++ b/src/monitor.cc
@@ -32,6 +32,7 @@
 #include "stl_util.h"
 #include "thread.h"
 #include "thread_list.h"
+#include "well_known_classes.h"
 
 namespace art {
 
@@ -823,6 +824,24 @@
   }
 }
 
+static uint32_t LockOwnerFromThreadLock(Object* thread_lock) {
+  if (thread_lock == NULL || thread_lock->GetClass() != WellKnownClasses::ToClass(WellKnownClasses::java_lang_ThreadLock)) {
+    return ThreadList::kInvalidId;
+  }
+  Field* thread_field = DecodeField(WellKnownClasses::java_lang_ThreadLock_thread);
+  Object* managed_thread = thread_field->GetObject(thread_lock);
+  if (managed_thread == NULL) {
+    return ThreadList::kInvalidId;
+  }
+  Field* vmData_field = DecodeField(WellKnownClasses::java_lang_Thread_vmData);
+  uintptr_t vmData = static_cast<uintptr_t>(vmData_field->GetInt(managed_thread));
+  Thread* thread = reinterpret_cast<Thread*>(vmData);
+  if (thread == NULL) {
+    return ThreadList::kInvalidId;
+  }
+  return thread->GetThinLockId();
+}
+
 void Monitor::DescribeWait(std::ostream& os, const Thread* thread) {
   ThreadState state = thread->GetState();
 
@@ -834,7 +853,7 @@
     if (monitor != NULL) {
       object = monitor->obj_;
     }
-    lock_owner = Thread::LockOwnerFromThreadLock(object);
+    lock_owner = LockOwnerFromThreadLock(object);
   } else if (state == kBlocked) {
     os << "  - waiting to lock ";
     object = thread->monitor_enter_object_;
diff --git a/src/thread.cc b/src/thread.cc
index e682487..a8ba701 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -765,24 +765,6 @@
   CHECK_PTHREAD_CALL(pthread_key_delete, (Thread::pthread_key_self_), "self key");
 }
 
-uint32_t Thread::LockOwnerFromThreadLock(Object* thread_lock) {
-  if (thread_lock == NULL || thread_lock->GetClass() != WellKnownClasses::ToClass(WellKnownClasses::java_lang_ThreadLock)) {
-    return ThreadList::kInvalidId;
-  }
-  Field* thread_field = DecodeField(WellKnownClasses::java_lang_ThreadLock_thread);
-  Object* managed_thread = thread_field->GetObject(thread_lock);
-  if (managed_thread == NULL) {
-    return ThreadList::kInvalidId;
-  }
-  Field* vmData_field = DecodeField(WellKnownClasses::java_lang_Thread_vmData);
-  uintptr_t vmData = static_cast<uintptr_t>(vmData_field->GetInt(managed_thread));
-  Thread* thread = reinterpret_cast<Thread*>(vmData);
-  if (thread == NULL) {
-    return ThreadList::kInvalidId;
-  }
-  return thread->GetThinLockId();
-}
-
 Thread::Thread()
     : suspend_count_(0),
       card_table_(NULL),
diff --git a/src/thread.h b/src/thread.h
index 6904d4a..5ff0414 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -112,7 +112,6 @@
 
   static Thread* FromManagedThread(Object* thread_peer);
   static Thread* FromManagedThread(JNIEnv* env, jobject thread);
-  static uint32_t LockOwnerFromThreadLock(Object* thread_lock);
 
   // Translates 172 to pAllocArrayFromCode and so on.
   static void DumpThreadOffset(std::ostream& os, uint32_t offset, size_t size_of_pointers);