Yes, without --predictable we compile concurrently, and we also print the
code concurrently. But on the other hand --predictable should not make a
difference for the generated code, so I would suggest to always pass
--predictable when printing code, but skipping it otherwise.
The disassembly looks like expected. In Liftoff, the code is longer and
there is some spilling in the loop and around the if block. That shouldn't
cause a 200x slowdown though.
So I would propose two things:
1) For your project, just disable Liftoff ("--no-liftoff") to get reliable
peak performance.
2) If you are interested to dig deeper, please prepare a standalone
reproducer and create a V8 bug. I could try to reproduce then, but it might
be the case that there is not much to do here, since the disassembly looks
like expected.
On Wed, Apr 8, 2020 at 12:28 PM Immanuel Haffner <[email protected]>
wrote:
> When running in the default configuration but comparing < 1 instead of <
> 0, this is the disassembly i get (and it runs for 11 ms).
>
> Liftoff:
> 0xfad0d8782c0 0 55 push rbp
> 0xfad0d8782c1 1 4889e5 REX.W movq rbp,rsp
> 0xfad0d8782c4 4 6a0a push 0xa
> 0xfad0d8782c6 6 4881ec28000000 REX.W subq rsp,0x28
> 0xfad0d8782cd d 488975f0 REX.W movq [rbp-0x10],rsi
> 0xfad0d8782d1 11 48c745dc00000000 REX.W movq [rbp-0x24],0x0
> 0xfad0d8782d9 19 48c745e400000000 REX.W movq [rbp-0x1c],0x0
> 0xfad0d8782e1 21 488b4df0 REX.W movq rcx,[rbp-0x10]
> 0xfad0d8782e5 25 488b4923 REX.W movq rcx,[rcx+0x23]
> 0xfad0d8782e9 29 483b21 REX.W cmpq rsp,[rcx]
> 0xfad0d8782ec 2c 0f86be000000 jna 0xfad0d8783b0 <+0xf0>
> 0xfad0d8782f2 32 488b4df0 REX.W movq rcx,[rbp-0x10]
> 0xfad0d8782f6 36 488b494f REX.W movq rcx,[rcx+0x4f]
> 0xfad0d8782fa 3a 8b11 movl rdx,[rcx]
> 0xfad0d8782fc 3c 488b4df0 REX.W movq rcx,[rbp-0x10]
> 0xfad0d878300 40 488b494f REX.W movq rcx,[rcx+0x4f]
> 0xfad0d878304 44 8b5904 movl rbx,[rcx+0x4]
> 0xfad0d878307 47 8945ec movl [rbp-0x14],rax
> 0xfad0d87830a 4a 8955e8 movl [rbp-0x18],rdx
> 0xfad0d87830d 4d 895de4 movl [rbp-0x1c],rbx
> 0xfad0d878310 50 488b45f0 REX.W movq rax,[rbp-0x10]
> 0xfad0d878314 54 488b4023 REX.W movq rax,[rax+0x23]
> 0xfad0d878318 58 483b20 REX.W cmpq rsp,[rax]
> 0xfad0d87831b 5b 0f869b000000 jna 0xfad0d8783bc <+0xfc>
>
> TurboFan:
> 0xfad0d878321 61 488b45f0 REX.W movq rax,[rbp-0x10]
> 0xfad0d878400 0 55 push rbp
> 0xfad0d878325 65 488b404f REX.W movq rax,[rax+0x4f]
> 0xfad0d878401 1 4889e5 REX.W movq rbp,rsp
> 0xfad0d878404 4 6a0a push 0xa
> 0xfad0d878406 6 56 push rsi
> 0xfad0d878329 69 8b480c movl rcx,[rax+0xc]
> 0xfad0d87832c 6c 8b45dc movl rax,[rbp-0x24]
> 0xfad0d878407 7 4883ec28 REX.W subq rsp,0x280xfad0d87832f
> 6f ba2c000000 movl rdx,0x2c
> 0xfad0d878334 74 0fafc2 imull rax,rdx
>
> 0xfad0d87840b b 488b5e4f REX.W movq rbx,[rsi+0x4f]
> 0xfad0d878337 77 03c8 addl rcx,rax0xfad0d87840f f
> 488b560b REX.W movq rdx,[rsi+0xb]
>
> 0xfad0d878413 13 488b4e13 REX.W movq
> rcx,[rsi+0x13]0xfad0d878339 79 488b55f0 REX.W movq rdx,[rbp-0x10]
>
> 0xfad0d87833d 7d 488b5213 REX.W movq rdx,[rdx+0x13]
> 0xfad0d878417 17 4883e903 REX.W subq rcx,0x30xfad0d878341 81
> b803000000 movl rax,0x3
>
> 0xfad0d87841b 1b 33ff xorl rdi,rdi0xfad0d878346 86
> 48f7d8 REX.W negq rax
> 0xfad0d87841d 1d 4c8bc7 REX.W movq r8,rdi
>
> 0xfad0d878349 89 4803c2 REX.W addq rax,rdx
> 0xfad0d87834c 8c 8bc9 movl rcx,rcx
> 0xfad0d87834e 8e 483bc8 REX.W cmpq rcx,rax
> 0xfad0d878351 91 0f836f000000 jnc 0xfad0d8783c6 <+0x106>
> 0xfad0d878357 97 488b45f0 REX.W movq rax,[rbp-0x10]
> 0xfad0d87835b 9b 488b400b REX.W movq rax,[rax+0xb]
> 0xfad0d87835f 9f 8b1408 movl rdx,[rax+rcx*1]
> 0xfad0d878362 a2 b801000000 movl rax,0x1
> 0xfad0d878367 a7 3bd0 cmpl rdx,rax
> 0xfad0d878420 20 4c8b4e23 REX.W movq r9,[rsi+0x23]
> 0xfad0d878424 24 493b21 REX.W cmpq rsp,[r9]
> 0xfad0d878369 a9 0f9cc2 setll dl
> 0xfad0d878427 27 0f8633000000 jna 0xfad0d878460 <+0x60>
> 0xfad0d87836c ac 0fb6d2 movzxbl rdx,rdx
> 0xfad0d87842d 2d 446bcf2c imull r9,rdi,0x2c
> 0xfad0d87836f af 85d2 testl rdx,rdx0xfad0d878431 31
> 448b5b0c movl r11,[rbx+0xc]
>
> 0xfad0d878435 35 4503cb addl r9,r11
> 0xfad0d878371 b1 0f840e000000 jz 0xfad0d878385
> <+0xc5>0xfad0d878438 38 4c3bc9 REX.W cmpq r9,rcx
>
> 0xfad0d878377 b7 8b45e0 movl rax,[rbp-0x20]
> 0xfad0d87843b 3b 0f8352000000 jnc 0xfad0d878493 <+0x93>
> 0xfad0d87837a ba 83c001 addl rax,0x1
> 0xfad0d878441 41 42833c0a01 cmpl [rdx+r9*1],0x10xfad0d87837d
> bd 8945e0 movl [rbp-0x20],rax
>
> 0xfad0d878446 46 0f8d04000000 jge 0xfad0d878450
> <+0x50>0xfad0d878380 c0 e900000000 jmp 0xfad0d878385 <+0xc5>
>
> 0xfad0d878385 c5 8b45dc movl rax,[rbp-0x24]0xfad0d87844c
> 4c 4183c001 addl r8,0x1
>
> 0xfad0d878388 c8 83c001 addl rax,0x1
> 0xfad0d878450 50 83c701 addl rdi,0x10xfad0d87838b cb
> 488b4df0 REX.W movq rcx,[rbp-0x10]
> 0xfad0d87838f cf 488b494f REX.W movq rcx,[rcx+0x4f]
> 0xfad0d878393 d3 8b5108 movl rdx,[rcx+0x8]
>
> 0xfad0d878396 d6 3bc2 cmpl rax,rdx
> 0xfad0d878453 53 397b08 cmpl [rbx+0x8],rdi
> 0xfad0d878456 56 77c8 ja 0xfad0d878420 <+0x20>
> 0xfad0d878458 58 498bc0 REX.W movq rax,r8
> 0xfad0d87845b 5b 488be5 REX.W movq rsp,rbp
> 0xfad0d87845e 5e 5d pop rbp0xfad0d878398 d8
> 0f8308000000 jnc 0xfad0d8783a6 <+0xe6>
> 0xfad0d87845f 5f c3 retl
> 0xfad0d878460 60 48895de8 REX.W movq [rbp-0x18],rbx
> 0xfad0d878464 64 48897de0 REX.W movq [rbp-0x20],rdi
> 0xfad0d878468 68 4c8945d8 REX.W movq [rbp-0x28],r8
>
> 0xfad0d87846c 6c 488955d0 REX.W movq [rbp-0x30],rdx
> 0xfad0d878470 70 48894dc8 REX.W movq
> [rbp-0x38],rcx0xfad0d87839e de 8945dc movl [rbp-0x24],rax
>
> 0xfad0d8783a1 e1 e96affffff jmp 0xfad0d878310 <+0x50>
> 0xfad0d878474 74 e847fdffff call 0xfad0d8781c0 ;; wasm stub:
> WasmStackGuard0xfad0d8783a6 e6 8b4de0 movl rcx,[rbp-0x20]
> 0xfad0d8783a9 e9 8bc1 movl rax,rcx
> 0xfad0d8783ab eb 488be5 REX.W movq rsp,rbp
> 0xfad0d8783ae ee 5d pop rbp
> 0xfad0d8783af ef c3 retl
> 0xfad0d8783b0 f0 50 push rax
> 0xfad0d878479 79 488b5de8 REX.W movq rbx,[rbp-0x18]
> 0xfad0d87847d 7d 488b7de0 REX.W movq
> rdi,[rbp-0x20]0xfad0d8783b1 f1 e80afeffff call 0xfad0d8781c0
> ;; wasm stub: WasmStackGuard
>
> 0xfad0d878481 81 4c8b45d8 REX.W movq r8,[rbp-0x28]0xfad0d8783b6
> f6 58 pop rax
>
> 0xfad0d878485 85 488b55d0 REX.W movq
> rdx,[rbp-0x30]0xfad0d8783b7 f7 e936ffffff jmp 0xfad0d8782f2 <+0x32>
>
> 0xfad0d8783bc fc e8fffdffff call 0xfad0d8781c0 ;; wasm stub:
> WasmStackGuard0xfad0d878489 89 488b4dc8 REX.W movq rcx,[rbp-0x38]
>
> 0xfad0d87848d 8d 488b75f0 REX.W movq
> rsi,[rbp-0x10]0xfad0d8783c1 101 e95bffffff jmp 0xfad0d878321 <+0x61>
> 0xfad0d878491 91 eb9a jmp 0xfad0d87842d <+0x2d>
>
> 0xfad0d878493 93 e8b8fbffff call 0xfad0d878050 ;; wasm stub:
> ThrowWasmTrapMemOutOfBounds
> 0xfad0d878498 98 90 nop
> 0xfad0d8783c6 106 e885fcffff call 0xfad0d878050 ;; wasm stub:
> ThrowWasmTrapMemOutOfBounds0xfad0d878499 99 0f1f00 nop
> 0xfad0d8783cb 10b 90 nop
>
>
> Is it possible that the two compilers write their disassembly
> concurrently? -.-
>
> --
> --
> v8-dev mailing list
> [email protected]
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/v8-dev/e150799a-2cef-4ff4-a2d6-801c5c70d168%40googlegroups.com
> <https://groups.google.com/d/msgid/v8-dev/e150799a-2cef-4ff4-a2d6-801c5c70d168%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
Clemens Backes
Software Engineer
[email protected]
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten
haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter,
löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen,
dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake,
please don't forward it to anyone else, please erase all copies and
attachments, and please let me know that it has gone to the wrong person.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/v8-dev/CAGO%3DqhDVwW3afttNotUozjbdjLOQizxFOWT1LgBx4PoDaWkH7Q%40mail.gmail.com.