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

Side by Side Diff: src/heap.h

Issue 9196003: Fix responsiveness of high promotion mode heuristics. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment by Vyacheslav Egorov and fixed regression. Created 8 years, 11 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 static inline void CopyBlock(Address dst, Address src, int byte_size); 1374 static inline void CopyBlock(Address dst, Address src, int byte_size);
1375 1375
1376 // Optimized version of memmove for blocks with pointer size aligned sizes and 1376 // Optimized version of memmove for blocks with pointer size aligned sizes and
1377 // pointer size aligned addresses. 1377 // pointer size aligned addresses.
1378 static inline void MoveBlock(Address dst, Address src, int byte_size); 1378 static inline void MoveBlock(Address dst, Address src, int byte_size);
1379 1379
1380 // Check new space expansion criteria and expand semispaces if it was hit. 1380 // Check new space expansion criteria and expand semispaces if it was hit.
1381 void CheckNewSpaceExpansionCriteria(); 1381 void CheckNewSpaceExpansionCriteria();
1382 1382
1383 inline void IncrementYoungSurvivorsCounter(int survived) { 1383 inline void IncrementYoungSurvivorsCounter(int survived) {
1384 ASSERT(survived >= 0);
1384 young_survivors_after_last_gc_ = survived; 1385 young_survivors_after_last_gc_ = survived;
1385 survived_since_last_expansion_ += survived; 1386 survived_since_last_expansion_ += survived;
1386 } 1387 }
1387 1388
1388 inline bool NextGCIsLikelyToBeFull() { 1389 inline bool NextGCIsLikelyToBeFull() {
1389 if (FLAG_gc_global) return true; 1390 if (FLAG_gc_global) return true;
1390 1391
1391 intptr_t total_promoted = PromotedTotalSize(); 1392 intptr_t total_promoted = PromotedTotalSize();
1392 1393
1393 intptr_t adjusted_promotion_limit = 1394 intptr_t adjusted_promotion_limit =
(...skipping 29 matching lines...) Expand all
1423 int MaxObjectSizeInNewSpace() { return kMaxObjectSizeInNewSpace; } 1424 int MaxObjectSizeInNewSpace() { return kMaxObjectSizeInNewSpace; }
1424 1425
1425 void ClearJSFunctionResultCaches(); 1426 void ClearJSFunctionResultCaches();
1426 1427
1427 void ClearNormalizedMapCaches(); 1428 void ClearNormalizedMapCaches();
1428 1429
1429 GCTracer* tracer() { return tracer_; } 1430 GCTracer* tracer() { return tracer_; }
1430 1431
1431 // Returns the size of objects residing in non new spaces. 1432 // Returns the size of objects residing in non new spaces.
1432 intptr_t PromotedSpaceSize(); 1433 intptr_t PromotedSpaceSize();
1434 intptr_t PromotedSpaceSizeOfObjects();
1433 1435
1434 double total_regexp_code_generated() { return total_regexp_code_generated_; } 1436 double total_regexp_code_generated() { return total_regexp_code_generated_; }
1435 void IncreaseTotalRegexpCodeGenerated(int size) { 1437 void IncreaseTotalRegexpCodeGenerated(int size) {
1436 total_regexp_code_generated_ += size; 1438 total_regexp_code_generated_ += size;
1437 } 1439 }
1438 1440
1439 // Returns maximum GC pause. 1441 // Returns maximum GC pause.
1440 int get_max_gc_pause() { return max_gc_pause_; } 1442 int get_max_gc_pause() { return max_gc_pause_; }
1441 1443
1442 // Returns maximum size of objects alive after GC. 1444 // Returns maximum size of objects alive after GC.
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 1794
1793 // Initializes the number to string cache based on the max semispace size. 1795 // Initializes the number to string cache based on the max semispace size.
1794 MUST_USE_RESULT MaybeObject* InitializeNumberStringCache(); 1796 MUST_USE_RESULT MaybeObject* InitializeNumberStringCache();
1795 // Flush the number to string cache. 1797 // Flush the number to string cache.
1796 void FlushNumberStringCache(); 1798 void FlushNumberStringCache();
1797 1799
1798 void UpdateSurvivalRateTrend(int start_new_space_size); 1800 void UpdateSurvivalRateTrend(int start_new_space_size);
1799 1801
1800 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; 1802 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING };
1801 1803
1802 static const int kYoungSurvivalRateThreshold = 90; 1804 static const int kYoungSurvivalRateHighThreshold = 90;
1805 static const int kYoungSurvivalRateLowThreshold = 10;
1803 static const int kYoungSurvivalRateAllowedDeviation = 15; 1806 static const int kYoungSurvivalRateAllowedDeviation = 15;
1804 1807
1805 int young_survivors_after_last_gc_; 1808 int young_survivors_after_last_gc_;
1806 int high_survival_rate_period_length_; 1809 int high_survival_rate_period_length_;
1810 int low_survival_rate_period_length_;
1807 double survival_rate_; 1811 double survival_rate_;
1808 SurvivalRateTrend previous_survival_rate_trend_; 1812 SurvivalRateTrend previous_survival_rate_trend_;
1809 SurvivalRateTrend survival_rate_trend_; 1813 SurvivalRateTrend survival_rate_trend_;
1810 1814
1811 void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) { 1815 void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) {
1812 ASSERT(survival_rate_trend != FLUCTUATING); 1816 ASSERT(survival_rate_trend != FLUCTUATING);
1813 previous_survival_rate_trend_ = survival_rate_trend_; 1817 previous_survival_rate_trend_ = survival_rate_trend_;
1814 survival_rate_trend_ = survival_rate_trend; 1818 survival_rate_trend_ = survival_rate_trend;
1815 } 1819 }
1816 1820
(...skipping 12 matching lines...) Expand all
1829 bool IsStableOrIncreasingSurvivalTrend() { 1833 bool IsStableOrIncreasingSurvivalTrend() {
1830 switch (survival_rate_trend()) { 1834 switch (survival_rate_trend()) {
1831 case STABLE: 1835 case STABLE:
1832 case INCREASING: 1836 case INCREASING:
1833 return true; 1837 return true;
1834 default: 1838 default:
1835 return false; 1839 return false;
1836 } 1840 }
1837 } 1841 }
1838 1842
1843 bool IsStableOrDecreasingSurvivalTrend() {
1844 switch (survival_rate_trend()) {
1845 case STABLE:
1846 case DECREASING:
1847 return true;
1848 default:
1849 return false;
1850 }
1851 }
1852
1839 bool IsIncreasingSurvivalTrend() { 1853 bool IsIncreasingSurvivalTrend() {
1840 return survival_rate_trend() == INCREASING; 1854 return survival_rate_trend() == INCREASING;
1841 } 1855 }
1842 1856
1843 bool IsDecreasingSurvivalTrend() { 1857 bool IsHighSurvivalRate() {
1844 return survival_rate_trend() == DECREASING; 1858 return high_survival_rate_period_length_ > 0;
1845 } 1859 }
1846 1860
1847 bool IsHighSurvivalRate() { 1861 bool IsLowSurvivalRate() {
1848 return high_survival_rate_period_length_ > 0; 1862 return low_survival_rate_period_length_ > 0;
1849 } 1863 }
1850 1864
1851 void SelectScavengingVisitorsTable(); 1865 void SelectScavengingVisitorsTable();
1852 1866
1853 void StartIdleRound() { 1867 void StartIdleRound() {
1854 mark_sweeps_since_idle_round_started_ = 0; 1868 mark_sweeps_since_idle_round_started_ = 0;
1855 ms_count_at_last_idle_notification_ = ms_count_; 1869 ms_count_at_last_idle_notification_ = ms_count_;
1856 } 1870 }
1857 1871
1858 void FinishIdleRound() { 1872 void FinishIdleRound() {
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 2629
2616 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2630 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2617 }; 2631 };
2618 #endif // DEBUG || LIVE_OBJECT_LIST 2632 #endif // DEBUG || LIVE_OBJECT_LIST
2619 2633
2620 } } // namespace v8::internal 2634 } } // namespace v8::internal
2621 2635
2622 #undef HEAP 2636 #undef HEAP
2623 2637
2624 #endif // V8_HEAP_H_ 2638 #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