Changeset 147962 in webkit
- Timestamp:
- Apr 8, 2013 4:41:02 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 added
- 43 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
r140718 r147962 33 33 #include "JSWeakObjectMapRefInternal.h" 34 34 #include "Operations.h" 35 #include "Weak.h" 35 36 #include <wtf/HashMap.h> 36 37 #include <wtf/text/StringHash.h> -
trunk/Source/JavaScriptCore/ChangeLog
r147950 r147962 1 2013-04-08 Geoffrey Garen <ggaren@apple.com> 2 3 Stop #include-ing all of JavaScriptCore in every DOM-related file 4 https://bugs.webkit.org/show_bug.cgi?id=114220 5 6 Reviewed by Sam Weinig. 7 8 I separated WeakInlines.h from Weak.h so WebCore data types that need 9 to declare a Weak<T> data member don't have to #include all of the 10 infrastructure for accessing that data member. 11 12 This also required separating Weak<T> from PassWeak<T> by removing the 13 WeakImplAccessor class template and pushing code down into its subclasses. 14 15 * API/JSWeakObjectMapRefPrivate.cpp: 16 * JavaScriptCore.xcodeproj/project.pbxproj: 17 * bytecode/UnlinkedCodeBlock.h: 18 * heap/PassWeak.h: 19 (JSC): 20 (PassWeak): 21 (JSC::::PassWeak): 22 (JSC::::operator): 23 (JSC::::get): 24 * heap/SlotVisitorInlines.h: 25 * heap/Weak.h: 26 (JSC): 27 (Weak): 28 * heap/WeakInlines.h: Copied from Source/JavaScriptCore/heap/Weak.h. 29 (JSC): 30 (JSC::::Weak): 31 (JSC::::operator): 32 (JSC::::get): 33 (JSC::::was): 34 (JSC::weakClear): 35 * jit/JITThunks.h: 36 * runtime/RegExpCache.h: 37 * runtime/Structure.h: 38 * runtime/WeakGCMap.h: 39 1 40 2013-04-05 Roger Fong <roger_fong@apple.com> 2 41 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r147324 r147962 492 492 14BD5A300A3E91F600BAF59C /* JSContextRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A290A3E91F600BAF59C /* JSContextRef.cpp */; }; 493 493 14BD5A320A3E91F600BAF59C /* JSValueRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */; }; 494 14BE7D3317135CF400D1807A /* WeakInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BE7D3217135CF400D1807A /* WeakInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 494 495 14BFCE6910CDB1FC00364CCE /* WeakGCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; 495 496 14C5242B0F5355E900BA3D04 /* JITStubs.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A6581A0F4E36F4000150FD /* JITStubs.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1354 1355 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSValueRef.cpp; sourceTree = "<group>"; }; 1355 1356 14BD5A2D0A3E91F600BAF59C /* testapi.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testapi.c; path = API/tests/testapi.c; sourceTree = "<group>"; }; 1357 14BE7D3217135CF400D1807A /* WeakInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakInlines.h; sourceTree = "<group>"; }; 1356 1358 14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakGCMap.h; sourceTree = "<group>"; }; 1357 1359 14CA958A16AB50DE00938A06 /* StaticPropertyAnalyzer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticPropertyAnalyzer.h; sourceTree = "<group>"; }; … … 2114 2116 C21122DF15DD9AB300790E3A /* GCThreadSharedData.h */, 2115 2117 142E312B134FF0A600AFADB5 /* Handle.h */, 2118 C28318FF16FE4B7D00157BFD /* HandleBlock.h */, 2119 C283190116FE533E00157BFD /* HandleBlockInlines.h */, 2116 2120 142E312C134FF0A600AFADB5 /* HandleSet.cpp */, 2117 2121 142E312D134FF0A600AFADB5 /* HandleSet.h */, … … 2147 2151 C21122E015DD9AB300790E3A /* MarkStackInlines.h */, 2148 2152 1497209014EB831500FEB1B7 /* PassWeak.h */, 2153 C20B25981706536200C21F4E /* Region.h */, 2149 2154 C225494215F7DBAA0065E898 /* SlotVisitor.cpp */, 2150 2155 14BA78F013AAB88F005B7C2C /* SlotVisitor.h */, … … 2152 2157 142E3132134FF0A600AFADB5 /* Strong.h */, 2153 2158 145722851437E140005FDE26 /* StrongInlines.h */, 2159 C2DF442D1707AC0100A5CA96 /* SuperRegion.cpp */, 2160 C2DF442E1707AC0100A5CA96 /* SuperRegion.h */, 2154 2161 141448CC13A1783700F5BA1A /* TinyBloomFilter.h */, 2155 2162 0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */, … … 2162 2169 14F7256414EE265E00B1652B /* WeakHandleOwner.h */, 2163 2170 14E84F9D14EE1ACC00D6D5D4 /* WeakImpl.h */, 2171 14BE7D3217135CF400D1807A /* WeakInlines.h */, 2164 2172 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */, 2165 2173 14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */, … … 2168 2176 0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */, 2169 2177 0FC8150914043BD200CFA603 /* WriteBarrierSupport.h */, 2170 C28318FF16FE4B7D00157BFD /* HandleBlock.h */,2171 C283190116FE533E00157BFD /* HandleBlockInlines.h */,2172 C20B25981706536200C21F4E /* Region.h */,2173 C2DF442D1707AC0100A5CA96 /* SuperRegion.cpp */,2174 C2DF442E1707AC0100A5CA96 /* SuperRegion.h */,2175 2178 ); 2176 2179 path = heap; … … 3309 3312 0FF729BD166AD360000F5BA3 /* ProfilerDatabase.h in Headers */, 3310 3313 0FF729BE166AD360000F5BA3 /* ProfilerExecutionCounter.h in Headers */, 3314 14BE7D3317135CF400D1807A /* WeakInlines.h in Headers */, 3311 3315 0FF729BF166AD360000F5BA3 /* ProfilerOrigin.h in Headers */, 3312 3316 0FF729C0166AD360000F5BA3 /* ProfilerOriginStack.h in Headers */, -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
r147892 r147962 39 39 #include "SpecialPointer.h" 40 40 #include "SymbolTable.h" 41 #include "Weak.h"42 41 43 42 #include <wtf/RefCountedArray.h> -
trunk/Source/JavaScriptCore/heap/PassWeak.h
r118483 r147962 1 1 /* 2 * Copyright (C) 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 35 35 namespace JSC { 36 36 37 template<typename T> class Weak;38 37 template<typename T> class PassWeak; 39 38 template<typename T> PassWeak<T> adoptWeak(WeakImpl*); 40 39 41 template<typename Base, typename T> class WeakImplAccessor{40 template<typename T> class PassWeak { 42 41 public: 43 typedef T* GetType;44 45 T* operator->() const;46 T& operator*() const;47 GetType get() const;48 49 bool was(GetType) const;50 };51 52 template<typename T> class PassWeak : public WeakImplAccessor<PassWeak<T>, T> {53 public:54 friend class WeakImplAccessor<PassWeak<T>, T>;55 typedef typename WeakImplAccessor<PassWeak<T>, T>::GetType GetType;56 57 42 PassWeak(); 58 43 PassWeak(std::nullptr_t); 59 PassWeak( GetType, WeakHandleOwner* = 0, void* context = 0);44 PassWeak(T*, WeakHandleOwner* = 0, void* context = 0); 60 45 61 46 // It somewhat breaks the type system to allow transfer of ownership out of … … 67 52 ~PassWeak(); 68 53 54 T* operator->() const; 55 T& operator*() const; 56 T* get() const; 57 69 58 bool operator!() const; 70 59 71 60 // This conversion operator allows implicit conversion to bool but not to other integer types. 72 typedef JSValue(PassWeak::*UnspecifiedBoolType);61 typedef void* (PassWeak::*UnspecifiedBoolType); 73 62 operator UnspecifiedBoolType*() const; 74 63 … … 82 71 }; 83 72 84 template<typename Base, typename T> inline T* WeakImplAccessor<Base, T>::operator->() const85 {86 ASSERT(static_cast<const Base*>(this)->m_impl && static_cast<const Base*>(this)->m_impl->state() == WeakImpl::Live);87 return jsCast<T*>(static_cast<const Base*>(this)->m_impl->jsValue().asCell());88 }89 90 template<typename Base, typename T> inline T& WeakImplAccessor<Base, T>::operator*() const91 {92 ASSERT(static_cast<const Base*>(this)->m_impl && static_cast<const Base*>(this)->m_impl->state() == WeakImpl::Live);93 return *jsCast<T*>(static_cast<const Base*>(this)->m_impl->jsValue().asCell());94 }95 96 template<typename Base, typename T> inline typename WeakImplAccessor<Base, T>::GetType WeakImplAccessor<Base, T>::get() const97 {98 if (!static_cast<const Base*>(this)->m_impl || static_cast<const Base*>(this)->m_impl->state() != WeakImpl::Live)99 return GetType();100 return jsCast<T*>(static_cast<const Base*>(this)->m_impl->jsValue().asCell());101 }102 103 template<typename Base, typename T> inline bool WeakImplAccessor<Base, T>::was(typename WeakImplAccessor<Base, T>::GetType other) const104 {105 return jsCast<T*>(static_cast<const Base*>(this)->m_impl->jsValue().asCell()) == other;106 }107 108 73 template<typename T> inline PassWeak<T>::PassWeak() 109 74 : m_impl(0) … … 116 81 } 117 82 118 template<typename T> inline PassWeak<T>::PassWeak( typename PassWeak<T>::GetType getType, WeakHandleOwner* weakOwner, void* context)119 : m_impl( getType ? WeakSet::allocate(getType, weakOwner, context) : 0)83 template<typename T> inline PassWeak<T>::PassWeak(T* cell, WeakHandleOwner* weakOwner, void* context) 84 : m_impl(cell ? WeakSet::allocate(cell, weakOwner, context) : 0) 120 85 { 121 86 } … … 138 103 } 139 104 105 template<typename T> inline T* PassWeak<T>::operator->() const 106 { 107 ASSERT(m_impl && m_impl->state() == WeakImpl::Live); 108 return jsCast<T*>(m_impl->jsValue().asCell()); 109 } 110 111 template<typename T> inline T& PassWeak<T>::operator*() const 112 { 113 ASSERT(m_impl && m_impl->state() == WeakImpl::Live); 114 return *jsCast<T*>(m_impl->jsValue().asCell()); 115 } 116 117 template<typename T> inline T* PassWeak<T>::get() const 118 { 119 if (!m_impl || m_impl->state() != WeakImpl::Live) 120 return 0; 121 return jsCast<T*>(m_impl->jsValue().asCell()); 122 } 123 140 124 template<typename T> inline bool PassWeak<T>::operator!() const 141 125 { -
trunk/Source/JavaScriptCore/heap/SlotVisitorInlines.h
r146558 r147962 32 32 #include "SlotVisitor.h" 33 33 #include "Weak.h" 34 #include "WeakInlines.h" 34 35 35 36 namespace JSC { -
trunk/Source/JavaScriptCore/heap/Weak.h
r140194 r147962 1 1 /* 2 * Copyright (C) 2009, 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #define Weak_h 28 28 29 #include "PassWeak.h" 30 #include "WeakSetInlines.h" 31 #include <wtf/Assertions.h> 32 #include <wtf/HashMap.h> 29 #include <wtf/Noncopyable.h> 30 #include <wtf/NullPtr.h> 33 31 34 32 namespace JSC { 35 33 36 template<typename T> class Weak : public WeakImplAccessor<Weak<T>, T> { 34 template<typename T> class PassWeak; 35 class WeakImpl; 36 class WeakHandleOwner; 37 38 template<typename T> class Weak { 37 39 WTF_MAKE_NONCOPYABLE(Weak); 38 40 public: 39 friend class WeakImplAccessor<Weak<T>, T>;40 typedef typename WeakImplAccessor<Weak<T>, T>::GetType GetType;41 42 41 Weak(); 43 42 explicit Weak(std::nullptr_t); 44 explicit Weak( GetType, WeakHandleOwner* = 0, void* context = 0);43 explicit Weak(T*, WeakHandleOwner* = 0, void* context = 0); 45 44 46 45 enum HashTableDeletedValueTag { HashTableDeletedValue }; … … 56 55 57 56 bool operator!() const; 57 T* operator->() const; 58 T& operator*() const; 59 T* get() const; 60 61 bool was(T*) const; 58 62 59 63 // This conversion operator allows implicit conversion to bool but not to other integer types. 60 typedef JSValue (HandleBase::*UnspecifiedBoolType);64 typedef void* (Weak::*UnspecifiedBoolType); 61 65 operator UnspecifiedBoolType*() const; 62 66 … … 70 74 }; 71 75 72 template<typename T> inline Weak<T>::Weak()73 : m_impl(0)74 {75 }76 77 template<typename T> inline Weak<T>::Weak(std::nullptr_t)78 : m_impl(0)79 {80 }81 82 template<typename T> inline Weak<T>::Weak(typename Weak<T>::GetType getType, WeakHandleOwner* weakOwner, void* context)83 : m_impl(getType ? WeakSet::allocate(getType, weakOwner, context) : 0)84 {85 }86 87 template<typename T> inline bool Weak<T>::isHashTableDeletedValue() const88 {89 return m_impl == hashTableDeletedValue();90 }91 92 template<typename T> inline Weak<T>::Weak(typename Weak<T>::HashTableDeletedValueTag)93 : m_impl(hashTableDeletedValue())94 {95 }96 97 template<typename T> template<typename U> inline Weak<T>::Weak(const PassWeak<U>& other)98 : m_impl(other.leakImpl())99 {100 }101 102 template<typename T> inline Weak<T>::~Weak()103 {104 clear();105 }106 107 template<class T> inline void swap(Weak<T>& a, Weak<T>& b)108 {109 a.swap(b);110 }111 112 template<typename T> inline void Weak<T>::swap(Weak& other)113 {114 std::swap(m_impl, other.m_impl);115 }116 117 template<typename T> inline Weak<T>& Weak<T>::operator=(const PassWeak<T>& o)118 {119 clear();120 m_impl = o.leakImpl();121 return *this;122 }123 124 template<typename T> inline bool Weak<T>::operator!() const125 {126 return !m_impl || !m_impl->jsValue() || m_impl->state() != WeakImpl::Live;127 }128 129 template<typename T> inline Weak<T>::operator UnspecifiedBoolType*() const130 {131 return reinterpret_cast<UnspecifiedBoolType*>(!!*this);132 }133 134 template<typename T> inline PassWeak<T> Weak<T>::release()135 {136 PassWeak<T> tmp = adoptWeak<T>(m_impl);137 m_impl = 0;138 return tmp;139 }140 141 template<typename T> inline void Weak<T>::clear()142 {143 if (!m_impl)144 return;145 WeakSet::deallocate(m_impl);146 m_impl = 0;147 }148 149 template<typename T> inline WeakImpl* Weak<T>::hashTableDeletedValue()150 {151 return reinterpret_cast<WeakImpl*>(-1);152 }153 154 template <typename T> inline bool operator==(const Weak<T>& lhs, const Weak<T>& rhs)155 {156 return lhs.get() == rhs.get();157 }158 159 // This function helps avoid modifying a weak table while holding an iterator into it. (Object allocation160 // can run a finalizer that modifies the table. We avoid that by requiring a pre-constructed object as our value.)161 template<typename Map, typename Key, typename Value> inline void weakAdd(Map& map, const Key& key, Value value)162 {163 ASSERT(!map.get(key));164 map.set(key, value); // The table may still have a zombie for value.165 }166 167 template<typename Map, typename Key, typename Value> inline void weakRemove(Map& map, const Key& key, Value value)168 {169 typename Map::iterator it = map.find(key);170 ASSERT_UNUSED(value, value);171 ASSERT(it != map.end());172 ASSERT(it->value.was(value));173 ASSERT(!it->value);174 map.remove(it);175 }176 177 template<typename T> inline void weakClear(Weak<T>& weak, typename Weak<T>::GetType value)178 {179 ASSERT_UNUSED(value, value);180 ASSERT(weak.was(value));181 ASSERT(!weak);182 weak.clear();183 }184 185 76 } // namespace JSC 186 77 187 namespace WTF {188 189 template<typename T> struct VectorTraits<JSC::Weak<T> > : SimpleClassVectorTraits {190 static const bool canCompareWithMemcmp = false;191 };192 193 template<typename T> struct HashTraits<JSC::Weak<T> > : SimpleClassHashTraits<JSC::Weak<T> > {194 typedef JSC::Weak<T> StorageType;195 196 typedef std::nullptr_t EmptyValueType;197 static EmptyValueType emptyValue() { return nullptr; }198 199 typedef JSC::PassWeak<T> PassInType;200 static void store(PassInType value, StorageType& storage) { storage = value; }201 202 typedef JSC::PassWeak<T> PassOutType;203 static PassOutType passOut(StorageType& value) { return value.release(); }204 static PassOutType passOut(EmptyValueType) { return PassOutType(); }205 206 typedef typename StorageType::GetType PeekType;207 static PeekType peek(const StorageType& value) { return value.get(); }208 static PeekType peek(EmptyValueType) { return PeekType(); }209 };210 211 }212 213 78 #endif // Weak_h -
trunk/Source/JavaScriptCore/heap/WeakInlines.h
r147938 r147962 1 1 /* 2 * Copyright (C) 2009, 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef Weak _h27 #define Weak _h26 #ifndef WeakInlines_h 27 #define WeakInlines_h 28 28 29 29 #include "PassWeak.h" 30 30 #include "WeakSetInlines.h" 31 31 #include <wtf/Assertions.h> 32 #include <wtf/Hash Map.h>32 #include <wtf/HashTraits.h> 33 33 34 34 namespace JSC { 35 36 template<typename T> class Weak : public WeakImplAccessor<Weak<T>, T> {37 WTF_MAKE_NONCOPYABLE(Weak);38 public:39 friend class WeakImplAccessor<Weak<T>, T>;40 typedef typename WeakImplAccessor<Weak<T>, T>::GetType GetType;41 42 Weak();43 explicit Weak(std::nullptr_t);44 explicit Weak(GetType, WeakHandleOwner* = 0, void* context = 0);45 46 enum HashTableDeletedValueTag { HashTableDeletedValue };47 bool isHashTableDeletedValue() const;48 Weak(HashTableDeletedValueTag);49 50 template<typename U> Weak(const PassWeak<U>&);51 52 ~Weak();53 54 void swap(Weak&);55 Weak& operator=(const PassWeak<T>&);56 57 bool operator!() const;58 59 // This conversion operator allows implicit conversion to bool but not to other integer types.60 typedef JSValue (HandleBase::*UnspecifiedBoolType);61 operator UnspecifiedBoolType*() const;62 63 PassWeak<T> release();64 void clear();65 66 private:67 static WeakImpl* hashTableDeletedValue();68 69 WeakImpl* m_impl;70 };71 35 72 36 template<typename T> inline Weak<T>::Weak() … … 80 44 } 81 45 82 template<typename T> inline Weak<T>::Weak( typename Weak<T>::GetType getType, WeakHandleOwner* weakOwner, void* context)83 : m_impl( getType ? WeakSet::allocate(getType, weakOwner, context) : 0)46 template<typename T> inline Weak<T>::Weak(T* cell, WeakHandleOwner* weakOwner, void* context) 47 : m_impl(cell ? WeakSet::allocate(cell, weakOwner, context) : 0) 84 48 { 85 49 } … … 120 84 m_impl = o.leakImpl(); 121 85 return *this; 86 } 87 88 template<typename T> inline T* Weak<T>::operator->() const 89 { 90 ASSERT(m_impl && m_impl->state() == WeakImpl::Live); 91 return jsCast<T*>(m_impl->jsValue().asCell()); 92 } 93 94 template<typename T> inline T& Weak<T>::operator*() const 95 { 96 ASSERT(m_impl && m_impl->state() == WeakImpl::Live); 97 return *jsCast<T*>(m_impl->jsValue().asCell()); 98 } 99 100 template<typename T> inline T* Weak<T>::get() const 101 { 102 if (!m_impl || m_impl->state() != WeakImpl::Live) 103 return 0; 104 return jsCast<T*>(m_impl->jsValue().asCell()); 105 } 106 107 template<typename T> inline bool Weak<T>::was(T* other) const 108 { 109 return jsCast<T*>(m_impl->jsValue().asCell()) == other; 122 110 } 123 111 … … 175 163 } 176 164 177 template<typename T> inline void weakClear(Weak<T>& weak, typename Weak<T>::GetType value)178 { 179 ASSERT_UNUSED( value, value);180 ASSERT(weak.was( value));165 template<typename T> inline void weakClear(Weak<T>& weak, T* cell) 166 { 167 ASSERT_UNUSED(cell, cell); 168 ASSERT(weak.was(cell)); 181 169 ASSERT(!weak); 182 170 weak.clear(); … … 204 192 static PassOutType passOut(EmptyValueType) { return PassOutType(); } 205 193 206 typedef typename StorageType::GetTypePeekType;194 typedef T* PeekType; 207 195 static PeekType peek(const StorageType& value) { return value.get(); } 208 196 static PeekType peek(EmptyValueType) { return PeekType(); } 209 197 }; 210 198 211 } 212 213 #endif // Weak _h199 } // namespace WTF 200 201 #endif // WeakInlines_h -
trunk/Source/JavaScriptCore/jit/JITThunks.h
r139541 r147962 37 37 #include "ThunkGenerator.h" 38 38 #include "Weak.h" 39 #include "WeakInlines.h" 39 40 #include <wtf/HashMap.h> 40 41 #include <wtf/OwnPtr.h> -
trunk/Source/JavaScriptCore/runtime/RegExpCache.h
r127191 r147962 30 30 #include "Strong.h" 31 31 #include "Weak.h" 32 #include "WeakInlines.h" 32 33 #include <wtf/FixedArray.h> 33 34 #include <wtf/HashMap.h> -
trunk/Source/JavaScriptCore/runtime/Structure.h
r145945 r147962 40 40 #include "JSTypeInfo.h" 41 41 #include "Watchpoint.h" 42 #include "Weak.h"43 42 #include <wtf/PassRefPtr.h> 44 43 #include <wtf/RefCounted.h> -
trunk/Source/JavaScriptCore/runtime/WeakGCMap.h
r140284 r147962 27 27 #define WeakGCMap_h 28 28 29 #include "Weak.h" 29 #include <heap/Weak.h> 30 #include <heap/WeakInlines.h> 30 31 #include <wtf/HashMap.h> 31 32 -
trunk/Source/WebCore/ChangeLog
r147958 r147962 1 2013-04-08 Geoffrey Garen <ggaren@apple.com> 2 3 Stop #include-ing all of JavaScriptCore in every DOM-related file 4 https://bugs.webkit.org/show_bug.cgi?id=114220 5 6 Reviewed by Sam Weinig. 7 8 I separated ScriptWrappableInlines.h from ScriptWrappable.h so 9 WebCore data types that inherit from ScriptWrappable don't 10 have to #include all of the infrastructure for accessing that data member. 11 12 * ForwardingHeaders/heap/PassWeak.h: Added. 13 * ForwardingHeaders/heap/WeakInlines.h: Added. 14 * WebCore.xcodeproj/project.pbxproj: 15 * bindings/js/DOMWrapperWorld.h: 16 * bindings/js/JSDOMBinding.h: 17 (JSC): 18 * bindings/js/JSEventListener.h: 19 * bindings/js/JSMutationCallback.cpp: 20 * bindings/js/JSNodeFilterCondition.h: 21 * bindings/js/ScriptWrappable.h: 22 (JSC): 23 (WebCore): 24 (ScriptWrappable): 25 * bindings/js/ScriptWrappableInlines.h: Added. 26 (WebCore): 27 (WebCore::ScriptWrappable::wrapper): 28 (WebCore::ScriptWrappable::setWrapper): 29 (WebCore::ScriptWrappable::clearWrapper): 30 * bridge/qt/qt_instance.h: 31 * bridge/qt/qt_runtime.h: 32 * bridge/runtime_root.cpp: 33 * bridge/runtime_root.h: 34 * css/StylePropertySet.cpp: 35 * dom/LiveNodeList.cpp: 36 (WebCore::LiveNodeListBase::reportMemoryUsage): 37 * dom/Node.cpp: 38 (WebCore::Node::reportMemoryUsage): 39 * inspector/InspectorDebuggerAgent.cpp: 40 * inspector/NetworkResourcesData.cpp: 41 * loader/cache/CachedSVGDocument.cpp: 42 * xml/XMLHttpRequest.cpp: 43 (WebCore::XMLHttpRequest::reportMemoryUsage): 44 1 45 2013-04-08 Tiancheng Jiang <tijiang@rim.com> 2 46 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r147921 r147962 303 303 1059459F15B42B1A004D37FD /* JSPropertyNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1059459E15B42B1A004D37FD /* JSPropertyNodeList.h */; }; 304 304 10FB084B14E15C7E00A3DB98 /* PublicURLManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */; }; 305 1400D7A817136EA70077CE05 /* ScriptWrappableInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 305 306 1402645E0AFDC19B005919E2 /* LoggingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1402645D0AFDC19B005919E2 /* LoggingMac.mm */; }; 306 307 1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1403B99509EB13AF00797C7F /* DOMWindow.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 6531 6532 1059459E15B42B1A004D37FD /* JSPropertyNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPropertyNodeList.h; sourceTree = "<group>"; }; 6532 6533 10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PublicURLManager.h; sourceTree = "<group>"; }; 6534 1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappableInlines.h; sourceTree = "<group>"; }; 6533 6535 1402645D0AFDC19B005919E2 /* LoggingMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = LoggingMac.mm; sourceTree = "<group>"; }; 6534 6536 1403B90C09EB124500797C7F /* DOMWindow.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindow.idl; sourceTree = "<group>"; }; … … 18732 18734 934CC0E00ED39D6F00A658F2 /* ScriptValue.h */, 18733 18735 228C284410D82500009D0D0E /* ScriptWrappable.h */, 18736 1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */, 18734 18737 A75E497510752ACB00C9B896 /* SerializedScriptValue.cpp */, 18735 18738 A75E497410752ACB00C9B896 /* SerializedScriptValue.h */, … … 23901 23904 6E47E66110B7944B00B186C8 /* WebGLGetInfo.h in Headers */, 23902 23905 49FFBF3F11C93EE3006A7118 /* WebGLLayer.h in Headers */, 23906 1400D7A817136EA70077CE05 /* ScriptWrappableInlines.h in Headers */, 23903 23907 93F1D5BB12D532C400832BEC /* WebGLLoseContext.h in Headers */, 23904 23908 49C7B9D51042D32F0009D447 /* WebGLObject.h in Headers */, -
trunk/Source/WebCore/bindings/js/DOMWrapperWorld.h
r140194 r147962 24 24 25 25 #include "JSDOMGlobalObject.h" 26 #include <heap/Weak.h>27 26 #include <runtime/WeakGCMap.h> 28 27 #include <wtf/Forward.h> -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r146430 r147962 31 31 #include "Document.h" 32 32 #include "ScriptWrappable.h" 33 #include "ScriptWrappableInlines.h" 33 34 #include <heap/SlotVisitor.h> 34 35 #include <heap/Weak.h> 36 #include <heap/WeakInlines.h> 35 37 #include <runtime/Error.h> 36 38 #include <runtime/FunctionPrototype.h> … … 45 47 46 48 namespace JSC { 47 48 49 class HashEntry; 49 50 50 } 51 51 -
trunk/Source/WebCore/bindings/js/JSEventListener.h
r134697 r147962 23 23 #include "EventListener.h" 24 24 #include "JSDOMWindow.h" 25 #include <heap/PassWeak.h> 25 26 #include <heap/StrongInlines.h> 26 27 #include <heap/Weak.h> 28 #include <heap/WeakInlines.h> 27 29 28 30 namespace WebCore { -
trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp
r145379 r147962 33 33 #include "JSMutationRecord.h" 34 34 #include "ScriptExecutionContext.h" 35 #include <heap/WeakInlines.h> 35 36 #include <runtime/JSLock.h> 36 37 -
trunk/Source/WebCore/bindings/js/JSNodeFilterCondition.h
r140718 r147962 23 23 #include "NodeFilterCondition.h" 24 24 #include <heap/Weak.h> 25 #include <heap/WeakInlines.h> 25 26 #include <runtime/JSCJSValue.h> 26 27 #include <runtime/Operations.h> -
trunk/Source/WebCore/bindings/js/ScriptWrappable.h
r141570 r147962 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved. 2 3 * Copyright (c) 2010, Google Inc. All rights reserved. 3 4 * … … 32 33 #define ScriptWrappable_h 33 34 34 #include "JSDOMWrapper.h"35 #include "WebCoreMemoryInstrumentation.h"36 35 #include <heap/Weak.h> 37 #include <runtime/Operations.h> 36 37 namespace JSC { 38 class JSGlobalData; 39 class WeakHandleOwner; 40 } 38 41 39 42 namespace WebCore { 40 43 44 class JSDOMWrapper; 45 41 46 class ScriptWrappable { 42 47 public: 43 JSDOMWrapper* wrapper() const 44 { 45 return m_wrapper.get(); 46 } 47 48 void setWrapper(JSC::JSGlobalData&, JSDOMWrapper* wrapper, JSC::WeakHandleOwner* wrapperOwner, void* context) 49 { 50 ASSERT(!m_wrapper); 51 m_wrapper = JSC::PassWeak<JSDOMWrapper>(wrapper, wrapperOwner, context); 52 } 53 54 void clearWrapper(JSDOMWrapper* wrapper) 55 { 56 weakClear(m_wrapper, wrapper); 57 } 58 59 void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 60 { 61 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); 62 info.addMember(m_wrapper, "wrapper"); 63 } 48 JSDOMWrapper* wrapper() const; 49 void setWrapper(JSC::JSGlobalData&, JSDOMWrapper*, JSC::WeakHandleOwner*, void*); 50 void clearWrapper(JSDOMWrapper*); 64 51 65 52 private: -
trunk/Source/WebCore/bridge/qt/qt_instance.h
r129647 r147962 24 24 #include "JSWeakObjectMapRefPrivate.h" 25 25 #include "Weak.h" 26 #include "WeakInlines.h" 26 27 #include "runtime_root.h" 27 28 #include <QPointer> -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r127238 r147962 25 25 #include "JavaScript.h" 26 26 #include "Weak.h" 27 #include "WeakInlines.h" 27 28 #include "qt_instance.h" 28 29 #include "runtime_method.h" -
trunk/Source/WebCore/bridge/runtime_root.cpp
r130612 r147962 31 31 #include <heap/StrongInlines.h> 32 32 #include <heap/Weak.h> 33 #include <heap/WeakInlines.h> 33 34 #include <runtime/JSGlobalObject.h> 34 35 #include <wtf/HashCountedSet.h> -
trunk/Source/WebCore/bridge/runtime_root.h
r129964 r147962 29 29 #include <heap/Strong.h> 30 30 #include <heap/Weak.h> 31 #include <heap/WeakInlines.h> 31 32 #include <wtf/Forward.h> 32 33 #include <wtf/HashCountedSet.h> -
trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.h
r147751 r147962 29 29 #include "CSSStyleDeclaration.h" 30 30 #include <wtf/HashMap.h> 31 #include <wtf/OwnPtr.h> 32 #include <wtf/RefPtr.h> 31 33 32 34 namespace WebCore { -
trunk/Source/WebCore/css/StylePropertySet.cpp
r145029 r147962 31 31 #include "StylePropertyShorthand.h" 32 32 #include "StyleSheetContents.h" 33 #include "WebCoreMemoryInstrumentation.h" 33 34 #include <wtf/BitArray.h> 34 35 #include <wtf/MemoryInstrumentationVector.h> -
trunk/Source/WebCore/css/WebKitCSSMatrix.cpp
r142810 r147962 31 31 #include "CSSValueKeywords.h" 32 32 #include "ExceptionCode.h" 33 #include "ScriptWrappableInlines.h" 33 34 #include "StylePropertySet.h" 34 35 #include "StyleResolver.h" -
trunk/Source/WebCore/dom/ClientRect.cpp
r95901 r147962 28 28 #include "ClientRect.h" 29 29 30 #include "ScriptWrappableInlines.h" 31 30 32 namespace WebCore { 31 33 -
trunk/Source/WebCore/dom/ClientRectList.cpp
r95901 r147962 30 30 #include "ExceptionCode.h" 31 31 #include "ClientRect.h" 32 #include "ScriptWrappableInlines.h" 32 33 33 34 namespace WebCore { -
trunk/Source/WebCore/dom/DOMStringMap.cpp
r95901 r147962 27 27 #include "DOMStringMap.h" 28 28 29 #include "ScriptWrappableInlines.h" 30 29 31 namespace WebCore { 32 33 DOMStringMap::DOMStringMap() 34 { 35 } 30 36 31 37 DOMStringMap::~DOMStringMap() -
trunk/Source/WebCore/dom/DOMStringMap.h
r135058 r147962 54 54 55 55 protected: 56 DOMStringMap() 57 { 58 } 56 DOMStringMap(); 59 57 }; 60 58 -
trunk/Source/WebCore/dom/Event.cpp
r142072 r147962 27 27 #include "EventNames.h" 28 28 #include "EventTarget.h" 29 #include "ScriptWrappableInlines.h" 29 30 #include "UserGestureIndicator.h" 30 31 #include "WebCoreMemoryInstrumentation.h" -
trunk/Source/WebCore/dom/LiveNodeList.cpp
r145818 r147962 94 94 { 95 95 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); 96 NodeList::reportMemoryUsage(memoryObjectInfo);97 96 info.addMember(m_ownerNode, "ownerNode"); 98 97 info.addWeakPointer(m_cachedItem); -
trunk/Source/WebCore/dom/MutationRecord.cpp
r138811 r147962 36 36 #include "NodeList.h" 37 37 #include "QualifiedName.h" 38 #include "ScriptWrappableInlines.h" 38 39 #include "StaticNodeList.h" 39 40 #include <wtf/Assertions.h> -
trunk/Source/WebCore/dom/Node.cpp
r147795 r147962 2628 2628 { 2629 2629 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); 2630 ScriptWrappable::reportMemoryUsage(memoryObjectInfo);2631 2630 info.addMember(m_parentOrShadowHostNode, "parentOrShadowHostNode"); 2632 2631 info.addMember(m_treeScope, "treeScope"); -
trunk/Source/WebCore/fileapi/FileList.cpp
r95901 r147962 28 28 29 29 #include "File.h" 30 #include "ScriptWrappableInlines.h" 30 31 31 32 namespace WebCore { -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
r144568 r147962 45 45 #include "ScriptDebugServer.h" 46 46 #include "ScriptObject.h" 47 #include "WebCoreMemoryInstrumentation.h" 47 48 #include <wtf/MemoryInstrumentationHashMap.h> 48 49 #include <wtf/MemoryInstrumentationVector.h> -
trunk/Source/WebCore/inspector/NetworkResourcesData.cpp
r144568 r147962 38 38 #include "SharedBuffer.h" 39 39 #include "TextResourceDecoder.h" 40 #include "WebCoreMemoryInstrumentation.h" 40 41 #include <wtf/MemoryInstrumentationHashMap.h> 41 42 -
trunk/Source/WebCore/loader/cache/CachedSVGDocument.cpp
r141570 r147962 29 29 #include "CachedResourceHandle.h" 30 30 #include "ResourceBuffer.h" 31 #include "WebCoreMemoryInstrumentation.h" 31 32 #include <wtf/text/StringBuilder.h> 32 33 -
trunk/Source/WebCore/page/Crypto.cpp
r134440 r147962 32 32 33 33 #include "ExceptionCode.h" 34 #include "ScriptWrappableInlines.h" 34 35 #include <wtf/ArrayBufferView.h> 35 36 #include <wtf/CryptographicallyRandomNumber.h> -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r147888 r147962 1321 1321 { 1322 1322 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); 1323 ScriptWrappable::reportMemoryUsage(memoryObjectInfo);1324 1323 ActiveDOMObject::reportMemoryUsage(memoryObjectInfo); 1325 1324 info.addMember(m_upload, "upload"); -
trunk/Source/WebKit2/ChangeLog
r147953 r147962 1 2013-04-08 Geoffrey Garen <ggaren@apple.com> 2 3 Stop #include-ing all of JavaScriptCore in every DOM-related file 4 https://bugs.webkit.org/show_bug.cgi?id=114220 5 6 Reviewed by Sam Weinig. 7 8 * Shared/WebCoreArgumentCoders.cpp: 9 * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: 10 1 11 2013-04-08 Brady Eidson <beidson@apple.com> 2 12 -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
r146544 r147962 51 51 #include <WebCore/ViewportArguments.h> 52 52 #include <WebCore/WindowFeatures.h> 53 #include <wtf/text/CString.h> 53 54 #include <wtf/text/StringHash.h> 54 55 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h
r117212 r147962 31 31 #include <WebCore/RunLoop.h> 32 32 #include <heap/Weak.h> 33 #include <heap/WeakInlines.h> 33 34 #include <wtf/Forward.h> 34 35 #include <wtf/HashMap.h>
Note: See TracChangeset
for help on using the changeset viewer.