Bug 136020 - Rationalize the handling of DFG polymorphic call inlining when we see a mix of closures and non-closures
Summary: Rationalize the handling of DFG polymorphic call inlining when we see a mix o...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on: 135145
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-16 12:07 PDT by Filip Pizlo
Modified: 2015-01-27 12:01 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2014-08-16 12:07:09 PDT
...
Comment 1 Filip Pizlo 2015-01-27 12:01:04 PST
Found the issue.  It's not a polyvariant call - it'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'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'll mess with that.
Comment 2 Filip Pizlo 2015-01-27 12:01:23 PST
(In reply to comment #1)
> Found the issue.  It's not a polyvariant call - it'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'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'll mess with that.

WRONG BUG.