Bug 64774 - DFG JIT sometimes emits spill code even when the respective values are never needed
Summary: DFG JIT sometimes emits spill code even when the respective values are never ...
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-18 19:05 PDT by Filip Pizlo
Modified: 2011-07-19 11:55 PDT (History)
3 users (show)

See Also:


Attachments
the patch (28.18 KB, patch)
2011-07-18 21:21 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-18 19:05:47 PDT
The DFG JIT does register allocation on-the-fly during code generation.  While emitting code for a DFG node, the registers needed are first reserved prior to any code being emitted, and are typically only released after.  If the code that is emitted needs to save (and possibly restore) registers (using either the silentSpillAllRegisters or the flushRegisters facilities), then this may contain redundant code that spills and fills values that are dead already, since the relevant registers are only unreserved after the code is emitted.  The DFG JIT should more carefully track which registers die during in the middle of the code for a DFG node, so that any save/restore sequences that are emitted will omit registers that are already dead.
Comment 1 Filip Pizlo 2011-07-18 21:21:04 PDT
Created attachment 101268 [details]
the patch
Comment 2 Gavin Barraclough 2011-07-19 11:10:48 PDT
Comment on attachment 101268 [details]
the patch

Per our last discussion I'd quite like to refactor this to make the RAII pattern a little more useful here, and try to make some of this more automatic - but we already have the issue of requiring that gpr() is called at the right point, and this all looks fine.
Comment 3 WebKit Review Bot 2011-07-19 11:55:29 PDT
Comment on attachment 101268 [details]
the patch

Clearing flags on attachment: 101268

Committed r91280: <http://trac.webkit.org/changeset/91280>
Comment 4 WebKit Review Bot 2011-07-19 11:55:34 PDT
All reviewed patches have been landed.  Closing bug.