OLD | NEW |
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 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2035 } | 2035 } |
2036 | 2036 |
2037 // Code that should be run before and after each GC. Includes some | 2037 // Code that should be run before and after each GC. Includes some |
2038 // reporting/verification activities when compiled with DEBUG set. | 2038 // reporting/verification activities when compiled with DEBUG set. |
2039 void GarbageCollectionPrologue(); | 2039 void GarbageCollectionPrologue(); |
2040 void GarbageCollectionEpilogue(); | 2040 void GarbageCollectionEpilogue(); |
2041 | 2041 |
2042 // Pretenuring decisions are made based on feedback collected during new | 2042 // Pretenuring decisions are made based on feedback collected during new |
2043 // space evacuation. Note that between feedback collection and calling this | 2043 // space evacuation. Note that between feedback collection and calling this |
2044 // method object in old space must not move. | 2044 // method object in old space must not move. |
| 2045 // Right now we only process pretenuring feedback in high promotion mode. |
2045 void ProcessPretenuringFeedback(); | 2046 void ProcessPretenuringFeedback(); |
2046 | 2047 |
2047 // Checks whether a global GC is necessary | 2048 // Checks whether a global GC is necessary |
2048 GarbageCollector SelectGarbageCollector(AllocationSpace space, | 2049 GarbageCollector SelectGarbageCollector(AllocationSpace space, |
2049 const char** reason); | 2050 const char** reason); |
2050 | 2051 |
2051 // Performs garbage collection operation. | 2052 // Performs garbage collection operation. |
2052 // Returns whether there is a chance that another major GC could | 2053 // Returns whether there is a chance that another major GC could |
2053 // collect more garbage. | 2054 // collect more garbage. |
2054 bool CollectGarbage(AllocationSpace space, | 2055 bool CollectGarbage(AllocationSpace space, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 // Performs a major collection in the whole heap. | 2162 // Performs a major collection in the whole heap. |
2162 void MarkCompact(GCTracer* tracer); | 2163 void MarkCompact(GCTracer* tracer); |
2163 | 2164 |
2164 // Code to be run before and after mark-compact. | 2165 // Code to be run before and after mark-compact. |
2165 void MarkCompactPrologue(); | 2166 void MarkCompactPrologue(); |
2166 | 2167 |
2167 void ProcessNativeContexts(WeakObjectRetainer* retainer, bool record_slots); | 2168 void ProcessNativeContexts(WeakObjectRetainer* retainer, bool record_slots); |
2168 void ProcessArrayBuffers(WeakObjectRetainer* retainer, bool record_slots); | 2169 void ProcessArrayBuffers(WeakObjectRetainer* retainer, bool record_slots); |
2169 void ProcessAllocationSites(WeakObjectRetainer* retainer, bool record_slots); | 2170 void ProcessAllocationSites(WeakObjectRetainer* retainer, bool record_slots); |
2170 | 2171 |
| 2172 // Deopts all code that contains allocation instruction which should be |
| 2173 // tenured and resets the pretenuring allocation site statistics. |
| 2174 void ResetAllAllocationSitesDependentCode(); |
| 2175 |
| 2176 // Deopts all code that contains tenured allocation instructions and sets the |
| 2177 // given pretenuring decisions to undecided. |
| 2178 void ResetAllTenuredAllocationSitesDependentCode(); |
| 2179 |
| 2180 // Evaluates local pretenuring for the old space and calls |
| 2181 // ResetAllTenuredAllocationSitesDependentCode if too many objects died in |
| 2182 // the old space. |
| 2183 void EvaluateOldSpaceLocalPretenuring(uint64_t size_of_objects_before_gc); |
| 2184 |
2171 // Called on heap tear-down. | 2185 // Called on heap tear-down. |
2172 void TearDownArrayBuffers(); | 2186 void TearDownArrayBuffers(); |
2173 | 2187 |
2174 // Record statistics before and after garbage collection. | 2188 // Record statistics before and after garbage collection. |
2175 void ReportStatisticsBeforeGC(); | 2189 void ReportStatisticsBeforeGC(); |
2176 void ReportStatisticsAfterGC(); | 2190 void ReportStatisticsAfterGC(); |
2177 | 2191 |
2178 // Slow part of scavenge object. | 2192 // Slow part of scavenge object. |
2179 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); | 2193 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); |
2180 | 2194 |
(...skipping 23 matching lines...) Expand all Loading... |
2204 void FlushNumberStringCache(); | 2218 void FlushNumberStringCache(); |
2205 | 2219 |
2206 void UpdateSurvivalRateTrend(int start_new_space_size); | 2220 void UpdateSurvivalRateTrend(int start_new_space_size); |
2207 | 2221 |
2208 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; | 2222 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; |
2209 | 2223 |
2210 static const int kYoungSurvivalRateHighThreshold = 90; | 2224 static const int kYoungSurvivalRateHighThreshold = 90; |
2211 static const int kYoungSurvivalRateLowThreshold = 10; | 2225 static const int kYoungSurvivalRateLowThreshold = 10; |
2212 static const int kYoungSurvivalRateAllowedDeviation = 15; | 2226 static const int kYoungSurvivalRateAllowedDeviation = 15; |
2213 | 2227 |
| 2228 static const int kOldSurvivalRateLowThreshold = 20; |
| 2229 |
2214 int young_survivors_after_last_gc_; | 2230 int young_survivors_after_last_gc_; |
2215 int high_survival_rate_period_length_; | 2231 int high_survival_rate_period_length_; |
2216 int low_survival_rate_period_length_; | 2232 int low_survival_rate_period_length_; |
2217 double survival_rate_; | 2233 double survival_rate_; |
2218 SurvivalRateTrend previous_survival_rate_trend_; | 2234 SurvivalRateTrend previous_survival_rate_trend_; |
2219 SurvivalRateTrend survival_rate_trend_; | 2235 SurvivalRateTrend survival_rate_trend_; |
2220 | 2236 |
2221 void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) { | 2237 void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) { |
2222 ASSERT(survival_rate_trend != FLUCTUATING); | 2238 ASSERT(survival_rate_trend != FLUCTUATING); |
2223 previous_survival_rate_trend_ = survival_rate_trend_; | 2239 previous_survival_rate_trend_ = survival_rate_trend_; |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2996 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3012 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2997 | 3013 |
2998 private: | 3014 private: |
2999 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3015 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
3000 }; | 3016 }; |
3001 #endif // DEBUG | 3017 #endif // DEBUG |
3002 | 3018 |
3003 } } // namespace v8::internal | 3019 } } // namespace v8::internal |
3004 | 3020 |
3005 #endif // V8_HEAP_H_ | 3021 #endif // V8_HEAP_H_ |
OLD | NEW |