<?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>163834</bug_id>
          
          <creation_ts>2016-10-21 19:19:57 -0700</creation_ts>
          <short_desc>TryGetById clobberize rules are wrong</short_desc>
          <delta_ts>2020-07-20 22:20:13 -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>WebKit 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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Saam Barati">saam</reporter>
          <assigned_to name="Mark Lam">mark.lam</assigned_to>
          <cc>benjamin</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>gskachkov</cc>
    
    <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
    
    <cc>ticaiolima</cc>
    
    <cc>tzagallo</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1243226</commentid>
    <comment_count>0</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-10-21 19:19:57 -0700</bug_when>
    <thetext>It calls getOwnPropertySlot(VMInquiry), which isn&apos;t supposed to do user observable effects, but it can definitely do other effects that the compiler needs to be aware of. For example, certain getOwnPropertySlot implementations will materialize properties lazily, so they can allocate and transition structures. It may be safe for now to just claim that TryGetById write(Heap). We may also be able to get away with giving it the same clobberize rules as PureGetById.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1613669</commentid>
    <comment_count>1</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2020-01-31 16:54:36 -0800</bug_when>
    <thetext>safe to execute might also be wrong</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1662684</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2020-06-15 10:08:09 -0700</bug_when>
    <thetext>@Saam I think this is now fixed, right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1662720</commentid>
    <comment_count>3</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2020-06-15 11:22:02 -0700</bug_when>
    <thetext>(In reply to Yusuke Suzuki from comment #2)
&gt; @Saam I think this is now fixed, right?

No, we still say it doesn&apos;t do any writes, even though on VMInquiry, some getOwnPropetySlot may do transitions, etc:

    case TryGetById: {
        read(Heap);
        return;
    }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1662721</commentid>
    <comment_count>4</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2020-06-15 11:22:12 -0700</bug_when>
    <thetext>We should probably just say write(World)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1662722</commentid>
    <comment_count>5</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2020-06-15 11:22:30 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #4)
&gt; We should probably just say write(World)

write(Heap)**</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1673328</commentid>
    <comment_count>6</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2020-07-20 17:06:56 -0700</bug_when>
    <thetext>&lt;rdar://problem/65625807&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1673332</commentid>
    <comment_count>7</comment_count>
      <attachid>404782</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2020-07-20 17:48:37 -0700</bug_when>
    <thetext>Created attachment 404782
proposed patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1673339</commentid>
    <comment_count>8</comment_count>
      <attachid>404782</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2020-07-20 18:19:16 -0700</bug_when>
    <thetext>Comment on attachment 404782
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=404782&amp;action=review

&gt; Source/JavaScriptCore/dfg/DFGClobbersExitState.cpp:88
&gt; +    case TryGetById:

you might want some more explanation here comment-wise. TryGetById does clobber memory potentially. But it&apos;s not spec-observable. That&apos;s why it&apos;s ok that it doesn&apos;t clobber exit state.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1673340</commentid>
    <comment_count>9</comment_count>
      <attachid>404782</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2020-07-20 18:22:29 -0700</bug_when>
    <thetext>Comment on attachment 404782
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=404782&amp;action=review

&gt;&gt; Source/JavaScriptCore/dfg/DFGClobbersExitState.cpp:88
&gt;&gt; +    case TryGetById:
&gt; 
&gt; you might want some more explanation here comment-wise. TryGetById does clobber memory potentially. But it&apos;s not spec-observable. That&apos;s why it&apos;s ok that it doesn&apos;t clobber exit state.

Doesn&apos;t the comment immediately below this already say that effectively?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1673341</commentid>
    <comment_count>10</comment_count>
      <attachid>404782</attachid>
    <who name="Keith Miller">keith_miller</who>
    <bug_when>2020-07-20 18:25:39 -0700</bug_when>
    <thetext>Comment on attachment 404782
proposed patch.

r=me. Assuming I&apos;m right in my thinking that we shouldn&apos;t, correctly, writing to the stack in TryGetById, can you add a comment to the ChangeLog that we are slightly more conservative than necessary? I can&apos;t think of a way we can do that off the top of my head today. However, I think the right answer is to just assume some future world where we will ask what our caller is or something.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1673342</commentid>
    <comment_count>11</comment_count>
      <attachid>404782</attachid>
    <who name="Keith Miller">keith_miller</who>
    <bug_when>2020-07-20 18:27:26 -0700</bug_when>
    <thetext>Comment on attachment 404782
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=404782&amp;action=review

&gt;&gt;&gt; Source/JavaScriptCore/dfg/DFGClobbersExitState.cpp:88
&gt;&gt;&gt; +    case TryGetById:
&gt;&gt; 
&gt;&gt; you might want some more explanation here comment-wise. TryGetById does clobber memory potentially. But it&apos;s not spec-observable. That&apos;s why it&apos;s ok that it doesn&apos;t clobber exit state.
&gt; 
&gt; Doesn&apos;t the comment immediately below this already say that effectively?

Yeah, I don&apos;t think you need another comment here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1673344</commentid>
    <comment_count>12</comment_count>
      <attachid>404782</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2020-07-20 19:02:08 -0700</bug_when>
    <thetext>Comment on attachment 404782
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=404782&amp;action=review

&gt;&gt;&gt;&gt; Source/JavaScriptCore/dfg/DFGClobbersExitState.cpp:88
&gt;&gt;&gt;&gt; +    case TryGetById:
&gt;&gt;&gt; 
&gt;&gt;&gt; you might want some more explanation here comment-wise. TryGetById does clobber memory potentially. But it&apos;s not spec-observable. That&apos;s why it&apos;s ok that it doesn&apos;t clobber exit state.
&gt;&gt; 
&gt;&gt; Doesn&apos;t the comment immediately below this already say that effectively?
&gt; 
&gt; Yeah, I don&apos;t think you need another comment here.

but we totally claim to write to an observable heap. It&apos;s more nuanced.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1673377</commentid>
    <comment_count>13</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2020-07-20 22:20:13 -0700</bug_when>
    <thetext>Thanks for the reviews.  I&apos;ve added some details to the ChangeLog but opted not to add an additional comment in DFGClobbersExitState.cpp.  There are nuanced differences but the existing comment is an accurate description about TryGetById as well.

Landed in r264643: &lt;http://trac.webkit.org/r264643&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>404782</attachid>
            <date>2020-07-20 17:48:37 -0700</date>
            <delta_ts>2020-07-20 18:25:39 -0700</delta_ts>
            <desc>proposed patch.</desc>
            <filename>bug-163834.patch</filename>
            <type>text/plain</type>
            <size>3104</size>
            <attacher name="Mark Lam">mark.lam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMjY0NjQwKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIxIEBA
CisyMDIwLTA3LTIwICBNYXJrIExhbSAgPG1hcmsubGFtQGFwcGxlLmNvbT4KKworICAgICAgICBU
cnlHZXRCeUlkIGNsb2JiZXJpemUgcnVsZXMgYXJlIHdyb25nLgorICAgICAgICBodHRwczovL2J1
Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTYzODM0CisgICAgICAgIDxyZGFyOi8vcHJv
YmxlbS82NTYyNTgwNz4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKwor
ICAgICAgICBUcnlHZXRCeUlkIGNhbiBkbyB0aGUgc2FtZSB0aGluZ3MgR2V0QnlJZCBkb2VzIGku
ZS4gcmVpZnkgbGF6eSBwcm9wZXJ0aWVzLCByZWFkCisgICAgICAgIHRoZSBzdGFjaywgZXRjLiAg
SGVu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Rv
IHRoYXQgcmlnaHQgbm93LgogICAgICAgICAvLyBGSVhNRTogaHR0cHM6Ly9idWdzLndlYmtpdC5v
cmcvc2hvd19idWcuY2dpP2lkPTE0ODQ0MAo=
</data>
<flag name="review"
          id="420181"
          type_id="1"
          status="+"
          setter="keith_miller"
    />
          </attachment>
      

    </bug>

</bugzilla>