Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(v6.x backport) child_process: fix deoptimizing use of arguments #13752

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6c81b75
deps: add example of comparing OpenSSL changes
danbev May 26, 2017
d319015
deps: upgrade openssl sources to 1.0.2l
danbev May 26, 2017
b0b52bc
deps: copy all openssl header files to include dir
danbev May 26, 2017
22d74c4
deps: fix openssl assembly error on ia32 win32
indutny Jan 8, 2014
32bbf7a
deps: fix asm build error of openssl in x86_win32
Feb 13, 2015
b7a80dd
openssl: fix keypress requirement in apps on win32
Feb 17, 2015
f90919f
deps: add -no_rand_screen to openssl s_client
May 27, 2015
02a04cf
deps: update openssl config files
danbev May 26, 2017
99cadcb
deps: update openssl asm and asm_obsolete files
danbev Jun 1, 2017
e510003
doc: add missing make command to UPGRADING.md
danbev May 30, 2017
6602954
doc: consistent case for primitive types
silverwind Feb 4, 2017
40babf1
doc: linkify type[] syntax, support lowercase for primitives
silverwind Feb 14, 2017
e70cb6a
tools: fix lint issue in doctool
silverwind Mar 2, 2017
311ef42
doc/tools: fix more type inconsistencies
silverwind Mar 5, 2017
ae20511
test: enable setuid/setgid test
Trott Apr 13, 2017
4848862
test: introduce `common.crashOnUnhandledRejection`
addaleax Apr 19, 2017
dfcefd6
test,doc: document `crashOnUnhandledRejection()`
addaleax Apr 27, 2017
321c90f
zlib: fix node crashing on invalid options
aqrln May 22, 2017
04fb72f
crypto: clear err stack after ECDH::BufferToPoint
rfk May 29, 2017
11c7e01
v8: fix build errors with g++ 7
Jun 9, 2017
099694f
test: move test-debug-brk to sequential
gibfahn Jun 9, 2017
7a22964
test: move common.PORT debug tests to sequential
gibfahn Jun 10, 2017
a1b8996
child_process: fix deoptimizing use of arguments
vsemozhetbyt Feb 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions benchmark/child_process/child-process-params.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
'use strict';

const common = require('../common.js');
const cp = require('child_process');

const command = 'echo';
const args = ['hello'];
const options = {};
const cb = () => {};

const configs = {
n: [1e3],
methodName: [
'exec', 'execSync',
'execFile', 'execFileSync',
'spawn', 'spawnSync',
],
params: [1, 2, 3, 4],
};

const bench = common.createBenchmark(main, configs);

function main(conf) {
const n = +conf.n;
const methodName = conf.methodName;
const params = +conf.params;

const method = cp[methodName];

switch (methodName) {
case 'exec':
switch (params) {
case 1:
bench.start();
for (let i = 0; i < n; i++) method(command).kill();
bench.end(n);
break;
case 2:
bench.start();
for (let i = 0; i < n; i++) method(command, options).kill();
bench.end(n);
break;
case 3:
bench.start();
for (let i = 0; i < n; i++) method(command, options, cb).kill();
bench.end(n);
break;
}
break;
case 'execSync':
switch (params) {
case 1:
bench.start();
for (let i = 0; i < n; i++) method(command);
bench.end(n);
break;
case 2:
bench.start();
for (let i = 0; i < n; i++) method(command, options);
bench.end(n);
break;
}
break;
case 'execFile':
switch (params) {
case 1:
bench.start();
for (let i = 0; i < n; i++) method(command).kill();
bench.end(n);
break;
case 2:
bench.start();
for (let i = 0; i < n; i++) method(command, args).kill();
bench.end(n);
break;
case 3:
bench.start();
for (let i = 0; i < n; i++) method(command, args, options).kill();
bench.end(n);
break;
case 4:
bench.start();
for (let i = 0; i < n; i++) method(command, args, options, cb).kill();
bench.end(n);
break;
}
break;
case 'execFileSync':
switch (params) {
case 1:
bench.start();
for (let i = 0; i < n; i++) method(command);
bench.end(n);
break;
case 2:
bench.start();
for (let i = 0; i < n; i++) method(command, args);
bench.end(n);
break;
case 3:
bench.start();
for (let i = 0; i < n; i++) method(command, args, options);
bench.end(n);
break;
}
break;
case 'spawn':
switch (params) {
case 1:
bench.start();
for (let i = 0; i < n; i++) method(command).kill();
bench.end(n);
break;
case 2:
bench.start();
for (let i = 0; i < n; i++) method(command, args).kill();
bench.end(n);
break;
case 3:
bench.start();
for (let i = 0; i < n; i++) method(command, args, options).kill();
bench.end(n);
break;
}
break;
case 'spawnSync':
switch (params) {
case 1:
bench.start();
for (let i = 0; i < n; i++) method(command);
bench.end(n);
break;
case 2:
bench.start();
for (let i = 0; i < n; i++) method(command, args);
bench.end(n);
break;
case 3:
bench.start();
for (let i = 0; i < n; i++) method(command, args, options);
bench.end(n);
break;
}
break;
}
}
2 changes: 1 addition & 1 deletion deps/openssl/asm/arm-void-gas/aes/bsaes-armv7.S
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ bsaes_cbc_encrypt:
vmov q4,q15 @ just in case ensure that IV
vmov q5,q0 @ and input are preserved
bl AES_decrypt
vld1.8 {q0}, [r9,:64] @ load result
vld1.8 {q0}, [r9] @ load result
veor q0, q0, q4 @ ^= IV
vmov q15, q5 @ q5 holds input
vst1.8 {q0}, [r10] @ write output
Expand Down
1 change: 1 addition & 0 deletions deps/openssl/asm/x64-elf-gas/aes/aesni-sha1-x86_64.s
Original file line number Diff line number Diff line change
Expand Up @@ -2692,6 +2692,7 @@ aesni_cbc_sha1_enc_shaext:
movl 240(%rcx),%r11d
subq %rdi,%rsi
movups (%rcx),%xmm15
movups (%r8),%xmm2
movups 16(%rcx),%xmm0
leaq 112(%rcx),%rcx

