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

Avoid unnecessary dependency on SYSCALLS object. NFC #21170

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -3757,7 +3757,8 @@ function wrapSyscallFunction(x, library, isWasi) {
}

library[x] = eval('(' + t + ')');
if (!WASMFS) {
// Automatically add dependency on `$SYSCALLS`
if (!WASMFS && t.includes('SYSCALLS')) {
library[x + '__deps'].push('$SYSCALLS');
}
#if PTHREADS
Expand Down
5 changes: 0 additions & 5 deletions src/library_syscall.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ var SyscallsLibrary = {
},

_munmap_js__i53abi: true,
_munmap_js__deps: ['$SYSCALLS',
#if FILESYSTEM && SYSCALLS_REQUIRE_FILESYSTEM
'$FS',
#endif
],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about line 170 below which uses SYSCALLS?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All function that are considers "syscalls" (i.e. all function in this file and in library_wasi.js) all get the SYSCALL dependency implicitly added by wrapSyscallFunction so there is no need to add in explicitly. Same goes for FS

_munmap_js: (addr, len, prot, flags, fd, offset) => {
#if FILESYSTEM && SYSCALLS_REQUIRE_FILESYSTEM
if (isNaN(offset)) return {{{ cDefs.EOVERFLOW }}};
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2164
2143
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4669
4607
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2200
2176
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4720
4658
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_mem_O3.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2617
2597
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_mem_O3.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5568
5507
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_mem_O3_grow.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2783
2758
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_mem_O3_grow.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5891
5829
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2475
2451
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5284
5223
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_mem_O3_standalone.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2441
2418
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_mem_O3_standalone.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5214
5153
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2187
2165
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4720
4658
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2200
2176
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4720
4658
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2200
2176
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4720
4658
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_pthreads.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4924
4923
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_pthreads.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
13665
13664
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size.js.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
58240
58237
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size_no_asserts.js.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
31641
31638
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size_strict.js.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
57082
57079