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 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 } | 1517 } |
1518 | 1518 |
1519 inline intptr_t OldGenerationCapacityAvailable() { | 1519 inline intptr_t OldGenerationCapacityAvailable() { |
1520 return max_old_generation_size_ - PromotedTotalSize(); | 1520 return max_old_generation_size_ - PromotedTotalSize(); |
1521 } | 1521 } |
1522 | 1522 |
1523 static const intptr_t kMinimumOldGenerationAllocationLimit = | 1523 static const intptr_t kMinimumOldGenerationAllocationLimit = |
1524 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); | 1524 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); |
1525 | 1525 |
1526 intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) { | 1526 intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) { |
1527 const int divisor = FLAG_stress_compaction ? 10 : 1; | 1527 intptr_t limit = FLAG_stress_compaction ? |
1528 intptr_t limit = | 1528 old_gen_size + old_gen_size / 10 : old_gen_size * 4; |
1529 Max(old_gen_size + old_gen_size / divisor, | 1529 limit = Max(limit, kMinimumOldGenerationAllocationLimit); |
1530 kMinimumOldGenerationAllocationLimit); | |
1531 limit += new_space_.Capacity(); | 1530 limit += new_space_.Capacity(); |
1532 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; | 1531 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; |
1533 return Min(limit, halfway_to_the_max); | 1532 return Min(limit, halfway_to_the_max); |
1534 } | 1533 } |
1535 | 1534 |
1536 // Indicates whether inline bump-pointer allocation has been disabled. | 1535 // Indicates whether inline bump-pointer allocation has been disabled. |
1537 bool inline_allocation_disabled() { return inline_allocation_disabled_; } | 1536 bool inline_allocation_disabled() { return inline_allocation_disabled_; } |
1538 | 1537 |
1539 // Switch whether inline bump-pointer allocation should be used. | 1538 // Switch whether inline bump-pointer allocation should be used. |
1540 void EnableInlineAllocation(); | 1539 void EnableInlineAllocation(); |
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3064 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3063 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
3065 | 3064 |
3066 private: | 3065 private: |
3067 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3066 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
3068 }; | 3067 }; |
3069 #endif // DEBUG | 3068 #endif // DEBUG |
3070 | 3069 |
3071 } } // namespace v8::internal | 3070 } } // namespace v8::internal |
3072 | 3071 |
3073 #endif // V8_HEAP_H_ | 3072 #endif // V8_HEAP_H_ |
OLD | NEW |