Bug 125950

Summary: REGRESSION(r157480): ~8% on Dromaeo/jslib-style-prototype and ~3% on jslib-modify-prototype
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: barraclough, fpizlo, ggaren, oliver, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
A/B test result none

Comment 2 Radar WebKit Bug Importer 2013-12-20 13:12:13 PST
<rdar://problem/15711021>
Comment 3 Ryosuke Niwa 2013-12-20 19:58:07 PST
Created attachment 219833 [details]
A/B test result
Comment 4 Ryosuke Niwa 2013-12-20 20:01:19 PST
This regression is caused by http://trac.webkit.org/changeset/157480.

Maybe we can improve elsewhere to compensate the effect?  It seems unfortunate not being able to share the code between baseline JIT and DFG JIT.
Comment 5 Filip Pizlo 2013-12-20 20:07:23 PST
(In reply to comment #4)
> This regression is caused by http://trac.webkit.org/changeset/157480.

Oh!  That's great news!

Previously we had two completely separate implementations of inline caching (IC): the baseline JIT version and the DFG version.  In many ways, the DFG version was better (cleaner implementation, somewhat more complete) but in other ways the baseline version was more complete (it had more performance hacks).

This patch killed the baseline version because we all sort of agreed that it was no longer maintainable.

This regression tells us that there were some performance hacks in the baseline JIT IC that apparently the DFG IC doesn't yet have.  We know that there was a finite set of things that the baseline JIT IC did that the DFG JIT IC didn't do, so we can either:

- Go through that set of optimizations and implement each of them in the DFG JIT IC.

- Check out r157479 and selectively turn off different baseline JIT IC optimizations to figure out which one these benchmarks love so much.

> 
> Maybe we can improve elsewhere to compensate the effect?

We can probably do that, but we could also just add whatever performance hack the Baseline JIT IC had that to the DFG JIT IC.

> It seems unfortunate not being able to share the code between baseline JIT and DFG JIT.

There's no fundamental problem with the DFG JIT IC - it's just newer code that doesn't have all of the same optimization hacks that the 5-year-old baseline JIT IC had.  We thought that the DFG JIT IC had enough hacks to perform well on benchmarks but I guess we were wrong.  Now it's just a matter of figuring out which gnarly path through the baseline JIT IC code was so beneficial to these benchmarks.  Then it'll probably take no more than a 10KB patch to add that same stuff to the DFG JIT IC.
Comment 6 Ryosuke Niwa 2014-01-21 20:51:10 PST
This appears to be also affecting DoYouEvenBench by ~1%.