<?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>84476</bug_id>
          
          <creation_ts>2012-04-20 12:09:18 -0700</creation_ts>
          <short_desc>JSGarbageCollect should not call collectAllGarbage()</short_desc>
          <delta_ts>2012-04-20 12:36:28 -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>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Mark Hahnenberg">mhahnenberg</reporter>
          <assigned_to name="Mark Hahnenberg">mhahnenberg</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>606788</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2012-04-20 12:09:18 -0700</bug_when>
    <thetext>JSGarbageCollect should not synchronously call collectAllGarbage(). Instead, it should notify the GCActivityCallback that it has abandoned an object graph, which will set the timer to run at some point in the future that JSC can decide according to its own policies.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606790</commentid>
    <comment_count>1</comment_count>
      <attachid>138139</attachid>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2012-04-20 12:11:25 -0700</bug_when>
    <thetext>Created attachment 138139
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606796</commentid>
    <comment_count>2</comment_count>
      <attachid>138139</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2012-04-20 12:17:14 -0700</bug_when>
    <thetext>Comment on attachment 138139
Patch

Let&apos;s fix the FIXME by taking advantage of our new callback, like so:

- Cancel the GC timer at the start of collection (rename didCollect to willCollect)
- If collection causes a didAbandonObjectGraph, it can now start the timer, which will, in fact, cause another collection later.

In the same patch, you can remove the isBusy() check, since didAbandonObjectGraph is safe to call while the heap is busy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>606813</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2012-04-20 12:36:28 -0700</bug_when>
    <thetext>Committed r114771: &lt;http://trac.webkit.org/changeset/114771&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>138139</attachid>
            <date>2012-04-20 12:11:25 -0700</date>
            <delta_ts>2012-04-20 12:21:13 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-84476-20120420121124.patch</filename>
            <type>text/plain</type>
            <size>1329</size>
            <attacher name="Mark Hahnenberg">mhahnenberg</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTE0NzY5KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBA
CisyMDEyLTA0LTIwICBNYXJrIEhhaG5lbmJlcmcgIDxtaGFobmVuYmVyZ0BhcHBsZS5jb20+CisK
KyAgICAgICAgSlNHYXJiYW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xlY3RBbGxHYXJiYWdlKCk7CisgICAgICAgIGdsb2Jh
bERhdGEuaGVhcC5hY3Rpdml0eUNhbGxiYWNrKCktPmRpZEFiYW5kb25PYmplY3RHcmFwaCgpOwog
CiAgICAgLy8gRklYTUU6IFBlcmhhcHMgd2Ugc2hvdWxkIHRyaWdnZXIgYSBzZWNvbmQgbWFyayBh
bmQgc3dlZXAKICAgICAvLyBvbmNlIHRoZSBnYXJiYWdlIGNvbGxlY3RvciBpcyBkb25lIGlmIHRo
aXMgaXMgY2FsbGVkIHdoZW4K
</data>
<flag name="review"
          id="143411"
          type_id="1"
          status="+"
          setter="ggaren"
    />
          </attachment>
      

    </bug>

</bugzilla>