OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 static inline void MoveBlock(Address dst, Address src, int byte_size); | 998 static inline void MoveBlock(Address dst, Address src, int byte_size); |
999 | 999 |
1000 static inline void MoveBlockToOldSpaceAndUpdateRegionMarks(Address dst, | 1000 static inline void MoveBlockToOldSpaceAndUpdateRegionMarks(Address dst, |
1001 Address src, | 1001 Address src, |
1002 int byte_size); | 1002 int byte_size); |
1003 | 1003 |
1004 // Check new space expansion criteria and expand semispaces if it was hit. | 1004 // Check new space expansion criteria and expand semispaces if it was hit. |
1005 static void CheckNewSpaceExpansionCriteria(); | 1005 static void CheckNewSpaceExpansionCriteria(); |
1006 | 1006 |
1007 static inline void IncrementYoungSurvivorsCounter(int survived) { | 1007 static inline void IncrementYoungSurvivorsCounter(int survived) { |
| 1008 young_survivors_after_last_gc_ = survived; |
1008 survived_since_last_expansion_ += survived; | 1009 survived_since_last_expansion_ += survived; |
1009 } | 1010 } |
1010 | 1011 |
1011 static void UpdateNewSpaceReferencesInExternalStringTable( | 1012 static void UpdateNewSpaceReferencesInExternalStringTable( |
1012 ExternalStringTableUpdaterCallback updater_func); | 1013 ExternalStringTableUpdaterCallback updater_func); |
1013 | 1014 |
1014 // Helper function that governs the promotion policy from new space to | 1015 // Helper function that governs the promotion policy from new space to |
1015 // old. If the object's old address lies below the new space's age | 1016 // old. If the object's old address lies below the new space's age |
1016 // mark or if we've already filled the bottom 1/16th of the to space, | 1017 // mark or if we've already filled the bottom 1/16th of the to space, |
1017 // we try to promote this object. | 1018 // we try to promote this object. |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 | 1266 |
1266 // Initializes the number to string cache based on the max semispace size. | 1267 // Initializes the number to string cache based on the max semispace size. |
1267 static Object* InitializeNumberStringCache(); | 1268 static Object* InitializeNumberStringCache(); |
1268 // Flush the number to string cache. | 1269 // Flush the number to string cache. |
1269 static void FlushNumberStringCache(); | 1270 static void FlushNumberStringCache(); |
1270 | 1271 |
1271 // Flush code from functions we do not expect to use again. The code will | 1272 // Flush code from functions we do not expect to use again. The code will |
1272 // be replaced with a lazy compilable version. | 1273 // be replaced with a lazy compilable version. |
1273 static void FlushCode(); | 1274 static void FlushCode(); |
1274 | 1275 |
| 1276 static void UpdateSurvivalRateTrend(int start_new_space_size); |
| 1277 |
| 1278 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; |
| 1279 |
| 1280 static const int kYoungSurvivalRateThreshold = 90; |
| 1281 static const int kYoungSurvivalRateAllowedDeviation = 15; |
| 1282 |
| 1283 static int young_survivors_after_last_gc_; |
| 1284 static int high_survival_rate_period_length_; |
| 1285 static int survival_rate_; |
| 1286 static SurvivalRateTrend previous_survival_rate_trend_; |
| 1287 static SurvivalRateTrend survival_rate_trend_; |
| 1288 static bool bumped_old_gen_limits_; |
| 1289 |
| 1290 static void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) { |
| 1291 ASSERT(survival_rate_trend != FLUCTUATING); |
| 1292 previous_survival_rate_trend_ = survival_rate_trend_; |
| 1293 survival_rate_trend_ = survival_rate_trend; |
| 1294 } |
| 1295 |
| 1296 static SurvivalRateTrend survival_rate_trend() { |
| 1297 if (survival_rate_trend_ == STABLE) { |
| 1298 return STABLE; |
| 1299 } else if (previous_survival_rate_trend_ == STABLE) { |
| 1300 return survival_rate_trend_; |
| 1301 } else if (survival_rate_trend_ != previous_survival_rate_trend_) { |
| 1302 return FLUCTUATING; |
| 1303 } else { |
| 1304 return survival_rate_trend_; |
| 1305 } |
| 1306 } |
| 1307 |
| 1308 static bool IsStableOrIncreasingSurvivalTrend() { |
| 1309 switch (survival_rate_trend()) { |
| 1310 case STABLE: |
| 1311 case INCREASING: |
| 1312 return true; |
| 1313 default: |
| 1314 return false; |
| 1315 } |
| 1316 } |
| 1317 |
| 1318 static bool IsIncreasingSurvivalTrend() { |
| 1319 return survival_rate_trend() == INCREASING; |
| 1320 } |
| 1321 |
| 1322 static bool IsHighSurvivalRate() { |
| 1323 return high_survival_rate_period_length_ > 0; |
| 1324 } |
| 1325 |
1275 static const int kInitialSymbolTableSize = 2048; | 1326 static const int kInitialSymbolTableSize = 2048; |
1276 static const int kInitialEvalCacheSize = 64; | 1327 static const int kInitialEvalCacheSize = 64; |
1277 | 1328 |
1278 friend class Factory; | 1329 friend class Factory; |
1279 friend class DisallowAllocationFailure; | 1330 friend class DisallowAllocationFailure; |
1280 friend class AlwaysAllocateScope; | 1331 friend class AlwaysAllocateScope; |
1281 friend class LinearAllocationScope; | 1332 friend class LinearAllocationScope; |
1282 }; | 1333 }; |
1283 | 1334 |
1284 | 1335 |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1934 | 1985 |
1935 // To speed up scavenge collections new space string are kept | 1986 // To speed up scavenge collections new space string are kept |
1936 // separate from old space strings. | 1987 // separate from old space strings. |
1937 static List<Object*> new_space_strings_; | 1988 static List<Object*> new_space_strings_; |
1938 static List<Object*> old_space_strings_; | 1989 static List<Object*> old_space_strings_; |
1939 }; | 1990 }; |
1940 | 1991 |
1941 } } // namespace v8::internal | 1992 } } // namespace v8::internal |
1942 | 1993 |
1943 #endif // V8_HEAP_H_ | 1994 #endif // V8_HEAP_H_ |
OLD | NEW |