| 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 are tenured or |
| 2173 // not tenured. Moreover it clears the pretenuring allocation site statistics. |
| 2174 void ResetAllAllocationSitesDependentCode(PretenureFlag flag); |
| 2175 |
| 2176 // Evaluates local pretenuring for the old space and calls |
| 2177 // ResetAllTenuredAllocationSitesDependentCode if too many objects died in |
| 2178 // the old space. |
| 2179 void EvaluateOldSpaceLocalPretenuring(uint64_t size_of_objects_before_gc); |
| 2180 |
| 2171 // Called on heap tear-down. | 2181 // Called on heap tear-down. |
| 2172 void TearDownArrayBuffers(); | 2182 void TearDownArrayBuffers(); |
| 2173 | 2183 |
| 2174 // Record statistics before and after garbage collection. | 2184 // Record statistics before and after garbage collection. |
| 2175 void ReportStatisticsBeforeGC(); | 2185 void ReportStatisticsBeforeGC(); |
| 2176 void ReportStatisticsAfterGC(); | 2186 void ReportStatisticsAfterGC(); |
| 2177 | 2187 |
| 2178 // Slow part of scavenge object. | 2188 // Slow part of scavenge object. |
| 2179 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); | 2189 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); |
| 2180 | 2190 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2204 void FlushNumberStringCache(); | 2214 void FlushNumberStringCache(); |
| 2205 | 2215 |
| 2206 void UpdateSurvivalRateTrend(int start_new_space_size); | 2216 void UpdateSurvivalRateTrend(int start_new_space_size); |
| 2207 | 2217 |
| 2208 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; | 2218 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; |
| 2209 | 2219 |
| 2210 static const int kYoungSurvivalRateHighThreshold = 90; | 2220 static const int kYoungSurvivalRateHighThreshold = 90; |
| 2211 static const int kYoungSurvivalRateLowThreshold = 10; | 2221 static const int kYoungSurvivalRateLowThreshold = 10; |
| 2212 static const int kYoungSurvivalRateAllowedDeviation = 15; | 2222 static const int kYoungSurvivalRateAllowedDeviation = 15; |
| 2213 | 2223 |
| 2224 static const int kOldSurvivalRateLowThreshold = 20; |
| 2225 |
| 2214 int young_survivors_after_last_gc_; | 2226 int young_survivors_after_last_gc_; |
| 2215 int high_survival_rate_period_length_; | 2227 int high_survival_rate_period_length_; |
| 2216 int low_survival_rate_period_length_; | 2228 int low_survival_rate_period_length_; |
| 2217 double survival_rate_; | 2229 double survival_rate_; |
| 2218 SurvivalRateTrend previous_survival_rate_trend_; | 2230 SurvivalRateTrend previous_survival_rate_trend_; |
| 2219 SurvivalRateTrend survival_rate_trend_; | 2231 SurvivalRateTrend survival_rate_trend_; |
| 2220 | 2232 |
| 2221 void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) { | 2233 void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) { |
| 2222 ASSERT(survival_rate_trend != FLUCTUATING); | 2234 ASSERT(survival_rate_trend != FLUCTUATING); |
| 2223 previous_survival_rate_trend_ = survival_rate_trend_; | 2235 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. | 3008 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2997 | 3009 |
| 2998 private: | 3010 private: |
| 2999 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3011 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 3000 }; | 3012 }; |
| 3001 #endif // DEBUG | 3013 #endif // DEBUG |
| 3002 | 3014 |
| 3003 } } // namespace v8::internal | 3015 } } // namespace v8::internal |
| 3004 | 3016 |
| 3005 #endif // V8_HEAP_H_ | 3017 #endif // V8_HEAP_H_ |
| OLD | NEW |