Global lock levels.

Introduce the notion of the mutators/GC being a shared-exclusive (aka
reader-writer) lock. Introduce globally ordered locks, analysable by
annotalysis, statically at compile time. Add locking attributes to
methods.

More subtly, remove the heap_lock_ and split between various locks that
are held for smaller periods (where work doesn't get blocked). Remove
buggy Dalvik style thread transitions. Make GC use CMS in all cases when
concurrent is enabled. Fix bug where suspend counts rather than debug
suspend counts were sent to JDWP. Move the PathClassLoader to
WellKnownClasses. In debugger refactor calls to send request and
possibly suspend. Break apart different VmWait thread states. Move
identity hash code to a shared method.

Change-Id: Icdbfc3ce3fcccd14341860ac7305d8e97b51f5c6
diff --git a/src/oat_compilation_unit.h b/src/oat_compilation_unit.h
index 41c1847..97815ac 100644
--- a/src/oat_compilation_unit.h
+++ b/src/oat_compilation_unit.h
@@ -30,23 +30,19 @@
 
 class OatCompilationUnit {
  public:
-  OatCompilationUnit(ClassLoader* class_loader, ClassLinker* class_linker,
-                     const DexFile& dex_file, DexCache& dex_cache,
-                     const DexFile::CodeItem* code_item,
-                     uint32_t method_idx, uint32_t access_flags)
-      : class_loader_(class_loader), class_linker_(class_linker),
-        dex_file_(&dex_file), dex_cache_(&dex_cache), code_item_(code_item),
-        method_idx_(method_idx), access_flags_(access_flags) {
+  OatCompilationUnit(jobject class_loader, ClassLinker* class_linker, const DexFile& dex_file,
+                     const DexFile::CodeItem* code_item, uint32_t method_idx, uint32_t access_flags)
+      : class_loader_(class_loader), class_linker_(class_linker), dex_file_(&dex_file),
+        code_item_(code_item), method_idx_(method_idx), access_flags_(access_flags) {
   }
 
   OatCompilationUnit* GetCallee(uint32_t callee_method_idx,
                                 uint32_t callee_access_flags) {
-    return new OatCompilationUnit(class_loader_, class_linker_, *dex_file_,
-                                  *dex_cache_, NULL, callee_method_idx,
-                                  callee_access_flags);
+    return new OatCompilationUnit(class_loader_, class_linker_, *dex_file_, NULL,
+                                  callee_method_idx, callee_access_flags);
   }
 
-  ClassLoader* GetClassLoader() const {
+  jobject GetClassLoader() const {
     return class_loader_;
   }
 
@@ -58,10 +54,6 @@
     return dex_file_;
   }
 
-  DexCache* GetDexCache() const {
-    return dex_cache_;
-  }
-
   uint32_t GetDexMethodIndex() const {
     return method_idx_;
   }
@@ -85,15 +77,14 @@
   }
 
  public:
-  ClassLoader* class_loader_;
-  ClassLinker* class_linker_;
+  jobject class_loader_;
+  ClassLinker* const class_linker_;
 
-  const DexFile* dex_file_;
-  DexCache* dex_cache_;
+  const DexFile* const dex_file_;
 
-  const DexFile::CodeItem* code_item_;
-  uint32_t method_idx_;
-  uint32_t access_flags_;
+  const DexFile::CodeItem* const code_item_;
+  const uint32_t method_idx_;
+  const uint32_t access_flags_;
 };
 
 } // namespace art