<?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>228550</bug_id>
          
          <creation_ts>2021-07-28 06:10:35 -0700</creation_ts>
          <short_desc>LLInt get_by_id unset IC looks inadventently disabled</short_desc>
          <delta_ts>2021-08-04 06:11:17 -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>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Angelos Oikonomopoulos">angelos</reporter>
          <assigned_to name="Angelos Oikonomopoulos">angelos</assigned_to>
          <cc>ews-watchlist</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
    
    <cc>tzagallo</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1780033</commentid>
    <comment_count>0</comment_count>
    <who name="Angelos Oikonomopoulos">angelos</who>
    <bug_when>2021-07-28 06:10:35 -0700</bug_when>
    <thetext>LLInt get_by_id IC looks inadventently disabled</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780034</commentid>
    <comment_count>1</comment_count>
      <attachid>434424</attachid>
    <who name="Angelos Oikonomopoulos">angelos</who>
    <bug_when>2021-07-28 06:11:05 -0700</bug_when>
    <thetext>Created attachment 434424
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780039</commentid>
    <comment_count>2</comment_count>
    <who name="Angelos Oikonomopoulos">angelos</who>
    <bug_when>2021-07-28 06:16:13 -0700</bug_when>
    <thetext>This commit

https://github.com/WebKit/WebKit/commit/22d3ec3ad0249d03d9a909c909fb1ccc246e1de5#diff-95ecbe05ccde2fa9490e1bac06bc5a159fabc13dc58aa4e7a33114fd95176d0aR775

