<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>27831</bug_id>
          
          <creation_ts>2009-07-30 05:18:35 -0700</creation_ts>
          <short_desc>Allow custom memory allocation control for JavaScriptCore&apos;s UString class</short_desc>
          <delta_ts>2011-06-17 01:05:42 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Zoltan Horvath">zoltan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
    
    <cc>barraclough</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>eric</cc>
    
    <cc>ggaren</cc>
    
    <cc>mjs</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>135820</commentid>
    <comment_count>0</comment_count>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2009-07-30 05:18:35 -0700</bug_when>
    <thetext>Inherits UString class from FastAllocBase because it has been
instantiated by &apos;new&apos; in JavaScriptCore/runtime/UString.cpp:212.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>135821</commentid>
    <comment_count>1</comment_count>
      <attachid>33770</attachid>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2009-07-30 05:21:54 -0700</bug_when>
    <thetext>Created attachment 33770
proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>136262</commentid>
    <comment_count>2</comment_count>
      <attachid>33770</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-07-31 15:09:34 -0700</bug_when>
    <thetext>Comment on attachment 33770
proposed patch

Did you run the layout tests?
11027 test cases (99%) succeeded
1 test case (&lt;1%) timed out
5 test cases (&lt;1%) crashed
14 test cases (&lt;1%) had stderr output</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>144121</commentid>
    <comment_count>3</comment_count>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2009-09-02 00:14:51 -0700</bug_when>
    <thetext>This patch breaks the layout tests on mac me too. I mark it as invalid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>181787</commentid>
    <comment_count>4</comment_count>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2010-01-18 01:50:15 -0800</bug_when>
    <thetext>I tested it again,  now the layout tests work well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>181789</commentid>
    <comment_count>5</comment_count>
      <attachid>46805</attachid>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2010-01-18 01:53:49 -0800</bug_when>
    <thetext>Created attachment 46805
updated patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>181876</commentid>
    <comment_count>6</comment_count>
      <attachid>46805</attachid>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2010-01-18 07:44:14 -0800</bug_when>
    <thetext>Comment on attachment 46805
updated patch

This patch changes JSC::CString, not JSC::UString as the bug and ChangeLog suggest. What&apos;s really going on here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>181908</commentid>
    <comment_count>7</comment_count>
      <attachid>46831</attachid>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2010-01-18 09:58:14 -0800</bug_when>
    <thetext>Created attachment 46831
updated proposed patch

I just uploaded from wrong directory. This is the good one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182038</commentid>
    <comment_count>8</comment_count>
      <attachid>46831</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-01-18 16:51:04 -0800</bug_when>
    <thetext>Comment on attachment 46831
updated proposed patch

Clearing flags on attachment: 46831

Committed r53438: &lt;http://trac.webkit.org/changeset/53438&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182039</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-01-18 16:51:13 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182050</commentid>
    <comment_count>10</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-01-18 17:17:51 -0800</bug_when>
    <thetext>I have bad news.

First, I have to roll this out because adding FastAllocBase as a base class made UString bigger than a single pointer, and in turn that made JSString too big for a garbage collection cell.

Second, that means that it’s likely that adding FastAllocBase as base class for other objects has been making them all larger, inflating WebKit’s memory use.

Someone needs to investigate this further.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182052</commentid>
    <comment_count>11</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-01-18 17:20:09 -0800</bug_when>
    <thetext>Rolled out in &lt;http://trac.webkit.org/changeset/53438&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182058</commentid>
    <comment_count>12</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-01-18 17:26:55 -0800</bug_when>
    <thetext>Anders Carlsson explained to me what’s going wrong.

The problem is that RefPtr derives from FastAllocBase and so does UString. Since the first member of UString is a RefPtr, it can’t be at the same address of the FastAllocBase we are inheriting from. So padding is added, making the object bigger.

This will happen any time the first data member of a class is an object of a class that derives from FastAllocBase (or Noncopyable or anything else that eventually leads up to FastAllocBase), and the class itself also derives from FastAllocBase (or Noncopyable, etc.).

One way to eliminate the problem is to make FastAllocBase a class template and inherit from FastAllocBase&lt;X&gt; so that each use of FastAllocBase is a unique class, but this still won’t help in the case of Noncopyable.

We may want to file a new bug about this. FastAllocBase is probably making many of our objects a bit bigger.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182060</commentid>
    <comment_count>13</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-01-18 17:35:32 -0800</bug_when>
    <thetext>I believe the build was broken only on 64-bit platforms, so the SnowLeopard bot showed the problem but the Leopard one did not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182072</commentid>
    <comment_count>14</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-01-18 17:58:21 -0800</bug_when>
    <thetext>The commit-queue really needs to be taught how to roll out its own patches whne it turns the bots red.  Sorry about the break. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182763</commentid>
    <comment_count>15</comment_count>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2010-01-20 06:13:47 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; First, I have to roll this out because adding FastAllocBase as a base class
