Bug 65146 - DFG non-speculative JIT emits obviously inefficient code for arithmetic where one operand is a constant
Summary: DFG non-speculative JIT emits obviously inefficient code for arithmetic where...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-25 16:01 PDT by Filip Pizlo
Modified: 2011-07-25 18:05 PDT (History)
3 users (show)

See Also:


Attachments
the patch (5.31 KB, patch)
2011-07-25 16:40 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2011-07-25 16:01:02 PDT
The DFG non-speculative JIT uses C function calls as non-integer or overflow-handling slow-paths for arithmetic against constants.  This is obviously inefficient, since the code will almost always see a number in the non-constant operand, and emitting int-to-double conversion (or double unboxing) followed by double arithmetic is both faster and likely involves less code than a C call.
Comment 1 Filip Pizlo 2011-07-25 16:40:40 PDT
Created attachment 101942 [details]
the patch
Comment 2 Gavin Barraclough 2011-07-25 16:47:12 PDT
Comment on attachment 101942 [details]
the patch

I guess we might want to also be able inline double code for ValueAdd too at some point.
Comment 3 Filip Pizlo 2011-07-25 16:48:23 PDT
(In reply to comment #2)
> (From update of attachment 101942 [details])
> I guess we might want to also be able inline double code for ValueAdd too at some point.

Indeed, and I think that we're actually hitting that slow path in Kraken.
Comment 4 WebKit Review Bot 2011-07-25 18:05:01 PDT
Comment on attachment 101942 [details]
the patch

Clearing flags on attachment: 101942

Committed r91734: <http://trac.webkit.org/changeset/91734>
Comment 5 WebKit Review Bot 2011-07-25 18:05:05 PDT
All reviewed patches have been landed.  Closing bug.