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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 | 1079 |
1080 inline intptr_t OldGenerationCapacityAvailable() { | 1080 inline intptr_t OldGenerationCapacityAvailable() { |
1081 return max_old_generation_size_ - PromotedTotalSize(); | 1081 return max_old_generation_size_ - PromotedTotalSize(); |
1082 } | 1082 } |
1083 | 1083 |
1084 static const intptr_t kMinimumOldGenerationAllocationLimit = | 1084 static const intptr_t kMinimumOldGenerationAllocationLimit = |
1085 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); | 1085 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); |
1086 | 1086 |
1087 static const int kInitalOldGenerationLimitFactor = 2; | 1087 static const int kInitalOldGenerationLimitFactor = 2; |
1088 | 1088 |
| 1089 #if V8_OS_ANDROID |
| 1090 // Don't apply pointer multiplier on Android since it has no swap space and |
| 1091 // should instead adapt it's heap size based on available physical memory. |
| 1092 static const int kPointerMultiplier = 1; |
| 1093 #else |
1089 static const int kPointerMultiplier = i::kPointerSize / 4; | 1094 static const int kPointerMultiplier = i::kPointerSize / 4; |
| 1095 #endif |
1090 | 1096 |
1091 // The new space size has to be a power of 2. Sizes are in MB. | 1097 // The new space size has to be a power of 2. Sizes are in MB. |
1092 static const int kMaxSemiSpaceSizeLowMemoryDevice = 1 * kPointerMultiplier; | 1098 static const int kMaxSemiSpaceSizeLowMemoryDevice = 1 * kPointerMultiplier; |
1093 static const int kMaxSemiSpaceSizeMediumMemoryDevice = 4 * kPointerMultiplier; | 1099 static const int kMaxSemiSpaceSizeMediumMemoryDevice = 4 * kPointerMultiplier; |
1094 static const int kMaxSemiSpaceSizeHighMemoryDevice = 8 * kPointerMultiplier; | 1100 static const int kMaxSemiSpaceSizeHighMemoryDevice = 8 * kPointerMultiplier; |
1095 static const int kMaxSemiSpaceSizeHugeMemoryDevice = 8 * kPointerMultiplier; | 1101 static const int kMaxSemiSpaceSizeHugeMemoryDevice = 8 * kPointerMultiplier; |
1096 | 1102 |
1097 // The old space size has to be a multiple of Page::kPageSize. | 1103 // The old space size has to be a multiple of Page::kPageSize. |
1098 // Sizes are in MB. | 1104 // Sizes are in MB. |
1099 static const int kMaxOldSpaceSizeLowMemoryDevice = 128 * kPointerMultiplier; | 1105 static const int kMaxOldSpaceSizeLowMemoryDevice = 128 * kPointerMultiplier; |
(...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2571 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2577 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2572 | 2578 |
2573 private: | 2579 private: |
2574 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2580 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2575 }; | 2581 }; |
2576 #endif // DEBUG | 2582 #endif // DEBUG |
2577 } | 2583 } |
2578 } // namespace v8::internal | 2584 } // namespace v8::internal |
2579 | 2585 |
2580 #endif // V8_HEAP_HEAP_H_ | 2586 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |