Move DexFiles to be allocated on the heap

Removed pointer from DexFile to RawDexfile to allow heap allocation of
DexFile. DexFile is now an ObjectArray of ObjectArrays. Removing the
pointer from DexFile to RawDexfile meant adding arguments to pass the
RawDexfile along to ClassLinker::LoadClass, LoadInterfaces, LoadField,
LoadMethod, LinkClass, LinkInterfaces, ResolveClass to avoid the need
to look a RawDexfile up from a DexFile. ClassLinker::CreateArrayClass
now takes the raw_dex_file to assist in looking up the component class
from the proper source. Moved Method::HasSame* methods to ClassLinker
since for access to the RawDexfile (and tests of HasSame from
ObjectTest to ClassLinkerTest.

	src/dex_file.cc
	src/dex_file.h
	src/class_linker.cc
	src/class_linker.h
	src/object.h

RunTime::Create/RunTime::Init/ClassLinker::Create/ClassLinker::Init
now take the boot class path. A boot class path with
Ljava/lang/Object; must be provided to initalize [Ljava/lang/Object;
during startup in order to heap allocate DexFiles.

	src/class_linker.cc
	src/class_linker.h
	src/runtime.cc
	src/runtime.h

Restored FindClass to load from a specific dex file. This is for use
by class loaders, otherwise it is assumed the caller wants to use the
boot classpath. We now distinguish and track the boot classpath as
separate from other dex files known to the class linker. Renamed
AppendToClassPath to AppendToBootClassPath and FindInClassPath to
FindInBootClassPath to clarify.

	src/class_linker.cc
	src/class_linker.h

Cleaned up AllocCharArray to generic AllocArray and added
AllocObjectArray. Added a functional ObjectArray implementation and a
ObjectTest to cover it.

	src/heap.h
	src/object.h
	src/object_test.cc

Switched more Object* downcasting to down_cast

	src/class_linker.cc

Switched order of arguments for DexFile::SetResolved to follow more
conventional collection ordering ( "(index, value)" vs "(value, index)" )

	src/dex_file.h
	src/class_linker.cc
	src/class_linker.h

Added class_linker_ and java_lang_raw_dex_file_ to RuntimeTest as
convenience to test subclasses. ClassLinkerTest now can use these to
simplify its ::Assert* methods. JniCompilerTest now uses it for
setting up its boot class path. Removed now unneeded
OpenDexFileBase64.

	src/common_test.h
	src/class_linker_test.cc
	src/jni_compiler_test.cc

Add external/gtest/include to non-test include path so FRIEND_TEST can be used.
Add src to include path to remove the need of using in in art/src files.

	build/Android.libart.host.mk
	build/Android.libart.mk
	src/assembler.cc
	src/assembler.h
	src/assembler_arm.cc
	src/assembler_arm.h
	src/assembler_x86.cc
	src/assembler_x86.h
	src/assembler_x86_test.cc
	src/base64.cc
	src/base64.h
	src/calling_convention.cc
	src/calling_convention.h
	src/calling_convention_arm.cc
	src/calling_convention_x86.cc
	src/casts.h
	src/class_linker.h
	src/class_linker_test.cc
	src/common_test.h
	src/constants.h
	src/constants_arm.h
	src/constants_x86.h
	src/dex_file.cc
	src/dex_file.h
	src/dex_file_test.cc
	src/dex_instruction.cc
	src/dex_instruction.h
	src/dex_instruction_visitor.h
	src/dex_instruction_visitor_test.cc
	src/dex_verifier.cc
	src/dex_verifier.h
	src/heap.cc
	src/heap.h
	src/jni_compiler.cc
	src/jni_compiler_test.cc
	src/jni_internal.cc
	src/jni_internal.h
	src/leb128.h
	src/managed_register.h
	src/managed_register_arm.cc
	src/managed_register_arm.h
	src/managed_register_arm_test.cc
	src/managed_register_x86.cc
	src/managed_register_x86.h
	src/managed_register_x86_test.cc
	src/mark_stack.cc
	src/mark_stack.h
	src/mark_sweep.cc
	src/mark_sweep.h
	src/memory_region.cc
	src/memory_region.h
	src/monitor.h
	src/object.cc
	src/object.h
	src/object_bitmap.cc
	src/object_bitmap.h
	src/object_test.cc
	src/offsets.cc
	src/offsets.h
	src/raw_dex_file.cc
	src/raw_dex_file.h
	src/raw_dex_file_test.cc
	src/runtime.cc
	src/runtime.h
	src/scoped_ptr.h
	src/space.cc
	src/space.h
	src/space_test.cc
	src/stringpiece.cc
	src/thread.cc
	src/thread.h
	src/thread_arm.cc
	src/thread_x86.cc
	src/utils.h

Change-Id: Ib633cea878c36921e9037b0464cb903aec318c3e
diff --git a/src/object.h b/src/object.h
index 218aed9..abbf6ca 100644
--- a/src/object.h
+++ b/src/object.h
@@ -3,15 +3,14 @@
 #ifndef ART_SRC_OBJECT_H_
 #define ART_SRC_OBJECT_H_
 
-#include "src/constants.h"
-#include "src/casts.h"
-#include "src/dex_file.h"
-#include "src/globals.h"
-#include "src/logging.h"
-#include "src/macros.h"
-#include "src/offsets.h"
-#include "src/stringpiece.h"
-#include "src/monitor.h"
+#include "constants.h"
+#include "casts.h"
+#include "globals.h"
+#include "logging.h"
+#include "macros.h"
+#include "offsets.h"
+#include "stringpiece.h"
+#include "monitor.h"
 
 namespace art {
 
@@ -433,22 +432,6 @@
   // Number of argument registers required by the prototype.
   uint32_t NumArgRegisters();
 
-  bool HasSameNameAndPrototype(const Method* that) const {
-    return HasSameName(that) && HasSamePrototype(that);
-  }
-
-  bool HasSameName(const Method* that) const {
-    return this->GetName() == that->GetName();
-  }
-
-  bool HasSamePrototype(const Method* that) const {
-    return HasSameReturnType(that) && HasSameArgumentTypes(that);
-  }
-
-  bool HasSameReturnType(const Method* that) const;
-
-  bool HasSameArgumentTypes(const Method* that) const;
-
  public:  // TODO: private
 #define METHOD_FIELD_SLOTS 1+11
   // AccessibleObject #0 flag
@@ -911,26 +894,32 @@
 
 class DataObject : public Object {
  public:
-  uint32_t fields_[1];
+  uint32_t fields_[0];
  private:
   DataObject();
 };
 
 class Array : public Object {
  public:
-  uint32_t GetLength() const{
+  uint32_t GetLength() const {
     return length_;
   }
-
   void SetLength(uint32_t length) {
     length_ = length;
   }
+  const void* GetData() const {
+    return &elements_;
+  }
+  void* GetData() {
+    return &elements_;
+  }
 
  private:
   // The number of array elements.
   uint32_t length_;
-
-  DISALLOW_IMPLICIT_CONSTRUCTORS(Array);
+  // Location of first element.
+  uint32_t elements_[0];
+  Array();
 };
 
 class CharArray : public Array {
@@ -940,19 +929,20 @@
 
 class ObjectArray : public Array {
  public:
-  Object* Get(int32_t i) {
-    return NULL;
+  Object* Get(uint32_t i) const {
+    DCHECK_LT(i, GetLength());
+    Object* const * data = reinterpret_cast<Object* const *>(GetData());
+    return data[i];
   }
-
-  const Object* Get(int32_t i) const {
-    return NULL;
+  void Set(uint32_t i, Object* object) {
+    DCHECK_LT(i, GetLength());
+    Object** data = reinterpret_cast<Object**>(GetData());
+    data[i] = object;
   }
-
  private:
-  DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectArray);
+  ObjectArray();
 };
 
-
 class String : public Object {
  public:
   CharArray* array_;