<?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>148914</bug_id>
          
          <creation_ts>2015-09-06 13:01:57 -0700</creation_ts>
          <short_desc>[JSC] Do not use disallowStubs</short_desc>
          <delta_ts>2024-05-28 16:31:05 -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>Other</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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>
          <dependson>148915</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1124030</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-09-06 13:01:57 -0700</bug_when>
    <thetext>This would allow us to say that one stub routine requires another stub routine to be alive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1124322</commentid>
    <comment_count>1</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-09-08 11:29:42 -0700</bug_when>
    <thetext>This could also be addressed by having stub routines hold RefPtr&apos;s to each other.  For example, in the case of a getter, we have the following objects:

1) PolymorphicAccess
2) AccessCase
3) CallLinkInfo
4) JITStubRoutine for PolymorphicAccess
5) JITStubRoutine for CallLinkInfo

Currently we would have the following ownership/ref rules:

(1) owns (2)
(2) owns (3)
(1) refs (4)
(3) refs (5)

Everything would be fine if we also added:

(5) refs (4)

This feels like it might be a bit ad-hoc and certainly not as flexible if these were GC cells.  But, it would work!

In particular:
- If (5) gets deleted, then (3)-&gt;(5) must have been cleared first.
- If (4) gets deleted, then (1)-&gt;(4) and (5)-&gt;(4) must have been cleared first.
- If the owning stub gets destroyed, then everyone gets deleted.

Basically, there is no case where things leak and there is no case where a dangling pointer is left behind.

This could be implemented by giving CallLinkInfo a pointer to its owning JIT stub routine, or more generally, its &quot;JIT owner&quot;.  This would mean that we&apos;d also have:

(3) refs (4).

Then, when the CallLinkInfo needs to spawn a stub routine, it can ensure that this new stub routine refs the stub that owned the CallLinkInfo.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038260</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-05-28 12:58:29 -0700</bug_when>
    <thetext>&lt;rdar://problem/128886060&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038261</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2024-05-28 13:01:44 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/29187</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038320</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-05-28 16:31:03 -0700</bug_when>
    <thetext>Committed 279410@main (5dec07a85f6e): &lt;https://commits.webkit.org/279410@main&gt;

Reviewed commits have been landed. Closing PR #29187 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>