ART: Use core image to speed up some gtests.
Host timing of
art_compiler_tests --no_isolate --gtest_filter='<pattern>'
for different patterns:
"ms total" before after
LoadStoreEliminationTest* 16945 4750
LoadStoreAnalysisTest* 2647 689
ReferenceTypePropagationTest* 13542 3929
InstructionSimplifierTest* 1452 406
Host timing of
art_runtime_tests --no_isolate --gtest_filter='<pattern>'
for different patterns:
"ms total" before after
RegType*Test* 2976 1675
DexCacheTest* 265 74
JavaVmExtTest* 785 230
Host timing of
art_libartbase_tests --no_isolate --gtest_filter='<pattern>'
for different patterns:
"ms total" before after
FlagsTests* 691 214
Host timing of
art_dex2oat_tests --no_isolate --gtest_filter='<pattern>'
for different patterns:
"ms total" before after
VerifierDepsTest* 3567 874
Test: m test-art-host-gtest
Change-Id: I20df90e3d38aaa286e22ba070c7845bcb09e3bca
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index 4eb3408..3f643e8 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -71,7 +71,11 @@
static bool unstarted_initialized_ = false;
CommonRuntimeTestImpl::CommonRuntimeTestImpl()
- : class_linker_(nullptr), java_lang_dex_file_(nullptr) {
+ : class_linker_(nullptr),
+ java_lang_dex_file_(nullptr),
+ boot_class_path_(),
+ callbacks_(),
+ use_boot_image_(false) {
}
CommonRuntimeTestImpl::~CommonRuntimeTestImpl() {
@@ -94,6 +98,9 @@
options.push_back(std::make_pair(boot_class_path_string, nullptr));
options.push_back(std::make_pair(boot_class_path_locations_string, nullptr));
+ if (use_boot_image_) {
+ options.emplace_back("-Ximage:" + GetImageLocation(), nullptr);
+ }
options.push_back(std::make_pair("-Xcheck:jni", nullptr));
options.push_back(std::make_pair(min_heap_string, nullptr));
options.push_back(std::make_pair(max_heap_string, nullptr));
@@ -107,7 +114,7 @@
SetUpRuntimeOptions(&options);
- // Install compiler-callbacks if SetupRuntimeOptions hasn't deleted them.
+ // Install compiler-callbacks if SetUpRuntimeOptions hasn't deleted them.
if (callbacks_.get() != nullptr) {
options.push_back(std::make_pair("compilercallbacks", callbacks_.get()));
}