Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: src/heap.h

Issue 15104004: Increase old generation space significantly if we observe a high promotion rate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 static const intptr_t kMinimumPromotionLimit = 5 * Page::kPageSize; 1578 static const intptr_t kMinimumPromotionLimit = 5 * Page::kPageSize;
1579 static const intptr_t kMinimumAllocationLimit = 1579 static const intptr_t kMinimumAllocationLimit =
1580 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); 1580 8 * (Page::kPageSize > MB ? Page::kPageSize : MB);
1581 1581
1582 intptr_t OldGenPromotionLimit(intptr_t old_gen_size) { 1582 intptr_t OldGenPromotionLimit(intptr_t old_gen_size) {
1583 const int divisor = FLAG_stress_compaction ? 10 : 1583 const int divisor = FLAG_stress_compaction ? 10 :
1584 new_space_high_promotion_mode_active_ ? 1 : 3; 1584 new_space_high_promotion_mode_active_ ? 1 : 3;
1585 intptr_t limit = 1585 intptr_t limit =
1586 Max(old_gen_size + old_gen_size / divisor, kMinimumPromotionLimit); 1586 Max(old_gen_size + old_gen_size / divisor, kMinimumPromotionLimit);
1587 limit += new_space_.Capacity(); 1587 limit += new_space_.Capacity();
1588 // TODO(hpayer): Can be removed when when pretenuring is supported for all
1589 // allocation sites.
1590 if (IsHighSurvivalRate() && IsStableOrIncreasingSurvivalTrend()) {
1591 limit *= 2;
1592 }
1588 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; 1593 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
1589 return Min(limit, halfway_to_the_max); 1594 return Min(limit, halfway_to_the_max);
1590 } 1595 }
1591 1596
1592 intptr_t OldGenAllocationLimit(intptr_t old_gen_size) { 1597 intptr_t OldGenAllocationLimit(intptr_t old_gen_size) {
1593 const int divisor = FLAG_stress_compaction ? 8 : 1598 const int divisor = FLAG_stress_compaction ? 8 :
1594 new_space_high_promotion_mode_active_ ? 1 : 2; 1599 new_space_high_promotion_mode_active_ ? 1 : 2;
1595 intptr_t limit = 1600 intptr_t limit =
1596 Max(old_gen_size + old_gen_size / divisor, kMinimumAllocationLimit); 1601 Max(old_gen_size + old_gen_size / divisor, kMinimumAllocationLimit);
1597 limit += new_space_.Capacity(); 1602 limit += new_space_.Capacity();
1603 // TODO(hpayer): Can be removed when when pretenuring is supported for all
1604 // allocation sites.
1605 if (IsHighSurvivalRate() && IsStableOrIncreasingSurvivalTrend()) {
1606 limit *= 2;
1607 }
1598 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; 1608 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
1599 return Min(limit, halfway_to_the_max); 1609 return Min(limit, halfway_to_the_max);
1600 } 1610 }
1601 1611
1602 // Implements the corresponding V8 API function. 1612 // Implements the corresponding V8 API function.
1603 bool IdleNotification(int hint); 1613 bool IdleNotification(int hint);
1604 1614
1605 // Declare all the root indices. 1615 // Declare all the root indices.
1606 enum RootListIndex { 1616 enum RootListIndex {
1607 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, 1617 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex,
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
3097 AssertNoAllocation no_alloc; // i.e. no gc allowed. 3107 AssertNoAllocation no_alloc; // i.e. no gc allowed.
3098 3108
3099 private: 3109 private:
3100 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3110 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3101 }; 3111 };
3102 #endif // DEBUG 3112 #endif // DEBUG
3103 3113
3104 } } // namespace v8::internal 3114 } } // namespace v8::internal
3105 3115
3106 #endif // V8_HEAP_H_ 3116 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698