Changeset 91288 in webkit


Ignore:
Timestamp:
Jul 19, 2011 12:49:07 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[JSC] WebKit allocates gigabytes of memory when doing repeated string concatenation
https://bugs.webkit.org/show_bug.cgi?id=63918

Patch by Mark Hahnenberg <mhahnenberg@apple.com> on 2011-07-19
Reviewed by Darin Adler.

When allocating JSStrings during concatenation, we needed to call the Heap's reportExtraMemoryCost
method due to additional string copying within several of the constructors when dealing with
UStrings. This has been added to the UString version of the appendStringInConstruct method
within the JSString class.

  • runtime/JSString.h:

(JSC::RopeBuilder::JSString):
(JSC::RopeBuilder::appendStringInConstruct):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r91284 r91288  
     12011-07-19  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        [JSC] WebKit allocates gigabytes of memory when doing repeated string concatenation
     4        https://bugs.webkit.org/show_bug.cgi?id=63918
     5
     6        Reviewed by Darin Adler.
     7
     8        When allocating JSStrings during concatenation, we needed to call the Heap's reportExtraMemoryCost
     9        method due to additional string copying within several of the constructors when dealing with
     10        UStrings.  This has been added to the UString version of the appendStringInConstruct method
     11        within the JSString class.
     12
     13        * runtime/JSString.h:
     14        (JSC::RopeBuilder::JSString):
     15        (JSC::RopeBuilder::appendStringInConstruct):
     16
    1172011-07-19  Gavin Barraclough  <barraclough@apple.com>
    218
  • trunk/Source/JavaScriptCore/runtime/JSString.h

    r91194 r91288  
    201201        {
    202202            ASSERT(!m_value.isNull());
     203            Heap::heap(this)->reportExtraMemoryCost(value.impl()->cost());
    203204        }
    204205        JSString(JSGlobalData& globalData, PassRefPtr<StringImpl> value, HasOtherOwnerType)
     
    394395            impl->ref();
    395396            m_fibers[index++] = impl;
     397            Heap::heap(this)->reportExtraMemoryCost(string.impl()->cost());
    396398        }
    397399
Note: See TracChangeset for help on using the changeset viewer.