Ignore:
Timestamp:
Sep 6, 2012, 6:29:12 PM (13 years ago)
Author:
[email protected]
Message:

16 bit JSRopeString up converts an 8 bit fibers to 16 bits during resolution
https://bugs.webkit.org/show_bug.cgi?id=95810

Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Added 8 bit path that copies the contents of an 8 bit fiber to the 16 bit buffer
when resolving a 16 bit rope.

  • runtime/JSString.cpp:

(JSC::JSRopeString::resolveRopeSlowCase):

Source/WTF:

New copy routine that takes an 8 bit source and a 16 bit destination. Used when copying
the contents of an 8 bit fiber to the 16 bit buffer when resolving a 16 bit rope.

  • wtf/text/StringImpl.h:

(WTF::StringImpl::copyChars):
(StringImpl):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r127505 r127809  
    131131        StringImpl* string = m_fibers[i]->m_value.impl();
    132132        unsigned length = string->length();
    133         StringImpl::copyChars(position, string->characters(), length);
     133        if (string->is8Bit())
     134            StringImpl::copyChars(position, string->characters8(), length);
     135        else
     136            StringImpl::copyChars(position, string->characters16(), length);
    134137        position += length;
    135138        m_fibers[i].clear();
     
    203206        unsigned length = string->length();
    204207        position -= length;
    205         StringImpl::copyChars(position, string->characters(), length);
     208        if (string->is8Bit())
     209            StringImpl::copyChars(position, string->characters8(), length);
     210        else
     211            StringImpl::copyChars(position, string->characters16(), length);
    206212    }
    207213
Note: See TracChangeset for help on using the changeset viewer.