[Webkit-unassigned] [Bug 237841] New: [JSC] Eliminate dead bytecode locals

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 14 10:42:09 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=237841

            Bug ID: 237841
           Summary: [JSC] Eliminate dead bytecode locals
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: rmorisset at apple.com

The bytecode generator tends to allocate more locals than strictly necessary. I saw quite a few examples, e.g. allocating two locals for the scope even when the function is simple enough to only need one:
[   0] enter              
[   1] get_scope          dst:loc4
[   3] mov                dst:loc5, src:loc4
[   6] check_traps  
Where loc5 is completely unused afterwards

I can think of two ways to solve this:
- either going carefully through a bunch of examples and for each one finding all dead locals, tracking where it came from and fixing this particular part of the bytecode generator
- or just adding a generic dead local elimination phase to the bytecode generator.

The latter seems easier, but the former is less likely to cause a perf regression.

The memory benefit here should be tiny, but I would expect some significant win in DFG compilation time, considering that most DFG phases constantly manipulate mappings from Local -> some kind of data, and materialize these mappings at each BasicBlock boundary.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220314/2f417798/attachment-0001.htm>


More information about the webkit-unassigned mailing list