| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 static bool isLowEndDevice() { return s_isLowEndDevice; } | 113 static bool isLowEndDevice() { return s_isLowEndDevice; } |
| 114 static void increaseTotalAllocatedObjectSize(size_t delta) { atomicAdd(&s_to
talAllocatedObjectSize, static_cast<long>(delta)); } | 114 static void increaseTotalAllocatedObjectSize(size_t delta) { atomicAdd(&s_to
talAllocatedObjectSize, static_cast<long>(delta)); } |
| 115 static void decreaseTotalAllocatedObjectSize(size_t delta) { atomicSubtract(
&s_totalAllocatedObjectSize, static_cast<long>(delta)); } | 115 static void decreaseTotalAllocatedObjectSize(size_t delta) { atomicSubtract(
&s_totalAllocatedObjectSize, static_cast<long>(delta)); } |
| 116 static size_t totalAllocatedObjectSize() { return acquireLoad(&s_totalAlloca
tedObjectSize); } | 116 static size_t totalAllocatedObjectSize() { return acquireLoad(&s_totalAlloca
tedObjectSize); } |
| 117 static void increaseTotalMarkedObjectSize(size_t delta) { atomicAdd(&s_total
MarkedObjectSize, static_cast<long>(delta)); } | 117 static void increaseTotalMarkedObjectSize(size_t delta) { atomicAdd(&s_total
MarkedObjectSize, static_cast<long>(delta)); } |
| 118 static size_t totalMarkedObjectSize() { return acquireLoad(&s_totalMarkedObj
ectSize); } | 118 static size_t totalMarkedObjectSize() { return acquireLoad(&s_totalMarkedObj
ectSize); } |
| 119 static void increaseTotalAllocatedSpace(size_t delta) { atomicAdd(&s_totalAl
locatedSpace, static_cast<long>(delta)); } | 119 static void increaseTotalAllocatedSpace(size_t delta) { atomicAdd(&s_totalAl
locatedSpace, static_cast<long>(delta)); } |
| 120 static void decreaseTotalAllocatedSpace(size_t delta) { atomicSubtract(&s_to
talAllocatedSpace, static_cast<long>(delta)); } | 120 static void decreaseTotalAllocatedSpace(size_t delta) { atomicSubtract(&s_to
talAllocatedSpace, static_cast<long>(delta)); } |
| 121 static size_t totalAllocatedSpace() { return acquireLoad(&s_totalAllocatedSp
ace); } | 121 static size_t totalAllocatedSpace() { return acquireLoad(&s_totalAllocatedSp
ace); } |
| 122 static void resetHeapCounters(); |
| 122 | 123 |
| 123 private: | 124 private: |
| 124 static bool s_isLowEndDevice; | 125 static bool s_isLowEndDevice; |
| 125 static size_t s_totalAllocatedSpace; | 126 static size_t s_totalAllocatedSpace; |
| 126 static size_t s_totalAllocatedObjectSize; | 127 static size_t s_totalAllocatedObjectSize; |
| 127 static size_t s_totalMarkedObjectSize; | 128 static size_t s_totalMarkedObjectSize; |
| 128 | 129 |
| 129 friend class ThreadState; | 130 friend class ThreadState; |
| 130 }; | 131 }; |
| 131 | 132 |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) | 551 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) |
| 551 { | 552 { |
| 552 T** cell = reinterpret_cast<T**>(object); | 553 T** cell = reinterpret_cast<T**>(object); |
| 553 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) | 554 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) |
| 554 *cell = nullptr; | 555 *cell = nullptr; |
| 555 } | 556 } |
| 556 | 557 |
| 557 } // namespace blink | 558 } // namespace blink |
| 558 | 559 |
| 559 #endif // Heap_h | 560 #endif // Heap_h |
| OLD | NEW |