<?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>100828</bug_id>
          
          <creation_ts>2012-10-31 01:19:47 -0700</creation_ts>
          <short_desc>GC should shrink arrays to fit in the smallest sensible amount of memory</short_desc>
          <delta_ts>2012-10-31 08:59:50 -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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>
          <dependson>100827</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Filip Pizlo">fpizlo</assigned_to>
          <cc>barraclough</cc>
    
    <cc>ggaren</cc>
    
    <cc>mark.lam</cc>
    
    <cc>mhahnenberg</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>755042</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-10-31 01:19:47 -0700</bug_when>
    <thetext>This will mostly prevent us from having to reason about a priori thresholds for sparse array logic.  If in doubt, JSC should be able to just allocate a large contiguous array and leave it to the GC to figure out whether or not that was a good idea.

That might imply that the GC should also be able to create sparse maps as needed.  Most likely the best way to do it will be that if the GC detects that an array would benefit from a sparse map and that array doesn&apos;t already have a sparse map, then it should defer the sparse map creation.  It can be done as part of sweeping, or something.

I&apos;m marking this as depending on https://bugs.webkit.org/show_bug.cgi?id=100827.  Really it&apos;s related to the other bug.  I want to first bump up the sparse map size threshold and then later worry about the heuristics to make it safe-for-space in all of the various pathological corner cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>755047</commentid>
    <comment_count>1</comment_count>
      <attachid>171595</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-10-31 01:29:14 -0700</bug_when>
    <thetext>Created attachment 171595
the patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>755048</commentid>
    <comment_count>2</comment_count>
      <attachid>171595</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-10-31 01:29:44 -0700</bug_when>
    <thetext>Comment on attachment 171595
the patch

Ahhh!!  Never mind.  I posted this patch to the wrong bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>755339</commentid>
    <comment_count>3</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2012-10-31 08:45:19 -0700</bug_when>
    <thetext>FWIW, I think we should apply the same logic to named property backing stores.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>755360</commentid>
    <comment_count>4</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2012-10-31 08:59:50 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; FWIW, I think we should apply the same logic to named property backing stores.

We&apos;d need to deal with structure implying backing store size</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>171595</attachid>
            <date>2012-10-31 01:29:14 -0700</date>
            <delta_ts>2012-10-31 01:29:43 -0700</delta_ts>
            <desc>the patch</desc>
            <filename>100000.patch</filename>
            <type>text/plain</type>
            <size>1690</size>
            <attacher name="Filip Pizlo">fpizlo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTMyOTk3KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE4IEBA
CisyMDEyLTEwLTMxICBGaWxpcCBQaXpsbyAgPGZwaXpsb0BhcHBsZS5jb20+CisKKyAgICAgICAg
U3BhcnNlIGFycmF5IHNpemUgdGhyZXNob2xkIHNob3VsZCBiZSBpbmNyZWFzZWQgdG8gMTAwMDAw
CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMDA4MjcK
KworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBUaGlzIGVu
YWJsZXMgdGhlIHVzZSBvZiBjb250aWd1b3VzIGFycmF5cyBpbiBwcm9ncmFtcyB0aGF0IHByZXZp
b3VzbHkKKyAgICAgICAgY291bGRuJ3QgdXNlIHRoZW0uIEFuZCBJIHNvIGZhciBjYW4ndCBzZWUg
YW55IGV4YW1wbGVzIG9mIHRoaXMgYmVpbmcKKyAgICAgICAgYSBkb3duc2lkZS4gVG8gdGhlIGV4
dGVudCB0aGF0IHRoZXJlIGlzIGEgZG93bnNpZGUsIGl0IG91Z2h0IHRvIGJlCisgICAgICAgIGFk
ZHJlc3NlZCBieSBHQzogaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTEw
MDgyOAorCisgICAgICAgICogcnVudGltZS9BcnJheUNvbnZlbnRpb25zLmg6CisgICAgICAgIChK
U0MpOgorCiAyMDEyLTEwLTMwICBZdXFpYW5nIFhpYW4gIDx5dXFpYW5nLnhpYW5AaW50ZWwuY29t
PgogCiAgICAgICAgIGdsc2wtZn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YIDB4RkZGRkZGRkVVCg==
</data>
<flag name="review"
          id="185575"
          type_id="1"
          status="-"
          setter="fpizlo"
    />
          </attachment>
      

    </bug>

</bugzilla>