Changeset 109105 in webkit


Ignore:
Timestamp:
Feb 28, 2012 8:02:02 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

JSString::resolveRope() should report extra memory cost to the heap.
https://bugs.webkit.org/show_bug.cgi?id=79555

Patch by Yong Li <yoli@rim.com> on 2012-02-28
Reviewed by Michael Saboff.

At the time a JSString is constructed with fibers, it doesn't report
extra memory cost, which is reasonable because it hasn't allocate
new memory. However when the rope is resolved, it should report meory
cost for the new buffer.

  • runtime/JSString.cpp:

(JSC::JSString::resolveRope):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r109059 r109105  
     12012-02-28  Yong Li  <yoli@rim.com>
     2
     3        JSString::resolveRope() should report extra memory cost to the heap.
     4        https://bugs.webkit.org/show_bug.cgi?id=79555
     5
     6        Reviewed by Michael Saboff.
     7
     8        At the time a JSString is constructed with fibers, it doesn't report
     9        extra memory cost, which is reasonable because it hasn't allocate
     10        new memory. However when the rope is resolved, it should report meory
     11        cost for the new buffer.
     12
     13        * runtime/JSString.cpp:
     14        (JSC::JSString::resolveRope):
     15
    1162012-02-27  Oliver Hunt  <oliver@apple.com>
    217
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r108649 r109105  
    6666    if (is8Bit()) {
    6767        LChar* buffer;
    68         if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
     68        if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) {
     69            Heap::heap(this)->reportExtraMemoryCost(newImpl->cost());
    6970            m_value = newImpl.release();
    70         else {
     71        } else {
    7172            outOfMemory(exec);
    7273            return;
     
    9394
    9495    UChar* buffer;
    95     if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
     96    if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) {
     97        Heap::heap(this)->reportExtraMemoryCost(newImpl->cost());
    9698        m_value = newImpl.release();
    97     else {
     99    } else {
    98100        outOfMemory(exec);
    99101        return;
Note: See TracChangeset for help on using the changeset viewer.