Changeset 190113 in webkit for trunk/Source/JavaScriptCore/heap/WeakInlines.h
- Timestamp:
- Sep 22, 2015, 5:21:31 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/WeakInlines.h
r189616 r190113 35 35 36 36 template<typename T> inline Weak<T>::Weak(T* cell, WeakHandleOwner* weakOwner, void* context) 37 : m_impl(cell ? WeakSet::allocate( *cell, weakOwner, context) : 0)37 : m_impl(cell ? WeakSet::allocate(cell, weakOwner, context) : 0) 38 38 { 39 static_assert((std::is_convertible<T, JSCell>::value), "JSC::Weak can only be used with cell types.");40 39 } 41 40 … … 75 74 { 76 75 ASSERT(m_impl && m_impl->state() == WeakImpl::Live); 77 return jsCast<T*>(m_impl-> cell());76 return jsCast<T*>(m_impl->jsValue().asCell()); 78 77 } 79 78 … … 81 80 { 82 81 ASSERT(m_impl && m_impl->state() == WeakImpl::Live); 83 return *jsCast<T*>(m_impl-> cell());82 return *jsCast<T*>(m_impl->jsValue().asCell()); 84 83 } 85 84 … … 88 87 if (!m_impl || m_impl->state() != WeakImpl::Live) 89 88 return 0; 90 return jsCast<T*>(m_impl-> cell());89 return jsCast<T*>(m_impl->jsValue().asCell()); 91 90 } 92 91 93 92 template<typename T> inline bool Weak<T>::was(T* other) const 94 93 { 95 return static_cast<T*>(m_impl-> cell()) == other;94 return static_cast<T*>(m_impl->jsValue().asCell()) == other; 96 95 } 97 96 98 97 template<typename T> inline bool Weak<T>::operator!() const 99 98 { 100 return !m_impl || !m_impl-> cell() || m_impl->state() != WeakImpl::Live;99 return !m_impl || !m_impl->jsValue() || m_impl->state() != WeakImpl::Live; 101 100 } 102 101
Note:
See TracChangeset
for help on using the changeset viewer.