OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // the young generation, we reserve 4 times the amount needed for a | 244 // the young generation, we reserve 4 times the amount needed for a |
245 // semi space. The young generation consists of two semi spaces and | 245 // semi space. The young generation consists of two semi spaces and |
246 // we reserve twice the amount needed for those in order to ensure | 246 // we reserve twice the amount needed for those in order to ensure |
247 // that new space can be aligned to its size. | 247 // that new space can be aligned to its size. |
248 static intptr_t MaxReserved() { | 248 static intptr_t MaxReserved() { |
249 return 4 * reserved_semispace_size_ + max_old_generation_size_; | 249 return 4 * reserved_semispace_size_ + max_old_generation_size_; |
250 } | 250 } |
251 static int MaxSemiSpaceSize() { return max_semispace_size_; } | 251 static int MaxSemiSpaceSize() { return max_semispace_size_; } |
252 static int ReservedSemiSpaceSize() { return reserved_semispace_size_; } | 252 static int ReservedSemiSpaceSize() { return reserved_semispace_size_; } |
253 static int InitialSemiSpaceSize() { return initial_semispace_size_; } | 253 static int InitialSemiSpaceSize() { return initial_semispace_size_; } |
254 static int MaxOldGenerationSize() { return max_old_generation_size_; } | 254 static intptr_t MaxOldGenerationSize() { return max_old_generation_size_; } |
255 | 255 |
256 // Returns the capacity of the heap in bytes w/o growing. Heap grows when | 256 // Returns the capacity of the heap in bytes w/o growing. Heap grows when |
257 // more spaces are needed until it reaches the limit. | 257 // more spaces are needed until it reaches the limit. |
258 static int Capacity(); | 258 static int Capacity(); |
259 | 259 |
260 // Returns the amount of memory currently committed for the heap. | 260 // Returns the amount of memory currently committed for the heap. |
261 static int CommittedMemory(); | 261 static int CommittedMemory(); |
262 | 262 |
263 // Returns the available bytes in space w/o growing. | 263 // Returns the available bytes in space w/o growing. |
264 // Heap doesn't guarantee that it can allocate an object that requires | 264 // Heap doesn't guarantee that it can allocate an object that requires |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 | 1063 |
1064 static void ClearNormalizedMapCaches(); | 1064 static void ClearNormalizedMapCaches(); |
1065 | 1065 |
1066 static GCTracer* tracer() { return tracer_; } | 1066 static GCTracer* tracer() { return tracer_; } |
1067 | 1067 |
1068 private: | 1068 private: |
1069 static int reserved_semispace_size_; | 1069 static int reserved_semispace_size_; |
1070 static int max_semispace_size_; | 1070 static int max_semispace_size_; |
1071 static int initial_semispace_size_; | 1071 static int initial_semispace_size_; |
1072 static intptr_t max_old_generation_size_; | 1072 static intptr_t max_old_generation_size_; |
1073 static size_t code_range_size_; | 1073 static intptr_t code_range_size_; |
1074 | 1074 |
1075 // For keeping track of how much data has survived | 1075 // For keeping track of how much data has survived |
1076 // scavenge since last new space expansion. | 1076 // scavenge since last new space expansion. |
1077 static int survived_since_last_expansion_; | 1077 static int survived_since_last_expansion_; |
1078 | 1078 |
1079 static int always_allocate_scope_depth_; | 1079 static int always_allocate_scope_depth_; |
1080 static int linear_allocation_scope_depth_; | 1080 static int linear_allocation_scope_depth_; |
1081 | 1081 |
1082 // For keeping track of context disposals. | 1082 // For keeping track of context disposals. |
1083 static int contexts_disposed_; | 1083 static int contexts_disposed_; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 } | 1224 } |
1225 | 1225 |
1226 // Checks whether a global GC is necessary | 1226 // Checks whether a global GC is necessary |
1227 static GarbageCollector SelectGarbageCollector(AllocationSpace space); | 1227 static GarbageCollector SelectGarbageCollector(AllocationSpace space); |
1228 | 1228 |
1229 // Performs garbage collection | 1229 // Performs garbage collection |
1230 static void PerformGarbageCollection(GarbageCollector collector, | 1230 static void PerformGarbageCollection(GarbageCollector collector, |
1231 GCTracer* tracer, | 1231 GCTracer* tracer, |
1232 CollectionPolicy collectionPolicy); | 1232 CollectionPolicy collectionPolicy); |
1233 | 1233 |
1234 static const int kMinimumPromotionLimit = 2 * MB; | 1234 static const intptr_t kMinimumPromotionLimit = 2 * MB; |
1235 static const int kMinimumAllocationLimit = 8 * MB; | 1235 static const intptr_t kMinimumAllocationLimit = 8 * MB; |
1236 | 1236 |
1237 inline static void UpdateOldSpaceLimits(); | 1237 inline static void UpdateOldSpaceLimits(); |
1238 | 1238 |
1239 // Allocate an uninitialized object in map space. The behavior is identical | 1239 // Allocate an uninitialized object in map space. The behavior is identical |
1240 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't | 1240 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't |
1241 // have to test the allocation space argument and (b) can reduce code size | 1241 // have to test the allocation space argument and (b) can reduce code size |
1242 // (since both AllocateRaw and AllocateRawMap are inlined). | 1242 // (since both AllocateRaw and AllocateRawMap are inlined). |
1243 MUST_USE_RESULT static inline Object* AllocateRawMap(); | 1243 MUST_USE_RESULT static inline Object* AllocateRawMap(); |
1244 | 1244 |
1245 // Allocate an uninitialized object in the global property cell space. | 1245 // Allocate an uninitialized object in the global property cell space. |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2039 | 2039 |
2040 // To speed up scavenge collections new space string are kept | 2040 // To speed up scavenge collections new space string are kept |
2041 // separate from old space strings. | 2041 // separate from old space strings. |
2042 static List<Object*> new_space_strings_; | 2042 static List<Object*> new_space_strings_; |
2043 static List<Object*> old_space_strings_; | 2043 static List<Object*> old_space_strings_; |
2044 }; | 2044 }; |
2045 | 2045 |
2046 } } // namespace v8::internal | 2046 } } // namespace v8::internal |
2047 | 2047 |
2048 #endif // V8_HEAP_H_ | 2048 #endif // V8_HEAP_H_ |
OLD | NEW |