diff options
| author | Feng Qian <fqian@google.com> | 2009-07-14 15:28:52 -0700 |
|---|---|---|
| committer | Feng Qian <fqian@google.com> | 2009-07-14 15:28:52 -0700 |
| commit | 55517b6f53f6574247e04252ddadfd7a14bd0a26 (patch) | |
| tree | ea4da22309622a69afcebfe3634686b70566964d /V8Binding/v8 | |
| parent | 9e9d52b3ff812319f5ba62138ea3aa9dd4e57892 (diff) | |
| download | external_webkit-55517b6f53f6574247e04252ddadfd7a14bd0a26.zip external_webkit-55517b6f53f6574247e04252ddadfd7a14bd0a26.tar.gz external_webkit-55517b6f53f6574247e04252ddadfd7a14bd0a26.tar.bz2 | |
Make some adjustment on heap parameters on Android platform.
1. reduced pages per chunk to 16, so a chunk is 128K, instead of 512K
2. free all clean chunks when shrink spaces.
3. renamed some macros to if defined(ANDROID).
All changes are being upstreamed to V8.
Diffstat (limited to 'V8Binding/v8')
| -rw-r--r-- | V8Binding/v8/src/compilation-cache.cc | 2 | ||||
| -rw-r--r-- | V8Binding/v8/src/heap.cc | 4 | ||||
| -rw-r--r-- | V8Binding/v8/src/spaces.cc | 5 | ||||
| -rw-r--r-- | V8Binding/v8/src/spaces.h | 4 |
4 files changed, 11 insertions, 4 deletions
diff --git a/V8Binding/v8/src/compilation-cache.cc b/V8Binding/v8/src/compilation-cache.cc index 4066bc7..64af075 100644 --- a/V8Binding/v8/src/compilation-cache.cc +++ b/V8Binding/v8/src/compilation-cache.cc @@ -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; diff --git a/V8Binding/v8/src/heap.cc b/V8Binding/v8/src/heap.cc index adfac3f..907c571 100644 --- a/V8Binding/v8/src/heap.cc +++ b/V8Binding/v8/src/heap.cc @@ -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 diff --git a/V8Binding/v8/src/spaces.cc b/V8Binding/v8/src/spaces.cc index 2393281..4177856 100644 --- a/V8Binding/v8/src/spaces.cc +++ b/V8Binding/v8/src/spaces.cc @@ -726,10 +726,14 @@ void PagedSpace::Shrink() { // Loop over the pages to the end of the space. while (current_page->is_valid()) { // Advance last_page_to_keep every other step to end up at the midpoint. +#if defined(ANDROID) + // Free all free chunks. +#else 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(); } @@ -747,7 +751,6 @@ void PagedSpace::Shrink() { last_page_ = p; p = p->next_page(); } - // The difference between free_pages and pages_to_keep is the number of // pages actually freed. ASSERT(pages_to_keep <= free_pages); diff --git a/V8Binding/v8/src/spaces.h b/V8Binding/v8/src/spaces.h index 3352d30..94f7a91 100644 --- a/V8Binding/v8/src/spaces.h +++ b/V8Binding/v8/src/spaces.h @@ -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: |
