OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 kRootListLength | 974 kRootListLength |
975 }; | 975 }; |
976 | 976 |
977 static Object* NumberToString(Object* number, | 977 static Object* NumberToString(Object* number, |
978 bool check_number_string_cache = true); | 978 bool check_number_string_cache = true); |
979 | 979 |
980 static Map* MapForExternalArrayType(ExternalArrayType array_type); | 980 static Map* MapForExternalArrayType(ExternalArrayType array_type); |
981 static RootListIndex RootIndexForExternalArrayType( | 981 static RootListIndex RootIndexForExternalArrayType( |
982 ExternalArrayType array_type); | 982 ExternalArrayType array_type); |
983 | 983 |
984 static void RecordStats(HeapStats* stats); | 984 static void RecordStats(HeapStats* stats, bool take_snapshot = false); |
985 | 985 |
986 static Scavenger GetScavenger(int instance_type, int instance_size); | 986 static Scavenger GetScavenger(int instance_type, int instance_size); |
987 | 987 |
988 // Copy block of memory from src to dst. Size of block should be aligned | 988 // Copy block of memory from src to dst. Size of block should be aligned |
989 // by pointer size. | 989 // by pointer size. |
990 static inline void CopyBlock(Address dst, Address src, int byte_size); | 990 static inline void CopyBlock(Address dst, Address src, int byte_size); |
991 | 991 |
992 static inline void CopyBlockToOldSpaceAndUpdateRegionMarks(Address dst, | 992 static inline void CopyBlockToOldSpaceAndUpdateRegionMarks(Address dst, |
993 Address src, | 993 Address src, |
994 int byte_size); | 994 int byte_size); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 | 1317 |
1318 friend class Factory; | 1318 friend class Factory; |
1319 friend class DisallowAllocationFailure; | 1319 friend class DisallowAllocationFailure; |
1320 friend class AlwaysAllocateScope; | 1320 friend class AlwaysAllocateScope; |
1321 friend class LinearAllocationScope; | 1321 friend class LinearAllocationScope; |
1322 }; | 1322 }; |
1323 | 1323 |
1324 | 1324 |
1325 class HeapStats { | 1325 class HeapStats { |
1326 public: | 1326 public: |
1327 int* start_marker; | 1327 int* start_marker; // 0 |
1328 int* new_space_size; | 1328 int* new_space_size; // 1 |
1329 int* new_space_capacity; | 1329 int* new_space_capacity; // 2 |
1330 int* old_pointer_space_size; | 1330 int* old_pointer_space_size; // 3 |
1331 int* old_pointer_space_capacity; | 1331 int* old_pointer_space_capacity; // 4 |
1332 int* old_data_space_size; | 1332 int* old_data_space_size; // 5 |
1333 int* old_data_space_capacity; | 1333 int* old_data_space_capacity; // 6 |
1334 int* code_space_size; | 1334 int* code_space_size; // 7 |
1335 int* code_space_capacity; | 1335 int* code_space_capacity; // 8 |
1336 int* map_space_size; | 1336 int* map_space_size; // 9 |
1337 int* map_space_capacity; | 1337 int* map_space_capacity; // 10 |
1338 int* cell_space_size; | 1338 int* cell_space_size; // 11 |
1339 int* cell_space_capacity; | 1339 int* cell_space_capacity; // 12 |
1340 int* lo_space_size; | 1340 int* lo_space_size; // 13 |
1341 int* global_handle_count; | 1341 int* global_handle_count; // 14 |
1342 int* weak_global_handle_count; | 1342 int* weak_global_handle_count; // 15 |
1343 int* pending_global_handle_count; | 1343 int* pending_global_handle_count; // 16 |
1344 int* near_death_global_handle_count; | 1344 int* near_death_global_handle_count; // 17 |
1345 int* destroyed_global_handle_count; | 1345 int* destroyed_global_handle_count; // 18 |
1346 int* end_marker; | 1346 int* memory_allocator_size; // 19 |
| 1347 int* memory_allocator_capacity; // 20 |
| 1348 int* objects_per_type; // 21 |
| 1349 int* size_per_type; // 22 |
| 1350 int* end_marker; // 23 |
1347 }; | 1351 }; |
1348 | 1352 |
1349 | 1353 |
1350 class AlwaysAllocateScope { | 1354 class AlwaysAllocateScope { |
1351 public: | 1355 public: |
1352 AlwaysAllocateScope() { | 1356 AlwaysAllocateScope() { |
1353 // We shouldn't hit any nested scopes, because that requires | 1357 // We shouldn't hit any nested scopes, because that requires |
1354 // non-handle code to call handle code. The code still works but | 1358 // non-handle code to call handle code. The code still works but |
1355 // performance will degrade, so we want to catch this situation | 1359 // performance will degrade, so we want to catch this situation |
1356 // in debug mode. | 1360 // in debug mode. |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1975 | 1979 |
1976 // To speed up scavenge collections new space string are kept | 1980 // To speed up scavenge collections new space string are kept |
1977 // separate from old space strings. | 1981 // separate from old space strings. |
1978 static List<Object*> new_space_strings_; | 1982 static List<Object*> new_space_strings_; |
1979 static List<Object*> old_space_strings_; | 1983 static List<Object*> old_space_strings_; |
1980 }; | 1984 }; |
1981 | 1985 |
1982 } } // namespace v8::internal | 1986 } } // namespace v8::internal |
1983 | 1987 |
1984 #endif // V8_HEAP_H_ | 1988 #endif // V8_HEAP_H_ |
OLD | NEW |