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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
438 static inline void UnprotectChunkFromPage(Page* page); | 438 static inline void UnprotectChunkFromPage(Page* page); |
439 #endif | 439 #endif |
440 | 440 |
441 #ifdef DEBUG | 441 #ifdef DEBUG |
442 // Reports statistic info of the space. | 442 // Reports statistic info of the space. |
443 static void ReportStatistics(); | 443 static void ReportStatistics(); |
444 #endif | 444 #endif |
445 | 445 |
446 // Due to encoding limitation, we can only have 8K chunks. | 446 // Due to encoding limitation, we can only have 8K chunks. |
447 static const int kMaxNofChunks = 1 << Page::kPageSizeBits; | 447 static const int kMaxNofChunks = 1 << Page::kPageSizeBits; |
448 // If a chunk has at least 32 pages, the maximum heap size is about | 448 // If a chunk has at least 16 pages, the maximum heap size is about |
449 // 8 * 1024 * 32 * 8K = 2G bytes. | 449 // 8 * 1024 * 16 * 8K = 1G bytes. |
Kasper Lund
2009/09/09 10:52:55
Why not 8K * 8K * 16?
| |
450 #if defined(ANDROID) | |
451 static const int kPagesPerChunk = 16; | 450 static const int kPagesPerChunk = 16; |
452 #else | |
453 static const int kPagesPerChunk = 64; | |
454 #endif | |
455 static const int kChunkSize = kPagesPerChunk * Page::kPageSize; | 451 static const int kChunkSize = kPagesPerChunk * Page::kPageSize; |
456 | 452 |
457 private: | 453 private: |
458 // Maximum space size in bytes. | 454 // Maximum space size in bytes. |
459 static int capacity_; | 455 static int capacity_; |
460 | 456 |
461 // Allocated space size in bytes. | 457 // Allocated space size in bytes. |
462 static int size_; | 458 static int size_; |
463 | 459 |
464 // The initial chunk of virtual memory. | 460 // The initial chunk of virtual memory. |
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1863 | 1859 |
1864 private: | 1860 private: |
1865 LargeObjectChunk* current_; | 1861 LargeObjectChunk* current_; |
1866 HeapObjectCallback size_func_; | 1862 HeapObjectCallback size_func_; |
1867 }; | 1863 }; |
1868 | 1864 |
1869 | 1865 |
1870 } } // namespace v8::internal | 1866 } } // namespace v8::internal |
1871 | 1867 |
1872 #endif // V8_SPACES_H_ | 1868 #endif // V8_SPACES_H_ |
OLD | NEW |