| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 { | 60 { |
| 61 static_assert(sizeof(T), "T must be fully defined"); | 61 static_assert(sizeof(T), "T must be fully defined"); |
| 62 return HeapObjectHeader::fromPayload(object)->isMarked(); | 62 return HeapObjectHeader::fromPayload(object)->isMarked(); |
| 63 } | 63 } |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 template<typename T> | 66 template<typename T> |
| 67 class ObjectAliveTrait<T, true> { | 67 class ObjectAliveTrait<T, true> { |
| 68 STATIC_ONLY(ObjectAliveTrait); | 68 STATIC_ONLY(ObjectAliveTrait); |
| 69 public: | 69 public: |
| 70 NO_LAZY_SWEEP_SANITIZE_ADDRESS |
| 70 static bool isHeapObjectAlive(T* object) | 71 static bool isHeapObjectAlive(T* object) |
| 71 { | 72 { |
| 72 static_assert(sizeof(T), "T must be fully defined"); | 73 static_assert(sizeof(T), "T must be fully defined"); |
| 73 return object->isHeapObjectAlive(); | 74 return object->isHeapObjectAlive(); |
| 74 } | 75 } |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 class PLATFORM_EXPORT Heap { | 78 class PLATFORM_EXPORT Heap { |
| 78 STATIC_ONLY(Heap); | 79 STATIC_ONLY(Heap); |
| 79 public: | 80 public: |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) | 497 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) |
| 497 { | 498 { |
| 498 T** cell = reinterpret_cast<T**>(object); | 499 T** cell = reinterpret_cast<T**>(object); |
| 499 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) | 500 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) |
| 500 *cell = nullptr; | 501 *cell = nullptr; |
| 501 } | 502 } |
| 502 | 503 |
| 503 } // namespace blink | 504 } // namespace blink |
| 504 | 505 |
| 505 #endif // Heap_h | 506 #endif // Heap_h |
| OLD | NEW |