Expand Down
1 change: 1 addition & 0 deletions deps/openssl/asm/x64-elf-gas/aes/aesni-sha256-x86_64.s
Original file line number Diff line number Diff line change
Expand Up @@ -4012,6 +4012,7 @@ aesni_cbc_sha256_enc_shaext:
movl 240(%rcx),%r11d
subq %rdi,%rsi
movups (%rcx),%xmm15
movups (%r8),%xmm6
movups 16(%rcx),%xmm4
leaq 112(%rcx),%rcx

Expand Down
17 changes: 9 additions & 8 deletions deps/openssl/asm/x64-elf-gas/x86_64cpuid.s
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,6 @@ OPENSSL_ia32_cpuid:
shrl $14,%r10d
andl $0xfff,%r10d

cmpl $7,%r11d
jb .Lnocacheinfo

movl $7,%eax
xorl %ecx,%ecx
cpuid
movl %ebx,8(%rdi)

.Lnocacheinfo:
movl $1,%eax
cpuid
Expand Down Expand Up @@ -144,6 +136,15 @@ OPENSSL_ia32_cpuid:
orl %ecx,%r9d

movl %edx,%r10d

cmpl $7,%r11d
jb .Lno_extended_info
movl $7,%eax
xorl %ecx,%ecx
cpuid
movl %ebx,8(%rdi)
.Lno_extended_info:

btl $27,%r9d
jnc .Lclear_avx
xorl %ecx,%ecx
Expand Down
1 change: 1 addition & 0 deletions deps/openssl/asm/x64-macosx-gas/aes/aesni-sha1-x86_64.s
Original file line number Diff line number Diff line change
Expand Up @@ -2692,6 +2692,7 @@ aesni_cbc_sha1_enc_shaext:
movl 240(%rcx),%r11d
subq %rdi,%rsi
movups (%rcx),%xmm15
movups (%r8),%xmm2
movups 16(%rcx),%xmm0
leaq 112(%rcx),%rcx

Expand Down
1 change: 1 addition & 0 deletions deps/openssl/asm/x64-macosx-gas/aes/aesni-sha256-x86_64.s
Original file line number Diff line number Diff line change
Expand Up @@ -4012,6 +4012,7 @@ aesni_cbc_sha256_enc_shaext:
movl 240(%rcx),%r11d
subq %rdi,%rsi
movups (%rcx),%xmm15
movups (%r8),%xmm6
movups 16(%rcx),%xmm4
leaq 112(%rcx),%rcx

Expand Down
17 changes: 9 additions & 8 deletions deps/openssl/asm/x64-macosx-gas/x86_64cpuid.s
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,6 @@ L$intel:
shrl $14,%r10d
andl $0xfff,%r10d

cmpl $7,%r11d
jb L$nocacheinfo

movl $7,%eax
xorl %ecx,%ecx
cpuid
movl %ebx,8(%rdi)

L$nocacheinfo:
movl $1,%eax
cpuid
Expand Down Expand Up @@ -145,6 +137,15 @@ L$generic:
orl %ecx,%r9d

movl %edx,%r10d

cmpl $7,%r11d
jb L$no_extended_info
movl $7,%eax
xorl %ecx,%ecx
cpuid
movl %ebx,8(%rdi)
L$no_extended_info:

