Revert "Reduce core image to core-{oj,libart,simple}."
This reverts commit ec91d48cade73c54f7a03c5d53d863bc2490976e.
Reason for revert: Breaks libcore tests.
Change-Id: I0ea55f74635332177eadd9a69fb831e7f5dc16c7
diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc
index 92dd932..97a5f24 100644
--- a/dex2oat/dex2oat_test.cc
+++ b/dex2oat/dex2oat_test.cc
@@ -192,12 +192,24 @@
}
int Dex2Oat(const std::vector<std::string>& dex2oat_args, std::string* error_msg) {
- std::vector<std::string> argv;
- if (!CommonRuntimeTest::StartDex2OatCommandLine(&argv, error_msg)) {
+ Runtime* runtime = Runtime::Current();
+
+ const std::vector<gc::space::ImageSpace*>& image_spaces =
+ runtime->GetHeap()->GetBootImageSpaces();
+ if (image_spaces.empty()) {
+ *error_msg = "No image location found for Dex2Oat.";
return false;
}
+ std::string image_location = image_spaces[0]->GetImageLocation();
- Runtime* runtime = Runtime::Current();
+ std::vector<std::string> argv;
+ argv.push_back(runtime->GetCompilerExecutable());
+
+ if (runtime->IsJavaDebuggable()) {
+ argv.push_back("--debuggable");
+ }
+ runtime->AddCurrentRuntimeFeaturesAsDex2OatArguments(&argv);
+
if (!runtime->IsVerificationEnabled()) {
argv.push_back("--compiler-filter=assume-verified");
}
@@ -214,6 +226,11 @@
argv.push_back("--host");
}
+ argv.push_back("--boot-image=" + image_location);
+
+ std::vector<std::string> compiler_options = runtime->GetCompilerOptions();
+ argv.insert(argv.end(), compiler_options.begin(), compiler_options.end());
+
argv.insert(argv.end(), dex2oat_args.begin(), dex2oat_args.end());
// We must set --android-root.