From 54159c6c6fe529a55ef3d15a3c8418362d5a43fb Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 20 Jun 2018 14:30:08 +0100 Subject: Use HashSet instead of unordered_set<>. Change the default parameters for HashSet to allow passing StringPiece as a key, avoiding an unnecessary allocation. Use the HashSet instead of std::unordered_set. 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 --- compiler/driver/compiler_driver.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compiler/driver/compiler_driver.h') diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 55f3561e3a..ff70d96272 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include "android-base/strings.h" @@ -28,6 +27,7 @@ #include "arch/instruction_set.h" #include "base/array_ref.h" #include "base/bit_utils.h" +#include "base/hash_set.h" #include "base/mutex.h" #include "base/os.h" #include "base/quasi_atomic.h" @@ -99,7 +99,7 @@ class CompilerDriver { Compiler::Kind compiler_kind, InstructionSet instruction_set, const InstructionSetFeatures* instruction_set_features, - std::unordered_set* image_classes, + std::unique_ptr>&& image_classes, size_t thread_count, int swap_fd, const ProfileCompilationInfo* profile_compilation_info); @@ -144,7 +144,7 @@ class CompilerDriver { return compiler_.get(); } - const std::unordered_set* GetImageClasses() const { + const HashSet* GetImageClasses() const { return image_classes_.get(); } @@ -493,12 +493,12 @@ class CompilerDriver { // If image_ is true, specifies the classes that will be included in the image. // Note if image_classes_ is null, all classes are included in the image. - std::unique_ptr> image_classes_; + std::unique_ptr> image_classes_; // Specifies the classes that will be compiled. Note that if classes_to_compile_ is null, // all classes are eligible for compilation (duplication filters etc. will still apply). // This option may be restricted to the boot image, depending on a flag in the implementation. - std::unique_ptr> classes_to_compile_; + std::unique_ptr> classes_to_compile_; std::atomic number_of_soft_verifier_failures_; -- cgit v1.2.3-59-g8ed1b