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 "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 // Sizes are in MB. | 1070 // Sizes are in MB. |
1071 static const int kMaxExecutableSizeLowMemoryDevice = | 1071 static const int kMaxExecutableSizeLowMemoryDevice = |
1072 128 * kPointerMultiplier; | 1072 128 * kPointerMultiplier; |
1073 static const int kMaxExecutableSizeMediumMemoryDevice = | 1073 static const int kMaxExecutableSizeMediumMemoryDevice = |
1074 256 * kPointerMultiplier; | 1074 256 * kPointerMultiplier; |
1075 static const int kMaxExecutableSizeHighMemoryDevice = | 1075 static const int kMaxExecutableSizeHighMemoryDevice = |
1076 512 * kPointerMultiplier; | 1076 512 * kPointerMultiplier; |
1077 static const int kMaxExecutableSizeHugeMemoryDevice = | 1077 static const int kMaxExecutableSizeHugeMemoryDevice = |
1078 700 * kPointerMultiplier; | 1078 700 * kPointerMultiplier; |
1079 | 1079 |
1080 intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) { | 1080 intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size, |
1081 intptr_t limit = FLAG_stress_compaction | 1081 int freed_global_handles); |
1082 ? old_gen_size + old_gen_size / 10 | |
1083 : old_gen_size * old_space_growing_factor_; | |
1084 limit = Max(limit, kMinimumOldGenerationAllocationLimit); | |
1085 limit += new_space_.Capacity(); | |
1086 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; | |
1087 return Min(limit, halfway_to_the_max); | |
1088 } | |
1089 | 1082 |
1090 // Indicates whether inline bump-pointer allocation has been disabled. | 1083 // Indicates whether inline bump-pointer allocation has been disabled. |
1091 bool inline_allocation_disabled() { return inline_allocation_disabled_; } | 1084 bool inline_allocation_disabled() { return inline_allocation_disabled_; } |
1092 | 1085 |
1093 // Switch whether inline bump-pointer allocation should be used. | 1086 // Switch whether inline bump-pointer allocation should be used. |
1094 void EnableInlineAllocation(); | 1087 void EnableInlineAllocation(); |
1095 void DisableInlineAllocation(); | 1088 void DisableInlineAllocation(); |
1096 | 1089 |
1097 // Implements the corresponding V8 API function. | 1090 // Implements the corresponding V8 API function. |
1098 bool IdleNotification(int hint); | 1091 bool IdleNotification(int hint); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 Object* roots_[kRootListLength]; | 1502 Object* roots_[kRootListLength]; |
1510 | 1503 |
1511 size_t code_range_size_; | 1504 size_t code_range_size_; |
1512 int reserved_semispace_size_; | 1505 int reserved_semispace_size_; |
1513 int max_semi_space_size_; | 1506 int max_semi_space_size_; |
1514 int initial_semispace_size_; | 1507 int initial_semispace_size_; |
1515 intptr_t max_old_generation_size_; | 1508 intptr_t max_old_generation_size_; |
1516 intptr_t max_executable_size_; | 1509 intptr_t max_executable_size_; |
1517 intptr_t maximum_committed_; | 1510 intptr_t maximum_committed_; |
1518 | 1511 |
1519 // The old space growing factor is used in the old space heap growing | |
1520 // strategy. The new old space size is the current old space size times | |
1521 // old_space_growing_factor_. | |
1522 int old_space_growing_factor_; | |
1523 | |
1524 // For keeping track of how much data has survived | 1512 // For keeping track of how much data has survived |
1525 // scavenge since last new space expansion. | 1513 // scavenge since last new space expansion. |
1526 int survived_since_last_expansion_; | 1514 int survived_since_last_expansion_; |
1527 | 1515 |
1528 // For keeping track on when to flush RegExp code. | 1516 // For keeping track on when to flush RegExp code. |
1529 int sweep_generation_; | 1517 int sweep_generation_; |
1530 | 1518 |
1531 int always_allocate_scope_depth_; | 1519 int always_allocate_scope_depth_; |
1532 | 1520 |
1533 // For keeping track of context disposals. | 1521 // For keeping track of context disposals. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 // remain until the next failure and garbage collection. | 1581 // remain until the next failure and garbage collection. |
1594 int allocation_timeout_; | 1582 int allocation_timeout_; |
1595 #endif // DEBUG | 1583 #endif // DEBUG |
1596 | 1584 |
1597 // Limit that triggers a global GC on the next (normally caused) GC. This | 1585 // Limit that triggers a global GC on the next (normally caused) GC. This |
1598 // is checked when we have already decided to do a GC to help determine | 1586 // is checked when we have already decided to do a GC to help determine |
1599 // which collector to invoke, before expanding a paged space in the old | 1587 // which collector to invoke, before expanding a paged space in the old |
1600 // generation and on every allocation in large object space. | 1588 // generation and on every allocation in large object space. |
1601 intptr_t old_generation_allocation_limit_; | 1589 intptr_t old_generation_allocation_limit_; |
1602 | 1590 |
1603 // Used to adjust the limits that control the timing of the next GC. | |
1604 intptr_t size_of_old_gen_at_last_old_space_gc_; | |
1605 | |
1606 // Indicates that an allocation has failed in the old generation since the | 1591 // Indicates that an allocation has failed in the old generation since the |
1607 // last GC. | 1592 // last GC. |
1608 bool old_gen_exhausted_; | 1593 bool old_gen_exhausted_; |
1609 | 1594 |
1610 // Indicates that inline bump-pointer allocation has been globally disabled | 1595 // Indicates that inline bump-pointer allocation has been globally disabled |
1611 // for all spaces. This is used to disable allocations in generated code. | 1596 // for all spaces. This is used to disable allocations in generated code. |
1612 bool inline_allocation_disabled_; | 1597 bool inline_allocation_disabled_; |
1613 | 1598 |
1614 // Weak list heads, threaded through the objects. | 1599 // Weak list heads, threaded through the objects. |
1615 // List heads are initilized lazily and contain the undefined_value at start. | 1600 // List heads are initilized lazily and contain the undefined_value at start. |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2779 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2764 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2780 | 2765 |
2781 private: | 2766 private: |
2782 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2767 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2783 }; | 2768 }; |
2784 #endif // DEBUG | 2769 #endif // DEBUG |
2785 | 2770 |
2786 } } // namespace v8::internal | 2771 } } // namespace v8::internal |
2787 | 2772 |
2788 #endif // V8_HEAP_H_ | 2773 #endif // V8_HEAP_H_ |
OLD | NEW |