Changeset 161027 in webkit


Ignore:
Timestamp:
Dec 23, 2013 3:17:25 PM (10 years ago)
Author:
mark.lam@apple.com
Message:

CStack: Cosmetic: rename JSStack::m_useableEnd to m_useableTop.
https://bugs.webkit.org/show_bug.cgi?id=126184.

Not yet reviewed.

In JSStack::enableErrorStackReserve() and disableErrorStackReserve(),
m_useableEnd is initialize to reservationTop() or reservationTop() +
commitSize. Hence, it points to an allocatable slot in the stack, not
past it. Naming it m_useableTop is more correct.

  • interpreter/JSStack.cpp:

(JSC::JSStack::growSlowCase):
(JSC::JSStack::enableErrorStackReserve):
(JSC::JSStack::disableErrorStackReserve):

  • interpreter/JSStack.h:
Location:
branches/jsCStack/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/jsCStack/Source/JavaScriptCore/ChangeLog

    r161025 r161027  
     12013-12-23  Mark Lam  <mark.lam@apple.com>
     2
     3        CStack: Cosmetic: rename JSStack::m_useableEnd to m_useableTop.
     4        https://bugs.webkit.org/show_bug.cgi?id=126184.
     5
     6        Not yet reviewed.
     7
     8        In JSStack::enableErrorStackReserve() and disableErrorStackReserve(),
     9        m_useableEnd is initialize to reservationTop() or reservationTop() +
     10        commitSize. Hence, it points to an allocatable slot in the stack, not
     11        past it. Naming it m_useableTop is more correct.
     12
     13        * interpreter/JSStack.cpp:
     14        (JSC::JSStack::growSlowCase):
     15        (JSC::JSStack::enableErrorStackReserve):
     16        (JSC::JSStack::disableErrorStackReserve):
     17        * interpreter/JSStack.h:
     18
    1192013-12-23  Mark Lam  <mark.lam@apple.com>
    220
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.cpp

    r161025 r161027  
    9191    // return false.
    9292    long delta = roundUpAllocationSize(reinterpret_cast<char*>(m_commitEnd) - reinterpret_cast<char*>(newEnd), commitSize);
    93     if (reinterpret_cast<char*>(m_commitEnd) - delta <= reinterpret_cast<char*>(m_useableEnd))
     93    if (reinterpret_cast<char*>(m_commitEnd) - delta <= reinterpret_cast<char*>(m_useableTop))
    9494        return false;
    9595
     
    148148void JSStack::enableErrorStackReserve()
    149149{
    150     m_useableEnd = reservationTop();
     150    m_useableTop = reservationTop();
    151151}
    152152
    153153void JSStack::disableErrorStackReserve()
    154154{
    155     char* useableEnd = reinterpret_cast<char*>(reservationTop()) + commitSize;
    156     m_useableEnd = reinterpret_cast_ptr<Register*>(useableEnd);
     155    char* useableTop = reinterpret_cast<char*>(reservationTop()) + commitSize;
     156    m_useableTop = reinterpret_cast_ptr<Register*>(useableTop);
    157157
    158158    // By the time we get here, we are guaranteed to be destructing the last
    159159    // Interpreter::ErrorHandlingMode that enabled this reserve in the first
    160     // place. That means the stack space beyond m_useableEnd before we
     160    // place. That means the stack space beyond m_useableTop before we
    161161    // enabled the reserve was not previously in use. Hence, it is safe to
    162     // shrink back to that m_useableEnd.
    163     if (m_end < m_useableEnd) {
    164         ASSERT(m_topCallFrame->topOfFrame() > m_useableEnd);
    165         shrink(m_useableEnd);
     162    // shrink back to that m_useableTop.
     163    if (m_end < m_useableTop) {
     164        ASSERT(m_topCallFrame->topOfFrame() > m_useableTop);
     165        shrink(m_useableTop);
    166166    }
    167167}
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h

    r161025 r161027  
    178178        Register* m_end;
    179179        Register* m_commitEnd;
    180         Register* m_useableEnd;
     180        Register* m_useableTop;
    181181        PageReservation m_reservation;
    182182        Register* m_lastStackTop;
Note: See TracChangeset for help on using the changeset viewer.