| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 static void decreaseWrapperCount(size_t delta) { atomicSubtract(&s_wrapperCo
unt, static_cast<long>(delta)); } | 259 static void decreaseWrapperCount(size_t delta) { atomicSubtract(&s_wrapperCo
unt, static_cast<long>(delta)); } |
| 260 static size_t wrapperCount() { return acquireLoad(&s_wrapperCount); } | 260 static size_t wrapperCount() { return acquireLoad(&s_wrapperCount); } |
| 261 static size_t wrapperCountAtLastGC() { return acquireLoad(&s_wrapperCountAtL
astGC); } | 261 static size_t wrapperCountAtLastGC() { return acquireLoad(&s_wrapperCountAtL
astGC); } |
| 262 static void increaseCollectedWrapperCount(size_t delta) { atomicAdd(&s_colle
ctedWrapperCount, static_cast<long>(delta)); } | 262 static void increaseCollectedWrapperCount(size_t delta) { atomicAdd(&s_colle
ctedWrapperCount, static_cast<long>(delta)); } |
| 263 static size_t collectedWrapperCount() { return acquireLoad(&s_collectedWrapp
erCount); } | 263 static size_t collectedWrapperCount() { return acquireLoad(&s_collectedWrapp
erCount); } |
| 264 static size_t partitionAllocSizeAtLastGC() { return acquireLoad(&s_partition
AllocSizeAtLastGC); } | 264 static size_t partitionAllocSizeAtLastGC() { return acquireLoad(&s_partition
AllocSizeAtLastGC); } |
| 265 | 265 |
| 266 static double estimatedMarkingTime(); | 266 static double estimatedMarkingTime(); |
| 267 static void reportMemoryUsageHistogram(); | 267 static void reportMemoryUsageHistogram(); |
| 268 static void reportMemoryUsageForTracing(); | 268 static void reportMemoryUsageForTracing(); |
| 269 static bool isLowEndDevice() { return s_isLowEndDevice; } |
| 269 | 270 |
| 270 #if ENABLE(ASSERT) | 271 #if ENABLE(ASSERT) |
| 271 static uint16_t gcGeneration() { return s_gcGeneration; } | 272 static uint16_t gcGeneration() { return s_gcGeneration; } |
| 272 #endif | 273 #endif |
| 273 | 274 |
| 274 private: | 275 private: |
| 275 // Reset counters that track live and allocated-since-last-GC sizes. | 276 // Reset counters that track live and allocated-since-last-GC sizes. |
| 276 static void resetHeapCounters(); | 277 static void resetHeapCounters(); |
| 277 | 278 |
| 278 static int heapIndexForObjectSize(size_t); | 279 static int heapIndexForObjectSize(size_t); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 290 static size_t s_allocatedSpace; | 291 static size_t s_allocatedSpace; |
| 291 static size_t s_allocatedObjectSize; | 292 static size_t s_allocatedObjectSize; |
| 292 static size_t s_objectSizeAtLastGC; | 293 static size_t s_objectSizeAtLastGC; |
| 293 static size_t s_markedObjectSize; | 294 static size_t s_markedObjectSize; |
| 294 static size_t s_markedObjectSizeAtLastCompleteSweep; | 295 static size_t s_markedObjectSizeAtLastCompleteSweep; |
| 295 static size_t s_wrapperCount; | 296 static size_t s_wrapperCount; |
| 296 static size_t s_wrapperCountAtLastGC; | 297 static size_t s_wrapperCountAtLastGC; |
| 297 static size_t s_collectedWrapperCount; | 298 static size_t s_collectedWrapperCount; |
| 298 static size_t s_partitionAllocSizeAtLastGC; | 299 static size_t s_partitionAllocSizeAtLastGC; |
| 299 static double s_estimatedMarkingTimePerByte; | 300 static double s_estimatedMarkingTimePerByte; |
| 301 static bool s_isLowEndDevice; |
| 300 #if ENABLE(ASSERT) | 302 #if ENABLE(ASSERT) |
| 301 static uint16_t s_gcGeneration; | 303 static uint16_t s_gcGeneration; |
| 302 #endif | 304 #endif |
| 303 | 305 |
| 304 friend class ThreadState; | 306 friend class ThreadState; |
| 305 }; | 307 }; |
| 306 | 308 |
| 307 template<typename T> | 309 template<typename T> |
| 308 struct IsEagerlyFinalizedType { | 310 struct IsEagerlyFinalizedType { |
| 309 STATIC_ONLY(IsEagerlyFinalizedType); | 311 STATIC_ONLY(IsEagerlyFinalizedType); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) | 496 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) |
| 495 { | 497 { |
| 496 T** cell = reinterpret_cast<T**>(object); | 498 T** cell = reinterpret_cast<T**>(object); |
| 497 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) | 499 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) |
| 498 *cell = nullptr; | 500 *cell = nullptr; |
| 499 } | 501 } |
| 500 | 502 |
| 501 } // namespace blink | 503 } // namespace blink |
| 502 | 504 |
| 503 #endif // Heap_h | 505 #endif // Heap_h |
| OLD | NEW |