Preallocate `CodeInfoTableDeduper::dedupe_set_`.
Preallocate large buffer except for multi-image compilation
which requires multiple dedupe sets, so we let them grow as
needed without wasting too much memory. We do not expect to
use multi-image compilation on user devices.
Also remove the hash from the dedupe set entry. With the
large pre-allocated buffer, we have very few hash conflicts
and comparing the hash just slows down finding identical
entries. If we exceed the pre-allocated buffer, this shall
trade some performance for lower memory use.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 181943478
Change-Id: Ibbb98b6d3ebbc35ffa75165baad54f4df7c62ad9
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h
index 7830924..0034306 100644
--- a/compiler/driver/compiler_options.h
+++ b/compiler/driver/compiler_options.h
@@ -233,6 +233,10 @@
return image_type_ == ImageType::kAppImage;
}
+ bool IsMultiImage() const {
+ return multi_image_;
+ }
+
// Returns whether we are running ART tests.
// The compiler will use that information for checking invariants.
bool CompileArtTest() const {
@@ -408,6 +412,7 @@
CompilerType compiler_type_;
ImageType image_type_;
+ bool multi_image_;
bool compile_art_test_;
bool baseline_;
bool debuggable_;