<?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>136020</bug_id>
          
          <creation_ts>2014-08-16 12:07:09 -0700</creation_ts>
          <short_desc>Rationalize the handling of DFG polymorphic call inlining when we see a mix of closures and non-closures</short_desc>
          <delta_ts>2015-01-27 12:01:23 -0800</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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>
          <dependson>135145</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Filip Pizlo">fpizlo</assigned_to>
          <cc>barraclough</cc>
    
    <cc>ggaren</cc>
    
    <cc>mark.lam</cc>
    
    <cc>mmirman</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1029632</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2014-08-16 12:07:09 -0700</bug_when>
    <thetext>...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1064593</commentid>
    <comment_count>1</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-01-27 12:01:04 -0800</bug_when>
    <thetext>Found the issue.  It&apos;s not a polyvariant call - it&apos;s actually a polymorphic call.  In richards, there is a call to the task run method call that can go to one of 4 task run methods (IdleTask, DeviceTask, WorkerTask, or HandlerTask).  The DeviceTask ends up being the most commonly called, but it&apos;s the last to be called.  So with call edge profiling we detect that we should emit:

if (callee = DeviceTask run)
    inline DeviceTask run
else
    polymorphic call

This ends up producing a healthy speed-up.  But with the new polymorphic call inline caching, we see the first three device types to be called (IdleTask, WorkerTask, and HandlerTask) and then we see a very high slow path count because the DeviceTask is what we usually end up calling.

This *might* be an example of why we want per-callee frequencies.  But it might also just be a good reason to increase the number of callees we allow in the poly call IC.  I&apos;ll mess with that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1064594</commentid>
    <comment_count>2</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-01-27 12:01:23 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; Found the issue.  It&apos;s not a polyvariant call - it&apos;s actually a polymorphic
&gt; call.  In richards, there is a call to the task run method call that can go
&gt; to one of 4 task run methods (IdleTask, DeviceTask, WorkerTask, or
&gt; HandlerTask).  The DeviceTask ends up being the most commonly called, but
&gt; it&apos;s the last to be called.  So with call edge profiling we detect that we
&gt; should emit:
&gt; 
&gt; if (callee = DeviceTask run)
&gt;     inline DeviceTask run
&gt; else
&gt;     polymorphic call
&gt; 
&gt; This ends up producing a healthy speed-up.  But with the new polymorphic
&gt; call inline caching, we see the first three device types to be called
&gt; (IdleTask, WorkerTask, and HandlerTask) and then we see a very high slow
&gt; path count because the DeviceTask is what we usually end up calling.
&gt; 
&gt; This *might* be an example of why we want per-callee frequencies.  But it
&gt; might also just be a good reason to increase the number of callees we allow
&gt; in the poly call IC.  I&apos;ll mess with that.

WRONG BUG.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>