|
> That is indeed very surprising. I think the fact that Go isn't dead-slow can be attributed mainly to the sheer speed of CPUs. Well, I suspect that in any reasonably complex C/C++ application (e.g. firefox) compilers
do pass params via stack and probably they do so rather often. Even on x86_64. /usr/lib/firefox/firefox objdump: a8b8: 48 83 ec 40 sub $0x40,%rsp
a8bc: 48 89 d3 mov %rdx,%rbx
a8bf: 48 89 f5 mov %rsi,%rbp
a8c2: 49 89 ff mov %rdi,%r15
a8c5: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax
a8cc: 00 00
a8ce: 48 89 44 24 38 mov %rax,0x38(%rsp)
a8d3: 44 8b 76 10 mov 0x10(%rsi),%r14d
a8d7: 44 8b 62 10 mov 0x10(%rdx),%r12d
a8db: 48 89 74 24 20 mov %rsi,0x20(%rsp)
a8e0: 48 89 54 24 28 mov %rdx,0x28(%rsp)
a8e5: c7 44 24 30 02 00 00 movl $0x2,0x30(%rsp)
a8ec: 00
a8ed: 48 8d 7c 24 20 lea 0x20(%rsp),%rdi
a8f2: e8 39 fd ff ff callq a630 <_ZN7mozilla11Compression3LZ417decompressPartialEPKcmPcmPm@@Base+0x2c0>
--
etc.
/usr/lib/firefox/libxul.so objdump: 81cf5e: 48 89 44 24 30 mov %rax,0x30(%rsp)
81cf63: 4c 89 7c 24 58 mov %r15,0x58(%rsp)
81cf68: 4d 89 cf mov %r9,%r15
81cf6b: f2 44 0f 11 64 24 60 movsd %xmm12,0x60(%rsp)
81cf72: e8 a9 00 00 00 callq 81d020 <mont_mulf_noconv@@xul66+0xa30>
--
etc.
|