diff options
author | 2012-02-04 23:06:55 -0800 | |
---|---|---|
committer | 2012-02-04 23:24:56 -0800 | |
commit | 223f20fa939c386c695977263780dea2195093db (patch) | |
tree | 642d1abe5dfbf2239bf239e8e91bebd333384378 | |
parent | a56fcd60596ae8694da21fccde5c56832e437c56 (diff) |
Remove old code to support multiple images
Change-Id: I29bc2f216361ac4ed0cc0fefb7e3c46ee64e0ae8
-rw-r--r-- | src/heap.cc | 10 | ||||
-rw-r--r-- | src/heap.h | 2 | ||||
-rw-r--r-- | src/runtime.cc | 11 | ||||
-rw-r--r-- | src/runtime.h | 2 | ||||
-rw-r--r-- | src/runtime_test.cc | 7 | ||||
-rwxr-xr-x | tools/art | 16 |
6 files changed, 20 insertions, 28 deletions
diff --git a/src/heap.cc b/src/heap.cc index 4daf4b5005..d13eae5df7 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -80,7 +80,7 @@ static void UpdateFirstAndLastSpace(Space** first_space, Space** last_space, Spa } 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 @@ void Heap::Init(size_t initial_size, size_t growth_limit, size_t capacity, // 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 58d79245c6..2fd381c5b2 100644 --- a/src/heap.h +++ b/src/heap.h @@ -51,7 +51,7 @@ class Heap { // 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 338a06c8b8..cfc4c59d46 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -310,7 +310,7 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b 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 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b } } - 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 @@ bool Runtime::Init(const Options& raw_options, bool ignore_unrecognized) { 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 8a86c3c1bb..e34a5775d4 100644 --- a/src/runtime.h +++ b/src/runtime.h @@ -63,7 +63,7 @@ class Runtime { 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 42e795071d..460fe44be1 100644 --- a/src/runtime_test.cc +++ b/src/runtime_test.cc @@ -42,8 +42,6 @@ TEST_F(RuntimeTest, ParsedOptions) { 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 @@ TEST_F(RuntimeTest, ParsedOptions) { 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_); @@ -35,13 +35,13 @@ done mkdir -p /tmp/android-data/art-cache ANDROID_DATA=/tmp/android-data \ -ANDROID_ROOT=$ANDROID_BUILD_TOP/out/host/linux-x86 \ -LD_LIBRARY_PATH=$ANDROID_BUILD_TOP/out/host/linux-x86/lib \ -$invoke_with $ANDROID_BUILD_TOP/out/host/linux-x86/bin/$oatexec \ +ANDROID_ROOT=$ANDROID_HOST_OUT \ +LD_LIBRARY_PATH=$ANDROID_HOST_OUT/lib \ +$invoke_with $ANDROID_HOST_OUT/bin/$oatexec \ -Xbootclasspath\ -:$ANDROID_BUILD_TOP/out/host/linux-x86/framework/core-hostdex.jar\ -:$ANDROID_BUILD_TOP/out/host/linux-x86/framework/core-junit-hostdex.jar\ -:$ANDROID_BUILD_TOP/out/host/linux-x86/framework/core-tests-hostdex.jar\ -:$ANDROID_BUILD_TOP/out/host/linux-x86/framework/bouncycastle-hostdex.jar\ -:$ANDROID_BUILD_TOP/out/host/linux-x86/framework/apache-xml-hostdex.jar \ +:$ANDROID_HOST_OUT/framework/core-hostdex.jar\ +:$ANDROID_HOST_OUT/framework/core-junit-hostdex.jar\ +:$ANDROID_HOST_OUT/framework/core-tests-hostdex.jar\ +:$ANDROID_HOST_OUT/framework/bouncycastle-hostdex.jar\ +:$ANDROID_HOST_OUT/framework/apache-xml-hostdex.jar \ $* |