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_H_ | 5 #ifndef V8_HEAP_H_ |
6 #define V8_HEAP_H_ | 6 #define V8_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "allocation.h" | 10 #include "allocation.h" |
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 } | 1352 } |
1353 | 1353 |
1354 bool flush_monomorphic_ics() { return flush_monomorphic_ics_; } | 1354 bool flush_monomorphic_ics() { return flush_monomorphic_ics_; } |
1355 | 1355 |
1356 int64_t amount_of_external_allocated_memory() { | 1356 int64_t amount_of_external_allocated_memory() { |
1357 return amount_of_external_allocated_memory_; | 1357 return amount_of_external_allocated_memory_; |
1358 } | 1358 } |
1359 | 1359 |
1360 void DeoptMarkedAllocationSites(); | 1360 void DeoptMarkedAllocationSites(); |
1361 | 1361 |
| 1362 bool changed_to_max_semi_space_size() { |
| 1363 return changed_to_max_semi_space_size_; |
| 1364 } |
| 1365 |
1362 // ObjectStats are kept in two arrays, counts and sizes. Related stats are | 1366 // ObjectStats are kept in two arrays, counts and sizes. Related stats are |
1363 // stored in a contiguous linear buffer. Stats groups are stored one after | 1367 // stored in a contiguous linear buffer. Stats groups are stored one after |
1364 // another. | 1368 // another. |
1365 enum { | 1369 enum { |
1366 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, | 1370 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, |
1367 FIRST_FIXED_ARRAY_SUB_TYPE = | 1371 FIRST_FIXED_ARRAY_SUB_TYPE = |
1368 FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS, | 1372 FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS, |
1369 FIRST_CODE_AGE_SUB_TYPE = | 1373 FIRST_CODE_AGE_SUB_TYPE = |
1370 FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1, | 1374 FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1, |
1371 OBJECT_STATS_COUNT = FIRST_CODE_AGE_SUB_TYPE + Code::kCodeAgeCount + 1 | 1375 OBJECT_STATS_COUNT = FIRST_CODE_AGE_SUB_TYPE + Code::kCodeAgeCount + 1 |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1998 | 2002 |
1999 // Sets used allocation sites entries to undefined. | 2003 // Sets used allocation sites entries to undefined. |
2000 void FlushAllocationSitesScratchpad(); | 2004 void FlushAllocationSitesScratchpad(); |
2001 | 2005 |
2002 // Initializes the allocation sites scratchpad with undefined values. | 2006 // Initializes the allocation sites scratchpad with undefined values. |
2003 void InitializeAllocationSitesScratchpad(); | 2007 void InitializeAllocationSitesScratchpad(); |
2004 | 2008 |
2005 // Adds an allocation site to the scratchpad if there is space left. | 2009 // Adds an allocation site to the scratchpad if there is space left. |
2006 void AddAllocationSiteToScratchpad(AllocationSite* site, | 2010 void AddAllocationSiteToScratchpad(AllocationSite* site, |
2007 ScratchpadSlotMode mode); | 2011 ScratchpadSlotMode mode); |
2008 | |
2009 void UpdateSurvivalStatistics(int start_new_space_size); | 2012 void UpdateSurvivalStatistics(int start_new_space_size); |
2010 | 2013 |
2011 static const int kYoungSurvivalRateHighThreshold = 90; | 2014 static const int kYoungSurvivalRateHighThreshold = 90; |
2012 static const int kYoungSurvivalRateAllowedDeviation = 15; | 2015 static const int kYoungSurvivalRateAllowedDeviation = 15; |
2013 | 2016 |
2014 static const int kOldSurvivalRateLowThreshold = 10; | 2017 static const int kOldSurvivalRateLowThreshold = 10; |
2015 | 2018 |
2016 int high_survival_rate_period_length_; | 2019 int high_survival_rate_period_length_; |
2017 intptr_t promoted_objects_size_; | 2020 intptr_t promoted_objects_size_; |
2018 double promotion_rate_; | 2021 double promotion_rate_; |
2019 intptr_t semi_space_copied_object_size_; | 2022 intptr_t semi_space_copied_object_size_; |
2020 double semi_space_copied_rate_; | 2023 double semi_space_copied_rate_; |
2021 | 2024 |
| 2025 // This is the pretenuring trigger for allocation sites that are in maybe |
| 2026 // tenure state. When we switched to the maximum new space size we deoptimize |
| 2027 // the code that belongs to the allocation site and derive the lifetime |
| 2028 // of the allocation site. |
| 2029 bool changed_to_max_semi_space_size_; |
| 2030 |
2022 // TODO(hpayer): Allocation site pretenuring may make this method obsolete. | 2031 // TODO(hpayer): Allocation site pretenuring may make this method obsolete. |
2023 // Re-visit incremental marking heuristics. | 2032 // Re-visit incremental marking heuristics. |
2024 bool IsHighSurvivalRate() { | 2033 bool IsHighSurvivalRate() { |
2025 return high_survival_rate_period_length_ > 0; | 2034 return high_survival_rate_period_length_ > 0; |
2026 } | 2035 } |
2027 | 2036 |
2028 void SelectScavengingVisitorsTable(); | 2037 void SelectScavengingVisitorsTable(); |
2029 | 2038 |
2030 void StartIdleRound() { | 2039 void StartIdleRound() { |
2031 mark_sweeps_since_idle_round_started_ = 0; | 2040 mark_sweeps_since_idle_round_started_ = 0; |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2761 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2770 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2762 | 2771 |
2763 private: | 2772 private: |
2764 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2773 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2765 }; | 2774 }; |
2766 #endif // DEBUG | 2775 #endif // DEBUG |
2767 | 2776 |
2768 } } // namespace v8::internal | 2777 } } // namespace v8::internal |
2769 | 2778 |
2770 #endif // V8_HEAP_H_ | 2779 #endif // V8_HEAP_H_ |
OLD | NEW |