OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 return old_generation_allocation_limit_ - PromotedTotalSize(); | 1511 return old_generation_allocation_limit_ - PromotedTotalSize(); |
1512 } | 1512 } |
1513 | 1513 |
1514 inline intptr_t OldGenerationCapacityAvailable() { | 1514 inline intptr_t OldGenerationCapacityAvailable() { |
1515 return max_old_generation_size_ - PromotedTotalSize(); | 1515 return max_old_generation_size_ - PromotedTotalSize(); |
1516 } | 1516 } |
1517 | 1517 |
1518 static const intptr_t kMinimumOldGenerationAllocationLimit = | 1518 static const intptr_t kMinimumOldGenerationAllocationLimit = |
1519 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); | 1519 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); |
1520 | 1520 |
| 1521 static const int kLumpOfMemory = (i::kPointerSize / 4) * i::MB; |
| 1522 |
| 1523 // The new space size has to be a power of 2. |
| 1524 static const int kMaxNewSpaceSizeLowMemoryDevice = 2 * kLumpOfMemory; |
| 1525 static const int kMaxNewSpaceSizeMediumMemoryDevice = 8 * kLumpOfMemory; |
| 1526 static const int kMaxNewSpaceSizeHighMemoryDevice = 16 * kLumpOfMemory; |
| 1527 static const int kMaxNewSpaceSizeHugeMemoryDevice = 16 * kLumpOfMemory; |
| 1528 |
| 1529 // The old space size has to be a multiple of Page::kPageSize. |
| 1530 static const int kMaxOldSpaceSizeLowMemoryDevice = 128 * kLumpOfMemory; |
| 1531 static const int kMaxOldSpaceSizeMediumMemoryDevice = 256 * kLumpOfMemory; |
| 1532 static const int kMaxOldSpaceSizeHighMemoryDevice = 512 * kLumpOfMemory; |
| 1533 static const int kMaxOldSpaceSizeHugeMemoryDevice = 700 * kLumpOfMemory; |
| 1534 |
| 1535 // The executable size has to be a multiple of Page::kPageSize. |
| 1536 static const int kMaxExecutableSizeLowMemoryDevice = 128 * kLumpOfMemory; |
| 1537 static const int kMaxExecutableSizeMediumMemoryDevice = 256 * kLumpOfMemory; |
| 1538 static const int kMaxExecutableSizeHighMemoryDevice = 512 * kLumpOfMemory; |
| 1539 static const int kMaxExecutableSizeHugeMemoryDevice = 700 * kLumpOfMemory; |
| 1540 |
1521 intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) { | 1541 intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) { |
1522 intptr_t limit = FLAG_stress_compaction ? | 1542 intptr_t limit = FLAG_stress_compaction |
1523 old_gen_size + old_gen_size / 10 : old_gen_size * 4; | 1543 ? old_gen_size + old_gen_size / 10 |
| 1544 : old_gen_size * old_space_growing_factor_; |
1524 limit = Max(limit, kMinimumOldGenerationAllocationLimit); | 1545 limit = Max(limit, kMinimumOldGenerationAllocationLimit); |
1525 limit += new_space_.Capacity(); | 1546 limit += new_space_.Capacity(); |
1526 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; | 1547 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; |
1527 return Min(limit, halfway_to_the_max); | 1548 return Min(limit, halfway_to_the_max); |
1528 } | 1549 } |
1529 | 1550 |
1530 // Indicates whether inline bump-pointer allocation has been disabled. | 1551 // Indicates whether inline bump-pointer allocation has been disabled. |
1531 bool inline_allocation_disabled() { return inline_allocation_disabled_; } | 1552 bool inline_allocation_disabled() { return inline_allocation_disabled_; } |
1532 | 1553 |
1533 // Switch whether inline bump-pointer allocation should be used. | 1554 // Switch whether inline bump-pointer allocation should be used. |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1879 Object* roots_[kRootListLength]; | 1900 Object* roots_[kRootListLength]; |
1880 | 1901 |
1881 intptr_t code_range_size_; | 1902 intptr_t code_range_size_; |
1882 int reserved_semispace_size_; | 1903 int reserved_semispace_size_; |
1883 int max_semispace_size_; | 1904 int max_semispace_size_; |
1884 int initial_semispace_size_; | 1905 int initial_semispace_size_; |
1885 intptr_t max_old_generation_size_; | 1906 intptr_t max_old_generation_size_; |
1886 intptr_t max_executable_size_; | 1907 intptr_t max_executable_size_; |
1887 intptr_t maximum_committed_; | 1908 intptr_t maximum_committed_; |
1888 | 1909 |
| 1910 // The old space growing factor is used in the old space heap growing |
| 1911 // strategy. The new old space size is the current old space size times |
| 1912 // old_space_growing_factor_. |
| 1913 int old_space_growing_factor_; |
| 1914 |
1889 // For keeping track of how much data has survived | 1915 // For keeping track of how much data has survived |
1890 // scavenge since last new space expansion. | 1916 // scavenge since last new space expansion. |
1891 int survived_since_last_expansion_; | 1917 int survived_since_last_expansion_; |
1892 | 1918 |
1893 // For keeping track on when to flush RegExp code. | 1919 // For keeping track on when to flush RegExp code. |
1894 int sweep_generation_; | 1920 int sweep_generation_; |
1895 | 1921 |
1896 int always_allocate_scope_depth_; | 1922 int always_allocate_scope_depth_; |
1897 int linear_allocation_scope_depth_; | 1923 int linear_allocation_scope_depth_; |
1898 | 1924 |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3058 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3084 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
3059 | 3085 |
3060 private: | 3086 private: |
3061 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3087 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
3062 }; | 3088 }; |
3063 #endif // DEBUG | 3089 #endif // DEBUG |
3064 | 3090 |
3065 } } // namespace v8::internal | 3091 } } // namespace v8::internal |
3066 | 3092 |
3067 #endif // V8_HEAP_H_ | 3093 #endif // V8_HEAP_H_ |
OLD | NEW |