Skip to content

Commit 22719c1

Browse files
authored
Avoid duplicate reads in select syscall. NFC (#25938)
1 parent 6d61ffd commit 22719c1

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/lib/libsyscall.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,8 @@ var SyscallsLibrary = {
568568
var dstExceptLow = 0,
569569
dstExceptHigh = 0;
570570

571-
var allLow = (readfds ? {{{ makeGetValue('readfds', 0, 'i32') }}} : 0) |
572-
(writefds ? {{{ makeGetValue('writefds', 0, 'i32') }}} : 0) |
573-
(exceptfds ? {{{ makeGetValue('exceptfds', 0, 'i32') }}} : 0);
574-
var allHigh = (readfds ? {{{ makeGetValue('readfds', 4, 'i32') }}} : 0) |
575-
(writefds ? {{{ makeGetValue('writefds', 4, 'i32') }}} : 0) |
576-
(exceptfds ? {{{ makeGetValue('exceptfds', 4, 'i32') }}} : 0);
571+
var allLow = srcReadLow | srcWriteLow | srcExceptLow;
572+
var allHigh = srcReadHigh | srcWriteHigh | srcExceptHigh;
577573

578574
var check = (fd, low, high, val) => fd < 32 ? (low & val) : (high & val);
579575

test/codesize/test_codesize_hello_dylink_all.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"a.out.js": 245751,
2+
"a.out.js": 245673,
33
"a.out.nodebug.wasm": 573748,
4-
"total": 819499,
4+
"total": 819421,
55
"sent": [
66
"IMG_Init",
77
"IMG_Load",

0 commit comments

Comments
 (0)