| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef TraceTraits_h | 5 #ifndef TraceTraits_h |
| 6 #define TraceTraits_h | 6 #define TraceTraits_h |
| 7 | 7 |
| 8 #include "platform/heap/GCInfo.h" | 8 #include "platform/heap/GCInfo.h" |
| 9 #include "platform/heap/Heap.h" | 9 #include "platform/heap/Heap.h" |
| 10 #include "platform/heap/StackFrameDepth.h" | 10 #include "platform/heap/StackFrameDepth.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 } | 234 } |
| 235 | 235 |
| 236 template <typename T> | 236 template <typename T> |
| 237 void TraceTrait<T>::traceMarkedWrapper(const WrapperVisitor* visitor, | 237 void TraceTrait<T>::traceMarkedWrapper(const WrapperVisitor* visitor, |
| 238 const void* t) { | 238 const void* t) { |
| 239 const T* traceable = ToWrapperTracingType(t); | 239 const T* traceable = ToWrapperTracingType(t); |
| 240 DCHECK(heapObjectHeader(t)->isWrapperHeaderMarked()); | 240 DCHECK(heapObjectHeader(t)->isWrapperHeaderMarked()); |
| 241 // The term *mark* is misleading here as we effectively trace through the | 241 // The term *mark* is misleading here as we effectively trace through the |
| 242 // API boundary, i.e., tell V8 that an object is alive. Actual marking | 242 // API boundary, i.e., tell V8 that an object is alive. Actual marking |
| 243 // will be done in V8. | 243 // will be done in V8. |
| 244 visitor->markWrappersInAllWorlds(traceable); | 244 traceable->markAndDispatchTraceWrappers(visitor); |
| 245 visitor->dispatchTraceWrappers(traceable); | |
| 246 } | 245 } |
| 247 | 246 |
| 248 template <typename T> | 247 template <typename T> |
| 249 HeapObjectHeader* TraceTrait<T>::heapObjectHeader(const void* t) { | 248 HeapObjectHeader* TraceTrait<T>::heapObjectHeader(const void* t) { |
| 250 return HeapObjectHeader::fromPayload(ToWrapperTracingType(t)); | 249 return HeapObjectHeader::fromPayload(ToWrapperTracingType(t)); |
| 251 } | 250 } |
| 252 | 251 |
| 253 template <typename T, typename Traits> | 252 template <typename T, typename Traits> |
| 254 struct TraceTrait<HeapVectorBacking<T, Traits>> { | 253 struct TraceTrait<HeapVectorBacking<T, Traits>> { |
| 255 STATIC_ONLY(TraceTrait); | 254 STATIC_ONLY(TraceTrait); |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 // since iterating over the hash table backing will find the whole | 783 // since iterating over the hash table backing will find the whole |
| 785 // chain. | 784 // chain. |
| 786 visitor->markNoTracing(node); | 785 visitor->markNoTracing(node); |
| 787 return false; | 786 return false; |
| 788 } | 787 } |
| 789 }; | 788 }; |
| 790 | 789 |
| 791 } // namespace WTF | 790 } // namespace WTF |
| 792 | 791 |
| 793 #endif | 792 #endif |
| OLD | NEW |