Add oat file generation and tests to build

- Currently builds boot.oat for host and target
  and target oat files for art tests.
- Added cross compilation support via --strip-prefix option to dex2oat
- Reduced output to prevent build log spam (Compiler::verbose_)
- Added image roots for recovering important pointers on image load
- Redid JNI stub creation and made the stub array an image root
- Fixed JNI stub test by making JNI stub array executable
- Fixed JNI UnregisterNative to having it reinstall the JNI stub
- Fixed ARM JNI stub to generate PIC code (with irogers)
- Fixed JniCompiler to generate PIC code (with irogers)
- Fixed FindNativeMethod to handle recursive calls
- Finished checkFieldType to use Object::InstanceOf
- Fixed thread unsafe access to ClassLinker::{dex_files_,dex_caches_}
- Added ResolvedMethod variant for use with Method* for context
- Fixed ImageWriter to call FixupMethod
- Fixed ImageWriter to rewrite JNI stub references
- Improved error reporting on lack of ANDROID_DATA dir or art-cache dir
- Fixed Runtime::Start to InitLibraries before creating thread peer
- Implemented Space::IsCondemned to skip spaces loaded from images
- Implemented artFindInterfaceMethodInCache,
  allowing interface invocation from managed code

Change-Id: I603e97fa0ac44508ae05a2e47c1cdb4481678d7b
diff --git a/src/runtime.h b/src/runtime.h
index 5e57018..084e49c 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -20,6 +20,8 @@
 
 namespace art {
 
+template<class T> class PrimitiveArray;
+typedef PrimitiveArray<int8_t> ByteArray;
 class ClassLinker;
 class DexFile;
 class Heap;
@@ -136,6 +138,21 @@
 
   void VisitRoots(Heap::RootVisitor* visitor, void* arg) const;
 
+  bool HasJniStubArray() const {
+    return jni_stub_array_ != NULL;
+  }
+
+  ByteArray* GetJniStubArray() const {
+    CHECK(jni_stub_array_ != NULL);
+    return jni_stub_array_;
+  }
+
+  void SetJniStubArray(ByteArray* jni_stub_array) {
+    CHECK(jni_stub_array != NULL);
+    CHECK(jni_stub_array_ == NULL || jni_stub_array_ == jni_stub_array);
+    jni_stub_array_ = jni_stub_array;
+  }
+
  private:
   static void PlatformAbort(const char*, int);
 
@@ -164,6 +181,8 @@
 
   JavaVMExt* java_vm_;
 
+  ByteArray* jni_stub_array_;
+
   bool started_;
 
   // Hooks supported by JNI_CreateJavaVM