[Webkit-unassigned] [Bug 171387] New: AirLowerStackArgs: generate less code for large offsets

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 27 12:47:05 PDT 2017


            Bug ID: 171387
           Summary: AirLowerStackArgs: generate less code for large
           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: jfbastien at apple.com
                CC: fpizlo at apple.com, jfbastien at apple.com,
                    keith_miller at apple.com, mark.lam at apple.com,
                    msaboff at apple.com, sbarati at apple.com
        Depends on: 170215

As part of bug #170215 I'm teaching AirowerStackArgs to handle large offsets from FP / SP on ARM, because it used to just assert.

We'll turn code such as:
    Move (spill337), (spill201), %r0, @8735

    Move $1404, %r16, @8736
    Add64 %sp, %r16, @8736
    Move (%r16), 2032(%sp), %r0, @8736

The code I'm writing for now will be silly and won't re-use r16 for large offsets even if it could.

This could be generated:
    Move 1416(%sp), 2016(%sp), %r0, @8735
    Move $1404, %r16, @8736
    Add64 %sp, %r16, @8736
    Move (%r16), 2032(%sp), %r0, @8736
    Move 1400(%sp), 2024(%sp), %r0, @8737
    Move 16(%r16), 2160(%sp), %r0, @8738
    Move 360(%r16), 2280(%sp), %r0, @8739
    Move 1376(%sp), 2080(%sp), %r0, @8740
    Move 24(%r16), 2104(%sp), %r0, @8741
    Move 1040(%sp), -208(%fp), %r0, @8742
    Move 1360(%sp), 2200(%sp), %r0, @8743
    Move 8(%r16), 2048(%sp), %r0, @8744
    Move 1048(%sp), -248(%fp), %r0, @8745
    Move 1328(%sp), -200(%fp), %r0, @8746
    Move 1392(%sp), 2176(%sp), %r0, @8747
    Move 1384(%sp), 2088(%sp), %r0, @8748
    Move 32(%r16), 2096(%sp), %r0, @8749
    Move 1344(%sp), 2328(%sp), %r0, @8750
    Move 40(%r16), 2120(%sp), %r0, @8751
    Move 56(%r16), 2240(%sp), %r0, @8752
    Move 1312(%sp), -216(%fp), %r0, @8753
    Move 1320(%sp), -232(%fp), %r0, @8754
    Move 1336(%sp), 2248(%sp), %r0, @8755
    Move 64(%r16), 2224(%sp), %r0, @8756
    Move32 1356(%sp), %r1, @8757

The code simply needs to, per basic block:
 - Track the last offset value generated in r16
 - Invalidate on clobber (dest==r16 or writesPinned calls)
 - If a new offset doesn't fit in addr, update the tracking value

This isn't super risky but also isn't worth doing in #170215.

Referenced Bugs:

[Bug 170215] WebAssembly: Air::Inst::generate crashes on large binary on A64
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/20170427/658617b6/attachment.html>

More information about the webkit-unassigned mailing list