appears to accidentally disable unsetMode for the IC in performLLIntGetByID. Specifically, we can only switch to unsetMode in setupGetByIdPrototypeCache, but the only call to setupGetByIdPrototypeCache is guarded by

     if (!LLINT_ALWAYS_ACCESS_SLOW
         &amp;&amp; baseValue.isCell()
         &amp;&amp; slot.isCacheable()
         &amp;&amp; !slot.isUnset()) {

in the body of performLLIntGetByID.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780109</commentid>
    <comment_count>3</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2021-07-28 10:32:39 -0700</bug_when>
    <thetext>(In reply to Angelos Oikonomopoulos from comment #0)
&gt; LLInt get_by_id IC looks inadventently disabled

The name of this bug seems off. I think you mean just proto loads.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780357</commentid>
    <comment_count>4</comment_count>
    <who name="Angelos Oikonomopoulos">angelos</who>
    <bug_when>2021-07-29 04:49:39 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #3)
&gt; (In reply to Angelos Oikonomopoulos from comment #0)
&gt; &gt; LLInt get_by_id IC looks inadventently disabled
&gt; 
&gt; The name of this bug seems off. I think you mean just proto loads.

I meant unsetMode. Updated the name.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780460</commentid>
    <comment_count>5</comment_count>
      <attachid>434424</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2021-07-29 11:20:24 -0700</bug_when>
    <thetext>Comment on attachment 434424
Patch

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

&gt; Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:775
&gt; -        &amp;&amp; slot.isCacheable()
&gt; -        &amp;&amp; !slot.isUnset()) {
&gt; +        &amp;&amp; slot.isCacheable()) {

I don&apos;t see how this is doing anything. In the below code, we only check for isValue before doing proto loads. What am I missing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780728</commentid>
    <comment_count>6</comment_count>
    <who name="Angelos Oikonomopoulos">angelos</who>
    <bug_when>2021-07-30 02:16:11 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #5)
&gt; Comment on attachment 434424 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=434424&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:775
&gt; &gt; -        &amp;&amp; slot.isCacheable()
&gt; &gt; -        &amp;&amp; !slot.isUnset()) {
&gt; &gt; +        &amp;&amp; slot.isCacheable()) {
&gt; 
&gt; I don&apos;t see how this is doing anything. In the below code, we only check for
&gt; isValue before doing proto loads. What am I missing?

Going by your use of &apos;only&apos;, what you&apos;re missing may be that

} else if (UNLIKELY(metadata.hitCountForLLIntCaching &amp;&amp; slot.isValue())) {

is nested within

if (!LLINT_ALWAYS_ACCESS_SLOW
        &amp;&amp; baseValue.isCell()
        &amp;&amp; slot.isCacheable()
        &amp;&amp; !slot.isUnset()) {

?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780792</commentid>
    <comment_count>7</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2021-07-30 08:25:04 -0700</bug_when>
    <thetext>(In reply to Angelos Oikonomopoulos from comment #6)
&gt; (In reply to Saam Barati from comment #5)
&gt; &gt; Comment on attachment 434424 [details]
&gt; &gt; Patch
&gt; &gt; 
&gt; &gt; View in context:
&gt; &gt; https://bugs.webkit.org/attachment.cgi?id=434424&amp;action=review
&gt; &gt; 
&gt; &gt; &gt; Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:775
&gt; &gt; &gt; -        &amp;&amp; slot.isCacheable()
&gt; &gt; &gt; -        &amp;&amp; !slot.isUnset()) {
&gt; &gt; &gt; +        &amp;&amp; slot.isCacheable()) {
&gt; &gt; 
&gt; &gt; I don&apos;t see how this is doing anything. In the below code, we only check for
&gt; &gt; isValue before doing proto loads. What am I missing?
&gt; 
&gt; Going by your use of &apos;only&apos;, what you&apos;re missing may be that
&gt; 
&gt; } else if (UNLIKELY(metadata.hitCountForLLIntCaching &amp;&amp; slot.isValue())) {
&gt; 
&gt; is nested within
&gt; 
&gt; if (!LLINT_ALWAYS_ACCESS_SLOW
&gt;         &amp;&amp; baseValue.isCell()
&gt;         &amp;&amp; slot.isCacheable()
&gt;         &amp;&amp; !slot.isUnset()) {
&gt; 
&gt; ?

slot.isValue() implies !slot.isUnset(). You can&apos;t be both a value and unset. So I don&apos;t see how removing !slot.isUnset() changes anything to be different in the proto load case, since we check slot.isValue()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780800</commentid>
    <comment_count>8</comment_count>
    <who name="Angelos Oikonomopoulos">angelos</who>
    <bug_when>2021-07-30 08:29:20 -0700</bug_when>
    <thetext>Fair enough, the patch is a no-op then. But AFAICT unsetMode remains effectively disabled, since the only call to setupGetByIdPrototypeCache is guarded by the slot.isValue() check.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780906</commentid>
    <comment_count>9</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2021-07-30 12:28:15 -0700</bug_when>
    <thetext>(In reply to Angelos Oikonomopoulos from comment #8)
&gt; Fair enough, the patch is a no-op then. But AFAICT unsetMode remains
&gt; effectively disabled, since the only call to setupGetByIdPrototypeCache is
&gt; guarded by the slot.isValue() check.

Right. Maybe that call to setupGetByIdPrototypeCache shouldn&apos;t be guarded by isValue()?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1780907</commentid>
    <comment_count>10</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2021-07-30 12:30:30 -0700</bug_when>
    <thetext>Clearing &quot;r?&quot; for now</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1781872</commentid>
    <comment_count>11</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-08-04 06:11:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/81511696&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>434424</attachid>
            <date>2021-07-28 06:11:05 -0700</date>
            <delta_ts>2021-07-30 12:30:38 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-228550-20210728131103.patch</filename>
            <type>text/plain</type>
            <size>1422</size>
            <attacher name="Angelos Oikonomopoulos">angelos</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjgwMzgwCmRpZmYgLS1naXQgYS9Tb3VyY2UvSmF2YVNjcmlw
dENvcmUvQ2hhbmdlTG9nIGIvU291cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwppbmRleCAy
ZGQ5ZDNmNTYxNTQ1ZjhjNWU4NzdjMjQwYjQ4NGFjNzAzYWIyZjlkLi4zZmFjOWI4Y2Y0MmIzMzk5
MmIyNDExZTRjNjU0MzEzNDc4YzAxOTQ4IDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2YVNjcmlwdENv
cmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwxMyBAQAorMjAyMS0wNy0yOCAgQW5nZWxvcyBPaWtvbm9tb3BvdWxvcyAgPGFuZ2Vsb3NA
aWdhbGlhLmNvbT4KKworICAgICAgICBMTEludCBnZXRfYnlfaWQgSUMgbG9va3MgaW5hZHZlbnRl
bnRseSBkaXNhYmxlZAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9za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