Commit 9b58a0c8 authored by feng@chromium.org's avatar feng@chromium.org

Adjust kPagesPerChunk to 16 instead of 64 on Android.

Renamed some macros to ANDROID.

Review URL: http://codereview.chromium.org/155538

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2460 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cc6be014
......@@ -37,7 +37,7 @@ namespace internal {
static const int kSubCacheCount = 4;
// The number of generations for each sub cache.
#if V8_TARGET_ARCH_ARM
#if defined(ANDROID)
static const int kScriptGenerations = 1;
static const int kEvalGlobalGenerations = 1;
static const int kEvalContextualGenerations = 1;
......
......@@ -69,7 +69,7 @@ int Heap::amount_of_external_allocated_memory_at_last_global_gc_ = 0;
// semispace_size_ should be a power of 2 and old_generation_size_ should be
// a multiple of Page::kPageSize.
#if V8_TARGET_ARCH_ARM
#if defined(ANDROID)
int Heap::semispace_size_ = 512*KB;
int Heap::old_generation_size_ = 128*MB;
int Heap::initial_semispace_size_ = 128*KB;
......@@ -223,7 +223,7 @@ void Heap::PrintShortHeapStatistics() {
PrintF("Map space, used: %8d, available: %8d\n",
map_space_->Size(), map_space_->Available());
PrintF("Large object space, used: %8d, avaialble: %8d\n",
map_space_->Size(), map_space_->Available());
lo_space_->Size(), lo_space_->Available());
}
#endif
......
......@@ -725,11 +725,15 @@ void PagedSpace::Shrink() {
Page* current_page = top_page->next_page();
// Loop over the pages to the end of the space.
while (current_page->is_valid()) {
#if defined(ANDROID)
// Free all chunks if possible
#else
// Advance last_page_to_keep every other step to end up at the midpoint.
if ((free_pages & 0x1) == 1) {
pages_to_keep++;
last_page_to_keep = last_page_to_keep->next_page();
}
#endif
free_pages++;
current_page = current_page->next_page();
}
......
......@@ -437,7 +437,11 @@ class MemoryAllocator : public AllStatic {
static const int kMaxNofChunks = 1 << Page::kPageSizeBits;
// If a chunk has at least 32 pages, the maximum heap size is about
// 8 * 1024 * 32 * 8K = 2G bytes.
#if defined(ANDROID)
static const int kPagesPerChunk = 16;
#else
static const int kPagesPerChunk = 64;
#endif
static const int kChunkSize = kPagesPerChunk * Page::kPageSize;
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment