summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.h
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2015-04-20 18:53:51 -0700
committer Andreas Gampe <agampe@google.com> 2015-04-20 19:51:44 -0700
commitb1fceadbd42b3047a9c06a8af6239c737d67344e (patch)
tree605389efc1479fa58b85481c4c291bc072ba0d78 /compiler/driver/compiler_driver.h
parent4474073ee836d463af29329c86d49354559a41c5 (diff)
ART: Change image_classes and compiled_classes to unordered set
These lists can be large, and the soon-to-follow compiled_methods will be potentially even larger. Use a hash set instead of a tree set. Change-Id: I7d25c075540f47771354c6f49928b4fd0c76eb2e
Diffstat (limited to 'compiler/driver/compiler_driver.h')
-rw-r--r--compiler/driver/compiler_driver.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h
index bd9d7c1b54..bd4ed06ed7 100644
--- a/compiler/driver/compiler_driver.h
+++ b/compiler/driver/compiler_driver.h
@@ -19,6 +19,7 @@
#include <set>
#include <string>
+#include <unordered_set>
#include <vector>
#include "arch/instruction_set.h"
@@ -101,8 +102,8 @@ class CompilerDriver {
Compiler::Kind compiler_kind,
InstructionSet instruction_set,
const InstructionSetFeatures* instruction_set_features,
- bool image, std::set<std::string>* image_classes,
- std::set<std::string>* compiled_classes,
+ bool image, std::unordered_set<std::string>* image_classes,
+ std::unordered_set<std::string>* compiled_classes,
size_t thread_count, bool dump_stats, bool dump_passes,
const std::string& dump_cfg_file_name,
CumulativeLogger* timer, int swap_fd,
@@ -154,7 +155,7 @@ class CompilerDriver {
return image_;
}
- const std::set<std::string>* GetImageClasses() const {
+ const std::unordered_set<std::string>* GetImageClasses() const {
return image_classes_.get();
}
@@ -420,7 +421,7 @@ class CompilerDriver {
// Checks if class specified by type_idx is one of the image_classes_
bool IsImageClass(const char* descriptor) const;
- // Checks if the provided class should be compiled, i.e., is in classes_to_compile_.
+ // Checks whether the provided class should be compiled, i.e., is in classes_to_compile_.
bool IsClassToCompile(const char* descriptor) const;
void RecordClassStatus(ClassReference ref, mirror::Class::Status status)
@@ -585,12 +586,12 @@ class CompilerDriver {
// If image_ is true, specifies the classes that will be included in
// the image. Note if image_classes_ is nullptr, all classes are
// included in the image.
- std::unique_ptr<std::set<std::string>> image_classes_;
+ std::unique_ptr<std::unordered_set<std::string>> image_classes_;
- // If image_ is true, specifies the classes that will be compiled in
- // the image. Note if classes_to_compile_ is nullptr, all classes are
- // included in the image.
- std::unique_ptr<std::set<std::string>> classes_to_compile_;
+ // Specifies the classes that will be compiled. Note that if classes_to_compile_ is nullptr,
+ // 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<std::unordered_set<std::string>> classes_to_compile_;
bool had_hard_verifier_failure_;