summaryrefslogtreecommitdiffstats
path: root/dex2oat
diff options
context:
space:
mode:
authorRichard Uhler <ruhler@google.com>2015-01-02 13:28:22 -0800
committerRichard Uhler <ruhler@google.com>2015-01-08 10:50:38 -0800
commitc275259449ec57987e52d3ab1eda3272b994488f (patch)
treeca3a6d182d768f8ef046a33576572a2e46370cc1 /dex2oat
parent4270e74152d8a7cd979ab5a92fe2a8f84adb8a42 (diff)
downloadart-c275259449ec57987e52d3ab1eda3272b994488f.tar.gz
art-c275259449ec57987e52d3ab1eda3272b994488f.tar.bz2
art-c275259449ec57987e52d3ab1eda3272b994488f.zip
Remove back-door bootclasspath option from Runtime
The 'bootclasspath' option allowed users of the Runtime to load their own boot class path DexFiles and pass them directly to the Runtime as an option. This obscures the fact that the Runtime must take ownership of the boot class path DexFiles. This change removes the use of the bootclasspath option by dex2oat and the common runtime tests. For dex2oat, we use the existing -Xbootclasspath option instead, and introduce a new -Xbootclasspath-locations option to override the dex locations for the loaded boot class path dex files. For the common runtime tests, we simply use -Xbootclasspath. Bug: 18809837 Change-Id: Idfcd4885390bf0f3dc350993756dd337220def73
Diffstat (limited to 'dex2oat')
-rw-r--r--dex2oat/dex2oat.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 63009bf25e..4f279f23d4 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -1014,17 +1014,16 @@ class Dex2Oat FINAL {
bool Setup() {
TimingLogger::ScopedTiming t("dex2oat Setup", timings_);
RuntimeOptions runtime_options;
- std::vector<const DexFile*> boot_class_path;
art::MemMap::Init(); // For ZipEntry::ExtractToMemMap.
if (boot_image_option_.empty()) {
- size_t failure_count = OpenDexFiles(dex_filenames_, dex_locations_, boot_class_path);
- if (failure_count > 0) {
- LOG(ERROR) << "Failed to open some dex files: " << failure_count;
- return false;
- }
- runtime_options.push_back(std::make_pair("bootclasspath", &boot_class_path));
+ std::string boot_class_path = "-Xbootclasspath:";
+ boot_class_path += Join(dex_filenames_, ':');
+ runtime_options.push_back(std::make_pair(boot_class_path, nullptr));
+ std::string boot_class_path_locations = "-Xbootclasspath-locations:";
+ boot_class_path_locations += Join(dex_locations_, ':');
+ runtime_options.push_back(std::make_pair(boot_class_path_locations, nullptr));
} else {
- runtime_options.push_back(std::make_pair(boot_image_option_.c_str(), nullptr));
+ runtime_options.push_back(std::make_pair(boot_image_option_, nullptr));
}
for (size_t i = 0; i < runtime_args_.size(); i++) {
runtime_options.push_back(std::make_pair(runtime_args_[i], nullptr));