| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
| 6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1365 | 1365 |
| 1366 // This should be used only for testing. | 1366 // This should be used only for testing. |
| 1367 void set_old_generation_allocation_counter(size_t new_value) { | 1367 void set_old_generation_allocation_counter(size_t new_value) { |
| 1368 old_generation_allocation_counter_ = new_value; | 1368 old_generation_allocation_counter_ = new_value; |
| 1369 } | 1369 } |
| 1370 | 1370 |
| 1371 size_t PromotedSinceLastGC() { | 1371 size_t PromotedSinceLastGC() { |
| 1372 return PromotedSpaceSizeOfObjects() - old_generation_size_at_last_gc_; | 1372 return PromotedSpaceSizeOfObjects() - old_generation_size_at_last_gc_; |
| 1373 } | 1373 } |
| 1374 | 1374 |
| 1375 // Record the fact that we generated some optimized code since the last GC |
| 1376 // which will pretenure some previously unpretenured allocation. |
| 1377 void RecordDeoptForPretenuring() { gathering_lifetime_feedback_ = 2; } |
| 1378 |
| 1375 // Update GC statistics that are tracked on the Heap. | 1379 // Update GC statistics that are tracked on the Heap. |
| 1376 void UpdateCumulativeGCStatistics(double duration, double spent_in_mutator, | 1380 void UpdateCumulativeGCStatistics(double duration, double spent_in_mutator, |
| 1377 double marking_time); | 1381 double marking_time); |
| 1378 | 1382 |
| 1379 // Returns maximum GC pause. | 1383 // Returns maximum GC pause. |
| 1380 double get_max_gc_pause() { return max_gc_pause_; } | 1384 double get_max_gc_pause() { return max_gc_pause_; } |
| 1381 | 1385 |
| 1382 // Returns maximum size of objects alive after GC. | 1386 // Returns maximum size of objects alive after GC. |
| 1383 intptr_t get_max_alive_after_gc() { return max_alive_after_gc_; } | 1387 intptr_t get_max_alive_after_gc() { return max_alive_after_gc_; } |
| 1384 | 1388 |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2166 | 2170 |
| 2167 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; | 2171 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; |
| 2168 | 2172 |
| 2169 static const int kYoungSurvivalRateHighThreshold = 90; | 2173 static const int kYoungSurvivalRateHighThreshold = 90; |
| 2170 static const int kYoungSurvivalRateLowThreshold = 10; | 2174 static const int kYoungSurvivalRateLowThreshold = 10; |
| 2171 static const int kYoungSurvivalRateAllowedDeviation = 15; | 2175 static const int kYoungSurvivalRateAllowedDeviation = 15; |
| 2172 | 2176 |
| 2173 static const int kOldSurvivalRateLowThreshold = 10; | 2177 static const int kOldSurvivalRateLowThreshold = 10; |
| 2174 | 2178 |
| 2175 bool new_space_high_promotion_mode_active_; | 2179 bool new_space_high_promotion_mode_active_; |
| 2180 // If this is non-zero, then there is hope yet that the optimized code we |
| 2181 // have generated will solve our high promotion rate problems, so we don't |
| 2182 // need to go into high promotion mode just yet. |
| 2183 int gathering_lifetime_feedback_; |
| 2176 int high_survival_rate_period_length_; | 2184 int high_survival_rate_period_length_; |
| 2177 intptr_t promoted_objects_size_; | 2185 intptr_t promoted_objects_size_; |
| 2178 int low_survival_rate_period_length_; | 2186 int low_survival_rate_period_length_; |
| 2179 double survival_rate_; | 2187 double survival_rate_; |
| 2180 double promotion_ratio_; | 2188 double promotion_ratio_; |
| 2181 double promotion_rate_; | 2189 double promotion_rate_; |
| 2182 intptr_t semi_space_copied_object_size_; | 2190 intptr_t semi_space_copied_object_size_; |
| 2183 intptr_t previous_semi_space_copied_object_size_; | 2191 intptr_t previous_semi_space_copied_object_size_; |
| 2184 double semi_space_copied_rate_; | 2192 double semi_space_copied_rate_; |
| 2185 int nodes_died_in_new_space_; | 2193 int nodes_died_in_new_space_; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2232 return false; | 2240 return false; |
| 2233 } | 2241 } |
| 2234 } | 2242 } |
| 2235 | 2243 |
| 2236 bool IsIncreasingSurvivalTrend() { | 2244 bool IsIncreasingSurvivalTrend() { |
| 2237 return survival_rate_trend() == INCREASING; | 2245 return survival_rate_trend() == INCREASING; |
| 2238 } | 2246 } |
| 2239 | 2247 |
| 2240 bool IsLowSurvivalRate() { return low_survival_rate_period_length_ > 0; } | 2248 bool IsLowSurvivalRate() { return low_survival_rate_period_length_ > 0; } |
| 2241 | 2249 |
| 2242 // TODO(hpayer): Allocation site pretenuring may make this method obsolete. | |
| 2243 // Re-visit incremental marking heuristics. | |
| 2244 bool IsHighSurvivalRate() { return high_survival_rate_period_length_ > 0; } | 2250 bool IsHighSurvivalRate() { return high_survival_rate_period_length_ > 0; } |
| 2245 | 2251 |
| 2246 void ConfigureInitialOldGenerationSize(); | 2252 void ConfigureInitialOldGenerationSize(); |
| 2247 | 2253 |
| 2248 void ConfigureNewGenerationSize(); | 2254 void ConfigureNewGenerationSize(); |
| 2249 | 2255 |
| 2250 void SelectScavengingVisitorsTable(); | 2256 void SelectScavengingVisitorsTable(); |
| 2251 | 2257 |
| 2252 bool HasLowYoungGenerationAllocationRate(); | 2258 bool HasLowYoungGenerationAllocationRate(); |
| 2253 bool HasLowOldGenerationAllocationRate(); | 2259 bool HasLowOldGenerationAllocationRate(); |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2852 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2858 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2853 | 2859 |
| 2854 private: | 2860 private: |
| 2855 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2861 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2856 }; | 2862 }; |
| 2857 #endif // DEBUG | 2863 #endif // DEBUG |
| 2858 } | 2864 } |
| 2859 } // namespace v8::internal | 2865 } // namespace v8::internal |
| 2860 | 2866 |
| 2861 #endif // V8_HEAP_HEAP_H_ | 2867 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |