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.cc b/src/runtime.cc
index 0d48aea..c21dcc5 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -30,6 +30,7 @@
       class_linker_(NULL),
       signal_catcher_(NULL),
       java_vm_(NULL),
+      jni_stub_array_(NULL),
       started_(false),
       vfprintf_(NULL),
       exit_(NULL),
@@ -171,7 +172,7 @@
   std::vector<std::string> parsed;
   Split(class_path, ':', parsed);
   for (size_t i = 0; i < parsed.size(); ++i) {
-    const DexFile* dex_file = DexFile::Open(parsed[i]);
+    const DexFile* dex_file = DexFile::Open(parsed[i], "");
     if (dex_file != NULL) {
       class_path_vector.push_back(dex_file);
     }
@@ -339,9 +340,8 @@
 
   // Finish attaching the main thread.
   Thread* main_thread = Thread::Current();
-  main_thread->CreatePeer("main", false);
-
   instance_->InitLibraries();
+  main_thread->CreatePeer("main", false);
   instance_->signal_catcher_ = new SignalCatcher;
 }
 
@@ -484,6 +484,7 @@
   intern_table_->VisitRoots(visitor, arg);
   java_vm_->VisitRoots(visitor, arg);
   thread_list_->VisitRoots(visitor, arg);
+  visitor(jni_stub_array_, arg);
 
   //(*visitor)(&gDvm.outOfMemoryObj, 0, ROOT_VM_INTERNAL, arg);
   //(*visitor)(&gDvm.internalErrorObj, 0, ROOT_VM_INTERNAL, arg);