&gt; made UString bigger than a single pointer, and in turn that made JSString too
&gt; big for a garbage collection cell.

I didn&apos;t know that UString is a GC collected class . Where is it converted to JSString?

I opened a new bug &quot;FastAllocBase is probably making many of our objects a bit bigger&quot; bug #33896.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182799</commentid>
    <comment_count>16</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-01-20 07:51:01 -0800</bug_when>
    <thetext>(In reply to comment #15)
&gt; I didn&apos;t know that UString is a GC collected class . Where is it converted to
&gt; JSString?

It&apos;s not a GC-collected class. But JSString objects have a UString as a data member. You can find it in JSString.h.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>422412</commentid>
    <comment_count>17</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2011-06-16 21:52:44 -0700</bug_when>
    <thetext>We no longer use FastAllocBase, and we do not heap allocate individual UString objects (it is just a pointer).  This patch does not seem valid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>422477</commentid>
    <comment_count>18</comment_count>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2011-06-17 01:05:42 -0700</bug_when>
    <thetext>(In reply to comment #17)
&gt; We no longer use FastAllocBase, and we do not heap allocate individual UString objects (it is just a pointer).  This patch does not seem valid.

Yes, exactly! It has been rolled out in &lt;http://trac.webkit.org/changeset/53438&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>33770</attachid>
            <date>2009-07-30 05:21:54 -0700</date>
            <delta_ts>2010-01-18 01:53:49 -0800</delta_ts>
            <desc>proposed patch</desc>
            <filename>UString.patch</filename>
            <type>text/plain</type>
            <size>1120</size>
            <attacher name="Zoltan Horvath">zoltan</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZhU2NyaXB0
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDQ2NTc1KQorKysgSmF2YVNjcmlwdENvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTUgQEAKKzIwMDktMDctMzAgWm9sdGFuIEhv
cnZhdGggIDxoem9sdGFuQGluZi51LXN6ZWdlZC5odT4KKworICAgICAgICBSZXZpZXdlZCBieSBO
T0JPRFkgKE9PUFMhKS4KKworICAgICAgICBBbGxvdyBjdXN0b20gbWVtb3J5IGFsbG9jYXRpb24g
Y29udHJvbCBmb3IgSmF2YVNjcmlwdENvcmUncyBVU3RyaW5nIGNsYXNzCisgICAgICAgIGh0dHBz
Oi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0yNzgzMQorCisgICAgICAgIEluaGVy
aXRzIFVTdHJpbmcgY2xhc3MgZnJvbSBGYXN0QWxsb2NCYXNlIGJlY2F1c2UgaXQgaGFzIGJlZW4K
KyAgICAgICAgaW5zdGFudGlhdGVkIGJ5ICduZXcnIGluIEphdmFTY3JpcHRDb3JlL3J1bnRpbWUv
VVN0cmluZy5jcHA6MjEyLgorCisgICAgICAgICogcnVudGltZS9VU3RyaW5nLmg6CisKIDIwMDkt
MDctMjkgIExhc3psbyBHb21ib3MgIDxsYXN6bG8uMS5nb21ib3NAbm9raWEuY29tPgogCiAgICAg
ICAgIFJldmlld2VkIGJ5IEdlb3JnZSBTdGFpa29zLgpJbmRleDogSmF2YVNjcmlwdENvcmUvcnVu
dGltZS9VU3RyaW5nLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gSmF2YVNjcmlwdENvcmUvcnVudGltZS9VU3Ry
aW5nLmgJKHJldmlzaW9uIDQ2NTc1KQorKysgSmF2YVNjcmlwdENvcmUvcnVudGltZS9VU3RyaW5n
LmgJKHdvcmtpbmcgY29weSkKQEAgLTczLDcgKzczLDcgQEAgbmFtZXNwYWNlIEpTQyB7CiAKICAg
ICB0eXBlZGVmIFZlY3RvcjxjaGFyLCAzMj4gQ1N0cmluZ0J1ZmZlcjsKIAotICAgIGNsYXNzIFVT
dHJpbmcgeworICAgIGNsYXNzIFVTdHJpbmcgOiBwdWJsaWMgRmFzdEFsbG9jQmFzZSB7CiAgICAg
ICAgIGZyaWVuZCBjbGFzcyBKSVQ7CiAKICAgICBwdWJsaWM6Cg==
</data>
<flag name="review"
          id="17974"
          type_id="1"
          status="-"
          setter="eric"
    />
          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>46805</attachid>
            <date>2010-01-18 01:53:49 -0800</date>
            <delta_ts>2010-01-18 09:58:14 -0800</delta_ts>
            <desc>updated patch</desc>
            <filename>ustring2.patch</filename>
            <type>text/plain</type>
            <size>1218</size>
            <attacher name="Zoltan Horvath">zoltan</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL3J1bnRpbWUvVVN0cmluZy5oCj09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIEph
dmFTY3JpcHRDb3JlL3J1bnRpbWUvVVN0cmluZy5oCShyZXZpc2lvbiA1MzM5NCkKKysrIEphdmFT
Y3JpcHRDb3JlL3J1bnRpbWUvVVN0cmluZy5oCSh3b3JraW5nIGNvcHkpCkBAIC00MCw3ICs0MCw3
IEBACiAgICAgdXNpbmcgV1RGOjpQbGFjZW1lbnROZXdBZG9wdFR5cGU7CiAgICAgdXNpbmcgV1RG
OjpQbGFjZW1lbnROZXdBZG9wdDsKIAotICAgIGNsYXNzIENTdHJpbmcgeworICAgIGNsYXNzIENT
dHJpbmcgOiBwdWJsaWMgRmFzdEFsbG9jQmFzZSB7CiAgICAgcHVibGljOgogICAgICAgICBDU3Ry
aW5nKCkKICAgICAgICAgICAgIDogbV9sZW5ndGgoMCkKSW5kZXg6IEphdmFTY3JpcHRDb3JlL0No
YW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9u
IDUzMzk0KQorKysgSmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0x
LDMgKzEsMTggQEAKKzIwMTAtMDEtMTggIFpvbHRhbiBIb3J2YXRoICA8em9sdGFuQHdlYmtpdC5v
cmc+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgQWxs
b3cgY3VzdG9tIG1lbW9yeSBhbGxvY2F0aW9uIGNvbnRyb2wgZm9yIFVTdHJpbmcgY2xhc3MKKyAg
ICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTI3ODMxCisKKyAg
ICAgICAgSW5oZXJpdHMgdGhlIGZvbGxvd2luZyBjbGFzcyBmcm9tIEZhc3RBbGxvY0Jhc2UgYmVj
YXVzZSBpdCBpcworICAgICAgICBpbnN0YW50aWF0ZWQgYnkgJ25ldycgYW5kIG5vIG5lZWQgdG8g
YmUgY29weWFibGU6CisKKyAgICAgICAgY2xhc3MgbmFtZSAgICAgLSBpbnN0YW50aWF0ZWQgYXQ6
CisgICAgICAgIGNsYXNzcyBVU3RyaW5nIC0gSmF2YVNjcmlwdENvcmUvcnVudGltZS9VU3RyaW5n
LmNwcDoxNjAKKworICAgICAgICAqIHJ1bnRpbWUvVVN0cmluZy5oOgorCiAyMDEwLTAxLTE1ICBH
YXZpbiBCYXJyYWNsb3VnaCAgPGJhcnJhY2xvdWdoQGFwcGxlLmNvbT4KIAogICAgICAgICBSZXZp
ZXdlZCBieSBPbGl2ZXIgSHVudC4K
</data>
<flag name="review"
          id="29129"
          type_id="1"
          status="-"
          setter="aroben"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>46831</attachid>
            <date>2010-01-18 09:58:14 -0800</date>
            <delta_ts>2010-06-10 20:33:43 -0700</delta_ts>
            <desc>updated proposed patch</desc>
            <filename>ustring3.patch</filename>
            <type>text/plain</type>
            <size>1174</size>
            <attacher name="Zoltan Horvath">zoltan</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL3J1bnRpbWUvVVN0cmluZy5oCj09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIEph
dmFTY3JpcHRDb3JlL3J1bnRpbWUvVVN0cmluZy5oCShyZXZpc2lvbiA1MzM5NCkKKysrIEphdmFT
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AgICAgICBjbGFzc3MgVVN0cmluZyAtIEphdmFTY3JpcHRDb3JlL3J1
bnRpbWUvVVN0cmluZy5jcHA6MTYwCisKKyAgICAgICAgKiBydW50aW1lL1VTdHJpbmcuaDoKKwog
MjAxMC0wMS0xNSAgR2F2aW4gQmFycmFjbG91Z2ggIDxiYXJyYWNsb3VnaEBhcHBsZS5jb20+CiAK
ICAgICAgICAgUmV2aWV3ZWQgYnkgT2xpdmVyIEh1bnQuCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>