⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 100208 in webkit


Ignore:
Timestamp:
Nov 14, 2011, 4:16:59 PM (15 years ago)
Author:
msaboff@apple.com
Message:

Further changes and cleanup to JSString.h and cpp.

Reviewed by Darin Adler.

  • runtime/JSString.cpp:

(JSC::JSString::resolveRope): Change PassRefPtr to RefPtr. Eliminated exec in slow case calls.
(JSC::JSString::resolveRopeSlowCase8): Darin and I agreed that this should have 8 in name.
(JSC::JSString::resolveRopeSlowCase): Removed exec parameter.

  • runtime/JSString.h:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r100205 r100208  
     12011-11-14  Michael Saboff  <msaboff@apple.com>
     2
     3        Further changes and cleanup to JSString.h and cpp.
     4
     5        Reviewed by Darin Adler.
     6
     7        * runtime/JSString.cpp:
     8        (JSC::JSString::resolveRope): Change PassRefPtr to RefPtr.  Eliminated exec in slow case calls.
     9        (JSC::JSString::resolveRopeSlowCase8): Darin and I agreed that this should have 8 in name.
     10        (JSC::JSString::resolveRopeSlowCase): Removed exec parameter.
     11        * runtime/JSString.h:
     12
    1132011-11-14  Adam Barth  <abarth@webkit.org>
    214
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r100202 r100208  
    6565    if (is8Bit()) {
    6666        LChar* buffer;
    67         if (PassRefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
    68             m_value = newImpl;
     67        if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
     68            m_value = newImpl.release();
    6969        else {
    7070            outOfMemory(exec);
     
    7474        for (size_t i = 0; i < s_maxInternalRopeLength && m_fibers[i]; ++i) {
    7575            if (m_fibers[i]->isRope())
    76                 return resolveRopeSlowCase(exec, buffer);
     76                return resolveRopeSlowCase8(buffer);
    7777        }
    7878
     
    9292
    9393    UChar* buffer;
    94     if (PassRefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
    95         m_value = newImpl;
     94    if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
     95        m_value = newImpl.release();
    9696    else {
    9797        outOfMemory(exec);
     
    101101    for (size_t i = 0; i < s_maxInternalRopeLength && m_fibers[i]; ++i) {
    102102        if (m_fibers[i]->isRope())
    103             return resolveRopeSlowCase(exec, buffer);
     103            return resolveRopeSlowCase(buffer);
    104104    }
    105105
     
    126126// only fill the queue with the number of substrings at any given level in a
    127127// rope-of-ropes.)   
    128 void JSString::resolveRopeSlowCase(ExecState* exec, LChar* buffer) const
    129 {
    130     UNUSED_PARAM(exec);
    131 
     128void JSString::resolveRopeSlowCase8(LChar* buffer) const
     129{
    132130    LChar* position = buffer + m_length; // We will be working backwards over the rope.
    133131    Vector<JSString*, 32> workQueue; // Putting strings into a Vector is only OK because there are no GC points in this method.
     
    159157}
    160158
    161 void JSString::resolveRopeSlowCase(ExecState* exec, UChar* buffer) const
    162 {
    163     UNUSED_PARAM(exec);
    164 
     159void JSString::resolveRopeSlowCase(UChar* buffer) const
     160{
    165161    UChar* position = buffer + m_length; // We will be working backwards over the rope.
    166162    Vector<JSString*, 32> workQueue; // These strings are kept alive by the parent rope, so using a Vector is OK.
  • trunk/Source/JavaScriptCore/runtime/JSString.h

    r100202 r100208  
    249249
    250250        void resolveRope(ExecState*) const;
    251         void resolveRopeSlowCase(ExecState*, LChar*) const;
    252         void resolveRopeSlowCase(ExecState*, UChar*) const;
     251        void resolveRopeSlowCase8(LChar*) const;
     252        void resolveRopeSlowCase(UChar*) const;
    253253        void outOfMemory(ExecState*) const;
    254254
Note: See TracChangeset for help on using the changeset viewer.