Remove the rest of the unordered_ stuff.

Change-Id: Ibfef4e807c1d2ce63887b6c67d1c1e60012d46a5
diff --git a/src/common_test.h b/src/common_test.h
index a7daba1..dc6f3bf 100644
--- a/src/common_test.h
+++ b/src/common_test.h
@@ -236,7 +236,7 @@
 #elif defined(__arm__)
     instruction_set = kThumb2;
 #endif
-    runtime_->SetJniDlsymLookupStub(Compiler::CreateJniDlysmLookupStub(instruction_set));
+    runtime_->SetJniDlsymLookupStub(Compiler::CreateJniDlsymLookupStub(instruction_set));
     runtime_->SetAbstractMethodErrorStubArray(Compiler::CreateAbstractMethodErrorStub(instruction_set));
     for (int i = 0; i < Runtime::kLastTrampolineMethodType; i++) {
       Runtime::TrampolineType type = Runtime::TrampolineType(i);
diff --git a/src/compiler.cc b/src/compiler.cc
index d700adb..51a5caa 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -28,13 +28,13 @@
   ByteArray* CreateAbstractMethodErrorStub();
   CompiledInvokeStub* ArmCreateInvokeStub(bool is_static, const char* shorty);
   ByteArray* ArmCreateResolutionTrampoline(Runtime::TrampolineType type);
-  ByteArray* CreateJniDlysmLookupStub();
+  ByteArray* CreateJniDlsymLookupStub();
 }
 namespace x86 {
   ByteArray* CreateAbstractMethodErrorStub();
   CompiledInvokeStub* X86CreateInvokeStub(bool is_static, const char* shorty);
   ByteArray* X86CreateResolutionTrampoline(Runtime::TrampolineType type);
-  ByteArray* CreateJniDlysmLookupStub();
+  ByteArray* CreateJniDlsymLookupStub();
 }
 
 Compiler::Compiler(InstructionSet instruction_set,
@@ -67,13 +67,13 @@
   }
 }
 
