Remove old code to support multiple images
Change-Id: I29bc2f216361ac4ed0cc0fefb7e3c46ee64e0ae8
diff --git a/src/heap.cc b/src/heap.cc
index 4daf4b5..d13eae5 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -80,7 +80,7 @@
}
void Heap::Init(size_t initial_size, size_t growth_limit, size_t capacity,
- const std::vector<std::string>& image_file_names) {
+ const std::string& image_file_name) {
if (VLOG_IS_ON(heap) || VLOG_IS_ON(startup)) {
LOG(INFO) << "Heap::Init entering";
}
@@ -92,13 +92,11 @@
// Requested begin for the alloc space, to follow the mapped image and oat files
byte* requested_begin = NULL;
- std::vector<Space*> image_spaces;
- for (size_t i = 0; i < image_file_names.size(); i++) {
- ImageSpace* space = Space::CreateImageSpace(image_file_names[i]);
+ if (image_file_name != NULL) {
+ ImageSpace* space = Space::CreateImageSpace(image_file_name);
if (space == NULL) {
- LOG(FATAL) << "Failed to create space from " << image_file_names[i];
+ LOG(FATAL) << "Failed to create space from " << image_file_name;
}
- image_spaces.push_back(space);
AddSpace(space);
UpdateFirstAndLastSpace(&first_space, &last_space, space);
// Oat files referenced by image files immediately follow them in memory, ensure alloc space
diff --git a/src/heap.h b/src/heap.h
index 58d7924..2fd381c 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -51,7 +51,7 @@
// image_file_names names specify Spaces to load based on
// ImageWriter output.
static void Init(size_t starting_size, size_t growth_limit, size_t capacity,
- const std::vector<std::string>& image_file_names);
+ const std::string& image_file_name);
static void Destroy();
diff --git a/src/runtime.cc b/src/runtime.cc
index 338a06c..cfc4c59 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -310,7 +310,7 @@
const StringPiece& value = options[i].first;
parsed->class_path_ = value.data();
} else if (option.starts_with("-Ximage:")) {
- parsed->images_.push_back(option.substr(strlen("-Ximage:")).data());
+ parsed->image_ = option.substr(strlen("-Ximage:")).data();
} else if (option.starts_with("-Xcheck:jni")) {
parsed->check_jni_ = true;
} else if (option.starts_with("-Xrunjdwp:") || option.starts_with("-agentlib:jdwp=")) {
@@ -431,10 +431,9 @@
}
}
- if (!parsed->is_compiler_ && parsed->images_.empty()) {
- std::string boot_art(GetAndroidRoot());
- boot_art += "/framework/boot.art";
- parsed->images_.push_back(boot_art);
+ if (!parsed->is_compiler_ && parsed->image_.empty()) {
+ parsed->image_ += GetAndroidRoot();
+ parsed->image_ += "/framework/boot.art";
}
if (parsed->heap_growth_limit_ == 0) {
parsed->heap_growth_limit_ = parsed->heap_maximum_size_;
@@ -604,7 +603,7 @@
Heap::Init(options->heap_initial_size_,
options->heap_growth_limit_,
options->heap_maximum_size_,
- options->images_);
+ options->image_);
BlockSignals();
diff --git a/src/runtime.h b/src/runtime.h
index 8a86c3c..e34a577 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -63,7 +63,7 @@
std::string boot_class_path_;
std::string class_path_;
std::string host_prefix_;
- std::vector<std::string> images_;
+ std::string image_;
bool check_jni_;
std::string jni_trace_;
bool is_compiler_;
diff --git a/src/runtime_test.cc b/src/runtime_test.cc
index 42e7950..460fe44 100644
--- a/src/runtime_test.cc
+++ b/src/runtime_test.cc
@@ -42,8 +42,6 @@
options.push_back(std::make_pair("-cp", null));
options.push_back(std::make_pair(lib_core.c_str(), null));
options.push_back(std::make_pair("-Ximage:boot_image", null));
- options.push_back(std::make_pair("-Ximage:image_1", null));
- options.push_back(std::make_pair("-Ximage:image_2", null));
options.push_back(std::make_pair("-Xcheck:jni", null));
options.push_back(std::make_pair("-Xms2048", null));
options.push_back(std::make_pair("-Xmx4k", null));
@@ -60,10 +58,7 @@
EXPECT_EQ(lib_core, parsed->boot_class_path_);
EXPECT_EQ(lib_core, parsed->class_path_);
- EXPECT_EQ(3U, parsed->images_.size());
- EXPECT_EQ(std::string("boot_image"), parsed->images_[0]);
- EXPECT_EQ(std::string("image_1"), parsed->images_[1]);
- EXPECT_EQ(std::string("image_2"), parsed->images_[2]);
+ EXPECT_EQ(std::string("boot_image"), parsed->image_);
EXPECT_EQ(true, parsed->check_jni_);
EXPECT_EQ(2048U, parsed->heap_initial_size_);
EXPECT_EQ(4 * KB, parsed->heap_maximum_size_);