btl $27,%r9d
jnc L$clear_avx
xorl %ecx,%ecx
Expand Down
1 change: 1 addition & 0 deletions deps/openssl/asm/x64-win32-masm/aes/aesni-sha1-x86_64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2793,6 +2793,7 @@ $L$prologue_shaext::
mov r11d,DWORD PTR[240+rcx]
sub rsi,rdi
movups xmm15,XMMWORD PTR[rcx]
movups xmm2,XMMWORD PTR[r8]
movups xmm0,XMMWORD PTR[16+rcx]
lea rcx,QWORD PTR[112+rcx]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4146,6 +4146,7 @@ $L$prologue_shaext::
mov r11d,DWORD PTR[240+rcx]
sub rsi,rdi
movups xmm15,XMMWORD PTR[rcx]
movups xmm6,XMMWORD PTR[r8]
movups xmm4,XMMWORD PTR[16+rcx]
lea rcx,QWORD PTR[112+rcx]

Expand Down
17 changes: 9 additions & 8 deletions deps/openssl/asm/x64-win32-masm/x86_64cpuid.asm
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,6 @@ $L$intel::
shr r10d,14
and r10d,0fffh

cmp r11d,7
jb $L$nocacheinfo

mov eax,7
xor ecx,ecx
cpuid
mov DWORD PTR[8+rdi],ebx

$L$nocacheinfo::
mov eax,1
cpuid
Expand Down Expand Up @@ -155,6 +147,15 @@ $L$generic::
or r9d,ecx

mov r10d,edx

cmp r11d,7
jb $L$no_extended_info
mov eax,7
xor ecx,ecx
cpuid
mov DWORD PTR[8+rdi],ebx
$L$no_extended_info::

bt r9d,27
jnc $L$clear_avx
xor ecx,ecx
Expand Down
43 changes: 21 additions & 22 deletions deps/openssl/asm/x86-elf-gas/x86cpuid.s
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ OPENSSL_ia32_cpuid:
popl %eax
xorl %eax,%ecx
xorl %eax,%eax
btl $21,%ecx
jnc .L000nocpuid
movl 20(%esp),%esi
movl %eax,8(%esi)
btl $21,%ecx
jnc .L000nocpuid
.byte 0x0f,0xa2
movl %eax,%edi
xorl %eax,%eax
Expand Down Expand Up @@ -74,40 +74,32 @@ OPENSSL_ia32_cpuid:
andl $4026531839,%edx
jmp .L002generic
.L001intel:
cmpl $7,%edi
jb .L003cacheinfo
movl 20(%esp),%esi
movl $7,%eax
xorl %ecx,%ecx
.byte 0x0f,0xa2
movl %ebx,8(%esi)
.L003cacheinfo:
cmpl $4,%edi
movl $-1,%edi
jb .L004nocacheinfo
movl $-1,%esi
jb .L003nocacheinfo
movl $4,%eax
movl $0,%ecx
.byte 0x0f,0xa2
movl %eax,%edi
shrl $14,%edi
andl $4095,%edi
.L004nocacheinfo:
movl %eax,%esi
shrl $14,%esi
andl $4095,%esi
.L003nocacheinfo:
movl $1,%eax
xorl %ecx,%ecx
.byte 0x0f,0xa2
andl $3220176895,%edx
cmpl $0,%ebp
jne .L005notintel
jne .L004notintel
orl $1073741824,%edx
andb $15,%ah
cmpb $15,%ah
jne .L005notintel
jne .L004notintel
orl $1048576,%edx
.L005notintel:
.L004notintel:
btl $28,%edx
jnc .L002generic
andl $4026531839,%edx
cmpl $0,%edi
cmpl $0,%esi
je .L002generic
orl $268435456,%edx
shrl $16,%ebx
Expand All @@ -119,7 +111,15 @@ OPENSSL_ia32_cpuid:
andl $4294965247,%ecx
movl %edx,%esi
orl %ecx,%ebp
btl $27,%ecx
cmpl $7,%edi
movl 20(%esp),%edi
jb .L005no_extended_info
movl $7,%eax
xorl %ecx,%ecx
.byte 0x0f,0xa2
movl %ebx,8(%edi)
.L005no_extended_info:
btl $27,%ebp
jnc .L006clear_avx
xorl %ecx,%ecx
.byte 15,1,208
Expand All @@ -133,7 +133,6 @@ OPENSSL_ia32_cpuid:
andl $4278190079,%esi
.L006clear_avx:
andl $4026525695,%ebp
movl 20(%esp),%edi
andl $4294967263,8(%edi)
.L007done:
movl %esi,%eax
Expand Down
Loading