-ByteArray* Compiler::CreateJniDlysmLookupStub(InstructionSet instruction_set) {
+ByteArray* Compiler::CreateJniDlsymLookupStub(InstructionSet instruction_set) {
   switch (instruction_set) {
     case kArm:
     case kThumb2:
-      return arm::CreateJniDlysmLookupStub();
+      return arm::CreateJniDlsymLookupStub();
     case kX86:
-      return x86::CreateJniDlysmLookupStub();
+      return x86::CreateJniDlsymLookupStub();
     default:
       LOG(FATAL) << "Unknown InstructionSet " << (int) instruction_set;
       return NULL;
diff --git a/src/compiler.h b/src/compiler.h
index 9d2b64c..89173eb 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -4,6 +4,8 @@
 #define ART_SRC_COMPILER_H_
 
 #include <map>
+#include <set>
+#include <string>
 
 #include "compiled_class.h"
 #include "compiled_method.h"
@@ -14,10 +16,6 @@
 #include "oat_file.h"
 #include "object.h"
 #include "runtime.h"
-#include "unordered_map.h"
-
-#include <set>
-#include <string>
 
 namespace art {
 
@@ -56,40 +54,16 @@
   static ByteArray* CreateResolutionStub(InstructionSet instruction_set,
                                          Runtime::TrampolineType type);
 
-  static ByteArray* CreateJniDlysmLookupStub(InstructionSet instruction_set);
+  static ByteArray* CreateJniDlsymLookupStub(InstructionSet instruction_set);
 
   // A class is uniquely located by its DexFile and the class_defs_ table index into that DexFile
   typedef std::pair<const DexFile*, uint32_t> ClassReference;
-  struct ClassReferenceHash {
-    size_t operator()(const ClassReference& id) const {
-      size_t dex = reinterpret_cast<size_t>(id.first);
-      DCHECK_NE(dex, static_cast<size_t>(0));
-      dex += 33;  // dex is an aligned pointer, get some non-zero low bits
-      size_t idx = id.second;
-      if (idx == 0) {  // special case of a method index of 0
-        return dex * 5381;
-      } else {
-        return dex * idx;
-      }
-    }
-  };
+
   CompiledClass* GetCompiledClass(ClassReference ref) const;
 
   // A method is uniquely located by its DexFile and the method_ids_ table index into that DexFile
   typedef std::pair<const DexFile*, uint32_t> MethodReference;
-  struct MethodReferenceHash {
-    size_t operator()(const MethodReference& id) const {
-      size_t dex = reinterpret_cast<size_t>(id.first);
-      DCHECK_NE(dex, static_cast<size_t>(0));
-      dex += 33;  // dex is an aligned pointer, get some non-zero low bits
-      size_t idx = id.second;
-      if (idx == 0) {  // special case of a method index of 0
-        return dex * 5381;
-      } else {
-        return dex * idx;
-      }
-    }
-  };
+
   CompiledMethod* GetCompiledMethod(MethodReference ref) const;
 
   const CompiledInvokeStub* FindInvokeStub(bool is_static, const char* shorty) const;
@@ -159,11 +133,11 @@
   InstructionSet instruction_set_;
   JniCompiler jni_compiler_;
 
-  typedef std::tr1::unordered_map<const ClassReference, CompiledClass*, ClassReferenceHash> ClassTable;
+  typedef std::map<const ClassReference, CompiledClass*> ClassTable;
   // All class references that this compiler has compiled
   ClassTable compiled_classes_;
 
-  typedef std::tr1::unordered_map<const MethodReference, CompiledMethod*, MethodReferenceHash> MethodTable;
+  typedef std::map<const MethodReference, CompiledMethod*> MethodTable;
   // All method references that this compiler has compiled
   MethodTable compiled_methods_;
 
@@ -178,6 +152,16 @@
   DISALLOW_COPY_AND_ASSIGN(Compiler);
 };
 
+inline bool operator<(const Compiler::ClassReference& lhs, const Compiler::ClassReference& rhs) {
+  if (lhs.second < rhs.second) {
+    return true;
+  } else if (lhs.second > rhs.second) {
+    return false;
+  } else {
+    return (lhs.first < rhs.first);
+  }
+}
+
 }  // namespace art
 
 #endif  // ART_SRC_COMPILER_H_
diff --git a/src/dex2oat.cc b/src/dex2oat.cc
index 24058ec..971fc09 100644
--- a/src/dex2oat.cc
+++ b/src/dex2oat.cc
@@ -228,7 +228,7 @@
 
     // if we loaded an existing image, we will reuse values from the image roots.
     if (!runtime->HasJniDlsymLookupStub()) {
-      runtime->SetJniDlsymLookupStub(Compiler::CreateJniDlysmLookupStub(instruction_set_));
+      runtime->SetJniDlsymLookupStub(Compiler::CreateJniDlsymLookupStub(instruction_set_));
     }
     if (!runtime->HasAbstractMethodErrorStubArray()) {
       runtime->SetAbstractMethodErrorStubArray(Compiler::CreateAbstractMethodErrorStub(instruction_set_));
diff --git a/src/dex_verifier.h b/src/dex_verifier.h
index 263dcae..5ef62f5 100644
--- a/src/dex_verifier.h
+++ b/src/dex_verifier.h
@@ -3,6 +3,11 @@
 #ifndef ART_SRC_DEX_VERIFY_H_
 #define ART_SRC_DEX_VERIFY_H_
 
+#include <deque>
+#include <limits>
+#include <map>
+#include <vector>
+
 #include "casts.h"
 #include "compiler.h"
 #include "dex_file.h"
@@ -10,14 +15,8 @@
 #include "macros.h"
 #include "object.h"
 #include "stl_util.h"
-#include "unordered_map.h"
 #include "UniquePtr.h"
 
-#include <deque>
-#include <limits>
-#include <map>
-#include <vector>
-
 namespace art {
 
 namespace verifier {
@@ -1191,9 +1190,7 @@
     return insn_flags_[work_insn_idx_];
   }
 
-  typedef std::tr1::unordered_map<const Compiler::MethodReference,
-                                  const std::vector<uint8_t>*,
-                                  Compiler::MethodReferenceHash> GcMapTable;
+  typedef std::map<const Compiler::MethodReference, const std::vector<uint8_t>*> GcMapTable;
   // All the GC maps that the verifier has created
   static GcMapTable gc_maps_;
   static void SetGcMap(Compiler::MethodReference ref, const std::vector<uint8_t>& gc_map);
diff --git a/src/stub_arm.cc b/src/stub_arm.cc
index b88cf6e..93e93f1 100644
--- a/src/stub_arm.cc
+++ b/src/stub_arm.cc
@@ -89,7 +89,7 @@
   return abstract_stub.get();
 }
 
-ByteArray* CreateJniDlysmLookupStub() {
+ByteArray* CreateJniDlsymLookupStub() {
   UniquePtr<ArmAssembler> assembler(static_cast<ArmAssembler*>(Assembler::Create(kArm)));
   // Build frame and save argument registers and LR.
   RegList save = (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3) | (1 << LR);
diff --git a/src/stub_x86.cc b/src/stub_x86.cc
index f5c92b9..460c1e2 100644
--- a/src/stub_x86.cc
+++ b/src/stub_x86.cc
@@ -55,7 +55,7 @@
   return abstract_stub.get();
 }
 
-ByteArray* CreateJniDlysmLookupStub() {
+ByteArray* CreateJniDlsymLookupStub() {
   UniquePtr<X86Assembler> assembler(static_cast<X86Assembler*>(Assembler::Create(kX86)));
 
   // Pad stack to ensure 16-byte alignment
diff --git a/src/unordered_map.h b/src/unordered_map.h
deleted file mode 100644
index 4f55d77..0000000
--- a/src/unordered_map.h
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2011 Google Inc. All Rights Reserved.
-
-#ifndef ART_SRC_CLASS_UNORDERED_MAP_H_
-#define ART_SRC_CLASS_UNORDERED_MAP_H_
-
-#include "stringpiece.h"
-
-#ifdef __ANDROID__
-#include <unordered_map>
-#else
-#include <tr1/unordered_map>
-#endif
-
-#endif  // ART_SRC_CLASS_UNORDERED_MAP_H_
diff --git a/src/unordered_set.h b/src/unordered_set.h
deleted file mode 100644
index 18ebaac..0000000
--- a/src/unordered_set.h
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2011 Google Inc. All Rights Reserved.
-
-#ifndef ART_SRC_CLASS_UNORDERED_SET_H_
-#define ART_SRC_CLASS_UNORDERED_SET_H_
-
-#ifdef __ANDROID__
-#include <unordered_set>
-#else
-#include <tr1/unordered_set>
-#endif
-
-#endif  // ART_SRC_CLASS_UNORDERED_SET_H_