OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 430 |
431 #ifdef DEBUG | 431 #ifdef DEBUG |
432 // Reports statistic info of the space. | 432 // Reports statistic info of the space. |
433 static void ReportStatistics(); | 433 static void ReportStatistics(); |
434 #endif | 434 #endif |
435 | 435 |
436 // Due to encoding limitation, we can only have 8K chunks. | 436 // Due to encoding limitation, we can only have 8K chunks. |
437 static const int kMaxNofChunks = 1 << Page::kPageSizeBits; | 437 static const int kMaxNofChunks = 1 << Page::kPageSizeBits; |
438 // If a chunk has at least 32 pages, the maximum heap size is about | 438 // If a chunk has at least 32 pages, the maximum heap size is about |
439 // 8 * 1024 * 32 * 8K = 2G bytes. | 439 // 8 * 1024 * 32 * 8K = 2G bytes. |
| 440 #if defined(ANDROID) |
| 441 static const int kPagesPerChunk = 16; |
| 442 #else |
440 static const int kPagesPerChunk = 64; | 443 static const int kPagesPerChunk = 64; |
| 444 #endif |
441 static const int kChunkSize = kPagesPerChunk * Page::kPageSize; | 445 static const int kChunkSize = kPagesPerChunk * Page::kPageSize; |
442 | 446 |
443 private: | 447 private: |
444 // Maximum space size in bytes. | 448 // Maximum space size in bytes. |
445 static int capacity_; | 449 static int capacity_; |
446 | 450 |
447 // Allocated space size in bytes. | 451 // Allocated space size in bytes. |
448 static int size_; | 452 static int size_; |
449 | 453 |
450 // The initial chunk of virtual memory. | 454 // The initial chunk of virtual memory. |
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 | 1799 |
1796 private: | 1800 private: |
1797 LargeObjectChunk* current_; | 1801 LargeObjectChunk* current_; |
1798 HeapObjectCallback size_func_; | 1802 HeapObjectCallback size_func_; |
1799 }; | 1803 }; |
1800 | 1804 |
1801 | 1805 |
1802 } } // namespace v8::internal | 1806 } } // namespace v8::internal |
1803 | 1807 |
1804 #endif // V8_SPACES_H_ | 1808 #endif // V8_SPACES_H_ |
OLD | NEW |