| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 public: | 226 public: |
| 227 ThreadHeap(); | 227 ThreadHeap(); |
| 228 ~ThreadHeap(); | 228 ~ThreadHeap(); |
| 229 | 229 |
| 230 // Returns true for main thread's heap. | 230 // Returns true for main thread's heap. |
| 231 // TODO(keishi): Per-thread-heap will return false. | 231 // TODO(keishi): Per-thread-heap will return false. |
| 232 bool isMainThreadHeap() { return this == ThreadHeap::mainThreadHeap(); } | 232 bool isMainThreadHeap() { return this == ThreadHeap::mainThreadHeap(); } |
| 233 static ThreadHeap* mainThreadHeap() { return s_mainThreadHeap; } | 233 static ThreadHeap* mainThreadHeap() { return s_mainThreadHeap; } |
| 234 | 234 |
| 235 #if DCHECK_IS_ON() | 235 #if DCHECK_IS_ON() |
| 236 bool isAtSafePoint(); | |
| 237 BasePage* findPageFromAddress(Address); | 236 BasePage* findPageFromAddress(Address); |
| 238 #endif | 237 #endif |
| 239 | 238 |
| 240 template <typename T> | 239 template <typename T> |
| 241 static inline bool isHeapObjectAlive(const T* object) { | 240 static inline bool isHeapObjectAlive(const T* object) { |
| 242 static_assert(sizeof(T), "T must be fully defined"); | 241 static_assert(sizeof(T), "T must be fully defined"); |
| 243 // The strongification of collections relies on the fact that once a | 242 // The strongification of collections relies on the fact that once a |
| 244 // collection has been strongified, there is no way that it can contain | 243 // collection has been strongified, there is no way that it can contain |
| 245 // non-live entries, so no entries will be removed. Since you can't set | 244 // non-live entries, so no entries will be removed. Since you can't set |
| 246 // the mark bit on a null pointer, that means that null pointers are | 245 // the mark bit on a null pointer, that means that null pointers are |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 T** cell = reinterpret_cast<T**>(object); | 682 T** cell = reinterpret_cast<T**>(object); |
| 684 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) | 683 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) |
| 685 *cell = nullptr; | 684 *cell = nullptr; |
| 686 } | 685 } |
| 687 | 686 |
| 688 } // namespace blink | 687 } // namespace blink |
| 689 | 688 |
| 690 #include "platform/heap/VisitorImpl.h" | 689 #include "platform/heap/VisitorImpl.h" |
| 691 | 690 |
| 692 #endif // Heap_h | 691 #endif // Heap_h |
| OLD | NEW |