OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 const GCInfo* info = s_gcInfoTable[gcInfoIndex]; | 1017 const GCInfo* info = s_gcInfoTable[gcInfoIndex]; |
1018 ASSERT(info); | 1018 ASSERT(info); |
1019 return info; | 1019 return info; |
1020 } | 1020 } |
1021 | 1021 |
1022 static void increaseAllocatedObjectSize(size_t delta) { atomicAdd(&s_allocat
edObjectSize, static_cast<long>(delta)); } | 1022 static void increaseAllocatedObjectSize(size_t delta) { atomicAdd(&s_allocat
edObjectSize, static_cast<long>(delta)); } |
1023 static void decreaseAllocatedObjectSize(size_t delta) { atomicSubtract(&s_al
locatedObjectSize, static_cast<long>(delta)); } | 1023 static void decreaseAllocatedObjectSize(size_t delta) { atomicSubtract(&s_al
locatedObjectSize, static_cast<long>(delta)); } |
1024 static size_t allocatedObjectSize() { return acquireLoad(&s_allocatedObjectS
ize); } | 1024 static size_t allocatedObjectSize() { return acquireLoad(&s_allocatedObjectS
ize); } |
1025 static void increaseMarkedObjectSize(size_t delta) { atomicAdd(&s_markedObje
ctSize, static_cast<long>(delta)); } | 1025 static void increaseMarkedObjectSize(size_t delta) { atomicAdd(&s_markedObje
ctSize, static_cast<long>(delta)); } |
1026 static size_t markedObjectSize() { return acquireLoad(&s_markedObjectSize);
} | 1026 static size_t markedObjectSize() { return acquireLoad(&s_markedObjectSize);
} |
| 1027 static void setMarkedObjectSizeAtLastCompleteSweep(size_t size) { releaseSto
re(&s_markedObjectSizeAtLastCompleteSweep, size); } |
| 1028 static size_t markedObjectSizeAtLastCompleteSweep() { return acquireLoad(&s_
markedObjectSizeAtLastCompleteSweep); } |
1027 static void increaseAllocatedSpace(size_t delta) { atomicAdd(&s_allocatedSpa
ce, static_cast<long>(delta)); } | 1029 static void increaseAllocatedSpace(size_t delta) { atomicAdd(&s_allocatedSpa
ce, static_cast<long>(delta)); } |
1028 static void decreaseAllocatedSpace(size_t delta) { atomicSubtract(&s_allocat
edSpace, static_cast<long>(delta)); } | 1030 static void decreaseAllocatedSpace(size_t delta) { atomicSubtract(&s_allocat
edSpace, static_cast<long>(delta)); } |
1029 static size_t allocatedSpace() { return acquireLoad(&s_allocatedSpace); } | 1031 static size_t allocatedSpace() { return acquireLoad(&s_allocatedSpace); } |
1030 static size_t objectSizeAtLastGC() { return acquireLoad(&s_objectSizeAtLastG
C); } | 1032 static size_t objectSizeAtLastGC() { return acquireLoad(&s_objectSizeAtLastG
C); } |
1031 static void increasePersistentCount(size_t delta) { atomicAdd(&s_persistentC
ount, static_cast<long>(delta)); } | 1033 static void increaseWrapperCount(size_t delta) { atomicAdd(&s_wrapperCount,
static_cast<long>(delta)); } |
1032 static void decreasePersistentCount(size_t delta) { atomicSubtract(&s_persis
tentCount, static_cast<long>(delta)); } | 1034 static void decreaseWrapperCount(size_t delta) { atomicSubtract(&s_wrapperCo
unt, static_cast<long>(delta)); } |
1033 static size_t persistentCount() { return acquireLoad(&s_persistentCount); } | 1035 static size_t wrapperCount() { return acquireLoad(&s_wrapperCount); } |
1034 static size_t persistentCountAtLastGC() { return acquireLoad(&s_persistentCo
untAtLastGC); } | 1036 static size_t wrapperCountAtLastGC() { return acquireLoad(&s_wrapperCountAtL
astGC); } |
1035 static void increaseCollectedPersistentCount(size_t delta) { atomicAdd(&s_co
llectedPersistentCount, static_cast<long>(delta)); } | 1037 static void increaseCollectedWrapperCount(size_t delta) { atomicAdd(&s_colle
ctedWrapperCount, static_cast<long>(delta)); } |
1036 static size_t collectedPersistentCount() { return acquireLoad(&s_collectedPe
rsistentCount); } | 1038 static size_t collectedWrapperCount() { return acquireLoad(&s_collectedWrapp
erCount); } |
1037 static size_t partitionAllocSizeAtLastGC() { return acquireLoad(&s_partition
AllocSizeAtLastGC); } | 1039 static size_t partitionAllocSizeAtLastGC() { return acquireLoad(&s_partition
AllocSizeAtLastGC); } |
1038 static size_t heapSizePerPersistent() { return acquireLoad(&s_heapSizePerPer
sistent); } | |
1039 static void setHeapSizePerPersistent(size_t size) { releaseStore(&s_heapSize
PerPersistent, size); } | |
1040 | 1040 |
1041 static double estimatedMarkingTime(); | 1041 static double estimatedMarkingTime(); |
1042 static void reportMemoryUsageHistogram(); | 1042 static void reportMemoryUsageHistogram(); |
1043 static void reportMemoryUsageForTracing(); | 1043 static void reportMemoryUsageForTracing(); |
1044 | 1044 |
1045 private: | 1045 private: |
1046 // A RegionTree is a simple binary search tree of PageMemoryRegions sorted | 1046 // A RegionTree is a simple binary search tree of PageMemoryRegions sorted |
1047 // by base addresses. | 1047 // by base addresses. |
1048 class RegionTree { | 1048 class RegionTree { |
1049 public: | 1049 public: |
(...skipping 24 matching lines...) Expand all Loading... |
1074 static CallbackStack* s_ephemeronStack; | 1074 static CallbackStack* s_ephemeronStack; |
1075 static HeapDoesNotContainCache* s_heapDoesNotContainCache; | 1075 static HeapDoesNotContainCache* s_heapDoesNotContainCache; |
1076 static bool s_shutdownCalled; | 1076 static bool s_shutdownCalled; |
1077 static FreePagePool* s_freePagePool; | 1077 static FreePagePool* s_freePagePool; |
1078 static OrphanedPagePool* s_orphanedPagePool; | 1078 static OrphanedPagePool* s_orphanedPagePool; |
1079 static RegionTree* s_regionTree; | 1079 static RegionTree* s_regionTree; |
1080 static size_t s_allocatedSpace; | 1080 static size_t s_allocatedSpace; |
1081 static size_t s_allocatedObjectSize; | 1081 static size_t s_allocatedObjectSize; |
1082 static size_t s_objectSizeAtLastGC; | 1082 static size_t s_objectSizeAtLastGC; |
1083 static size_t s_markedObjectSize; | 1083 static size_t s_markedObjectSize; |
1084 static size_t s_persistentCount; | 1084 static size_t s_markedObjectSizeAtLastCompleteSweep; |
1085 static size_t s_persistentCountAtLastGC; | 1085 static size_t s_wrapperCount; |
1086 static size_t s_collectedPersistentCount; | 1086 static size_t s_wrapperCountAtLastGC; |
| 1087 static size_t s_collectedWrapperCount; |
1087 static size_t s_partitionAllocSizeAtLastGC; | 1088 static size_t s_partitionAllocSizeAtLastGC; |
1088 static size_t s_heapSizePerPersistent; | |
1089 static double s_estimatedMarkingTimePerByte; | 1089 static double s_estimatedMarkingTimePerByte; |
1090 | 1090 |
1091 friend class ThreadState; | 1091 friend class ThreadState; |
1092 }; | 1092 }; |
1093 | 1093 |
1094 template<typename T> | 1094 template<typename T> |
1095 struct IsEagerlyFinalizedType { | 1095 struct IsEagerlyFinalizedType { |
1096 private: | 1096 private: |
1097 typedef char YesType; | 1097 typedef char YesType; |
1098 struct NoType { | 1098 struct NoType { |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 size_t copySize = previousHeader->payloadSize(); | 1392 size_t copySize = previousHeader->payloadSize(); |
1393 if (copySize > size) | 1393 if (copySize > size) |
1394 copySize = size; | 1394 copySize = size; |
1395 memcpy(address, previous, copySize); | 1395 memcpy(address, previous, copySize); |
1396 return address; | 1396 return address; |
1397 } | 1397 } |
1398 | 1398 |
1399 } // namespace blink | 1399 } // namespace blink |
1400 | 1400 |
1401 #endif // Heap_h | 1401 #endif // Heap_h |
OLD | NEW |