Ignore:
Timestamp:
Sep 22, 2015, 5:21:31 AM (10 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r189616.
https://bugs.webkit.org/show_bug.cgi?id=149456

suspected cause of multiple regressions (Requested by kling on
#webkit).

Reverted changeset:

"[JSC] Weak should only accept cell pointees."
https://bugs.webkit.org/show_bug.cgi?id=148955
http://trac.webkit.org/changeset/189616

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/WeakInlines.h

    r189616 r190113  
    3535
    3636template<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)
    3838{
    39     static_assert((std::is_convertible<T, JSCell>::value), "JSC::Weak can only be used with cell types.");
    4039}
    4140
     
    7574{
    7675    ASSERT(m_impl && m_impl->state() == WeakImpl::Live);
    77     return jsCast<T*>(m_impl->cell());
     76    return jsCast<T*>(m_impl->jsValue().asCell());
    7877}
    7978
     
    8180{
    8281    ASSERT(m_impl && m_impl->state() == WeakImpl::Live);
    83     return *jsCast<T*>(m_impl->cell());
     82    return *jsCast<T*>(m_impl->jsValue().asCell());
    8483}
    8584
     
    8887    if (!m_impl || m_impl->state() != WeakImpl::Live)
    8988        return 0;
    90     return jsCast<T*>(m_impl->cell());
     89    return jsCast<T*>(m_impl->jsValue().asCell());
    9190}
    9291
    9392template<typename T> inline bool Weak<T>::was(T* other) const
    9493{
    95     return static_cast<T*>(m_impl->cell()) == other;
     94    return static_cast<T*>(m_impl->jsValue().asCell()) == other;
    9695}
    9796
    9897template<typename T> inline bool Weak<T>::operator!() const
    9998{
    100     return !m_impl || !m_impl->cell() || m_impl->state() != WeakImpl::Live;
     99    return !m_impl || !m_impl->jsValue() || m_impl->state() != WeakImpl::Live;
    101100}
    102101
Note: See TracChangeset for help on using the changeset viewer.