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

Side by Side Diff: src/heap.h

Issue 236063015: Grow old generation slower on low-memory devices. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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
« src/api.cc ('K') | « src/api.cc ('k') | 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 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // The new space size has to be a power of 2.
1522 static const int kMaxNewSpaceSizeLowMemoryDevice = 2;
1523 static const int kMaxNewSpaceSizeMediumMemoryDevice = 8;
1524 static const int kMaxNewSpaceSizeHighMemoryDevice = 16;
1525 static const int kMaxNewSpaceSizeHugeMemoryDevice = 16;
1526
1527 // The old space size has to be a multiple of Page::kPageSize.
1528 static const int kMaxOldSpaceSizeLowMemoryDevice = 128;
1529 static const int kMaxOldSpaceSizeMediumMemoryDevice = 256;
1530 static const int kMaxOldSpaceSizeHighMemoryDevice = 512;
1531 static const int kMaxOldSpaceSizeHugeMemoryDevice = 700;
1532
1533 // The executable size has to be a multiple of Page::kPageSize.
1534 static const int kMaxExecutableSizeLowMemoryDevice = 128;
1535 static const int kMaxExecutableSizeMediumMemoryDevice = 256;
1536 static const int kMaxExecutableSizeHighMemoryDevice = 512;
1537 static const int kMaxExecutableSizeHugeMemoryDevice = 700;
1538
1521 intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) { 1539 intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) {
1522 intptr_t limit = FLAG_stress_compaction ? 1540 intptr_t limit = FLAG_stress_compaction
1523 old_gen_size + old_gen_size / 10 : old_gen_size * 4; 1541 ? old_gen_size + old_gen_size / 10
1542 : old_gen_size * old_space_growing_factor_;
1524 limit = Max(limit, kMinimumOldGenerationAllocationLimit); 1543 limit = Max(limit, kMinimumOldGenerationAllocationLimit);
1525 limit += new_space_.Capacity(); 1544 limit += new_space_.Capacity();
1526 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; 1545 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
1527 return Min(limit, halfway_to_the_max); 1546 return Min(limit, halfway_to_the_max);
1528 } 1547 }
1529 1548
1530 // Indicates whether inline bump-pointer allocation has been disabled. 1549 // Indicates whether inline bump-pointer allocation has been disabled.
1531 bool inline_allocation_disabled() { return inline_allocation_disabled_; } 1550 bool inline_allocation_disabled() { return inline_allocation_disabled_; }
1532 1551
1533 // Switch whether inline bump-pointer allocation should be used. 1552 // Switch whether inline bump-pointer allocation should be used.
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 Object* roots_[kRootListLength]; 1898 Object* roots_[kRootListLength];
1880 1899
1881 intptr_t code_range_size_; 1900 intptr_t code_range_size_;
1882 int reserved_semispace_size_; 1901 int reserved_semispace_size_;
1883 int max_semispace_size_; 1902 int max_semispace_size_;
1884 int initial_semispace_size_; 1903 int initial_semispace_size_;
1885 intptr_t max_old_generation_size_; 1904 intptr_t max_old_generation_size_;
1886 intptr_t max_executable_size_; 1905 intptr_t max_executable_size_;
1887 intptr_t maximum_committed_; 1906 intptr_t maximum_committed_;
1888 1907
1908 // The old space growing factor is used in the old space heap growing
1909 // strategy. The new old space size is the current old space size times
1910 // old_space_growing_factor_.
1911 int old_space_growing_factor_;
1912
1889 // For keeping track of how much data has survived 1913 // For keeping track of how much data has survived
1890 // scavenge since last new space expansion. 1914 // scavenge since last new space expansion.
1891 int survived_since_last_expansion_; 1915 int survived_since_last_expansion_;
1892 1916
1893 // For keeping track on when to flush RegExp code. 1917 // For keeping track on when to flush RegExp code.
1894 int sweep_generation_; 1918 int sweep_generation_;
1895 1919
1896 int always_allocate_scope_depth_; 1920 int always_allocate_scope_depth_;
1897 int linear_allocation_scope_depth_; 1921 int linear_allocation_scope_depth_;
1898 1922
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
3058 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3082 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3059 3083
3060 private: 3084 private:
3061 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3085 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3062 }; 3086 };
3063 #endif // DEBUG 3087 #endif // DEBUG
3064 3088
3065 } } // namespace v8::internal 3089 } } // namespace v8::internal
3066 3090
3067 #endif // V8_HEAP_H_ 3091 #endif // V8_HEAP_H_
OLDNEW
« src/api.cc ('K') | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698