| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 static_assert(sizeof(T), "T must be fully defined"); | 101 static_assert(sizeof(T), "T must be fully defined"); |
| 102 return object->isHeapObjectAlive(); | 102 return object->isHeapObjectAlive(); |
| 103 } | 103 } |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 class PLATFORM_EXPORT Heap { | 106 class PLATFORM_EXPORT Heap { |
| 107 STATIC_ONLY(Heap); | 107 STATIC_ONLY(Heap); |
| 108 public: | 108 public: |
| 109 static void init(); | 109 static void init(); |
| 110 static void shutdown(); | 110 static void shutdown(); |
| 111 static void doShutdown(); | |
| 112 | 111 |
| 113 static CrossThreadPersistentRegion& crossThreadPersistentRegion(); | 112 static CrossThreadPersistentRegion& crossThreadPersistentRegion(); |
| 114 | 113 |
| 115 #if ENABLE(ASSERT) | 114 #if ENABLE(ASSERT) |
| 116 static BasePage* findPageFromAddress(Address); | 115 static BasePage* findPageFromAddress(Address); |
| 117 static BasePage* findPageFromAddress(const void* pointer) { return findPageF
romAddress(reinterpret_cast<Address>(const_cast<void*>(pointer))); } | 116 static BasePage* findPageFromAddress(const void* pointer) { return findPageF
romAddress(reinterpret_cast<Address>(const_cast<void*>(pointer))); } |
| 118 #endif | 117 #endif |
| 119 | 118 |
| 120 template<typename T> | 119 template<typename T> |
| 121 static inline bool isHeapObjectAlive(T* object) | 120 static inline bool isHeapObjectAlive(T* object) |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) | 531 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) |
| 533 { | 532 { |
| 534 T** cell = reinterpret_cast<T**>(object); | 533 T** cell = reinterpret_cast<T**>(object); |
| 535 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) | 534 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) |
| 536 *cell = nullptr; | 535 *cell = nullptr; |
| 537 } | 536 } |
| 538 | 537 |
| 539 } // namespace blink | 538 } // namespace blink |
| 540 | 539 |
| 541 #endif // Heap_h | 540 #endif // Heap_h |
| OLD | NEW |