Reviewers: Mads Ager,

Description:
Adjust kPagesPerChunk to 16 instead of 64 on Android.

Renamed some macros to ANDROID.


Please review this at http://codereview.chromium.org/155538

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/compilation-cache.cc
   M     src/heap.cc
   M     src/spaces.h
   M     src/spaces.cc


Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 2459)
+++ src/heap.cc (working copy)
@@ -69,7 +69,7 @@

  // 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 @@
    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

Index: src/spaces.h
===================================================================
--- src/spaces.h        (revision 2459)
+++ src/spaces.h        (working copy)
@@ -437,7 +437,11 @@
    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:
Index: src/spaces.cc
===================================================================
--- src/spaces.cc       (revision 2459)
+++ src/spaces.cc       (working copy)
@@ -725,11 +725,15 @@
    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();
    }
Index: src/compilation-cache.cc
===================================================================
--- src/compilation-cache.cc    (revision 2459)
+++ src/compilation-cache.cc    (working copy)
@@ -37,7 +37,7 @@
  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;



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to