Ignore:
Timestamp:
Apr 26, 2011, 11:31:03 AM (14 years ago)
Author:
[email protected]
Message:

2011-04-25 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

Nixed special finalizer handling for WebCore strings
https://bugs.webkit.org/show_bug.cgi?id=59425


SunSpider reports no change.


Not needed anymore, since weak handles have finalizers.

  • runtime/JSString.cpp: (JSC::JSString::resolveRope): (JSC::JSString::resolveRopeSlowCase): (JSC::JSString::outOfMemory): (JSC::JSString::substringFromRope): (JSC::JSString::replaceCharacter): Updated for removal of union.
  • runtime/JSString.h: (JSC::RopeBuilder::JSString): (JSC::RopeBuilder::~JSString): (JSC::RopeBuilder::appendStringInConstruct): (JSC::RopeBuilder::appendValueInConstructAndIncrementLength): No need for union or special constructor anymore.

2011-04-25 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

Nixed special finalizer handling for WebCore strings
https://bugs.webkit.org/show_bug.cgi?id=59425

Not needed anymore, since weak handles have finalizers.

  • WebCore.exp.in: Exports!
  • bindings/js/DOMWrapperWorld.cpp: (WebCore::JSStringOwner::finalize): (WebCore::DOMWrapperWorld::DOMWrapperWorld): Use a weak handle finalizer, so we don't need special treatment anymore.
  • bindings/js/DOMWrapperWorld.h: (WebCore::JSStringOwner::JSStringOwner): (WebCore::DOMWrapperWorld::stringWrapperOwner): Use a HashMap of Weak<T> instead of a WeakGCMap, so we can specify a custom finalizer.
  • bindings/js/JSDOMBinding.cpp: (WebCore::jsStringSlowCase):
  • bindings/js/JSDOMBinding.h: (WebCore::jsString): Updated for string map change.
File:
1 edited

Legend:

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

    r84800 r84934  
    4949    }
    5050
    51     RopeImpl::Fiber currentFiber = m_other.m_fibers[0];
     51    RopeImpl::Fiber currentFiber = m_fibers[0];
    5252
    5353    if ((m_fiberCount > 2) || (RopeImpl::isRope(currentFiber))
    54         || ((m_fiberCount == 2) && (RopeImpl::isRope(m_other.m_fibers[1])))) {
     54        || ((m_fiberCount == 2) && (RopeImpl::isRope(m_fibers[1])))) {
    5555        resolveRopeSlowCase(exec, buffer);
    5656        return;
     
    6464    if (m_fiberCount > 1) {
    6565        position += length;
    66         currentFiber = m_other.m_fibers[1];
     66        currentFiber = m_fibers[1];
    6767        string = static_cast<StringImpl*>(currentFiber);
    6868        length = string->length();
     
    7373    ASSERT((buffer + m_length) == position);
    7474    for (unsigned i = 0; i < m_fiberCount; ++i) {
    75         RopeImpl::deref(m_other.m_fibers[i]);
    76         m_other.m_fibers[i] = 0;
     75        RopeImpl::deref(m_fibers[i]);
     76        m_fibers[i] = 0;
    7777    }
    7878    m_fiberCount = 0;
     
    101101    RopeImpl::Fiber currentFiber;
    102102    for (unsigned i = 0; i < (m_fiberCount - 1); ++i)
    103         workQueue.append(m_other.m_fibers[i]);
    104     currentFiber = m_other.m_fibers[m_fiberCount - 1];
     103        workQueue.append(m_fibers[i]);
     104    currentFiber = m_fibers[m_fiberCount - 1];
    105105    while (true) {
    106106        if (RopeImpl::isRope(currentFiber)) {
     
    123123                ASSERT(buffer == position);
    124124                for (unsigned i = 0; i < m_fiberCount; ++i) {
    125                     RopeImpl::deref(m_other.m_fibers[i]);
    126                     m_other.m_fibers[i] = 0;
     125                    RopeImpl::deref(m_fibers[i]);
     126                    m_fibers[i] = 0;
    127127                }
    128128                m_fiberCount = 0;
     
    142142{
    143143    for (unsigned i = 0; i < m_fiberCount; ++i) {
    144         RopeImpl::deref(m_other.m_fibers[i]);
    145         m_other.m_fibers[i] = 0;
     144        RopeImpl::deref(m_fibers[i]);
     145        m_fibers[i] = 0;
    146146    }
    147147    m_fiberCount = 0;
     
    170170
    171171    RopeIterator end;
    172     for (RopeIterator it(m_other.m_fibers.data(), m_fiberCount); it != end; ++it) {
     172    for (RopeIterator it(m_fibers.data(), m_fiberCount); it != end; ++it) {
    173173        ++fiberCount;
    174174        StringImpl* fiberString = *it;
     
    221221    StringImpl* matchString = 0;
    222222    size_t matchPosition = notFound;
    223     for (RopeIterator it(m_other.m_fibers.data(), m_fiberCount); it != end; ++it) {
     223    for (RopeIterator it(m_fibers.data(), m_fiberCount); it != end; ++it) {
    224224        ++fiberCount;
    225225        if (matchString)
     
    240240        return throwOutOfMemoryError(exec);
    241241
    242     for (RopeIterator it(m_other.m_fibers.data(), m_fiberCount); it != end; ++it) {
     242    for (RopeIterator it(m_fibers.data(), m_fiberCount); it != end; ++it) {
    243243        StringImpl* string = *it;
    244244        if (string != matchString) {
Note: See TracChangeset for help on using the changeset viewer.