Skip to content

Port all i64 and i32 ops to ARMv7 - #3

Merged
xanlpz merged 1 commit into
xanlpz:wasm32from
gezalore:wasm32-integer-ops
Jan 26, 2022
Merged

xanlpz merged 1 commit into
xanlpz:wasm32from
gezalore:wasm32-integer-ops

Conversation

@gezalore

Copy link
Copy Markdown

No description provided.

@xanlpz
xanlpz merged commit 34d6e87 into xanlpz:wasm32 Jan 26, 2022
@gezalore
gezalore deleted the wasm32-integer-ops branch January 26, 2022 18:41
xanlpz pushed a commit that referenced this pull request May 27, 2022
…LInt asm.

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

Reviewed by Geoffrey Garen.

With this, debugging LLInt code will be easier.  LLInt code will no longer all be at an
offset from vmEntryToJavaScript.  They will instead be broken up into different sections
under human readable labels.

Secondly, crash traces of LLInt crashes will now be able to give us the nearest label
for a crash site, as opposed to everything being an offset from vmEntryToJavaScript.

For example, instead of this:

    JavaScriptCore`vmEntryToJavaScript:
        0x1026525b8 <+0>:   pacibsp
        0x1026525bc <+4>:   stp    x29, x30, [sp, #-0x10]!
        0x1026525c0 <+8>:   mov    x29, sp
        0x1026525c4 <+12>:  sub    sp, x29, #0xb0
        0x1026525c8 <+16>:  mov    x13, #0xc800
        0x1026525cc <+20>:  add    x17, x1, x13
        0x1026525d0 <+24>:  ldr    w4, [x17]
        0x1026525d4 <+28>:  cbnz   w4, 0x10265275c           ; vmEntryToJavaScriptGateAfter + 120
        0x1026525d8 <+32>:  str    x1, [sp]
        0x1026525dc <+36>:  mov    x17, #0x9e78
        0x1026525e0 <+40>:  add    x13, x1, x17
        0x1026525e4 <+44>:  ldr    x4, [x13]
        0x1026525e8 <+48>:  str    x4, [sp, #0x8]
        0x1026525ec <+52>:  mov    x13, #0x9e70
        0x1026525f0 <+56>:  add    x17, x1, x13
        0x1026525f4 <+60>:  ldr    x4, [x17]
        0x1026525f8 <+64>:  str    x4, [sp, #0x10]
        0x1026525fc <+68>:  ldr    x4, [x2, #0x8]
        0x102652600 <+72>:  str    x4, [sp, #0x18]
        0x102652604 <+76>:  ldr    w4, [x2, #0x20]
        0x102652608 <+80>:  add    x4, x4, #0x5
        0x10265260c <+84>:  lsl    x4, x4, #3
        0x102652610 <+88>:  sub    x3, sp, x4
        0x102652614 <+92>:  cmp    sp, x3
        0x102652618 <+96>:  b.ls   0x10265271c               ; vmEntryToJavaScriptGateAfter + 56
        0x10265261c <+100>: mov    x17, #0xca00
        0x102652620 <+104>: add    x13, x1, x17
        0x102652624 <+108>: ldr    x17, [x13]
        0x102652628 <+112>: cmp    x3, x17
        0x10265262c <+116>: b.lo   0x10265271c               ; vmEntryToJavaScriptGateAfter + 56
        0x102652630 <+120>: mov    sp, x3
        0x102652634 <+124>: mov    x3, #0x4
        0x102652638 <+128>: sub    w3, w3, #0x1
        0x10265263c <+132>: add    x17, x2, x3, lsl #3
        0x102652640 <+136>: ldr    x5, [x17]

We now get this:

    JavaScriptCore`vmEntryToJavaScript:
        0x1028b5d90 <+0>:   pacibsp
        0x1028b5d94 <+4>:   stp    x29, x30, [sp, #-0x10]!
        0x1028b5d98 <+8>:   mov    x29, sp
        0x1028b5d9c <+12>:  sub    sp, x29, #0xb0
        0x1028b5da0 <+16>:  mov    x13, #0xc800
        0x1028b5da4 <+20>:  add    x17, x1, x13
        0x1028b5da8 <+24>:  ldr    w4, [x17]
        0x1028b5dac <+28>:  cbnz   w4, 0x1028b5f34           ; _offlineasm_doVMEntry__checkVMEntryPermission
        0x1028b5db0 <+32>:  str    x1, [sp]
        0x1028b5db4 <+36>:  mov    x17, #0x9e78
        0x1028b5db8 <+40>:  add    x13, x1, x17
        0x1028b5dbc <+44>:  ldr    x4, [x13]
        0x1028b5dc0 <+48>:  str    x4, [sp, #0x8]
        0x1028b5dc4 <+52>:  mov    x13, #0x9e70
        0x1028b5dc8 <+56>:  add    x17, x1, x13
        0x1028b5dcc <+60>:  ldr    x4, [x17]
        0x1028b5dd0 <+64>:  str    x4, [sp, #0x10]
        0x1028b5dd4 <+68>:  ldr    x4, [x2, #0x8]
        0x1028b5dd8 <+72>:  str    x4, [sp, #0x18]
        0x1028b5ddc <+76>:  ldr    w4, [x2, #0x20]
        0x1028b5de0 <+80>:  add    x4, x4, #0x5
        0x1028b5de4 <+84>:  lsl    x4, x4, #3
        0x1028b5de8 <+88>:  sub    x3, sp, x4
        0x1028b5dec <+92>:  cmp    sp, x3
        0x1028b5df0 <+96>:  b.ls   0x1028b5ef4               ; _offlineasm_doVMEntry__throwStackOverflow
        0x1028b5df4 <+100>: mov    x17, #0xca00
        0x1028b5df8 <+104>: add    x13, x1, x17
        0x1028b5dfc <+108>: ldr    x17, [x13]
        0x1028b5e00 <+112>: cmp    x3, x17
        0x1028b5e04 <+116>: b.lo   0x1028b5ef4               ; _offlineasm_doVMEntry__throwStackOverflow

    JavaScriptCore`_offlineasm_doVMEntry__stackHeightOK:
        0x1028b5e08 <+0>:   mov    sp, x3
        0x1028b5e0c <+4>:   mov    x3, #0x4

    JavaScriptCore`_offlineasm_doVMEntry__copyHeaderLoop:
        0x1028b5e10 <+0>:   sub    w3, w3, #0x1
        0x1028b5e14 <+4>:   add    x17, x2, x3, lsl #3
        0x1028b5e18 <+8>:   ldr    x5, [x17]

This feature is only available when COMPILER(CLANG) is true.

* Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:

Canonical link: https://commits.webkit.org/250933@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
xanlpz pushed a commit that referenced this pull request May 27, 2022
https://bugs.webkit.org/show_bug.cgi?id=240885

Reviewed by Geoffrey Garen.

Code generated by the offlineasm is tightly coupled with JSC anyway.  Might as well
make the local labels more informative about where the code came from in crash traces.

So, instead of this:

    JavaScriptCore`vmEntryToJavaScript:
        0x1028b5d90 <+0 >:   pacibsp
        0x1028b5d94 <+4 >:   stp    x29, x30, [sp, #-0x10]!
        0x1028b5d98 <+8 >:   mov    x29, sp
        0x1028b5d9c <+12 >:  sub    sp, x29, #0xb0
        0x1028b5da0 <+16 >:  mov    x13, #0xc800
        0x1028b5da4 <+20 >:  add    x17, x1, x13
        0x1028b5da8 <+24 >:  ldr    w4, [x17]
        0x1028b5dac <+28 >:  cbnz   w4, 0x1028b5f34           ; _offlineasm_doVMEntry__checkVMEntryPermission
        0x1028b5db0 <+32 >:  str    x1, [sp]
        0x1028b5db4 <+36 >:  mov    x17, #0x9e78
        ...
        0x1028b5de8 <+88 >:  sub    x3, sp, x4
        0x1028b5dec <+92 >:  cmp    sp, x3
        0x1028b5df0 <+96 >:  b.ls   0x1028b5ef4               ; _offlineasm_doVMEntry__throwStackOverflow
        0x1028b5df4 <+100 >: mov    x17, #0xca00
        0x1028b5df8 <+104 >: add    x13, x1, x17
        0x1028b5dfc <+108 >: ldr    x17, [x13]
        0x1028b5e00 <+112 >: cmp    x3, x17
        0x1028b5e04 <+116 >: b.lo   0x1028b5ef4               ; _offlineasm_doVMEntry__throwStackOverflow

    JavaScriptCore`_offlineasm_doVMEntry__stackHeightOK:
        0x1028b5e08 <+0 >:   mov    sp, x3
        0x1028b5e0c <+4 >:   mov    x3, #0x4

    JavaScriptCore`_offlineasm_doVMEntry__copyHeaderLoop:
        0x1028b5e10 <+0 >:   sub    w3, w3, #0x1
        0x1028b5e14 <+4 >:   add    x17, x2, x3, lsl #3
        0x1028b5e18 <+8 >:   ldr    x5, [x17]

We now get this:

    JavaScriptCore`vmEntryToJavaScript:
        0x1028cdd90 <+0>:   pacibsp
        0x1028cdd94 <+4>:   stp    x29, x30, [sp, #-0x10]!
        0x1028cdd98 <+8>:   mov    x29, sp
        0x1028cdd9c <+12>:  sub    sp, x29, #0xb0
        0x1028cdda0 <+16>:  mov    x13, #0xc800
        0x1028cdda4 <+20>:  add    x17, x1, x13
        0x1028cdda8 <+24>:  ldr    w4, [x17]
        0x1028cddac <+28>:  cbnz   w4, 0x1028cdf34           ; jsc_llint_doVMEntry__checkVMEntryPermission
        0x1028cddb0 <+32>:  str    x1, [sp]
        0x1028cddb4 <+36>:  mov    x17, #0x9e78
        ...
        0x1028cdde8 <+88>:  sub    x3, sp, x4
        0x1028cddec <+92>:  cmp    sp, x3
        0x1028cddf0 <+96>:  b.ls   0x1028cdef4               ; jsc_llint_doVMEntry__throwStackOverflow
        0x1028cddf4 <+100>: mov    x17, #0xca00
        0x1028cddf8 <+104>: add    x13, x1, x17
        0x1028cddfc <+108>: ldr    x17, [x13]
        0x1028cde00 <+112>: cmp    x3, x17
        0x1028cde04 <+116>: b.lo   0x1028cdef4               ; jsc_llint_doVMEntry__throwStackOverflow

    JavaScriptCore`jsc_llint_doVMEntry__stackHeightOK:
        0x1028cde08 <+0>:   mov    sp, x3
        0x1028cde0c <+4>:   mov    x3, #0x4

    JavaScriptCore`jsc_llint_doVMEntry__copyHeaderLoop:
        0x1028cde10 <+0>:   sub    w3, w3, #0x1
        0x1028cde14 <+4>:   add    x17, x2, x3, lsl #3
        0x1028cde18 <+8>:   ldr    x5, [x17]

* Source/JavaScriptCore/offlineasm/arm.rb:
* Source/JavaScriptCore/offlineasm/arm64.rb:
* Source/JavaScriptCore/offlineasm/backends.rb:
* Source/JavaScriptCore/offlineasm/config.rb:

Canonical link: https://commits.webkit.org/250946@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
xanlpz pushed a commit that referenced this pull request Jun 30, 2022
https://bugs.webkit.org/show_bug.cgi?id=241905

Reviewed by Yusuke Suzuki.

offlineasm used to emit this LLInt code:
    ".loc 1 996\n"        "ldr x19, [x0] \n"                   // LowLevelInterpreter.asm:996
    ".loc 1 997\n"        "ldr x20, [x0, #8] \n"               // LowLevelInterpreter.asm:997
    ".loc 1 998\n"        "ldr x21, [x0, #16] \n"              // LowLevelInterpreter.asm:998
    ".loc 1 999\n"        "ldr x22, [x0, #24] \n"              // LowLevelInterpreter.asm:999
    ...
    ".loc 1 1006\n"       "ldr d8, [x0, WebKit#80] \n"               // LowLevelInterpreter.asm:1006
    ".loc 1 1007\n"       "ldr d9, [x0, WebKit#88] \n"               // LowLevelInterpreter.asm:1007
    ".loc 1 1008\n"       "ldr d10, [x0, WebKit#96] \n"              // LowLevelInterpreter.asm:1008
    ".loc 1 1009\n"       "ldr d11, [x0, WebKit#104] \n"             // LowLevelInterpreter.asm:1009
    ...

Now, it can emit this instead:
    ".loc 1 996\n"        "ldp x19, x20, [x0, #0] \n"          // LowLevelInterpreter.asm:996
    ".loc 1 997\n"        "ldp x21, x22, [x0, #16] \n"         // LowLevelInterpreter.asm:997
    ...
    ".loc 1 1001\n"       "ldp d8, d9, [x0, WebKit#80] \n"           // LowLevelInterpreter.asm:1001
    ".loc 1 1002\n"       "ldp d10, d11, [x0, WebKit#96] \n"         // LowLevelInterpreter.asm:1002
    ...

Also, there was some code that kept recomputing the base address of a sequence of load/store
instructions.  For example,
    ".loc 6 902\n"        "add x13, sp, x10, lsl #3 \n"        // WebAssembly.asm:902
                          "ldr x0, [x13, WebKit#48] \n"
                          "add x13, sp, x10, lsl #3 \n"
                          "ldr x1, [x13, WebKit#56] \n"
                          "add x13, sp, x10, lsl #3 \n"
                          "ldr x2, [x13, WebKit#64] \n"
                          "add x13, sp, x10, lsl #3 \n"
                          "ldr x3, [x13, WebKit#72] \n"
    ...

For such places, we observe that the base address is the same for every load/store instruction
in the sequence, and precompute it in the LLInt asm code to help out the offline asm.  This
allows the offlineasm to now emit this more efficient code instead:
    ".loc 6 896\n"        "add x10, sp, x10, lsl #3 \n"        // WebAssembly.asm:896
    ".loc 6 898\n"        "ldp x0, x1, [x10, WebKit#48] \n"          // WebAssembly.asm:898
                          "ldp x2, x3, [x10, WebKit#64] \n"
    ...

* Source/JavaScriptCore/llint/LowLevelInterpreter.asm:
* Source/JavaScriptCore/llint/WebAssembly.asm:
* Source/JavaScriptCore/offlineasm/arm64.rb:
* Source/JavaScriptCore/offlineasm/instructions.rb:

Canonical link: https://commits.webkit.org/251799@main
xanlpz pushed a commit that referenced this pull request Aug 22, 2022
…us wrapper

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

Reviewed by Antti Koivisto.

When the anonymous block wrapper for an inline level child is not needed anymore (sibling block is removed or became non-inflow), we
1. detach the inline level child (and its subtree)
2. destroy the anonymous wrapper
3. re-attach the inline level child under the new parent (most likely the parent of the destroyed anonymous wrapper)

We call this re-parenting activity an "internal move".
Certain properties (e.g fragmentation state) are not supposed to change during this type of move (we simply stop calling some "reset" functions when RenderObject::IsInternalMove::Yes)

This patch ensures that the internal move flag is set for both #1 and #3.

* Source/WebCore/rendering/RenderBlockFlow.cpp: drive-by fix to ensure no ruby content gets multi-column context.
(WebCore::RenderBlockFlow::willCreateColumns const):
* Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded): Make sure both detach and attach are covered with the "internal move" flag as currently only the attach is covered. It means that whatever flags we reset at detach (not an internal move) we don't set back on attach (internal move).

Canonical link: https://commits.webkit.org/252456@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants