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

Side by Side Diff: src/heap.h

Issue 149393005: Make eager allocation site pretenuring decisions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | src/heap.cc » ('j') | 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 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 } 1505 }
1506 1506
1507 inline intptr_t OldGenerationCapacityAvailable() { 1507 inline intptr_t OldGenerationCapacityAvailable() {
1508 return max_old_generation_size_ - PromotedTotalSize(); 1508 return max_old_generation_size_ - PromotedTotalSize();
1509 } 1509 }
1510 1510
1511 static const intptr_t kMinimumOldGenerationAllocationLimit = 1511 static const intptr_t kMinimumOldGenerationAllocationLimit =
1512 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); 1512 8 * (Page::kPageSize > MB ? Page::kPageSize : MB);
1513 1513
1514 intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) { 1514 intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) {
1515 const int divisor = FLAG_stress_compaction ? 10 : 1515 const int divisor = FLAG_stress_compaction ? 10 : 1;
1516 new_space_high_promotion_mode_active_ ? 1 : 3;
1517 intptr_t limit = 1516 intptr_t limit =
1518 Max(old_gen_size + old_gen_size / divisor, 1517 Max(old_gen_size + old_gen_size / divisor,
1519 kMinimumOldGenerationAllocationLimit); 1518 kMinimumOldGenerationAllocationLimit);
1520 limit += new_space_.Capacity(); 1519 limit += new_space_.Capacity();
1521 // TODO(hpayer): Can be removed when when pretenuring is supported for all
1522 // allocation sites.
1523 if (IsHighSurvivalRate() && IsStableOrIncreasingSurvivalTrend()) {
1524 limit *= 2;
1525 }
1526 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; 1520 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
1527 return Min(limit, halfway_to_the_max); 1521 return Min(limit, halfway_to_the_max);
1528 } 1522 }
1529 1523
1530 // Indicates whether inline bump-pointer allocation has been disabled. 1524 // Indicates whether inline bump-pointer allocation has been disabled.
1531 bool inline_allocation_disabled() { return inline_allocation_disabled_; } 1525 bool inline_allocation_disabled() { return inline_allocation_disabled_; }
1532 1526
1533 // Switch whether inline bump-pointer allocation should be used. 1527 // Switch whether inline bump-pointer allocation should be used.
1534 void EnableInlineAllocation(); 1528 void EnableInlineAllocation();
1535 void DisableInlineAllocation(); 1529 void DisableInlineAllocation();
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after
3038 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3032 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3039 3033
3040 private: 3034 private:
3041 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3035 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3042 }; 3036 };
3043 #endif // DEBUG 3037 #endif // DEBUG
3044 3038
3045 } } // namespace v8::internal 3039 } } // namespace v8::internal
3046 3040
3047 #endif // V8_HEAP_H_ 3041 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698