| 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 16 pages, the maximum heap size is about | 448 // If a chunk has at least 16 pages, the maximum heap size is about |
| 449 // 8K * 8K * 16 = 1G bytes. | 449 // 8K * 8K * 16 = 1G bytes. |
| 450 #ifdef V8_TARGET_ARCH_X64 |
| 451 static const int kPagesPerChunk = 32; |
| 452 #else |
| 450 static const int kPagesPerChunk = 16; | 453 static const int kPagesPerChunk = 16; |
| 454 #endif |
| 451 static const int kChunkSize = kPagesPerChunk * Page::kPageSize; | 455 static const int kChunkSize = kPagesPerChunk * Page::kPageSize; |
| 452 | 456 |
| 453 private: | 457 private: |
| 454 // Maximum space size in bytes. | 458 // Maximum space size in bytes. |
| 455 static int capacity_; | 459 static int capacity_; |
| 456 | 460 |
| 457 // Allocated space size in bytes. | 461 // Allocated space size in bytes. |
| 458 static int size_; | 462 static int size_; |
| 459 | 463 |
| 460 // The initial chunk of virtual memory. | 464 // The initial chunk of virtual memory. |
| (...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1859 | 1863 |
| 1860 private: | 1864 private: |
| 1861 LargeObjectChunk* current_; | 1865 LargeObjectChunk* current_; |
| 1862 HeapObjectCallback size_func_; | 1866 HeapObjectCallback size_func_; |
| 1863 }; | 1867 }; |
| 1864 | 1868 |
| 1865 | 1869 |
| 1866 } } // namespace v8::internal | 1870 } } // namespace v8::internal |
| 1867 | 1871 |
| 1868 #endif // V8_SPACES_H_ | 1872 #endif // V8_SPACES_H_ |
| OLD | NEW |