Changeset 161025 in webkit


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

CStack: Cosmetic: rename reservationEnd() to reservationTop().
https://bugs.webkit.org/show_bug.cgi?id=126181.

Not yet reviewed.

reservationEnd() computes the end of the stack at the top. The value
is computed as:

char* reservationEnd = static_cast<char*>(m_reservation.base());
return reinterpret_cast_ptr<Register*>(reservationEnd);

Since m_reservation.base() points at a slot of memory that is within the
allocatable range of the stack, naming this function reservationEnd() is
inappropriate. Per Geoff's input, "end" usually refers to the slot past
the end of a buffer. Calling it "top" is more appropriate. Hence, I'm
renaming it to reservationTop().

  • interpreter/JSStack.cpp:

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

  • interpreter/JSStack.h:

(JSC::JSStack::reservationTop):

Location:
branches/jsCStack/Source/JavaScriptCore
Files:
3 edited

Legend:

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

    r161012 r161025  
     12013-12-23  Mark Lam  <mark.lam@apple.com>
     2
     3        CStack: Cosmetic: rename reservationEnd() to reservationTop().
     4        https://bugs.webkit.org/show_bug.cgi?id=126181.
     5
     6        Not yet reviewed.
     7
     8        reservationEnd() computes the end of the stack at the top. The value
     9        is computed as:
     10
     11            char* reservationEnd = static_cast<char*>(m_reservation.base());
     12            return reinterpret_cast_ptr<Register*>(reservationEnd);
     13
     14        Since m_reservation.base() points at a slot of memory that is within the
     15        allocatable range of the stack, naming this function reservationEnd() is
     16        inappropriate.  Per Geoff's input, "end" usually refers to the slot past
     17        the end of a buffer. Calling it "top" is more appropriate. Hence, I'm
     18        renaming it to reservationTop().
     19
     20        * interpreter/JSStack.cpp:
     21        (JSC::JSStack::enableErrorStackReserve):
     22        (JSC::JSStack::disableErrorStackReserve):
     23        * interpreter/JSStack.h:
     24        (JSC::JSStack::reservationTop):
     25
    1262013-12-23  Filip Pizlo  <fpizlo@apple.com>
    227
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.cpp

    r160982 r161025  
    148148void JSStack::enableErrorStackReserve()
    149149{
    150     m_useableEnd = reservationEnd();
     150    m_useableEnd = reservationTop();
    151151}
    152152
    153153void JSStack::disableErrorStackReserve()
    154154{
    155     char* useableEnd = reinterpret_cast<char*>(reservationEnd()) + commitSize;
     155    char* useableEnd = reinterpret_cast<char*>(reservationTop()) + commitSize;
    156156    m_useableEnd = reinterpret_cast_ptr<Register*>(useableEnd);
    157157
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h

    r160982 r161025  
    147147
    148148#if ENABLE(LLINT_C_LOOP)
    149         Register* reservationEnd() const
     149        Register* reservationTop() const
    150150        {
    151             char* reservationEnd = static_cast<char*>(m_reservation.base());
    152             return reinterpret_cast_ptr<Register*>(reservationEnd);
     151            char* reservationTop = static_cast<char*>(m_reservation.base());
     152            return reinterpret_cast_ptr<Register*>(reservationTop);
    153153        }
    154154
Note: See TracChangeset for help on using the changeset viewer.