Use HashSet<std::string> instead of unordered_set<>.

Change the default parameters for HashSet<std::string> to
allow passing StringPiece as a key, avoiding an unnecessary
allocation. Use the HashSet<std::string> instead of
std::unordered_set<std::string>. Rename HashSet<> functions
that mirror std::unordered_multiset<> to lower-case.

Fix CompilerDriver::LoadImageClasses() to avoid using
invalidated iterator.

Test: m test-art-host-gtest
Test: testrunner.py --host
Change-Id: I7f8b82ee0b07befc5a0ee1c420b08a2068ad931e
diff --git a/dex2oat/linker/image_test.h b/dex2oat/linker/image_test.h
index f0daf69..12ecd3a 100644
--- a/dex2oat/linker/image_test.h
+++ b/dex2oat/linker/image_test.h
@@ -27,6 +27,7 @@
 
 #include "art_method-inl.h"
 #include "base/file_utils.h"
+#include "base/hash_set.h"
 #include "base/unix_file/fd_file.h"
 #include "base/utils.h"
 #include "class_linker-inl.h"
@@ -93,8 +94,8 @@
     options->push_back(std::make_pair("compilercallbacks", callbacks_.get()));
   }
 
-  std::unordered_set<std::string>* GetImageClasses() OVERRIDE {
-    return new std::unordered_set<std::string>(image_classes_);
+  std::unique_ptr<HashSet<std::string>> GetImageClasses() OVERRIDE {
+    return std::make_unique<HashSet<std::string>>(image_classes_);
   }
 
   ArtMethod* FindCopiedMethod(ArtMethod* origin, ObjPtr<mirror::Class> klass)
@@ -110,7 +111,7 @@
   }
 
  private:
-  std::unordered_set<std::string> image_classes_;
+  HashSet<std::string> image_classes_;
 };
 
 inline CompilationHelper::~CompilationHelper() {
@@ -426,7 +427,7 @@
   }
 
   ASSERT_TRUE(compiler_driver_->GetImageClasses() != nullptr);
-  std::unordered_set<std::string> image_classes(*compiler_driver_->GetImageClasses());
+  HashSet<std::string> image_classes(*compiler_driver_->GetImageClasses());
 
   // Need to delete the compiler since it has worker threads which are attached to runtime.
   compiler_driver_.reset();
@@ -496,7 +497,7 @@
       ObjPtr<mirror::Class> klass = class_linker_->FindSystemClass(soa.Self(), descriptor);
       EXPECT_TRUE(klass != nullptr) << descriptor;
       uint8_t* raw_klass = reinterpret_cast<uint8_t*>(klass.Ptr());
-      if (image_classes.find(descriptor) == image_classes.end()) {
+      if (image_classes.find(StringPiece(descriptor)) == image_classes.end()) {
         EXPECT_TRUE(raw_klass >= image_end || raw_klass < image_begin) << descriptor;
       } else {
         // Image classes should be located inside the image.