<?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>201158</bug_id>
          
          <creation_ts>2019-08-26 16:08:10 -0700</creation_ts>
          <short_desc>[JSC] JSPromise should work with object-allocation-sinking</short_desc>
          <delta_ts>2019-08-30 16:59:23 -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>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="Yusuke Suzuki">ysuzuki</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1565140</commentid>
    <comment_count>0</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2019-08-26 16:08:10 -0700</bug_when>
    <thetext>...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1565141</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-08-26 16:08:32 -0700</bug_when>
    <thetext>&lt;rdar://problem/54726575&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1566840</commentid>
    <comment_count>2</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2019-08-30 15:29:27 -0700</bug_when>
    <thetext>won&apos;t inlining the constructor which will be written in JS now sink the executor function?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1566843</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2019-08-30 15:37:03 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #2)
&gt; won&apos;t inlining the constructor which will be written in JS now sink the
&gt; executor function?

I would like to sink JSPromise object itself too when it can be done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1566847</commentid>
    <comment_count>4</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2019-08-30 15:38:23 -0700</bug_when>
    <thetext>One possible thing (I&apos;m not talking about whether it is possible in our implementation) is, 

Promise.resolve(42).then(function (value) {
    //
});

Promise.resolve&apos;s returning promise is essentially unnecessary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1566876</commentid>
    <comment_count>5</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2019-08-30 16:28:52 -0700</bug_when>
    <thetext>(In reply to Yusuke Suzuki from comment #4)
&gt; One possible thing (I&apos;m not talking about whether it is possible in our
&gt; implementation) is, 
&gt; 
&gt; Promise.resolve(42).then(function (value) {
&gt;     //
&gt; });
&gt; 
&gt; Promise.resolve&apos;s returning promise is essentially unnecessary.

Yeah it would be nice too. But is this common?

Maybe through inlining it might become common. That said, don&apos;t we need the intermediate promise because &quot;function (value)&quot; isn&apos;t called until next run loop tick?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1566888</commentid>
    <comment_count>6</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2019-08-30 16:59:23 -0700</bug_when>
    <thetext>(In reply to Saam Barati from comment #5)
&gt; (In reply to Yusuke Suzuki from comment #4)
&gt; &gt; One possible thing (I&apos;m not talking about whether it is possible in our
&gt; &gt; implementation) is, 
&gt; &gt; 
&gt; &gt; Promise.resolve(42).then(function (value) {
&gt; &gt;     //
&gt; &gt; });
&gt; &gt; 
&gt; &gt; Promise.resolve&apos;s returning promise is essentially unnecessary.
&gt; 
&gt; Yeah it would be nice too. But is this common?
&gt; 
&gt; Maybe through inlining it might become common. That said, don&apos;t we need the
&gt; intermediate promise because &quot;function (value)&quot; isn&apos;t called until next run
&gt; loop tick?

In the above example, Promise.resolve&apos;s promise is unnecessary. It is already resolved. Microtask only contains reactions of Promises, and value for resolution, so Promise object itself is not necessary.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>