Changeset 79948 in webkit


Ignore:
Timestamp:
Feb 28, 2011 5:06:21 PM (13 years ago)
Author:
oliver@apple.com
Message:

2011-02-28 Oliver Hunt <oliver@apple.com>

Reviewed by Darin Adler.

Stop using DeprecatedPtr for the global exception slot
https://bugs.webkit.org/show_bug.cgi?id=55424

Create GCRootPtr to signify that the exception slot is
a gcroot, and so is exempt from the usual writebarrier
restrictions.

  • runtime/JSGlobalData.h:
  • runtime/WriteBarrier.h: (JSC::GCRootPtr::GCRootPtr): (JSC::GCRootPtr::operator=):
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r79924 r79948  
     12011-02-28  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Stop using DeprecatedPtr for the global exception slot
     6        https://bugs.webkit.org/show_bug.cgi?id=55424
     7
     8        Create GCRootPtr to signify that the exception slot is
     9        a gcroot, and so is exempt from the usual writebarrier
     10        restrictions.
     11
     12        * runtime/JSGlobalData.h:
     13        * runtime/WriteBarrier.h:
     14        (JSC::GCRootPtr::GCRootPtr):
     15        (JSC::GCRootPtr::operator=):
     16
    1172011-02-28  Adam Barth  <abarth@webkit.org>
    218
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.h

    r79904 r79948  
    207207        Heap heap;
    208208
    209         DeprecatedPtr<Unknown> exception;
     209        GCRootPtr<Unknown> exception;
    210210#if ENABLE(JIT)
    211211        ReturnAddressPtr exceptionLocation;
  • trunk/Source/JavaScriptCore/runtime/WriteBarrier.h

    r78945 r79948  
    152152};
    153153
     154template <typename T> class GCRootPtr : public WriteBarrierBase<T> {
     155public:
     156    GCRootPtr() { }
     157    GCRootPtr(T* value)
     158    {
     159        this->setWithoutWriteBarrier(value);
     160    }
     161
     162    GCRootPtr& operator=(T* value)
     163    {
     164        this->setWithoutWriteBarrier(value);
     165        return *this;
     166    }
     167
     168private:
     169    using WriteBarrier<T>::set;
     170    using WriteBarrier<T>::setWithoutWriteBarrier;
     171};
     172
     173template <> class GCRootPtr<Unknown> : public WriteBarrierBase<Unknown> {
     174public:
     175    GCRootPtr() { }
     176    GCRootPtr(JSValue value)
     177    {
     178        this->setWithoutWriteBarrier(value);
     179    }
     180   
     181    GCRootPtr& operator=(JSValue value)
     182    {
     183        this->setWithoutWriteBarrier(value);
     184        return *this;
     185    }
     186   
     187private:
     188    using WriteBarrierBase<Unknown>::set;
     189    using WriteBarrierBase<Unknown>::setWithoutWriteBarrier;
     190};
     191   
    154192template <typename U, typename V> inline bool operator==(const DeprecatedPtr<U>& lhs, const DeprecatedPtr<V>& rhs)
    155193{
Note: See TracChangeset for help on using the changeset viewer.