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 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1218 inline void IncrementNodesCopiedInNewSpace() { nodes_copied_in_new_space_++; } | 1218 inline void IncrementNodesCopiedInNewSpace() { nodes_copied_in_new_space_++; } |
1219 | 1219 |
1220 inline void IncrementNodesPromoted() { nodes_promoted_++; } | 1220 inline void IncrementNodesPromoted() { nodes_promoted_++; } |
1221 | 1221 |
1222 inline void IncrementYoungSurvivorsCounter(int survived) { | 1222 inline void IncrementYoungSurvivorsCounter(int survived) { |
1223 DCHECK(survived >= 0); | 1223 DCHECK(survived >= 0); |
1224 survived_last_scavenge_ = survived; | 1224 survived_last_scavenge_ = survived; |
1225 survived_since_last_expansion_ += survived; | 1225 survived_since_last_expansion_ += survived; |
1226 } | 1226 } |
1227 | 1227 |
1228 inline bool NextGCIsLikelyToBeFull() { | 1228 inline bool NextGCIsLikelyToBeFull(intptr_t limit = 0) { |
ulan
2015/04/16 14:17:22
Always pass the limit (either the old_generation_a
Hannes Payer (out of office)
2015/04/16 14:46:45
Done.
| |
1229 if (FLAG_gc_global) return true; | 1229 if (FLAG_gc_global) return true; |
1230 | 1230 |
1231 if (FLAG_stress_compaction && (gc_count_ & 1) != 0) return true; | 1231 if (FLAG_stress_compaction && (gc_count_ & 1) != 0) return true; |
1232 | 1232 |
1233 intptr_t adjusted_allocation_limit = | 1233 if (limit == 0) limit = old_generation_allocation_limit_; |
1234 old_generation_allocation_limit_ - new_space_.Capacity(); | 1234 intptr_t adjusted_allocation_limit = limit - new_space_.Capacity(); |
1235 | 1235 |
1236 if (PromotedTotalSize() >= adjusted_allocation_limit) return true; | 1236 if (PromotedTotalSize() >= adjusted_allocation_limit) return true; |
1237 | 1237 |
1238 return false; | 1238 return false; |
1239 } | 1239 } |
1240 | 1240 |
1241 void UpdateNewSpaceReferencesInExternalStringTable( | 1241 void UpdateNewSpaceReferencesInExternalStringTable( |
1242 ExternalStringTableUpdaterCallback updater_func); | 1242 ExternalStringTableUpdaterCallback updater_func); |
1243 | 1243 |
1244 void UpdateReferencesInExternalStringTable( | 1244 void UpdateReferencesInExternalStringTable( |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1626 // remain until the next failure and garbage collection. | 1626 // remain until the next failure and garbage collection. |
1627 int allocation_timeout_; | 1627 int allocation_timeout_; |
1628 #endif // DEBUG | 1628 #endif // DEBUG |
1629 | 1629 |
1630 // Limit that triggers a global GC on the next (normally caused) GC. This | 1630 // Limit that triggers a global GC on the next (normally caused) GC. This |
1631 // is checked when we have already decided to do a GC to help determine | 1631 // is checked when we have already decided to do a GC to help determine |
1632 // which collector to invoke, before expanding a paged space in the old | 1632 // which collector to invoke, before expanding a paged space in the old |
1633 // generation and on every allocation in large object space. | 1633 // generation and on every allocation in large object space. |
1634 intptr_t old_generation_allocation_limit_; | 1634 intptr_t old_generation_allocation_limit_; |
1635 | 1635 |
1636 // The minimum factor used to grow the old generation. | |
ulan
2015/04/16 14:17:22
Each additional state variable complicates GC sche
Hannes Payer (out of office)
2015/04/16 14:46:45
Done.
| |
1637 double min_old_generation_growing_factor_; | |
Erik Corry Chromium.org
2015/04/16 14:16:44
This never changes.
Hannes Payer (out of office)
2015/04/16 14:46:45
Done.
| |
1638 | |
1639 // The maximum factor used to grow the old generation. | |
1640 double max_old_generation_growing_factor_; | |
1641 | |
1642 // The factor used in the idle notification to grow the old generation. | |
1643 double idle_old_generation_growing_factor_; | |
Erik Corry Chromium.org
2015/04/16 14:16:44
This never changes.
I think it keeps things simpl
Hannes Payer (out of office)
2015/04/16 14:46:45
Done.
| |
1644 | |
1645 // The currently used old generation growing factor determined by the heap | |
1646 // growing strategy (not by the idle notification). | |
1647 double current_old_generation_growing_factor_; | |
1648 | |
1636 // Indicates that an allocation has failed in the old generation since the | 1649 // Indicates that an allocation has failed in the old generation since the |
1637 // last GC. | 1650 // last GC. |
1638 bool old_gen_exhausted_; | 1651 bool old_gen_exhausted_; |
1639 | 1652 |
1640 // Indicates that inline bump-pointer allocation has been globally disabled | 1653 // Indicates that inline bump-pointer allocation has been globally disabled |
1641 // for all spaces. This is used to disable allocations in generated code. | 1654 // for all spaces. This is used to disable allocations in generated code. |
1642 bool inline_allocation_disabled_; | 1655 bool inline_allocation_disabled_; |
1643 | 1656 |
1644 // Weak list heads, threaded through the objects. | 1657 // Weak list heads, threaded through the objects. |
1645 // List heads are initialized lazily and contain the undefined_value at start. | 1658 // List heads are initialized lazily and contain the undefined_value at start. |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2606 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2619 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2607 | 2620 |
2608 private: | 2621 private: |
2609 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2622 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2610 }; | 2623 }; |
2611 #endif // DEBUG | 2624 #endif // DEBUG |
2612 } | 2625 } |
2613 } // namespace v8::internal | 2626 } // namespace v8::internal |
2614 | 2627 |
2615 #endif // V8_HEAP_HEAP_H_ | 2628 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |