| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
| 35 #include "platform/heap/StackFrameDepth.h" | 35 #include "platform/heap/StackFrameDepth.h" |
| 36 #include "platform/heap/ThreadState.h" | 36 #include "platform/heap/ThreadState.h" |
| 37 #include "wtf/Assertions.h" | 37 #include "wtf/Assertions.h" |
| 38 #include "wtf/Atomics.h" | 38 #include "wtf/Atomics.h" |
| 39 #include "wtf/Deque.h" | 39 #include "wtf/Deque.h" |
| 40 #include "wtf/Forward.h" | 40 #include "wtf/Forward.h" |
| 41 #include "wtf/HashMap.h" | 41 #include "wtf/HashMap.h" |
| 42 #include "wtf/HashTraits.h" | 42 #include "wtf/HashTraits.h" |
| 43 #include "wtf/TypeTraits.h" |
| 44 #if ENABLE(GC_PROFILING) |
| 43 #include "wtf/InstanceCounter.h" | 45 #include "wtf/InstanceCounter.h" |
| 44 #include "wtf/OwnPtr.h" | |
| 45 #include "wtf/RefPtr.h" | |
| 46 #include "wtf/TypeTraits.h" | |
| 47 #include "wtf/WeakPtr.h" | |
| 48 #if ENABLE(GC_PROFILING) | |
| 49 #include "wtf/text/WTFString.h" | 46 #include "wtf/text/WTFString.h" |
| 50 #endif | 47 #endif |
| 51 | 48 |
| 52 #if ENABLE(ASSERT) | |
| 53 #define DEBUG_ONLY(x) x | |
| 54 #else | |
| 55 #define DEBUG_ONLY(x) | |
| 56 #endif | |
| 57 | |
| 58 namespace blink { | 49 namespace blink { |
| 59 | 50 |
| 60 template<typename T> class GarbageCollected; | 51 template<typename T> class GarbageCollected; |
| 61 template<typename T> class GarbageCollectedFinalized; | 52 template<typename T> class GarbageCollectedFinalized; |
| 62 class GarbageCollectedMixin; | 53 class GarbageCollectedMixin; |
| 63 class HeapObjectHeader; | 54 class HeapObjectHeader; |
| 64 class InlinedGlobalMarkingVisitor; | 55 class InlinedGlobalMarkingVisitor; |
| 65 template<typename T> class Member; | 56 template<typename T> class Member; |
| 66 template<typename T> class WeakMember; | 57 template<typename T> class WeakMember; |
| 67 class Visitor; | 58 class Visitor; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 bool m_nonTrivialFinalizer; | 91 bool m_nonTrivialFinalizer; |
| 101 bool m_hasVTable; | 92 bool m_hasVTable; |
| 102 #if ENABLE(GC_PROFILING) | 93 #if ENABLE(GC_PROFILING) |
| 103 // |m_className| is held as a reference to prevent dtor being called at exit
. | 94 // |m_className| is held as a reference to prevent dtor being called at exit
. |
| 104 const String& m_className; | 95 const String& m_className; |
| 105 #endif | 96 #endif |
| 106 }; | 97 }; |
| 107 | 98 |
| 108 #if ENABLE(ASSERT) | 99 #if ENABLE(ASSERT) |
| 109 PLATFORM_EXPORT void assertObjectHasGCInfo(const void*, size_t gcInfoIndex); | 100 PLATFORM_EXPORT void assertObjectHasGCInfo(const void*, size_t gcInfoIndex); |
| 110 | |
| 111 #endif | 101 #endif |
| 112 | 102 |
| 113 | |
| 114 // The FinalizerTraitImpl specifies how to finalize objects. Object | 103 // The FinalizerTraitImpl specifies how to finalize objects. Object |
| 115 // that inherit from GarbageCollectedFinalized are finalized by | 104 // that inherit from GarbageCollectedFinalized are finalized by |
| 116 // calling their 'finalize' method which by default will call the | 105 // calling their 'finalize' method which by default will call the |
| 117 // destructor on the object. | 106 // destructor on the object. |
| 118 template<typename T, bool isGarbageCollectedFinalized> | 107 template<typename T, bool isGarbageCollectedFinalized> |
| 119 struct FinalizerTraitImpl; | 108 struct FinalizerTraitImpl; |
| 120 | 109 |
| 121 template<typename T> | 110 template<typename T> |
| 122 struct FinalizerTraitImpl<T, true> { | 111 struct FinalizerTraitImpl<T, true> { |
| 123 static void finalize(void* obj) { static_cast<T*>(obj)->finalizeGarbageColle
ctedObject(); }; | 112 static void finalize(void* obj) { static_cast<T*>(obj)->finalizeGarbageColle
ctedObject(); }; |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 }; | 1002 }; |
| 1014 | 1003 |
| 1015 template<typename T> | 1004 template<typename T> |
| 1016 struct GCInfoTrait { | 1005 struct GCInfoTrait { |
| 1017 static size_t index() | 1006 static size_t index() |
| 1018 { | 1007 { |
| 1019 return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::index(); | 1008 return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::index(); |
| 1020 } | 1009 } |
| 1021 }; | 1010 }; |
| 1022 | 1011 |
| 1023 } | 1012 } // namespace blink |
| 1024 | 1013 |
| 1025 #endif | 1014 #endif // Visitor_h |
| OLD | NEW |